@viamedici-spc/configurator-framer 3.1.0-alpha13 → 3.1.0-alpha17
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 +70 -70
- package/dist/index.d.ts +34 -5
- package/dist/index.js +3099 -2991
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),c=require("framer"),M=require("styled-components"),u=require("@viamedici-spc/configurator-ts"),Y=require("@viamedici-spc/configurator-react"),w=require("react"),Tr=require("url-join"),k=require("ts-pattern"),Er=require("react-error-boundary"),gt=require("@fortawesome/free-solid-svg-icons"),bt=require("@fortawesome/react-fontawesome"),m=require("@viamedici-spc/fp-ts-extensions"),mt=require("mustache"),To=require("react-dom"),Ir=require("clsx"),Eo=require("merge-props"),Ar=require("dyna-guid"),ee=require("zod"),Pr=require("zod-validation-error"),Rr=require("react-number-format"),Dr=require("use-debounce"),jr=require("framer-motion"),Vr=require("hex-to-css-filter"),Or=require("rgb-hex"),kr=require("camelcase");function Io(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const E=Io(w),Fr=Io(To),In="--spc-",Mr=/var\(--(?!spc-)(?!framer-)/g,Nr="var(--spc-";function An(e){if(e.type!=="decl")return;const t=e.props,n=e.children,o=t.startsWith("--")&&!t.startsWith(In),i=typeof n=="string"&&n.includes("var(--");if(!o&&!i)return;const r=o?In+t.slice(2):t,l=i?n.replace(Mr,Nr):n;o&&(e.props=r),e.return=`${r}:${l};`}function X(){return c.RenderTarget.current()!==c.RenderTarget.preview}const Br=M.div`
|
|
2
2
|
padding: var(--space-md);
|
|
3
3
|
margin: var(--space-md);
|
|
4
4
|
border-radius: var(--shape-border-radius-sm);
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
border: 1px solid #DB0100;
|
|
14
14
|
border-left-width: 15px;
|
|
15
15
|
}
|
|
16
|
-
`,
|
|
16
|
+
`,Lr=M.h3`
|
|
17
17
|
margin: 0 0 var(--space-xs);
|
|
18
|
-
|
|
18
|
+
`,$r=M.div`
|
|
19
19
|
white-space: break-spaces;
|
|
20
|
-
`;function
|
|
20
|
+
`;function Ao(e){return d.jsxs(Br,{className:e.type,children:[d.jsx(Lr,{children:e.title}),d.jsx($r,{children:e.message})]})}function zr(e){var i,r,l;if(X())return null;const{error:n}=Y.useConfigurationInitialization();if(!n)return null;const o=s=>d.jsx(Ao,{type:"error",title:"Configuration initialization failed",message:s});switch(n.type){case u.ConfiguratorErrorType.ConfigurationModelNotFound:return w.Children.toArray(e.configurationModelNotFoundContent).length>0?e.configurationModelNotFoundContent:o("The Configuration Model was not found for the specified deployment name.");case u.ConfiguratorErrorType.AuthenticationFailure:return w.Children.toArray(e.accessTokenInvalidContent).length>0?e.accessTokenInvalidContent:o("The HCA access token is invalid.");case u.ConfiguratorErrorType.SpecifiedDeploymentForbidden:return w.Children.toArray(e.accessTokenRestrictionContent).length>0?e.accessTokenRestrictionContent:o("The HCA access token does not permit using the specified Configuration Model.");case u.ConfiguratorErrorType.DecisionsToRespectInvalid:const s=`Attribute Id: ${((i=n.globalAttributeId)==null?void 0:i.localId)??""}`,a=`Component Path: ${((r=n.globalAttributeId.componentPath)==null?void 0:r.join(" -> "))??""}`,p=`Shared Configuration Model: ${((l=n.globalAttributeId)==null?void 0:l.sharedConfigurationModelId)??""}`;return o(`The definition of Attribute Relations is invalid: ${n.validationMessage}
|
|
21
21
|
|
|
22
22
|
${s}
|
|
23
23
|
${a}
|
|
24
|
-
${
|
|
24
|
+
${p}`);case u.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configuration Session parameters are invalid: ${n.detail}`);default:return w.Children.toArray(e.errorContent).length>0?e.errorContent:o("An error occurred while initializing the configuration.")}}function ne(e){return w.forwardRef((t,n)=>d.jsx(Er.ErrorBoundary,{fallbackRender:()=>d.jsx("span",{children:"Component crashed"}),children:d.jsx(e,{...t,ref:n})}))}const Wr=M.createGlobalStyle`
|
|
25
25
|
:root {
|
|
26
26
|
--font-primary: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif);
|
|
27
27
|
--font-heading: "Inter-Medium", "Inter", "Inter Placeholder", sans-serif;
|
|
@@ -40,7 +40,7 @@ ${f}`);case d.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
40
40
|
--text-xxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
41
41
|
--text-xxxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio));
|
|
42
42
|
}
|
|
43
|
-
`,
|
|
43
|
+
`,Kr=Wr,Qr=M.createGlobalStyle`
|
|
44
44
|
:root {
|
|
45
45
|
--space-unit: 1em;
|
|
46
46
|
--space-xxs: calc(0.25 * var(--space-unit));
|
|
@@ -60,14 +60,14 @@ ${f}`);case d.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
60
60
|
--space-xl-fixed: calc(3.25 * var(--space-unit-fixed));
|
|
61
61
|
--space-xxl-fixed: calc(5.25 * var(--space-unit-fixed));
|
|
62
62
|
}
|
|
63
|
-
`,
|
|
63
|
+
`,qr=Qr,_r=M.createGlobalStyle`
|
|
64
64
|
:root {
|
|
65
65
|
--shape-border-radius-xs: 5px;
|
|
66
66
|
--shape-border-radius-sm: 7px;
|
|
67
67
|
--shape-border-radius-md: 12px;
|
|
68
68
|
--shape-border-radius-lg: 20px;
|
|
69
69
|
}
|
|
70
|
-
`,Kr=Wr;function Tn(){return c.jsxs(c.Fragment,{children:[c.jsx(Kr,{}),c.jsx(zr,{}),c.jsx(Br,{})]})}const Ge=S.createContext(null);function ce(){const{process:e,switchMode:t,applySolution:n,dismiss:o}=S.useContext(Ge);return e?{...e,switchMode:t,applySolution:n,dismiss:o}:null}const Eo=(e={})=>({padding:{type:u.ControlType.FusedNumber,title:"Padding",toggleKey:"isMixedPadding",toggleTitles:["Padding","Padding per Side"],valueKeys:["paddingTop","paddingRight","paddingBottom","paddingLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:e.padding??0}}),Ao=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}),Ut=(e={})=>{var t,n;return{radius:{title:"Radius",type:u.ControlType.Number,defaultValue:e.radius??0},border:{title:"Border",type:u.ControlType.Object,controls:{color:{type:u.ControlType.Color,title:"Color",defaultValue:(t=e.border)==null?void 0:t.color},width:{type:u.ControlType.FusedNumber,title:"Width",toggleKey:"isMixedWidth",toggleTitles:["Width","Width per Side"],valueKeys:["widthTop","widthRight","widthBottom","widthLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:((n=e.border)==null?void 0:n.width)??0}}}}},Io=e=>{var t,n,o,i,r,l,s,a,f,x,m,C,p;return{borderRadius:e.radius,borderColor:(t=e.border)==null?void 0:t.color,borderTopWidth:(n=e.border)!=null&&n.isMixedWidth?(o=e.border)==null?void 0:o.widthTop:(i=e.border)==null?void 0:i.width,borderRightWidth:(r=e.border)!=null&&r.isMixedWidth?(l=e.border)==null?void 0:l.widthRight:(s=e.border)==null?void 0:s.width,borderBottomWidth:(a=e.border)!=null&&a.isMixedWidth?(f=e.border)==null?void 0:f.widthBottom:(x=e.border)==null?void 0:x.width,borderLeftWidth:(m=e.border)!=null&&m.isMixedWidth?(C=e.border)==null?void 0:C.widthLeft:(p=e.border)==null?void 0:p.width,borderStyle:"solid"}},Ye=(e={})=>({fill:{title:"Fill",type:u.ControlType.Color,defaultValue:e.fill},backdropFilter:{title:"Backdrop Filter",type:u.ControlType.String,defaultValue:e.backdropFilter??"none"},shadow:{title:"Shadow",type:u.ControlType.String,defaultValue:e.shadow??"none"},filter:{title:"Filter",type:u.ControlType.String,defaultValue:e.filter??"none"},...Eo(e),...Ut(e)}),$e=e=>({...Ao(e),...Io(e),backgroundColor:e.fill,backdropFilter:e.backdropFilter,boxShadow:e.shadow,filter:e.filter}),pe=(e={})=>{var t,n;return{color:{title:"Color",type:u.ControlType.Color,defaultValue:e.color??"black"},text:{title:"Text",type:u.ControlType.Font,controls:"basic",displayTextAlignment:!0,displayFontSize:!0,defaultValue:{fontSize:(t=e.text)==null?void 0:t.fontSize,textAlign:(n=e.text)==null?void 0:n.textAlign}}}},he=e=>({...e.text,color:e.color}),pt=(e={})=>({staticText:{title:"Text",type:u.ControlType.String,defaultValue:e.staticText},...pe(e)}),ht=e=>he(e),mt=(e={})=>{var t,n,o;return{fillHover:{title:"Fill – Hover",type:u.ControlType.Color,defaultValue:e.fillHover},focusOutline:{title:"Focus Outline",type:u.ControlType.Object,controls:{color:{title:"Color",type:u.ControlType.Color,defaultValue:(t=e.focusOutline)==null?void 0:t.color},size:{title:"Size",type:u.ControlType.Number,defaultValue:(n=e.focusOutline)==null?void 0:n.size},offset:{title:"Offset",type:u.ControlType.Number,defaultValue:(o=e.focusOutline)==null?void 0:o.offset}}},...Ye(e),...pt(e)}},At=e=>({...$e(e),...ht(e),"--color-button-fill-hover":e.fillHover,"--color-button-focus-outline":e.focusOutline.color,"--size-button-focus-outline":`${e.focusOutline.size}px`,"--size-button-focus-outline-offset":`${e.focusOutline.offset}px`}),gt=(e={})=>({margin:{type:u.ControlType.FusedNumber,title:"Margin",toggleKey:"isMixedMargin",toggleTitles:["Margin","Margin per Side"],valueKeys:["marginTop","marginRight","marginBottom","marginLeft"],valueLabels:["Top","Right","Bottom","Left"],defaultValue:e.margin??0}}),It=e=>({marginTop:e.isMixedMargin?e.marginTop:e.margin,marginRight:e.isMixedMargin?e.marginRight:e.margin,marginBottom:e.isMixedMargin?e.marginBottom:e.margin,marginLeft:e.isMixedMargin?e.marginLeft:e.margin}),qr=(e={})=>{var t,n,o,i;return{subject:{title:"Subject",type:u.ControlType.Object,controls:{...pe(e.subject??{}),configurationSubjectTitle:{title:"Configuration Subject Title",type:u.ControlType.String,defaultValue:((t=e.subject)==null?void 0:t.configurationSubjectTitle)??"Configuration"},generalConflictTitle:{title:"General Conflict Title",type:u.ControlType.String,defaultValue:((n=e.subject)==null?void 0:n.generalConflictTitle)??"Conflict"}}},suffix:{title:"Suffix",type:u.ControlType.Object,controls:{...pe(e.suffix??{}),isBlockedSuffix:{title:"Is Blocked Suffix",type:u.ControlType.String,defaultValue:((o=e.suffix)==null?void 0:o.isBlockedSuffix)??"is blocked"},isNotSatisfiedSuffix:{title:"Is Not Satisfied Suffix",type:u.ControlType.String,defaultValue:((i=e.suffix)==null?void 0:i.isNotSatisfiedSuffix)??"is not satisfied"}}}}},Po=(e={})=>{var t,n,o,i,r,l,s,a,f,x,m,C,p,b,w,g,y,v,R,T;return{header:{title:"Header",type:u.ControlType.Object,controls:{...qr(e.header??{})},hidden:A=>A.useCustomExplain},attributeName:{title:"Attribute Name",type:u.ControlType.Object,controls:{...pe(e.attributeName??{})},hidden:A=>A.useCustomExplain},attributeValue:{title:"Attribute Value",type:u.ControlType.Object,controls:{add:{title:"Adding",type:u.ControlType.Object,controls:{...pe(((t=e.attributeValue)==null?void 0:t.add)??{}),...Ut(((n=e.attributeValue)==null?void 0:n.add)??{}),fill:{title:"Fill",type:u.ControlType.Color,defaultValue:(i=(o=e.attributeValue)==null?void 0:o.add)==null?void 0:i.fill},iconFill:{title:"Icon Fill",type:u.ControlType.Color,defaultValue:(l=(r=e.attributeValue)==null?void 0:r.add)==null?void 0:l.iconFill},iconColor:{title:"Icon Color",type:u.ControlType.Color,defaultValue:(a=(s=e.attributeValue)==null?void 0:s.add)==null?void 0:a.iconColor}}},remove:{title:"Removing",type:u.ControlType.Object,controls:{...pe(((f=e.attributeValue)==null?void 0:f.remove)??{}),...Ut(((x=e.attributeValue)==null?void 0:x.remove)??{}),fill:{title:"Fill",type:u.ControlType.Color,defaultValue:(C=(m=e.attributeValue)==null?void 0:m.remove)==null?void 0:C.fill},iconFill:{title:"Icon Fill",type:u.ControlType.Color,defaultValue:(b=(p=e.attributeValue)==null?void 0:p.remove)==null?void 0:b.iconFill},iconColor:{title:"Icon Color",type:u.ControlType.Color,defaultValue:(g=(w=e.attributeValue)==null?void 0:w.remove)==null?void 0:g.iconColor}}},...Eo(e.attributeValue??{}),componentDecisionStateIncludedLabel:{title:"Component Decision State Included Label",type:u.ControlType.String,defaultValue:((y=e.attributeValue)==null?void 0:y.componentDecisionStateIncludedLabel)??"Included"},componentDecisionStateExcludedLabel:{title:"Component Decision State Excluded Label",type:u.ControlType.String,defaultValue:((v=e.attributeValue)==null?void 0:v.componentDecisionStateExcludedLabel)??"Excluded"},booleanDecisionStateTrueLabel:{title:"Boolean Decision State True Label",type:u.ControlType.String,defaultValue:((R=e.attributeValue)==null?void 0:R.booleanDecisionStateTrueLabel)??"Yes"},booleanDecisionStateFalseLabel:{title:"Boolean Decision State False Label",type:u.ControlType.String,defaultValue:((T=e.attributeValue)==null?void 0:T.booleanDecisionStateFalseLabel)??"No"}}},applySolutionButton:{title:"Apply Solution Button",type:u.ControlType.Object,controls:{...mt(e.applySolutionButton??{}),...gt(e.applySolutionButton??{})},hidden:A=>A.useCustomExplain},closeButton:{title:"Close Button",type:u.ControlType.Object,controls:{...mt(e.closeButton??{})},hidden:A=>A.useCustomExplain},infoMessage:{title:"Info Message",type:u.ControlType.Object,controls:{...pe(e.infoMessage??{})},hidden:A=>A.useCustomExplain}}},_r={popoverBox:{title:"Popover Box",type:u.ControlType.Object,controls:Ye({fill:"#002134",radius:12,padding:18,isMixedPadding:!1,filter:"drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.4))"}),hidden:e=>e.useCustomExplain},subline:{title:"Subline",type:u.ControlType.Object,controls:{...pt({color:"white",staticText:"Solution",text:{fontWeight:"500",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})},hidden:e=>e.useCustomExplain},...Po({header:{subject:{color:"rgb(0, 161, 230)",text:{fontWeight:"500",fontSize:19,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}},suffix:{color:"white",text:{fontWeight:"500",fontSize:19,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}}},attributeName:{color:"white",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}},attributeValue:{add:{color:"white",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},radius:300,fill:"rgba(255, 255, 255, 0.2)",iconFill:"rgba(47, 255, 0, 0.2)",iconColor:"#63e446"},remove:{color:"white",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},radius:300,fill:"rgba(255, 255, 255, 0.2)",iconFill:"#ff00004a",iconColor:"#ff6060"},paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:10,isMixedPadding:!0},applySolutionButton:{fill:"rgb(0, 161, 230)",fillHover:"#15ACED",radius:300,paddingTop:9,paddingBottom:9,paddingLeft:29,paddingRight:29,isMixedPadding:!0,color:"white",staticText:"Apply Solution",text:{textAlign:"center",fontWeight:"600",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"rgba(255, 255, 255, 0.8)",size:2,offset:-1},marginTop:18,isMixedMargin:!0},closeButton:{fill:"transparent",fillHover:"#FFFFFF26",radius:300,paddingTop:2,paddingBottom:2,paddingLeft:6,paddingRight:6,isMixedPadding:!0,color:"white",staticText:"Close",text:{textAlign:"center",fontWeight:"400",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"rgba(255, 255, 255, 0.8)",size:2,offset:-1}},infoMessage:{color:"white",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}}}),showConstraintsButton:{title:"Show Constraints Button",type:u.ControlType.Object,controls:{...mt({fill:"transparent",fillHover:"transparent",radius:5,paddingTop:1,paddingBottom:1,paddingLeft:6,paddingRight:6,isMixedPadding:!0,color:"white",staticText:"Show Constraints",text:{textAlign:"center",fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"rgba(255, 255, 255, 0.8)",size:2,offset:-1}}),...gt({marginTop:13})},hidden:e=>e.useCustomExplain},showMoreButton:{title:"Show More Button",type:u.ControlType.Object,controls:{...mt({fill:"transparent",fillHover:"transparent",radius:5,paddingTop:1,paddingBottom:1,paddingLeft:6,paddingRight:6,isMixedPadding:!0,color:"white",staticText:"Show more ({{amount}})",text:{textAlign:"center",fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"rgba(255, 255, 255, 0.8)",size:2,offset:-1}}),...gt({marginTop:13})},hidden:e=>e.useCustomExplain},listSeparator:{title:"List Separator",type:u.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.3)",hidden:e=>e.useCustomExplain},arrow:{title:"Arrow",type:u.ControlType.Color,defaultValue:"#002134"},useCustomExplain:{title:"Use Custom Popover",type:u.ControlType.Boolean,defaultValue:!1}},Hr=e=>{var t;return{fill:e.arrow??((t=e.popoverBox)==null?void 0:t.fill)}},on=S.createContext(null),Ze=()=>S.useContext(on),Qr={dialogBox:{title:"Dialog Box",type:u.ControlType.Object,controls:Ye({fill:"rgba(255, 255, 255, 0.7)",backdropFilter:"blur(10px) saturate(200%)",shadow:"0.2px 0.4px 2.3px rgba(0, 0, 0, 0.02), 0.6px 1px 5.7px rgba(0, 0, 0, 0.025), 1.2px 2.1px 10.6px rgba(0, 0, 0, 0.03), 2.3px 4px 17.2px rgba(0, 0, 0, 0.034), 4.2px 7.2px 25.9px rgba(0, 0, 0, 0.04), 7.6px 12.8px 37.7px rgba(0, 0, 0, 0.048), 13.9px 23.6px 54.7px rgba(0, 0, 0, 0.061), 40px 68px 96px rgba(0, 0, 0, 0.1)",radius:12,paddingTop:18,paddingBottom:0,paddingLeft:24,paddingRight:24,isMixedPadding:!0})},explanationCard:{title:"Explanation Card",type:u.ControlType.Object,controls:{...Ye({fill:"white",shadow:"2px 1px 10px -5px rgba(0, 0, 0, 0.4)",radius:7,padding:12,isMixedPadding:!1}),...gt({marginLeft:-12,marginRight:-12,isMixedMargin:!0})}},constraintExplanation:{title:"Constraint Explanation",type:u.ControlType.Object,controls:{configurationModelId:{title:"Configuration Model Id",type:u.ControlType.Object,controls:pe({color:"#171717",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})},ruleId:{title:"Rule Id",type:u.ControlType.Object,controls:pe({color:"#171717",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})}}},...Po({header:{subject:{color:"rgb(0, 161, 230)",text:{fontWeight:"500",fontSize:19,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}},suffix:{color:"#171717",text:{fontWeight:"500",fontSize:19,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}}},attributeName:{color:"#171717",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}},attributeValue:{add:{color:"#171717",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},radius:300,fill:"#efefef",iconFill:"#cfefc7",iconColor:"#48c52b"},remove:{color:"#171717",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},radius:300,fill:"#efefef",iconFill:"#ffdada",iconColor:"#c52b2b"},paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:10,isMixedPadding:!0},applySolutionButton:{fill:"#F2F2F2",fillHover:"#F7F7F7",radius:7,paddingTop:9,paddingBottom:9,paddingLeft:29,paddingRight:29,isMixedPadding:!0,color:"#171717",staticText:"Apply Solution",text:{textAlign:"center",fontWeight:"600",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"#00a1e6",size:2,offset:-1},marginTop:18,isMixedMargin:!0},closeButton:{fill:"transparent",fillHover:"00000012",radius:300,paddingTop:2,paddingBottom:2,paddingLeft:6,paddingRight:6,isMixedPadding:!0,color:"#171717",staticText:"Close",text:{textAlign:"center",fontWeight:"400",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"#00a1e6",size:2,offset:-1}},infoMessage:{color:"#171717",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}}}),decisionExplanationSolutionsTitle:{title:"Decision Explanation Solutions Title",type:u.ControlType.Object,controls:{...pt({color:"#171717",staticText:"Solutions",text:{fontWeight:"500",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})}},constraintExplanationSolutionsTitle:{title:"Constraint Explanation Solutions Title",type:u.ControlType.Object,controls:{...pt({color:"#171717",staticText:"Constraint Explanations",text:{fontWeight:"500",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})}},scrollShadowBorder:{title:"Scroll Shadow Border",type:u.ControlType.Color,defaultValue:"rgba(0, 0, 0, 0.3)"}},rn=S.createContext(null),Pt=()=>S.useContext(rn),Ur=()=>S.useContext(on)||S.useContext(rn),ze=Ur,Gr=V.button`
|
|
70
|
+
`,Ur=_r;function Pn(){return d.jsxs(d.Fragment,{children:[d.jsx(Ur,{}),d.jsx(qr,{}),d.jsx(Kr,{})]})}const Ye=w.createContext(null);function ce(){const{process:e,switchMode:t,applySolution:n,dismiss:o}=w.useContext(Ye);return e?{...e,switchMode:t,applySolution:n,dismiss:o}:null}const Po=(e={})=>({padding:{type:c.ControlType.FusedNumber,title:"Padding",toggleKey:"isMixedPadding",toggleTitles:["Padding","Padding per Side"],valueKeys:["paddingTop","paddingRight","paddingBottom","paddingLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:e.padding??0}}),Ro=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}),Yt=(e={})=>{var t,n;return{radius:{title:"Radius",type:c.ControlType.Number,defaultValue:e.radius??0},border:{title:"Border",type:c.ControlType.Object,controls:{color:{type:c.ControlType.Color,title:"Color",defaultValue:(t=e.border)==null?void 0:t.color},width:{type:c.ControlType.FusedNumber,title:"Width",toggleKey:"isMixedWidth",toggleTitles:["Width","Width per Side"],valueKeys:["widthTop","widthRight","widthBottom","widthLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:((n=e.border)==null?void 0:n.width)??0}}}}},Do=e=>{var t,n,o,i,r,l,s,a,p,C,y,g,f;return{borderRadius:e.radius,borderColor:(t=e.border)==null?void 0:t.color,borderTopWidth:(n=e.border)!=null&&n.isMixedWidth?(o=e.border)==null?void 0:o.widthTop:(i=e.border)==null?void 0:i.width,borderRightWidth:(r=e.border)!=null&&r.isMixedWidth?(l=e.border)==null?void 0:l.widthRight:(s=e.border)==null?void 0:s.width,borderBottomWidth:(a=e.border)!=null&&a.isMixedWidth?(p=e.border)==null?void 0:p.widthBottom:(C=e.border)==null?void 0:C.width,borderLeftWidth:(y=e.border)!=null&&y.isMixedWidth?(g=e.border)==null?void 0:g.widthLeft:(f=e.border)==null?void 0:f.width,borderStyle:"solid"}},Je=(e={})=>({fill:{title:"Fill",type:c.ControlType.Color,defaultValue:e.fill},backdropFilter:{title:"Backdrop Filter",type:c.ControlType.String,defaultValue:e.backdropFilter??"none"},shadow:{title:"Shadow",type:c.ControlType.String,defaultValue:e.shadow??"none"},filter:{title:"Filter",type:c.ControlType.String,defaultValue:e.filter??"none"},...Po(e),...Yt(e)}),$e=e=>({...Ro(e),...Do(e),backgroundColor:e.fill,backdropFilter:e.backdropFilter,boxShadow:e.shadow,filter:e.filter}),pe=(e={})=>{var t,n;return{color:{title:"Color",type:c.ControlType.Color,defaultValue:e.color??"black"},text:{title:"Text",type:c.ControlType.Font,controls:"basic",displayTextAlignment:!0,displayFontSize:!0,defaultValue:{fontSize:(t=e.text)==null?void 0:t.fontSize,textAlign:(n=e.text)==null?void 0:n.textAlign}}}},he=e=>({...e.text,color:e.color}),xt=(e={})=>({staticText:{title:"Text",type:c.ControlType.String,defaultValue:e.staticText},...pe(e)}),Ct=e=>he(e),vt=(e={})=>{var t,n,o;return{fillHover:{title:"Fill – Hover",type:c.ControlType.Color,defaultValue:e.fillHover},focusOutline:{title:"Focus Outline",type:c.ControlType.Object,controls:{color:{title:"Color",type:c.ControlType.Color,defaultValue:(t=e.focusOutline)==null?void 0:t.color},size:{title:"Size",type:c.ControlType.Number,defaultValue:(n=e.focusOutline)==null?void 0:n.size},offset:{title:"Offset",type:c.ControlType.Number,defaultValue:(o=e.focusOutline)==null?void 0:o.offset}}},...Je(e),...xt(e)}},jt=e=>({...$e(e),...Ct(e),"--spc-color-button-fill-hover":e.fillHover,"--spc-color-button-focus-outline":e.focusOutline.color,"--spc-size-button-focus-outline":`${e.focusOutline.size}px`,"--spc-size-button-focus-outline-offset":`${e.focusOutline.offset}px`}),St=(e={})=>({margin:{type:c.ControlType.FusedNumber,title:"Margin",toggleKey:"isMixedMargin",toggleTitles:["Margin","Margin per Side"],valueKeys:["marginTop","marginRight","marginBottom","marginLeft"],valueLabels:["Top","Right","Bottom","Left"],defaultValue:e.margin??0}}),Vt=e=>({marginTop:e.isMixedMargin?e.marginTop:e.margin,marginRight:e.isMixedMargin?e.marginRight:e.margin,marginBottom:e.isMixedMargin?e.marginBottom:e.margin,marginLeft:e.isMixedMargin?e.marginLeft:e.margin}),Hr=(e={})=>{var t,n,o,i;return{subject:{title:"Subject",type:c.ControlType.Object,controls:{...pe(e.subject??{}),configurationSubjectTitle:{title:"Configuration Subject Title",type:c.ControlType.String,defaultValue:((t=e.subject)==null?void 0:t.configurationSubjectTitle)??"Configuration"},generalConflictTitle:{title:"General Conflict Title",type:c.ControlType.String,defaultValue:((n=e.subject)==null?void 0:n.generalConflictTitle)??"Conflict"}}},suffix:{title:"Suffix",type:c.ControlType.Object,controls:{...pe(e.suffix??{}),isBlockedSuffix:{title:"Is Blocked Suffix",type:c.ControlType.String,defaultValue:((o=e.suffix)==null?void 0:o.isBlockedSuffix)??"is blocked"},isNotSatisfiedSuffix:{title:"Is Not Satisfied Suffix",type:c.ControlType.String,defaultValue:((i=e.suffix)==null?void 0:i.isNotSatisfiedSuffix)??"is not satisfied"}}}}},jo=(e={})=>{var t,n,o,i,r,l,s,a,p,C,y,g,f,x,v,h,b,S,R,I,A,P,V,O,B,D,K,L;return{header:{title:"Header",type:c.ControlType.Object,controls:{...Hr(e.header??{})},hidden:Q=>Q.useCustomExplain},attributeName:{title:"Attribute Name",type:c.ControlType.Object,controls:{...pe(e.attributeName??{})},hidden:Q=>Q.useCustomExplain},attributeValue:{title:"Attribute Value",type:c.ControlType.Object,controls:{add:{title:"Adding",type:c.ControlType.Object,controls:{...pe(((t=e.attributeValue)==null?void 0:t.add)??{}),...Yt(((n=e.attributeValue)==null?void 0:n.add)??{}),fill:{title:"Fill",type:c.ControlType.Color,defaultValue:(i=(o=e.attributeValue)==null?void 0:o.add)==null?void 0:i.fill},iconFill:{title:"Icon Fill",type:c.ControlType.Color,defaultValue:(l=(r=e.attributeValue)==null?void 0:r.add)==null?void 0:l.iconFill},iconColor:{title:"Icon Color",type:c.ControlType.Color,defaultValue:(a=(s=e.attributeValue)==null?void 0:s.add)==null?void 0:a.iconColor}}},remove:{title:"Removing",type:c.ControlType.Object,controls:{...pe(((p=e.attributeValue)==null?void 0:p.remove)??{}),...Yt(((C=e.attributeValue)==null?void 0:C.remove)??{}),fill:{title:"Fill",type:c.ControlType.Color,defaultValue:(g=(y=e.attributeValue)==null?void 0:y.remove)==null?void 0:g.fill},iconFill:{title:"Icon Fill",type:c.ControlType.Color,defaultValue:(x=(f=e.attributeValue)==null?void 0:f.remove)==null?void 0:x.iconFill},iconColor:{title:"Icon Color",type:c.ControlType.Color,defaultValue:(h=(v=e.attributeValue)==null?void 0:v.remove)==null?void 0:h.iconColor}}},...Po(e.attributeValue??{}),componentDecisionStateIncludedLabel:{title:"Component Decision State Included Label",type:c.ControlType.String,defaultValue:((b=e.attributeValue)==null?void 0:b.componentDecisionStateIncludedLabel)??"Included"},componentDecisionStateExcludedLabel:{title:"Component Decision State Excluded Label",type:c.ControlType.String,defaultValue:((S=e.attributeValue)==null?void 0:S.componentDecisionStateExcludedLabel)??"Excluded"},booleanDecisionStateTrueLabel:{title:"Boolean Decision State True Label",type:c.ControlType.String,defaultValue:((R=e.attributeValue)==null?void 0:R.booleanDecisionStateTrueLabel)??"Yes"},booleanDecisionStateFalseLabel:{title:"Boolean Decision State False Label",type:c.ControlType.String,defaultValue:((I=e.attributeValue)==null?void 0:I.booleanDecisionStateFalseLabel)??"No"}}},applySolutionButton:{title:"Apply Solution Button",type:c.ControlType.Object,controls:{...vt(e.applySolutionButton??{}),...St(e.applySolutionButton??{})},hidden:Q=>Q.useCustomExplain},closeButton:{title:"Close Button",type:c.ControlType.Object,controls:{...vt(e.closeButton??{})},hidden:Q=>Q.useCustomExplain},infoMessage:{title:"Info Message",type:c.ControlType.Object,controls:{...pe(e.infoMessage??{}),whyIsStateNotPossibleQuestion:{title:"Why Is State Not Possible Question",type:c.ControlType.String,defaultValue:((A=e.infoMessage)==null?void 0:A.whyIsStateNotPossibleQuestion)??"why your selection is not possible"},whyConfigurationIsNotSatisfiedQuestion:{title:"Why Configuration Is Not Satisfied Question",type:c.ControlType.String,defaultValue:((P=e.infoMessage)==null?void 0:P.whyConfigurationIsNotSatisfiedQuestion)??"why your configuration is not satisfied"},whyAttributeIsNotSatisfiedQuestion:{title:"Why Attribute Is Not Satisfied Question",type:c.ControlType.String,defaultValue:((V=e.infoMessage)==null?void 0:V.whyAttributeIsNotSatisfiedQuestion)??"why your attribute is not satisfied"},generalConflictQuestion:{title:"General Conflict Question",type:c.ControlType.String,defaultValue:((O=e.infoMessage)==null?void 0:O.generalConflictQuestion)??"why your selections are not possible"},failedToExplainText:{title:"Failed To Explain Text",type:c.ControlType.String,defaultValue:((B=e.infoMessage)==null?void 0:B.failedToExplainText)??"Failed to explain {{question}}."},failedToExplainHintText:{title:"Failed To Explain Hint Text",type:c.ControlType.String,defaultValue:((D=e.infoMessage)==null?void 0:D.failedToExplainHintText)??"Please check your internet connection and try again."},noExplanationFoundText:{title:"No Explanation Found Text",type:c.ControlType.String,defaultValue:((K=e.infoMessage)==null?void 0:K.noExplanationFoundText)??"There was no explanation found for {{question}}."},noSolutionFoundText:{title:"No Solution Found Text",type:c.ControlType.String,defaultValue:((L=e.infoMessage)==null?void 0:L.noSolutionFoundText)??"There was no solution found for {{question}}."}},hidden:Q=>Q.useCustomExplain}}},Gr={popoverBox:{title:"Popover Box",type:c.ControlType.Object,controls:Je({fill:"#002134",radius:12,padding:18,isMixedPadding:!1,filter:"drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.4))"}),hidden:e=>e.useCustomExplain},subline:{title:"Subline",type:c.ControlType.Object,controls:{...xt({color:"white",staticText:"Solution",text:{fontWeight:"500",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})},hidden:e=>e.useCustomExplain},...jo({header:{subject:{color:"rgb(0, 161, 230)",text:{fontWeight:"500",fontSize:19,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}},suffix:{color:"white",text:{fontWeight:"500",fontSize:19,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}}},attributeName:{color:"white",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}},attributeValue:{add:{color:"white",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},radius:300,fill:"rgba(255, 255, 255, 0.2)",iconFill:"rgba(47, 255, 0, 0.2)",iconColor:"#63e446"},remove:{color:"white",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},radius:300,fill:"rgba(255, 255, 255, 0.2)",iconFill:"#ff00004a",iconColor:"#ff6060"},paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:10,isMixedPadding:!0},applySolutionButton:{fill:"rgb(0, 161, 230)",fillHover:"#15ACED",radius:300,paddingTop:9,paddingBottom:9,paddingLeft:29,paddingRight:29,isMixedPadding:!0,color:"white",staticText:"Apply Solution",text:{textAlign:"center",fontWeight:"600",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"rgba(255, 255, 255, 0.8)",size:2,offset:-1},marginTop:18,isMixedMargin:!0},closeButton:{fill:"transparent",fillHover:"#FFFFFF26",radius:300,paddingTop:2,paddingBottom:2,paddingLeft:6,paddingRight:6,isMixedPadding:!0,color:"white",staticText:"Close",text:{textAlign:"center",fontWeight:"400",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"rgba(255, 255, 255, 0.8)",size:2,offset:-1}},infoMessage:{color:"white",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}}}),showConstraintsButton:{title:"Show Constraints Button",type:c.ControlType.Object,controls:{...vt({fill:"transparent",fillHover:"transparent",radius:5,paddingTop:1,paddingBottom:1,paddingLeft:6,paddingRight:6,isMixedPadding:!0,color:"white",staticText:"Show Constraints",text:{textAlign:"center",fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"rgba(255, 255, 255, 0.8)",size:2,offset:-1}}),...St({marginTop:13})},hidden:e=>e.useCustomExplain},showMoreButton:{title:"Show More Button",type:c.ControlType.Object,controls:{...vt({fill:"transparent",fillHover:"transparent",radius:5,paddingTop:1,paddingBottom:1,paddingLeft:6,paddingRight:6,isMixedPadding:!0,color:"white",staticText:"Show more ({{amount}})",text:{textAlign:"center",fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"rgba(255, 255, 255, 0.8)",size:2,offset:-1}}),...St({marginTop:13})},hidden:e=>e.useCustomExplain},listSeparator:{title:"List Separator",type:c.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.3)",hidden:e=>e.useCustomExplain},arrow:{title:"Arrow",type:c.ControlType.Color,defaultValue:"#002134"},useCustomExplain:{title:"Use Custom Popover",type:c.ControlType.Boolean,defaultValue:!1}},Xr=e=>{var t;return{fill:e.arrow??((t=e.popoverBox)==null?void 0:t.fill)}},ln=w.createContext(null),tt=()=>w.useContext(ln),Yr={dialogBox:{title:"Dialog Box",type:c.ControlType.Object,controls:Je({fill:"rgba(255, 255, 255, 0.7)",backdropFilter:"blur(10px) saturate(200%)",shadow:"0.2px 0.4px 2.3px rgba(0, 0, 0, 0.02), 0.6px 1px 5.7px rgba(0, 0, 0, 0.025), 1.2px 2.1px 10.6px rgba(0, 0, 0, 0.03), 2.3px 4px 17.2px rgba(0, 0, 0, 0.034), 4.2px 7.2px 25.9px rgba(0, 0, 0, 0.04), 7.6px 12.8px 37.7px rgba(0, 0, 0, 0.048), 13.9px 23.6px 54.7px rgba(0, 0, 0, 0.061), 40px 68px 96px rgba(0, 0, 0, 0.1)",radius:12,paddingTop:18,paddingBottom:0,paddingLeft:24,paddingRight:24,isMixedPadding:!0})},explanationCard:{title:"Explanation Card",type:c.ControlType.Object,controls:{...Je({fill:"white",shadow:"2px 1px 10px -5px rgba(0, 0, 0, 0.4)",radius:7,padding:12,isMixedPadding:!1}),...St({marginLeft:-12,marginRight:-12,isMixedMargin:!0})}},constraintExplanation:{title:"Constraint Explanation",type:c.ControlType.Object,controls:{configurationModelId:{title:"Configuration Model Id",type:c.ControlType.Object,controls:pe({color:"#171717",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})},ruleId:{title:"Rule Id",type:c.ControlType.Object,controls:pe({color:"#171717",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})}}},...jo({header:{subject:{color:"rgb(0, 161, 230)",text:{fontWeight:"500",fontSize:19,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}},suffix:{color:"#171717",text:{fontWeight:"500",fontSize:19,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}}},attributeName:{color:"#171717",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}},attributeValue:{add:{color:"#171717",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},radius:300,fill:"#efefef",iconFill:"#cfefc7",iconColor:"#48c52b"},remove:{color:"#171717",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},radius:300,fill:"#efefef",iconFill:"#ffdada",iconColor:"#c52b2b"},paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:10,isMixedPadding:!0},applySolutionButton:{fill:"#F2F2F2",fillHover:"#F7F7F7",radius:7,paddingTop:9,paddingBottom:9,paddingLeft:29,paddingRight:29,isMixedPadding:!0,color:"#171717",staticText:"Apply Solution",text:{textAlign:"center",fontWeight:"600",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"#00a1e6",size:2,offset:-1},marginTop:18,isMixedMargin:!0},closeButton:{fill:"transparent",fillHover:"00000012",radius:300,paddingTop:2,paddingBottom:2,paddingLeft:6,paddingRight:6,isMixedPadding:!0,color:"#171717",staticText:"Close",text:{textAlign:"center",fontWeight:"400",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"#00a1e6",size:2,offset:-1}},infoMessage:{color:"#171717",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}}}),decisionExplanationSolutionsTitle:{title:"Decision Explanation Solutions Title",type:c.ControlType.Object,controls:{...xt({color:"#171717",staticText:"Solutions",text:{fontWeight:"500",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})}},constraintExplanationSolutionsTitle:{title:"Constraint Explanation Solutions Title",type:c.ControlType.Object,controls:{...xt({color:"#171717",staticText:"Constraint Explanations",text:{fontWeight:"500",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})}},scrollShadowBorder:{title:"Scroll Shadow Border",type:c.ControlType.Color,defaultValue:"rgba(0, 0, 0, 0.3)"}},sn=w.createContext(null),Ot=()=>w.useContext(sn),Jr=()=>w.useContext(ln)||w.useContext(sn),ze=Jr,Zr=M.button`
|
|
71
71
|
appearance: none;
|
|
72
72
|
cursor: pointer;
|
|
73
73
|
|
|
@@ -79,12 +79,12 @@ ${f}`);case d.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
79
79
|
outline: var(--size-button-focus-outline) solid var(--color-button-focus-outline);
|
|
80
80
|
outline-offset: var(--size-button-focus-outline-offset);
|
|
81
81
|
}
|
|
82
|
-
`;function
|
|
82
|
+
`;function Vo(e){const{explanation:t,...n}=e,o=ce(),{applySolutionButton:i}=ze();return d.jsx(Zr,{...n,onClick:()=>o.applySolution(t.solution),style:{...jt(i),...Vt(i)},children:i.staticText})}function an(e,t,n){return k.match(e).returnType().with({type:u.AttributeType.Choice},o=>t.get(o.choiceValueId)??o.choiceValueId).with({type:u.AttributeType.Boolean,state:!0},()=>n.attributeValue.booleanDecisionStateTrueLabel).with({type:u.AttributeType.Boolean,state:!1},()=>n.attributeValue.booleanDecisionStateFalseLabel).with({type:u.AttributeType.Component,state:u.ComponentDecisionState.Included},()=>n.attributeValue.componentDecisionStateIncludedLabel).with({type:u.AttributeType.Component,state:u.ComponentDecisionState.Excluded},()=>n.attributeValue.componentDecisionStateExcludedLabel).with({type:u.AttributeType.Numeric},o=>o.state.toString()).exhaustive()}const el=M.div`
|
|
83
83
|
display: flex;
|
|
84
84
|
gap: var(--space-xs);
|
|
85
85
|
align-items: center;
|
|
86
86
|
min-width: 0;
|
|
87
|
-
`,
|
|
87
|
+
`,tl=M.div`
|
|
88
88
|
display: grid;
|
|
89
89
|
place-content: center;
|
|
90
90
|
border-top-left-radius: 360px;
|
|
@@ -92,74 +92,74 @@ ${f}`);case d.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
92
92
|
height: 1.5em;
|
|
93
93
|
width: 1.5em;
|
|
94
94
|
flex-shrink: 0;
|
|
95
|
-
`,
|
|
95
|
+
`,nl=M.div`
|
|
96
96
|
white-space: nowrap;
|
|
97
97
|
overflow: hidden;
|
|
98
98
|
text-overflow: ellipsis;
|
|
99
|
-
`;function
|
|
99
|
+
`;function ol(e){const{decision:t,choiceValuesNames:n}=e,o=t.intention,i=ze(),r=an(t,n,i),l=k.match(o).with("remove",()=>i.attributeValue.remove).with("add",()=>i.attributeValue.add).exhaustive();return d.jsxs(el,{style:{...Ro(i.attributeValue),...he(l),...Do(l),backgroundColor:l.fill},children:[d.jsxs(tl,{style:{backgroundColor:l.iconFill,color:l.iconColor},children:[o==="remove"&&d.jsx(bt.FontAwesomeIcon,{icon:gt.faMinus}),o==="add"&&d.jsx(bt.FontAwesomeIcon,{icon:gt.faPlus})]}),d.jsx(nl,{children:r})]})}function te(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 kt=w.createContext(null);function nt(e){const{attributes:t}=w.useContext(kt),{activeLocale:n}=c.useLocaleInfo(),o=n.code;return w.useMemo(()=>m.pipe(t,m.RA.findFirst(i=>u.globalAttributeIdEq.equals(te(i),e)),m.O.map(i=>i.name),m.RA.fromOption,m.RA.flatten,cn(o),m.O.toUndefined),[t,o,e.localId,e.componentPath,e.sharedConfigurationModelId])}function We(e){const{choiceValues:t}=w.useContext(kt),{activeLocale:n}=c.useLocaleInfo(),o=Y.useChoiceAttribute(e);if(!o)return m.RM.empty;const i=w.useMemo(()=>m.pipe(t,m.RA.filter(s=>u.globalAttributeIdEq.equals(te(s),e))),[t,e.localId,e.componentPath,e.sharedConfigurationModelId]),r=n.code,l=o.attribute.values;return w.useMemo(()=>m.pipe(l,m.RM.mapWithIndex((s,a)=>m.pipe(i,m.RA.findFirst(p=>p.choiceValueId===s),m.O.map(p=>p.name),m.RA.fromOption,m.RA.flatten,cn(r))),m.RM.compact),[l,i,r])}function Oo(e,t){const{choiceValues:n}=w.useContext(kt),{activeLocale:o}=c.useLocaleInfo(),i=o.code;return w.useMemo(()=>m.pipe(n,m.RA.findFirst(r=>u.globalAttributeIdEq.equals(te(r),e)&&r.choiceValueId===t),m.O.map(r=>r.name),m.RA.fromOption,m.RA.flatten,cn(i),m.O.toUndefined),[n,i,e.localId,e.componentPath,e.sharedConfigurationModelId,t])}function cn(e){return m.flow(m.RA.findFirst(t=>t.localeCode.localeCompare(e,void 0,{sensitivity:"accent"})===0),m.O.map(t=>t.translation))}function ko(e,t,n){const o=m.pipe(m.Str.Ord,m.Ord.contramap(i=>an(i,t,n)));return m.pipe(e,m.RA.sort(o))}const il=M.div`
|
|
100
100
|
display: grid;
|
|
101
101
|
grid-template-columns: subgrid;
|
|
102
102
|
grid-column: span 2;
|
|
103
103
|
align-items: center;
|
|
104
|
-
`,
|
|
104
|
+
`,rl=M.div`
|
|
105
105
|
grid-area: name;
|
|
106
106
|
white-space: nowrap;
|
|
107
107
|
overflow: hidden;
|
|
108
108
|
text-overflow: ellipsis;
|
|
109
|
-
`,
|
|
109
|
+
`,ll=M.div`
|
|
110
110
|
grid-area: values;
|
|
111
111
|
display: flex;
|
|
112
112
|
flex-wrap: wrap;
|
|
113
113
|
min-width: 0;
|
|
114
114
|
gap: var(--space-xxs);
|
|
115
|
-
`;function
|
|
115
|
+
`;function sl(e){const{decisions:t}=e,n=t[0].attributeId,o=We(n),i=nt(n),r=ze(),l=ko(t,o,r);return d.jsxs(il,{children:[d.jsx(rl,{style:he(r.attributeName),children:i??n.localId}),d.jsx(ll,{children:l.map((s,a)=>d.jsx(ol,{decision:s,choiceValuesNames:o},a))})]})}function Fo(e){const{attributes:t,...n}=e;return d.jsx("div",{...n,children:t.map(o=>d.jsx(sl,{decisions:o.decisions},o.key))})}function Mo(e){const t=e.sharedConfigurationModelId&&`shared::${e.sharedConfigurationModelId}`,n=(e.componentPath??[]).join("::");return[t,n,e.localId].filter(o=>(o==null?void 0:o.length)>0).join("::")}const al=m.pipe(m.Str.Ord,m.Ord.contramap(e=>e.attributeId.localId));function un(e,t="any"){var l,s;const n=((s=(l=e.solution)==null?void 0:l.decisions)==null?void 0:s.filter(a=>a.state!=null))??[],o=e.causedByDecisions??[],i=[...n.map(a=>({...a,intention:"add"})),...o.map(a=>({...a,intention:"remove"}))],r=k.match(t).with("add",()=>a=>a.intention==="add").with("remove",()=>a=>a.intention==="remove").otherwise(()=>m.constTrue);return m.pipe(i,m.RA.filter(r),m.RNEA.groupBy(a=>Mo(a.attributeId)),m.RR.collect(m.Ord.trivial)((a,p)=>({key:a,attributeId:m.RNEA.head(p).attributeId,decisions:p})),m.RA.sort(al))}const cl=M(Fo)`
|
|
116
116
|
display: grid;
|
|
117
117
|
grid-template-columns: [name] minmax(150px, auto) [values] minmax(0px, 1fr);
|
|
118
118
|
gap: var(--space-sm);
|
|
119
|
-
`;function
|
|
119
|
+
`;function ul(e){const{explanation:t}=e,{explanationCard:n}=Ot(),o=un(t);return d.jsxs("div",{style:{...$e(n),...Vt(n)},children:[d.jsx(cl,{attributes:o}),d.jsx(Vo,{explanation:t})]})}const dl=M.div`
|
|
120
120
|
ul {
|
|
121
121
|
margin: 0;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
line-height: 1.5em;
|
|
125
|
-
`,
|
|
125
|
+
`,fl=M.ul`
|
|
126
126
|
list-style-type: none;
|
|
127
127
|
margin-inline-start: 0;
|
|
128
128
|
padding-inline-start: 0;
|
|
129
|
-
`,
|
|
129
|
+
`,Rn=M.ul`
|
|
130
130
|
list-style-type: disc;
|
|
131
131
|
margin-inline-start: 0;
|
|
132
132
|
padding-inline-start: var(--space-lg);
|
|
133
|
-
`;function
|
|
133
|
+
`;function pl(e){const{explanation:t}=e,{explanationCard:n,constraintExplanation:o}=Ot(),i=t.causedByCardinalities,r=m.pipe(t.causedByRules,m.RNEA.groupBy(l=>l.configurationModelId),m.RR.collect(m.Str.Ord)((l,s)=>({configurationModelId:l,rules:m.pipe(s,m.RA.map(a=>a.localId),m.RA.sort(m.Str.Ord))})));return d.jsx(dl,{style:{...$e(n),...Vt(n)},children:d.jsxs(fl,{children:[r.map(l=>d.jsxs("li",{children:[d.jsx("span",{style:he(o.configurationModelId),children:l.configurationModelId}),d.jsx(Rn,{style:he(o.ruleId),children:l.rules.map(s=>d.jsx("li",{children:s}))})]})),i.length>0&&d.jsxs("li",{style:he(o.ruleId),children:[d.jsx("span",{children:"Cardinality"}),d.jsx(Rn,{children:i.map(l=>d.jsx("li",{children:l.localId}))})]})]})})}function No(e){const{variant:t,...n}=e,{explainQuestion:o}=ce(),{infoMessage:i}=ze(),r=k.match(o).returnType().with({question:u.ExplainQuestionType.whyIsStateNotPossible},()=>i.whyIsStateNotPossibleQuestion).with({question:u.ExplainQuestionType.whyIsNotSatisfied,subject:u.ExplainQuestionSubject.configuration},()=>i.whyConfigurationIsNotSatisfiedQuestion).with({question:u.ExplainQuestionType.whyIsNotSatisfied,subject:u.ExplainQuestionSubject.attribute},()=>i.whyAttributeIsNotSatisfiedQuestion).with(k.P.nullish,()=>i.generalConflictQuestion).exhaustive(),l=k.match(t).returnType().with("failedToExplain",()=>d.jsxs(d.Fragment,{children:[mt.render(i.failedToExplainText,{question:r}),d.jsx("br",{}),i.failedToExplainHintText]})).with("noExplanationFound",()=>d.jsx(d.Fragment,{children:mt.render(i.noExplanationFoundText,{question:r})})).with("noSolutionFound",()=>d.jsx(d.Fragment,{children:mt.render(i.noSolutionFoundText,{question:r})})).exhaustive();return d.jsx("div",{...n,style:he(i),children:l})}const Dn=M.div`
|
|
134
134
|
margin-bottom: var(--space-xs);
|
|
135
|
-
`,
|
|
135
|
+
`,jn=M.div`
|
|
136
136
|
display: flex;
|
|
137
137
|
flex-direction: column;
|
|
138
138
|
gap: var(--space-xs);
|
|
139
|
-
`,
|
|
139
|
+
`,hl=M.div`
|
|
140
140
|
display: flex;
|
|
141
141
|
flex-direction: column;
|
|
142
142
|
gap: var(--space-md);
|
|
143
|
-
`,
|
|
143
|
+
`,Vn=M(No)`
|
|
144
144
|
width: min-content;
|
|
145
145
|
min-width: 400px;
|
|
146
146
|
margin: var(--space-sm-fixed) var(--space-md-fixed) var(--space-sm-fixed) var(--space-sm-fixed);
|
|
147
|
-
`;function dl(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=ce(),{decisionExplanationSolutionsTitle:o,constraintExplanationSolutionsTitle:i}=Pt();return n?c.jsx(Pn,{variant:"failedToExplain"}):e.length===0&&t.length===0?c.jsx(Pn,{variant:"noExplanationFound"}):c.jsxs(ul,{children:[e.length>0&&c.jsxs("div",{children:[c.jsx(An,{style:ht(o),children:o.staticText}),c.jsx(In,{children:e.map(r=>c.jsx(ll,{explanation:r},e.indexOf(r)))})]}),t.length>0&&c.jsxs("div",{children:[c.jsx(An,{style:ht(i),children:i.staticText}),c.jsx(In,{children:t.map(r=>c.jsx(cl,{explanation:r},t.indexOf(r)))})]})]})}function xe(e){return Mo(e)?(e.nodeName||"").toLowerCase():"#document"}function se(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ce(e){var t;return(t=(Mo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Mo(e){return e instanceof Node||e instanceof se(e).Node}function X(e){return e instanceof Element||e instanceof se(e).Element}function oe(e){return e instanceof HTMLElement||e instanceof se(e).HTMLElement}function Gt(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof se(e).ShadowRoot}function tt(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=ae(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function fl(e){return["table","td","th"].includes(xe(e))}function cn(e){const t=un(),n=ae(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(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Fo(e){let t=Ae(e);for(;oe(t)&&!Me(t);){if(cn(t))return t;t=Ae(t)}return null}function un(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Me(e){return["html","body","#document"].includes(xe(e))}function ae(e){return se(e).getComputedStyle(e)}function jt(e){return X(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ae(e){if(xe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Gt(e)&&e.host||Ce(e);return Gt(t)?t.host:t}function No(e){const t=Ae(e);return Me(t)?e.ownerDocument?e.ownerDocument.body:e.body:oe(t)&&tt(t)?t:No(t)}function ve(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=No(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),l=se(i);return r?t.concat(l,l.visualViewport||[],tt(i)?i:[],l.frameElement&&n?ve(l.frameElement):[]):t.concat(i,ve(i,[],n))}function Ve(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 le(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Gt(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Lo(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Bo(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:o}=t;return n+"/"+o}).join(" "):navigator.userAgent}function pl(e){return e.mozInputSource===0&&e.isTrusted?!0:Yt()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function hl(e){return gl()?!1:!Yt()&&e.width===0&&e.height===0||Yt()&&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 ml(){return/apple/i.test(navigator.vendor)}function Yt(){const e=/android/i;return e.test(Lo())||e.test(Bo())}function gl(){return Bo().includes("jsdom/")}function Rn(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function yl(e){return"nativeEvent"in e}function bl(e){return e.matches("html,body")}function be(e){return(e==null?void 0:e.ownerDocument)||document}function kt(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 De(e){return"composedPath"in e?e.composedPath()[0]:e.target}const xl="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function $o(e){return oe(e)&&e.matches(xl)}function Mt(e){e.preventDefault(),e.stopPropagation()}function Cl(e){return e?e.getAttribute("role")==="combobox"&&$o(e):!1}const Fe=Math.min,Ee=Math.max,yt=Math.round,st=Math.floor,we=e=>({x:e,y:e}),vl={left:"right",right:"left",bottom:"top",top:"bottom"},wl={start:"end",end:"start"};function Xt(e,t,n){return Ee(e,Fe(t,n))}function nt(e,t){return typeof e=="function"?e(t):e}function Ie(e){return e.split("-")[0]}function ot(e){return e.split("-")[1]}function zo(e){return e==="x"?"y":"x"}function dn(e){return e==="y"?"height":"width"}function Vt(e){return["top","bottom"].includes(Ie(e))?"y":"x"}function fn(e){return zo(Vt(e))}function Sl(e,t,n){n===void 0&&(n=!1);const o=ot(e),i=fn(e),r=dn(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=bt(l)),[l,bt(l)]}function Tl(e){const t=bt(e);return[Jt(e),t,Jt(t)]}function Jt(e){return e.replace(/start|end/g,t=>wl[t])}function El(e,t,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?r:l;default:return[]}}function Al(e,t,n,o){const i=ot(e);let r=El(Ie(e),n==="start",o);return i&&(r=r.map(l=>l+"-"+i),t&&(r=r.concat(r.map(Jt)))),r}function bt(e){return e.replace(/left|right|bottom|top/g,t=>vl[t])}function Il(e){return{top:0,right:0,bottom:0,left:0,...e}}function Wo(e){return typeof e!="number"?Il(e):{top:e,right:e,bottom:e,left:e}}function xt(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function jn(e,t,n){let{reference:o,floating:i}=e;const r=Vt(t),l=fn(t),s=dn(l),a=Ie(t),f=r==="y",x=o.x+o.width/2-i.width/2,m=o.y+o.height/2-i.height/2,C=o[s]/2-i[s]/2;let p;switch(a){case"top":p={x,y:o.y-i.height};break;case"bottom":p={x,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:m};break;case"left":p={x:o.x-i.width,y:m};break;default:p={x:o.x,y:o.y}}switch(ot(t)){case"start":p[l]-=C*(n&&f?-1:1);break;case"end":p[l]+=C*(n&&f?-1:1);break}return p}const Pl=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,s=r.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(t));let f=await l.getElementRects({reference:e,floating:t,strategy:i}),{x,y:m}=jn(f,o,a),C=o,p={},b=0;for(let w=0;w<s.length;w++){const{name:g,fn:y}=s[w],{x:v,y:R,data:T,reset:A}=await y({x,y:m,initialPlacement:o,placement:C,strategy:i,middlewareData:p,rects:f,platform:l,elements:{reference:e,floating:t}});x=v??x,m=R??m,p={...p,[g]:{...p[g],...T}},A&&b<=50&&(b++,typeof A=="object"&&(A.placement&&(C=A.placement),A.rects&&(f=A.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x,y:m}=jn(f,C,a)),w=-1)}return{x,y:m,placement:C,strategy:i,middlewareData:p}};async function Ko(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:r,rects:l,elements:s,strategy:a}=e,{boundary:f="clippingAncestors",rootBoundary:x="viewport",elementContext:m="floating",altBoundary:C=!1,padding:p=0}=nt(t,e),b=Wo(p),g=s[C?m==="floating"?"reference":"floating":m],y=xt(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(g)))==null||n?g:g.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(s.floating)),boundary:f,rootBoundary:x,strategy:a})),v=m==="floating"?{...l.floating,x:o,y:i}:l.reference,R=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s.floating)),T=await(r.isElement==null?void 0:r.isElement(R))?await(r.getScale==null?void 0:r.getScale(R))||{x:1,y:1}:{x:1,y:1},A=xt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:R,strategy:a}):v);return{top:(y.top-A.top+b.top)/T.y,bottom:(A.bottom-y.bottom+b.bottom)/T.y,left:(y.left-A.left+b.left)/T.x,right:(A.right-y.right+b.right)/T.x}}const Rl=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:l,elements:s,middlewareData:a}=t,{element:f,padding:x=0}=nt(e,t)||{};if(f==null)return{};const m=Wo(x),C={x:n,y:o},p=fn(i),b=dn(p),w=await l.getDimensions(f),g=p==="y",y=g?"top":"left",v=g?"bottom":"right",R=g?"clientHeight":"clientWidth",T=r.reference[b]+r.reference[p]-C[p]-r.floating[b],A=C[p]-r.reference[p],P=await(l.getOffsetParent==null?void 0:l.getOffsetParent(f));let D=P?P[R]:0;(!D||!await(l.isElement==null?void 0:l.isElement(P)))&&(D=s.floating[R]||r.floating[b]);const j=T/2-A/2,F=D/2-w[b]/2-1,I=Fe(m[y],F),N=Fe(m[v],F),B=I,W=D-w[b]-N,_=D/2-w[b]/2+j,M=Xt(B,_,W),$=!a.arrow&&ot(i)!=null&&_!==M&&r.reference[b]/2-(_<B?I:N)-w[b]/2<0,k=$?_<B?_-B:_-W:0;return{[p]:C[p]+k,data:{[p]:M,centerOffset:_-M-k,...$&&{alignmentOffset:k}},reset:$}}}),jl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:r,rects:l,initialPlacement:s,platform:a,elements:f}=t,{mainAxis:x=!0,crossAxis:m=!0,fallbackPlacements:C,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...g}=nt(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const y=Ie(i),v=Ie(s)===s,R=await(a.isRTL==null?void 0:a.isRTL(f.floating)),T=C||(v||!w?[bt(s)]:Tl(s));!C&&b!=="none"&&T.push(...Al(s,w,b,R));const A=[s,...T],P=await Ko(t,g),D=[];let j=((o=r.flip)==null?void 0:o.overflows)||[];if(x&&D.push(P[y]),m){const B=Sl(i,l,R);D.push(P[B[0]],P[B[1]])}if(j=[...j,{placement:i,overflows:D}],!D.every(B=>B<=0)){var F,I;const B=(((F=r.flip)==null?void 0:F.index)||0)+1,W=A[B];if(W)return{data:{index:B,overflows:j},reset:{placement:W}};let _=(I=j.filter(M=>M.overflows[0]<=0).sort((M,$)=>M.overflows[1]-$.overflows[1])[0])==null?void 0:I.placement;if(!_)switch(p){case"bestFit":{var N;const M=(N=j.map($=>[$.placement,$.overflows.filter(k=>k>0).reduce((k,L)=>k+L,0)]).sort(($,k)=>$[1]-k[1])[0])==null?void 0:N[0];M&&(_=M);break}case"initialPlacement":_=s;break}if(i!==_)return{reset:{placement:_}}}return{}}}};async function Vl(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=Ie(n),s=ot(n),a=Vt(n)==="y",f=["left","top"].includes(l)?-1:1,x=r&&a?-1:1,m=nt(t,e);let{mainAxis:C,crossAxis:p,alignmentAxis:b}=typeof m=="number"?{mainAxis:m,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...m};return s&&typeof b=="number"&&(p=s==="end"?b*-1:b),a?{x:p*x,y:C*f}:{x:C*f,y:p*x}}const Dl=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:l,middlewareData:s}=t,a=await Vl(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:l}}}}},Ol=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:r=!0,crossAxis:l=!1,limiter:s={fn:g=>{let{x:y,y:v}=g;return{x:y,y:v}}},...a}=nt(e,t),f={x:n,y:o},x=await Ko(t,a),m=Vt(Ie(i)),C=zo(m);let p=f[C],b=f[m];if(r){const g=C==="y"?"top":"left",y=C==="y"?"bottom":"right",v=p+x[g],R=p-x[y];p=Xt(v,p,R)}if(l){const g=m==="y"?"top":"left",y=m==="y"?"bottom":"right",v=b+x[g],R=b-x[y];b=Xt(v,b,R)}const w=s.fn({...t,[C]:p,[m]:b});return{...w,data:{x:w.x-n,y:w.y-o}}}}};function qo(e){const t=ae(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=oe(e),r=i?e.offsetWidth:n,l=i?e.offsetHeight:o,s=yt(n)!==r||yt(o)!==l;return s&&(n=r,o=l),{width:n,height:o,$:s}}function pn(e){return X(e)?e:e.contextElement}function ke(e){const t=pn(e);if(!oe(t))return we(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=qo(t);let l=(r?yt(n.width):n.width)/o,s=(r?yt(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const kl=we(0);function _o(e){const t=se(e);return!un()||!t.visualViewport?kl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ml(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==se(e)?!1:t}function Pe(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=pn(e);let l=we(1);t&&(o?X(o)&&(l=ke(o)):l=ke(e));const s=Ml(r,n,o)?_o(r):we(0);let a=(i.left+s.x)/l.x,f=(i.top+s.y)/l.y,x=i.width/l.x,m=i.height/l.y;if(r){const C=se(r),p=o&&X(o)?se(o):o;let b=C.frameElement;for(;b&&o&&p!==C;){const w=ke(b),g=b.getBoundingClientRect(),y=ae(b),v=g.left+(b.clientLeft+parseFloat(y.paddingLeft))*w.x,R=g.top+(b.clientTop+parseFloat(y.paddingTop))*w.y;a*=w.x,f*=w.y,x*=w.x,m*=w.y,a+=v,f+=R,b=se(b).frameElement}}return xt({width:x,height:m,x:a,y:f})}const Fl=[":popover-open",":modal"];function Ho(e){let t=!1,n=0,o=0;function i(r){try{t=t||e.matches(r)}catch{}}if(Fl.forEach(r=>{i(r)}),t){const r=Fo(e);if(r){const l=r.getBoundingClientRect();n=l.x,o=l.y}}return[t,n,o]}function Nl(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=Ce(o),[l]=t?Ho(t.floating):[!1];if(o===r||l)return n;let s={scrollLeft:0,scrollTop:0},a=we(1);const f=we(0),x=oe(o);if((x||!x&&i!=="fixed")&&((xe(o)!=="body"||tt(r))&&(s=jt(o)),oe(o))){const m=Pe(o);a=ke(o),f.x=m.x+o.clientLeft,f.y=m.y+o.clientTop}return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-s.scrollLeft*a.x+f.x,y:n.y*a.y-s.scrollTop*a.y+f.y}}function Ll(e){return Array.from(e.getClientRects())}function Qo(e){return Pe(Ce(e)).left+jt(e).scrollLeft}function Bl(e){const t=Ce(e),n=jt(e),o=e.ownerDocument.body,i=Ee(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=Ee(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+Qo(e);const s=-n.scrollTop;return ae(o).direction==="rtl"&&(l+=Ee(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:s}}function $l(e,t){const n=se(e),o=Ce(e),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,s=0,a=0;if(i){r=i.width,l=i.height;const f=un();(!f||f&&t==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}return{width:r,height:l,x:s,y:a}}function zl(e,t){const n=Pe(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=oe(e)?ke(e):we(1),l=e.clientWidth*r.x,s=e.clientHeight*r.y,a=i*r.x,f=o*r.y;return{width:l,height:s,x:a,y:f}}function Vn(e,t,n){let o;if(t==="viewport")o=$l(e,n);else if(t==="document")o=Bl(Ce(e));else if(X(t))o=zl(t,n);else{const i=_o(e);o={...t,x:t.x-i.x,y:t.y-i.y}}return xt(o)}function Uo(e,t){const n=Ae(e);return n===t||!X(n)||Me(n)?!1:ae(n).position==="fixed"||Uo(n,t)}function Wl(e,t){const n=t.get(e);if(n)return n;let o=ve(e,[],!1).filter(s=>X(s)&&xe(s)!=="body"),i=null;const r=ae(e).position==="fixed";let l=r?Ae(e):e;for(;X(l)&&!Me(l);){const s=ae(l),a=cn(l);!a&&s.position==="fixed"&&(i=null),(r?!a&&!i:!a&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||tt(l)&&!a&&Uo(e,l))?o=o.filter(x=>x!==l):i=s,l=Ae(l)}return t.set(e,o),o}function Kl(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const l=[...n==="clippingAncestors"?Wl(t,this._c):[].concat(n),o],s=l[0],a=l.reduce((f,x)=>{const m=Vn(t,x,i);return f.top=Ee(m.top,f.top),f.right=Fe(m.right,f.right),f.bottom=Fe(m.bottom,f.bottom),f.left=Ee(m.left,f.left),f},Vn(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function ql(e){const{width:t,height:n}=qo(e);return{width:t,height:n}}function _l(e,t,n,o){const i=oe(t),r=Ce(t),l=n==="fixed",s=Pe(e,!0,l,t);let a={scrollLeft:0,scrollTop:0};const f=we(0);if(i||!i&&!l)if((xe(t)!=="body"||tt(r))&&(a=jt(t)),i){const w=Pe(t,!0,l,t);f.x=w.x+t.clientLeft,f.y=w.y+t.clientTop}else r&&(f.x=Qo(r));let x=s.left+a.scrollLeft-f.x,m=s.top+a.scrollTop-f.y;const[C,p,b]=Ho(o);return C&&(x+=p,m+=b,i&&(x+=t.clientLeft,m+=t.clientTop)),{x,y:m,width:s.width,height:s.height}}function Dn(e,t){return!oe(e)||ae(e).position==="fixed"?null:t?t(e):e.offsetParent}function Go(e,t){const n=se(e);if(!oe(e))return n;let o=Dn(e,t);for(;o&&fl(o)&&ae(o).position==="static";)o=Dn(o,t);return o&&(xe(o)==="html"||xe(o)==="body"&&ae(o).position==="static"&&!cn(o))?n:o||Fo(e)||n}const Hl=async function(e){const t=this.getOffsetParent||Go,n=this.getDimensions;return{reference:_l(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}};function Ql(e){return ae(e).direction==="rtl"}const Yo={convertOffsetParentRelativeRectToViewportRelativeRect:Nl,getDocumentElement:Ce,getClippingRect:Kl,getOffsetParent:Go,getElementRects:Hl,getClientRects:Ll,getDimensions:ql,getScale:ke,isElement:X,isRTL:Ql};function Ul(e,t){let n=null,o;const i=Ce(e);function r(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),r();const{left:f,top:x,width:m,height:C}=e.getBoundingClientRect();if(s||t(),!m||!C)return;const p=st(x),b=st(i.clientWidth-(f+m)),w=st(i.clientHeight-(x+C)),g=st(f),v={rootMargin:-p+"px "+-b+"px "+-w+"px "+-g+"px",threshold:Ee(0,Fe(1,a))||1};let R=!0;function T(A){const P=A[0].intersectionRatio;if(P!==a){if(!R)return l();P?l(!1,P):o=setTimeout(()=>{l(!1,1e-7)},100)}R=!1}try{n=new IntersectionObserver(T,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(T,v)}n.observe(e)}return l(!0),r}function Gl(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,f=pn(e),x=i||r?[...f?ve(f):[],...ve(t)]:[];x.forEach(y=>{i&&y.addEventListener("scroll",n,{passive:!0}),r&&y.addEventListener("resize",n)});const m=f&&s?Ul(f,n):null;let C=-1,p=null;l&&(p=new ResizeObserver(y=>{let[v]=y;v&&v.target===f&&p&&(p.unobserve(t),cancelAnimationFrame(C),C=requestAnimationFrame(()=>{var R;(R=p)==null||R.observe(t)})),n()}),f&&!a&&p.observe(f),p.observe(t));let b,w=a?Pe(e):null;a&&g();function g(){const y=Pe(e);w&&(y.x!==w.x||y.y!==w.y||y.width!==w.width||y.height!==w.height)&&n(),w=y,b=requestAnimationFrame(g)}return n(),()=>{var y;x.forEach(v=>{i&&v.removeEventListener("scroll",n),r&&v.removeEventListener("resize",n)}),m==null||m(),(y=p)==null||y.disconnect(),p=null,a&&cancelAnimationFrame(b)}}const Yl=Ol,Xl=jl,On=Rl,Jl=(e,t,n)=>{const o=new Map,i={platform:Yo,...n},r={...i.platform,_c:o};return Pl(e,t,{...i,platform:r})},Zl=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:i}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?On({element:o.current,padding:i}).fn(n):{}:o?On({element:o,padding:i}).fn(n):{}}}};var ut=typeof document<"u"?S.useLayoutEffect:S.useEffect;function Ct(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,o,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Ct(e[o],t[o]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,i[o]))return!1;for(o=n;o--!==0;){const r=i[o];if(!(r==="_owner"&&e.$$typeof)&&!Ct(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function Xo(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kn(e,t){const n=Xo(e);return Math.round(t*n)/n}function Mn(e){const t=E.useRef(e);return ut(()=>{t.current=e}),t}function es(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:r,floating:l}={},transform:s=!0,whileElementsMounted:a,open:f}=e,[x,m]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[C,p]=E.useState(o);Ct(C,o)||p(o);const[b,w]=E.useState(null),[g,y]=E.useState(null),v=E.useCallback(k=>{k!==P.current&&(P.current=k,w(k))},[]),R=E.useCallback(k=>{k!==D.current&&(D.current=k,y(k))},[]),T=r||b,A=l||g,P=E.useRef(null),D=E.useRef(null),j=E.useRef(x),F=a!=null,I=Mn(a),N=Mn(i),B=E.useCallback(()=>{if(!P.current||!D.current)return;const k={placement:t,strategy:n,middleware:C};N.current&&(k.platform=N.current),Jl(P.current,D.current,k).then(L=>{const ne={...L,isPositioned:!0};W.current&&!Ct(j.current,ne)&&(j.current=ne,Or.flushSync(()=>{m(ne)}))})},[C,t,n,N]);ut(()=>{f===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,m(k=>({...k,isPositioned:!1})))},[f]);const W=E.useRef(!1);ut(()=>(W.current=!0,()=>{W.current=!1}),[]),ut(()=>{if(T&&(P.current=T),A&&(D.current=A),T&&A){if(I.current)return I.current(T,A,B);B()}},[T,A,B,I,F]);const _=E.useMemo(()=>({reference:P,floating:D,setReference:v,setFloating:R}),[v,R]),M=E.useMemo(()=>({reference:T,floating:A}),[T,A]),$=E.useMemo(()=>{const k={position:n,left:0,top:0};if(!M.floating)return k;const L=kn(M.floating,x.x),ne=kn(M.floating,x.y);return s?{...k,transform:"translate("+L+"px, "+ne+"px)",...Xo(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:ne}},[n,s,M.floating,x.x,x.y]);return E.useMemo(()=>({...x,update:B,refs:_,elements:M,floatingStyles:$}),[x,B,_,M,$])}/*!
|
|
147
|
+
`;function ml(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=ce(),{decisionExplanationSolutionsTitle:o,constraintExplanationSolutionsTitle:i}=Ot();return n?d.jsx(Vn,{variant:"failedToExplain"}):e.length===0&&t.length===0?d.jsx(Vn,{variant:"noExplanationFound"}):d.jsxs(hl,{children:[e.length>0&&d.jsxs("div",{children:[d.jsx(Dn,{style:Ct(o),children:o.staticText}),d.jsx(jn,{children:e.map(r=>d.jsx(ul,{explanation:r},e.indexOf(r)))})]}),t.length>0&&d.jsxs("div",{children:[d.jsx(Dn,{style:Ct(i),children:i.staticText}),d.jsx(jn,{children:t.map(r=>d.jsx(pl,{explanation:r},t.indexOf(r)))})]})]})}function xe(e){return Bo(e)?(e.nodeName||"").toLowerCase():"#document"}function se(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ce(e){var t;return(t=(Bo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Bo(e){return e instanceof Node||e instanceof se(e).Node}function Z(e){return e instanceof Element||e instanceof se(e).Element}function oe(e){return e instanceof HTMLElement||e instanceof se(e).HTMLElement}function Jt(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof se(e).ShadowRoot}function ot(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=ae(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function yl(e){return["table","td","th"].includes(xe(e))}function dn(e){const t=fn(),n=ae(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(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Lo(e){let t=Ie(e);for(;oe(t)&&!Fe(t);){if(dn(t))return t;t=Ie(t)}return null}function fn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Fe(e){return["html","body","#document"].includes(xe(e))}function ae(e){return se(e).getComputedStyle(e)}function Ft(e){return Z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ie(e){if(xe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Jt(e)&&e.host||Ce(e);return Jt(t)?t.host:t}function $o(e){const t=Ie(e);return Fe(t)?e.ownerDocument?e.ownerDocument.body:e.body:oe(t)&&ot(t)?t:$o(t)}function ve(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=$o(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),l=se(i);return r?t.concat(l,l.visualViewport||[],ot(i)?i:[],l.frameElement&&n?ve(l.frameElement):[]):t.concat(i,ve(i,[],n))}function je(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 le(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Jt(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function zo(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Wo(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:o}=t;return n+"/"+o}).join(" "):navigator.userAgent}function gl(e){return e.mozInputSource===0&&e.isTrusted?!0:Zt()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function bl(e){return Cl()?!1:!Zt()&&e.width===0&&e.height===0||Zt()&&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 xl(){return/apple/i.test(navigator.vendor)}function Zt(){const e=/android/i;return e.test(zo())||e.test(Wo())}function Cl(){return Wo().includes("jsdom/")}function On(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function vl(e){return"nativeEvent"in e}function Sl(e){return e.matches("html,body")}function be(e){return(e==null?void 0:e.ownerDocument)||document}function Lt(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 Ve(e){return"composedPath"in e?e.composedPath()[0]:e.target}const wl="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Ko(e){return oe(e)&&e.matches(wl)}function $t(e){e.preventDefault(),e.stopPropagation()}function Tl(e){return e?e.getAttribute("role")==="combobox"&&Ko(e):!1}const Me=Math.min,Ee=Math.max,wt=Math.round,ct=Math.floor,Se=e=>({x:e,y:e}),El={left:"right",right:"left",bottom:"top",top:"bottom"},Il={start:"end",end:"start"};function en(e,t,n){return Ee(e,Me(t,n))}function it(e,t){return typeof e=="function"?e(t):e}function Ae(e){return e.split("-")[0]}function rt(e){return e.split("-")[1]}function Qo(e){return e==="x"?"y":"x"}function pn(e){return e==="y"?"height":"width"}function Mt(e){return["top","bottom"].includes(Ae(e))?"y":"x"}function hn(e){return Qo(Mt(e))}function Al(e,t,n){n===void 0&&(n=!1);const o=rt(e),i=hn(e),r=pn(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=Tt(l)),[l,Tt(l)]}function Pl(e){const t=Tt(e);return[tn(e),t,tn(t)]}function tn(e){return e.replace(/start|end/g,t=>Il[t])}function Rl(e,t,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?r:l;default:return[]}}function Dl(e,t,n,o){const i=rt(e);let r=Rl(Ae(e),n==="start",o);return i&&(r=r.map(l=>l+"-"+i),t&&(r=r.concat(r.map(tn)))),r}function Tt(e){return e.replace(/left|right|bottom|top/g,t=>El[t])}function jl(e){return{top:0,right:0,bottom:0,left:0,...e}}function qo(e){return typeof e!="number"?jl(e):{top:e,right:e,bottom:e,left:e}}function Et(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function kn(e,t,n){let{reference:o,floating:i}=e;const r=Mt(t),l=hn(t),s=pn(l),a=Ae(t),p=r==="y",C=o.x+o.width/2-i.width/2,y=o.y+o.height/2-i.height/2,g=o[s]/2-i[s]/2;let f;switch(a){case"top":f={x:C,y:o.y-i.height};break;case"bottom":f={x:C,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y};break;case"left":f={x:o.x-i.width,y};break;default:f={x:o.x,y:o.y}}switch(rt(t)){case"start":f[l]-=g*(n&&p?-1:1);break;case"end":f[l]+=g*(n&&p?-1:1);break}return f}const Vl=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,s=r.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(t));let p=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:C,y}=kn(p,o,a),g=o,f={},x=0;for(let v=0;v<s.length;v++){const{name:h,fn:b}=s[v],{x:S,y:R,data:I,reset:A}=await b({x:C,y,initialPlacement:o,placement:g,strategy:i,middlewareData:f,rects:p,platform:l,elements:{reference:e,floating:t}});C=S??C,y=R??y,f={...f,[h]:{...f[h],...I}},A&&x<=50&&(x++,typeof A=="object"&&(A.placement&&(g=A.placement),A.rects&&(p=A.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:C,y}=kn(p,g,a)),v=-1)}return{x:C,y,placement:g,strategy:i,middlewareData:f}};async function _o(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:r,rects:l,elements:s,strategy:a}=e,{boundary:p="clippingAncestors",rootBoundary:C="viewport",elementContext:y="floating",altBoundary:g=!1,padding:f=0}=it(t,e),x=qo(f),h=s[g?y==="floating"?"reference":"floating":y],b=Et(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(h)))==null||n?h:h.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(s.floating)),boundary:p,rootBoundary:C,strategy:a})),S=y==="floating"?{...l.floating,x:o,y:i}:l.reference,R=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s.floating)),I=await(r.isElement==null?void 0:r.isElement(R))?await(r.getScale==null?void 0:r.getScale(R))||{x:1,y:1}:{x:1,y:1},A=Et(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:S,offsetParent:R,strategy:a}):S);return{top:(b.top-A.top+x.top)/I.y,bottom:(A.bottom-b.bottom+x.bottom)/I.y,left:(b.left-A.left+x.left)/I.x,right:(A.right-b.right+x.right)/I.x}}const Ol=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:l,elements:s,middlewareData:a}=t,{element:p,padding:C=0}=it(e,t)||{};if(p==null)return{};const y=qo(C),g={x:n,y:o},f=hn(i),x=pn(f),v=await l.getDimensions(p),h=f==="y",b=h?"top":"left",S=h?"bottom":"right",R=h?"clientHeight":"clientWidth",I=r.reference[x]+r.reference[f]-g[f]-r.floating[x],A=g[f]-r.reference[f],P=await(l.getOffsetParent==null?void 0:l.getOffsetParent(p));let V=P?P[R]:0;(!V||!await(l.isElement==null?void 0:l.isElement(P)))&&(V=s.floating[R]||r.floating[x]);const O=I/2-A/2,B=V/2-v[x]/2-1,D=Me(y[b],B),K=Me(y[S],B),L=D,Q=V-v[x]-K,U=V/2-v[x]/2+O,T=en(L,U,Q),N=!a.arrow&&rt(i)!=null&&U!==T&&r.reference[x]/2-(U<L?D:K)-v[x]/2<0,j=N?U<L?U-L:U-Q:0;return{[f]:g[f]+j,data:{[f]:T,centerOffset:U-T-j,...N&&{alignmentOffset:j}},reset:N}}}),kl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:r,rects:l,initialPlacement:s,platform:a,elements:p}=t,{mainAxis:C=!0,crossAxis:y=!0,fallbackPlacements:g,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0,...h}=it(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const b=Ae(i),S=Ae(s)===s,R=await(a.isRTL==null?void 0:a.isRTL(p.floating)),I=g||(S||!v?[Tt(s)]:Pl(s));!g&&x!=="none"&&I.push(...Dl(s,v,x,R));const A=[s,...I],P=await _o(t,h),V=[];let O=((o=r.flip)==null?void 0:o.overflows)||[];if(C&&V.push(P[b]),y){const L=Al(i,l,R);V.push(P[L[0]],P[L[1]])}if(O=[...O,{placement:i,overflows:V}],!V.every(L=>L<=0)){var B,D;const L=(((B=r.flip)==null?void 0:B.index)||0)+1,Q=A[L];if(Q)return{data:{index:L,overflows:O},reset:{placement:Q}};let U=(D=O.filter(T=>T.overflows[0]<=0).sort((T,N)=>T.overflows[1]-N.overflows[1])[0])==null?void 0:D.placement;if(!U)switch(f){case"bestFit":{var K;const T=(K=O.map(N=>[N.placement,N.overflows.filter(j=>j>0).reduce((j,F)=>j+F,0)]).sort((N,j)=>N[1]-j[1])[0])==null?void 0:K[0];T&&(U=T);break}case"initialPlacement":U=s;break}if(i!==U)return{reset:{placement:U}}}return{}}}};async function Fl(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=Ae(n),s=rt(n),a=Mt(n)==="y",p=["left","top"].includes(l)?-1:1,C=r&&a?-1:1,y=it(t,e);let{mainAxis:g,crossAxis:f,alignmentAxis:x}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return s&&typeof x=="number"&&(f=s==="end"?x*-1:x),a?{x:f*C,y:g*p}:{x:g*p,y:f*C}}const Ml=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:l,middlewareData:s}=t,a=await Fl(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:l}}}}},Nl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:r=!0,crossAxis:l=!1,limiter:s={fn:h=>{let{x:b,y:S}=h;return{x:b,y:S}}},...a}=it(e,t),p={x:n,y:o},C=await _o(t,a),y=Mt(Ae(i)),g=Qo(y);let f=p[g],x=p[y];if(r){const h=g==="y"?"top":"left",b=g==="y"?"bottom":"right",S=f+C[h],R=f-C[b];f=en(S,f,R)}if(l){const h=y==="y"?"top":"left",b=y==="y"?"bottom":"right",S=x+C[h],R=x-C[b];x=en(S,x,R)}const v=s.fn({...t,[g]:f,[y]:x});return{...v,data:{x:v.x-n,y:v.y-o}}}}};function Uo(e){const t=ae(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=oe(e),r=i?e.offsetWidth:n,l=i?e.offsetHeight:o,s=wt(n)!==r||wt(o)!==l;return s&&(n=r,o=l),{width:n,height:o,$:s}}function mn(e){return Z(e)?e:e.contextElement}function ke(e){const t=mn(e);if(!oe(t))return Se(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=Uo(t);let l=(r?wt(n.width):n.width)/o,s=(r?wt(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const Bl=Se(0);function Ho(e){const t=se(e);return!fn()||!t.visualViewport?Bl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ll(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==se(e)?!1:t}function Pe(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=mn(e);let l=Se(1);t&&(o?Z(o)&&(l=ke(o)):l=ke(e));const s=Ll(r,n,o)?Ho(r):Se(0);let a=(i.left+s.x)/l.x,p=(i.top+s.y)/l.y,C=i.width/l.x,y=i.height/l.y;if(r){const g=se(r),f=o&&Z(o)?se(o):o;let x=g.frameElement;for(;x&&o&&f!==g;){const v=ke(x),h=x.getBoundingClientRect(),b=ae(x),S=h.left+(x.clientLeft+parseFloat(b.paddingLeft))*v.x,R=h.top+(x.clientTop+parseFloat(b.paddingTop))*v.y;a*=v.x,p*=v.y,C*=v.x,y*=v.y,a+=S,p+=R,x=se(x).frameElement}}return Et({width:C,height:y,x:a,y:p})}const $l=[":popover-open",":modal"];function Go(e){let t=!1,n=0,o=0;function i(r){try{t=t||e.matches(r)}catch{}}if($l.forEach(r=>{i(r)}),t){const r=Lo(e);if(r){const l=r.getBoundingClientRect();n=l.x,o=l.y}}return[t,n,o]}function zl(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=Ce(o),[l]=t?Go(t.floating):[!1];if(o===r||l)return n;let s={scrollLeft:0,scrollTop:0},a=Se(1);const p=Se(0),C=oe(o);if((C||!C&&i!=="fixed")&&((xe(o)!=="body"||ot(r))&&(s=Ft(o)),oe(o))){const y=Pe(o);a=ke(o),p.x=y.x+o.clientLeft,p.y=y.y+o.clientTop}return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-s.scrollLeft*a.x+p.x,y:n.y*a.y-s.scrollTop*a.y+p.y}}function Wl(e){return Array.from(e.getClientRects())}function Xo(e){return Pe(Ce(e)).left+Ft(e).scrollLeft}function Kl(e){const t=Ce(e),n=Ft(e),o=e.ownerDocument.body,i=Ee(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=Ee(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+Xo(e);const s=-n.scrollTop;return ae(o).direction==="rtl"&&(l+=Ee(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:s}}function Ql(e,t){const n=se(e),o=Ce(e),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,s=0,a=0;if(i){r=i.width,l=i.height;const p=fn();(!p||p&&t==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}return{width:r,height:l,x:s,y:a}}function ql(e,t){const n=Pe(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=oe(e)?ke(e):Se(1),l=e.clientWidth*r.x,s=e.clientHeight*r.y,a=i*r.x,p=o*r.y;return{width:l,height:s,x:a,y:p}}function Fn(e,t,n){let o;if(t==="viewport")o=Ql(e,n);else if(t==="document")o=Kl(Ce(e));else if(Z(t))o=ql(t,n);else{const i=Ho(e);o={...t,x:t.x-i.x,y:t.y-i.y}}return Et(o)}function Yo(e,t){const n=Ie(e);return n===t||!Z(n)||Fe(n)?!1:ae(n).position==="fixed"||Yo(n,t)}function _l(e,t){const n=t.get(e);if(n)return n;let o=ve(e,[],!1).filter(s=>Z(s)&&xe(s)!=="body"),i=null;const r=ae(e).position==="fixed";let l=r?Ie(e):e;for(;Z(l)&&!Fe(l);){const s=ae(l),a=dn(l);!a&&s.position==="fixed"&&(i=null),(r?!a&&!i:!a&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ot(l)&&!a&&Yo(e,l))?o=o.filter(C=>C!==l):i=s,l=Ie(l)}return t.set(e,o),o}function Ul(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const l=[...n==="clippingAncestors"?_l(t,this._c):[].concat(n),o],s=l[0],a=l.reduce((p,C)=>{const y=Fn(t,C,i);return p.top=Ee(y.top,p.top),p.right=Me(y.right,p.right),p.bottom=Me(y.bottom,p.bottom),p.left=Ee(y.left,p.left),p},Fn(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Hl(e){const{width:t,height:n}=Uo(e);return{width:t,height:n}}function Gl(e,t,n,o){const i=oe(t),r=Ce(t),l=n==="fixed",s=Pe(e,!0,l,t);let a={scrollLeft:0,scrollTop:0};const p=Se(0);if(i||!i&&!l)if((xe(t)!=="body"||ot(r))&&(a=Ft(t)),i){const v=Pe(t,!0,l,t);p.x=v.x+t.clientLeft,p.y=v.y+t.clientTop}else r&&(p.x=Xo(r));let C=s.left+a.scrollLeft-p.x,y=s.top+a.scrollTop-p.y;const[g,f,x]=Go(o);return g&&(C+=f,y+=x,i&&(C+=t.clientLeft,y+=t.clientTop)),{x:C,y,width:s.width,height:s.height}}function Mn(e,t){return!oe(e)||ae(e).position==="fixed"?null:t?t(e):e.offsetParent}function Jo(e,t){const n=se(e);if(!oe(e))return n;let o=Mn(e,t);for(;o&&yl(o)&&ae(o).position==="static";)o=Mn(o,t);return o&&(xe(o)==="html"||xe(o)==="body"&&ae(o).position==="static"&&!dn(o))?n:o||Lo(e)||n}const Xl=async function(e){const t=this.getOffsetParent||Jo,n=this.getDimensions;return{reference:Gl(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}};function Yl(e){return ae(e).direction==="rtl"}const Zo={convertOffsetParentRelativeRectToViewportRelativeRect:zl,getDocumentElement:Ce,getClippingRect:Ul,getOffsetParent:Jo,getElementRects:Xl,getClientRects:Wl,getDimensions:Hl,getScale:ke,isElement:Z,isRTL:Yl};function Jl(e,t){let n=null,o;const i=Ce(e);function r(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),r();const{left:p,top:C,width:y,height:g}=e.getBoundingClientRect();if(s||t(),!y||!g)return;const f=ct(C),x=ct(i.clientWidth-(p+y)),v=ct(i.clientHeight-(C+g)),h=ct(p),S={rootMargin:-f+"px "+-x+"px "+-v+"px "+-h+"px",threshold:Ee(0,Me(1,a))||1};let R=!0;function I(A){const P=A[0].intersectionRatio;if(P!==a){if(!R)return l();P?l(!1,P):o=setTimeout(()=>{l(!1,1e-7)},100)}R=!1}try{n=new IntersectionObserver(I,{...S,root:i.ownerDocument})}catch{n=new IntersectionObserver(I,S)}n.observe(e)}return l(!0),r}function Zl(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,p=mn(e),C=i||r?[...p?ve(p):[],...ve(t)]:[];C.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),r&&b.addEventListener("resize",n)});const y=p&&s?Jl(p,n):null;let g=-1,f=null;l&&(f=new ResizeObserver(b=>{let[S]=b;S&&S.target===p&&f&&(f.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var R;(R=f)==null||R.observe(t)})),n()}),p&&!a&&f.observe(p),f.observe(t));let x,v=a?Pe(e):null;a&&h();function h(){const b=Pe(e);v&&(b.x!==v.x||b.y!==v.y||b.width!==v.width||b.height!==v.height)&&n(),v=b,x=requestAnimationFrame(h)}return n(),()=>{var b;C.forEach(S=>{i&&S.removeEventListener("scroll",n),r&&S.removeEventListener("resize",n)}),y==null||y(),(b=f)==null||b.disconnect(),f=null,a&&cancelAnimationFrame(x)}}const es=Nl,ts=kl,Nn=Ol,ns=(e,t,n)=>{const o=new Map,i={platform:Zo,...n},r={...i.platform,_c:o};return Vl(e,t,{...i,platform:r})},os=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:i}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?Nn({element:o.current,padding:i}).fn(n):{}:o?Nn({element:o,padding:i}).fn(n):{}}}};var yt=typeof document<"u"?w.useLayoutEffect:w.useEffect;function It(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,o,i;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!It(e[o],t[o]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,i[o]))return!1;for(o=n;o--!==0;){const r=i[o];if(!(r==="_owner"&&e.$$typeof)&&!It(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function ei(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Bn(e,t){const n=ei(e);return Math.round(t*n)/n}function Ln(e){const t=E.useRef(e);return yt(()=>{t.current=e}),t}function is(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:i,elements:{reference:r,floating:l}={},transform:s=!0,whileElementsMounted:a,open:p}=e,[C,y]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,f]=E.useState(o);It(g,o)||f(o);const[x,v]=E.useState(null),[h,b]=E.useState(null),S=E.useCallback(j=>{j!==P.current&&(P.current=j,v(j))},[]),R=E.useCallback(j=>{j!==V.current&&(V.current=j,b(j))},[]),I=r||x,A=l||h,P=E.useRef(null),V=E.useRef(null),O=E.useRef(C),B=a!=null,D=Ln(a),K=Ln(i),L=E.useCallback(()=>{if(!P.current||!V.current)return;const j={placement:t,strategy:n,middleware:g};K.current&&(j.platform=K.current),ns(P.current,V.current,j).then(F=>{const z={...F,isPositioned:!0};Q.current&&!It(O.current,z)&&(O.current=z,Fr.flushSync(()=>{y(z)}))})},[g,t,n,K]);yt(()=>{p===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,y(j=>({...j,isPositioned:!1})))},[p]);const Q=E.useRef(!1);yt(()=>(Q.current=!0,()=>{Q.current=!1}),[]),yt(()=>{if(I&&(P.current=I),A&&(V.current=A),I&&A){if(D.current)return D.current(I,A,L);L()}},[I,A,L,D,B]);const U=E.useMemo(()=>({reference:P,floating:V,setReference:S,setFloating:R}),[S,R]),T=E.useMemo(()=>({reference:I,floating:A}),[I,A]),N=E.useMemo(()=>{const j={position:n,left:0,top:0};if(!T.floating)return j;const F=Bn(T.floating,C.x),z=Bn(T.floating,C.y);return s?{...j,transform:"translate("+F+"px, "+z+"px)",...ei(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:F,top:z}},[n,s,T.floating,C.x,C.y]);return E.useMemo(()=>({...C,update:L,refs:U,elements:T,floatingStyles:N}),[C,L,U,T,N])}/*!
|
|
148
148
|
* tabbable 6.2.0
|
|
149
149
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
150
|
-
*/var ts=["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])"],Zt=ts.join(","),Jo=typeof Element>"u",Xe=Jo?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,vt=!Jo&&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},wt=function e(t,n){var o;n===void 0&&(n=!0);var i=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),r=i===""||i==="true",l=r||n&&t&&e(t.parentNode);return l},ns=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},os=function(t,n,o){if(wt(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Zt));return n&&Xe.call(t,Zt)&&i.unshift(t),i=i.filter(o),i},is=function e(t,n,o){for(var i=[],r=Array.from(t);r.length;){var l=r.shift();if(!wt(l,!1))if(l.tagName==="SLOT"){var s=l.assignedElements(),a=s.length?s:l.children,f=e(a,!0,o);o.flatten?i.push.apply(i,f):i.push({scopeParent:l,candidates:f})}else{var x=Xe.call(l,Zt);x&&o.filter(l)&&(n||!t.includes(l))&&i.push(l);var m=l.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(l),C=!wt(m,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(l));if(m&&C){var p=e(m===!0?l.children:m.children,!0,o);o.flatten?i.push.apply(i,p):i.push({scopeParent:l,candidates:p})}else r.unshift.apply(r,l.children)}}return i},Zo=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},ei=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ns(t))&&!Zo(t)?0:t.tabIndex},rs=function(t,n){var o=ei(t);return o<0&&n&&!Zo(t)?0:o},ls=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},ti=function(t){return t.tagName==="INPUT"},ss=function(t){return ti(t)&&t.type==="hidden"},as=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},cs=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},us=function(t){if(!t.name)return!0;var n=t.form||vt(t),o=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=o(window.CSS.escape(t.name));else try{i=o(t.name)}catch(l){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",l.message),!1}var r=cs(i,t.form);return!r||r===t},ds=function(t){return ti(t)&&t.type==="radio"},fs=function(t){return ds(t)&&!us(t)},ps=function(t){var n,o=t&&vt(t),i=(n=o)===null||n===void 0?void 0:n.host,r=!1;if(o&&o!==t){var l,s,a;for(r=!!((l=i)!==null&&l!==void 0&&(s=l.ownerDocument)!==null&&s!==void 0&&s.contains(i)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!r&&i;){var f,x,m;o=vt(i),i=(f=o)===null||f===void 0?void 0:f.host,r=!!((x=i)!==null&&x!==void 0&&(m=x.ownerDocument)!==null&&m!==void 0&&m.contains(i))}}return r},Fn=function(t){var n=t.getBoundingClientRect(),o=n.width,i=n.height;return o===0&&i===0},hs=function(t,n){var o=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var r=Xe.call(t,"details>summary:first-of-type"),l=r?t.parentElement:t;if(Xe.call(l,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="legacy-full"){if(typeof i=="function"){for(var s=t;t;){var a=t.parentElement,f=vt(t);if(a&&!a.shadowRoot&&i(a)===!0)return Fn(t);t.assignedSlot?t=t.assignedSlot:!a&&f!==t.ownerDocument?t=f.host:t=a}t=s}if(ps(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Fn(t);return!1},ms=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var i=n.children.item(o);if(i.tagName==="LEGEND")return Xe.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},gs=function(t,n){return!(n.disabled||wt(n)||ss(n)||hs(n,t)||as(n)||ms(n))},Nn=function(t,n){return!(fs(n)||ei(n)<0||!gs(t,n))},ys=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},bs=function e(t){var n=[],o=[];return t.forEach(function(i,r){var l=!!i.scopeParent,s=l?i.scopeParent:i,a=rs(s,l),f=l?e(i.candidates):s;a===0?l?n.push.apply(n,f):n.push(s):o.push({documentOrder:r,tabIndex:a,item:i,isScope:l,content:f})}),o.sort(ls).reduce(function(i,r){return r.isScope?i.push.apply(i,r.content):i.push(r.content),i},[]).concat(n)},hn=function(t,n){n=n||{};var o;return n.getShadowRoot?o=is([t],n.includeContainer,{filter:Nn.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:ys}):o=os(t,n.includeContainer,Nn.bind(null,n)),bs(o)};function mn(e){return E.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const xs=E["useInsertionEffect".toString()],Cs=xs||(e=>e());function Oe(e){const t=E.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Cs(()=>{t.current=e}),E.useCallback(function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return t.current==null?void 0:t.current(...o)},[])}let Ln=0;function Se(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:i=!1}=t;o&&cancelAnimationFrame(Ln);const r=()=>e==null?void 0:e.focus({preventScroll:n});i?r():Ln=requestAnimationFrame(r)}var ue=typeof document<"u"?S.useLayoutEffect:S.useEffect;function Ne(){return Ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ne.apply(this,arguments)}let Ft=!1,vs=0;const Bn=()=>"floating-ui-"+vs++;function ws(){const[e,t]=E.useState(()=>Ft?Bn():void 0);return ue(()=>{e==null&&t(Bn())},[]),E.useEffect(()=>{Ft||(Ft=!0)},[]),e}const Ss=E["useId".toString()],Dt=Ss||ws,Ts=E.forwardRef(function(t,n){let{context:{placement:o,elements:{floating:i},middlewareData:{arrow:r}},width:l=14,height:s=7,tipRadius:a=0,strokeWidth:f=0,staticOffset:x,stroke:m,d:C,style:{transform:p,...b}={},...w}=t;process.env.NODE_ENV!=="production"&&(n||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const g=Dt();if(!i)return null;f*=2;const y=f/2,v=l/2*(a/-8+1),R=s/2*a/4,[T,A]=o.split("-"),P=Yo.isRTL(i),D=!!C,j=T==="top"||T==="bottom",F=x&&A==="end"?"bottom":"top";let I=x&&A==="end"?"right":"left";x&&P&&(I=A==="end"?"left":"right");const N=(r==null?void 0:r.x)!=null?x||r.x:"",B=(r==null?void 0:r.y)!=null?x||r.y:"",W=C||"M0,0"+(" H"+l)+(" L"+(l-v)+","+(s-R))+(" Q"+l/2+","+s+" "+v+","+(s-R))+" Z",_={top:D?"rotate(180deg)":"",left:D?"rotate(90deg)":"rotate(-90deg)",bottom:D?"":"rotate(180deg)",right:D?"rotate(-90deg)":"rotate(90deg)"}[T];return E.createElement("svg",Ne({},w,{"aria-hidden":!0,ref:n,width:D?l:l+f,height:l,viewBox:"0 0 "+l+" "+(s>l?s:l),style:{position:"absolute",pointerEvents:"none",[I]:N,[F]:B,[T]:j||D?"100%":"calc(100% - "+f/2+"px)",transform:""+_+(p??""),...b}}),f>0&&E.createElement("path",{clipPath:"url(#"+g+")",fill:"none",stroke:m,strokeWidth:f+(C?0:1),d:W}),E.createElement("path",{stroke:f&&!C?w.fill:"none",d:W}),E.createElement("clipPath",{id:g},E.createElement("rect",{x:-y,y:y*(D?-1:1),width:l+f,height:l})))});function Es(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var o;e.set(t,((o=e.get(t))==null?void 0:o.filter(i=>i!==n))||[])}}}const As=E.createContext(null),Is=E.createContext(null),Ps=()=>{var e;return((e=E.useContext(As))==null?void 0:e.id)||null},gn=()=>E.useContext(Is);function Je(e){return"data-floating-ui-"+e}function Nt(e){const t=S.useRef(e);return ue(()=>{t.current=e}),t}function Rs(e,t){var n;let o=[],i=(n=e.find(r=>r.id===t))==null?void 0:n.parentId;for(;i;){const r=e.find(l=>l.id===i);i=r==null?void 0:r.parentId,r&&(o=o.concat(r))}return o}function Qe(e,t){let n=e.filter(i=>{var r;return i.parentId===t&&((r=i.context)==null?void 0:r.open)}),o=n;for(;o.length;)o=e.filter(i=>{var r;return(r=o)==null?void 0:r.some(l=>{var s;return i.parentId===l.id&&((s=i.context)==null?void 0:s.open)})}),n=n.concat(o);return n}let je=new WeakMap,at=new WeakSet,ct={},Lt=0;const js=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,ni=e=>e&&(e.host||ni(e.parentNode)),Vs=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=ni(n);return e.contains(o)?o:null}).filter(n=>n!=null);function Ds(e,t,n,o){const i="data-floating-ui-inert",r=o?"inert":n?"aria-hidden":null,l=Vs(t,e),s=new Set,a=new Set(l),f=[];ct[i]||(ct[i]=new WeakMap);const x=ct[i];l.forEach(m),C(t),s.clear();function m(p){!p||s.has(p)||(s.add(p),p.parentNode&&m(p.parentNode))}function C(p){!p||a.has(p)||Array.prototype.forEach.call(p.children,b=>{if(s.has(b))C(b);else{const w=r?b.getAttribute(r):null,g=w!==null&&w!=="false",y=(je.get(b)||0)+1,v=(x.get(b)||0)+1;je.set(b,y),x.set(b,v),f.push(b),y===1&&g&&at.add(b),v===1&&b.setAttribute(i,""),!g&&r&&b.setAttribute(r,"true")}})}return Lt++,()=>{f.forEach(p=>{const b=(je.get(p)||0)-1,w=(x.get(p)||0)-1;je.set(p,b),x.set(p,w),b||(!at.has(p)&&r&&p.removeAttribute(r),at.delete(p)),w||p.removeAttribute(i)}),Lt--,Lt||(je=new WeakMap,je=new WeakMap,at=new WeakSet,ct={})}}function $n(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=be(e[0]).body;return Ds(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const yn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function oi(e,t){const n=hn(e,yn());t==="prev"&&n.reverse();const o=n.indexOf(Ve(be(e)));return n.slice(o+1)[0]}function ii(){return oi(document.body,"next")}function ri(){return oi(document.body,"prev")}function Ue(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!le(n,o)}function Os(e){hn(e,yn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function ks(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}const bn={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 Ms;function zn(e){e.key==="Tab"&&(e.target,clearTimeout(Ms))}const St=E.forwardRef(function(t,n){const[o,i]=E.useState();ue(()=>(ml()&&i("button"),document.addEventListener("keydown",zn),()=>{document.removeEventListener("keydown",zn)}),[]);const r={ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[Je("focus-guard")]:"",style:bn};return E.createElement("span",Ne({},t,r))}),li=E.createContext(null),Wn=Je("portal");function Fs(e){let{id:t,root:n}=e===void 0?{}:e;const[o,i]=E.useState(null),r=Dt(),l=ai(),s=E.useRef(null);return ue(()=>()=>{o==null||o.remove(),queueMicrotask(()=>{s.current=null})},[o]),ue(()=>{if(s.current)return;const a=t?document.getElementById(t):null;if(!a)return;const f=document.createElement("div");f.id=r,f.setAttribute(Wn,""),a.appendChild(f),s.current=f,i(f)},[t,r]),ue(()=>{if(s.current)return;let a=n||(l==null?void 0:l.portalNode);a&&!X(a)&&(a=a.current),a=a||document.body;let f=null;t&&(f=document.createElement("div"),f.id=t,a.appendChild(f));const x=document.createElement("div");x.id=r,x.setAttribute(Wn,""),a=f||a,a.appendChild(x),s.current=x,i(x)},[t,n,r,l]),o}function si(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const r=Fs({id:n,root:o}),[l,s]=E.useState(null),a=E.useRef(null),f=E.useRef(null),x=E.useRef(null),m=E.useRef(null),C=!!l&&!l.modal&&l.open&&i&&!!(o||r);return E.useEffect(()=>{if(!r||!i||l!=null&&l.modal)return;function p(b){r&&Ue(b)&&(b.type==="focusin"?ks:Os)(r)}return r.addEventListener("focusin",p,!0),r.addEventListener("focusout",p,!0),()=>{r.removeEventListener("focusin",p,!0),r.removeEventListener("focusout",p,!0)}},[r,i,l==null?void 0:l.modal]),E.createElement(li.Provider,{value:E.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:f,beforeInsideRef:x,afterInsideRef:m,portalNode:r,setFocusManagerState:s}),[i,r])},C&&r&&E.createElement(St,{"data-type":"outside",ref:a,onFocus:p=>{if(Ue(p,r)){var b;(b=x.current)==null||b.focus()}else{const w=ri()||(l==null?void 0:l.refs.domReference.current);w==null||w.focus()}}}),C&&r&&E.createElement("span",{"aria-owns":r.id,style:bn}),r&&vo.createPortal(t,r),C&&r&&E.createElement(St,{"data-type":"outside",ref:f,onFocus:p=>{if(Ue(p,r)){var b;(b=m.current)==null||b.focus()}else{const w=ii()||(l==null?void 0:l.refs.domReference.current);w==null||w.focus(),l!=null&&l.closeOnFocusOut&&(l==null||l.onOpenChange(!1,p.nativeEvent))}}}))}const ai=()=>E.useContext(li),Kn=20;let Te=[];function Bt(e){Te=Te.filter(t=>t.isConnected),e&&xe(e)!=="body"&&(Te.push(e),Te.length>Kn&&(Te=Te.slice(-Kn)))}function qn(){return Te.slice().reverse().find(e=>e.isConnected)}const Ns=E.forwardRef(function(t,n){return E.createElement("button",Ne({},t,{type:"button",ref:n,tabIndex:-1,style:bn}))});function ci(e){const{context:t,children:n,disabled:o=!1,order:i=["content"],guards:r=!0,initialFocus:l=0,returnFocus:s=!0,modal:a=!0,visuallyHiddenDismiss:f=!1,closeOnFocusOut:x=!0}=e,{open:m,refs:C,nodeId:p,onOpenChange:b,events:w,dataRef:g,elements:{domReference:y,floating:v}}=t,R=typeof l=="number"&&l<0,T=Cl(y)&&R,A=js()?r:!0,P=Nt(i),D=Nt(l),j=Nt(s),F=gn(),I=ai(),N=E.useRef(null),B=E.useRef(null),W=E.useRef(!1),_=E.useRef(!1),M=I!=null,$=E.useCallback(function(q){return q===void 0&&(q=v),q?hn(q,yn()):[]},[v]),k=E.useCallback(q=>{const K=$(q);return P.current.map(z=>y&&z==="reference"?y:v&&z==="floating"?v:K).filter(Boolean).flat()},[y,v,P,$]);E.useEffect(()=>{if(o||!a)return;function q(z){if(z.key==="Tab"){le(v,Ve(be(v)))&&$().length===0&&!T&&Mt(z);const H=k(),G=De(z);P.current[0]==="reference"&&G===y&&(Mt(z),z.shiftKey?Se(H[H.length-1]):Se(H[1])),P.current[1]==="floating"&&G===v&&z.shiftKey&&(Mt(z),Se(H[0]))}}const K=be(v);return K.addEventListener("keydown",q),()=>{K.removeEventListener("keydown",q)}},[o,y,v,a,P,T,$,k]),E.useEffect(()=>{if(o||!x)return;function q(){_.current=!0,setTimeout(()=>{_.current=!1})}function K(z){const H=z.relatedTarget;queueMicrotask(()=>{const G=!(le(y,H)||le(v,H)||le(H,v)||le(I==null?void 0:I.portalNode,H)||H!=null&&H.hasAttribute(Je("focus-guard"))||F&&(Qe(F.nodesRef.current,p).find(Y=>{var te,de;return le((te=Y.context)==null?void 0:te.elements.floating,H)||le((de=Y.context)==null?void 0:de.elements.domReference,H)})||Rs(F.nodesRef.current,p).find(Y=>{var te,de;return((te=Y.context)==null?void 0:te.elements.floating)===H||((de=Y.context)==null?void 0:de.elements.domReference)===H})));H&&G&&!_.current&&H!==qn()&&(W.current=!0,b(!1,z))})}if(v&&oe(y))return y.addEventListener("focusout",K),y.addEventListener("pointerdown",q),!a&&v.addEventListener("focusout",K),()=>{y.removeEventListener("focusout",K),y.removeEventListener("pointerdown",q),!a&&v.removeEventListener("focusout",K)}},[o,y,v,a,p,F,I,b,x]),E.useEffect(()=>{var q;if(o)return;const K=Array.from((I==null||(q=I.portalNode)==null?void 0:q.querySelectorAll("["+Je("portal")+"]"))||[]);if(v){const z=[v,...K,N.current,B.current,P.current.includes("reference")||T?y:null].filter(G=>G!=null),H=a||T?$n(z,A,!A):$n(z);return()=>{H()}}},[o,y,v,a,P,I,T,A]),ue(()=>{if(o||!v)return;const q=be(v),K=Ve(q);queueMicrotask(()=>{const z=k(v),H=D.current,G=(typeof H=="number"?z[H]:H.current)||v,Y=le(v,K);!R&&!Y&&m&&Se(G,{preventScroll:G===v})})},[o,m,v,R,k,D]),ue(()=>{if(o||!v)return;let q=!1;const K=be(v),z=Ve(K),H=g.current;Bt(z);function G(Y){let{reason:te,event:de,nested:He}=Y;te==="escape-key"&&C.domReference.current&&Bt(C.domReference.current),te==="hover"&&de.type==="mouseleave"&&(W.current=!0),te==="outside-press"&&(He?(W.current=!1,q=!0):W.current=!(pl(de)||hl(de)))}return w.on("openchange",G),()=>{w.off("openchange",G);const Y=Ve(K),te=le(v,Y)||F&&Qe(F.nodesRef.current,p).some(Cr=>{var Sn;return le((Sn=Cr.context)==null?void 0:Sn.elements.floating,Y)});(te||H.openEvent&&["click","mousedown"].includes(H.openEvent.type))&&C.domReference.current&&Bt(C.domReference.current);const He=qn();j.current&&!W.current&&oe(He)&&(!(He!==Y&&Y!==K.body)||te)&&Se(He,{cancelPrevious:!1,preventScroll:q})}},[o,v,j,g,C,w,F,p]),ue(()=>{if(!(o||!I))return I.setFocusManagerState({modal:a,closeOnFocusOut:x,open:m,onOpenChange:b,refs:C}),()=>{I.setFocusManagerState(null)}},[o,I,a,m,b,C,x]),ue(()=>{if(o||!v||typeof MutationObserver!="function"||R)return;const q=()=>{const z=v.getAttribute("tabindex");P.current.includes("floating")||Ve(be(v))!==C.domReference.current&&$().length===0?z!=="0"&&v.setAttribute("tabindex","0"):z!=="-1"&&v.setAttribute("tabindex","-1")};q();const K=new MutationObserver(q);return K.observe(v,{childList:!0,subtree:!0,attributes:!0}),()=>{K.disconnect()}},[o,v,C,P,$,R]);function L(q){return o||!f||!a?null:E.createElement(Ns,{ref:q==="start"?N:B,onClick:K=>b(!1,K.nativeEvent)},typeof f=="string"?f:"Dismiss")}const ne=!o&&A&&(M||a);return E.createElement(E.Fragment,null,ne&&E.createElement(St,{"data-type":"inside",ref:I==null?void 0:I.beforeInsideRef,onFocus:q=>{if(a){const z=k();Se(i[0]==="reference"?z[0]:z[z.length-1])}else if(I!=null&&I.preserveTabOrder&&I.portalNode)if(W.current=!1,Ue(q,I.portalNode)){const z=ii()||y;z==null||z.focus()}else{var K;(K=I.beforeOutsideRef.current)==null||K.focus()}}}),!T&&L("start"),n,L("end"),ne&&E.createElement(St,{"data-type":"inside",ref:I==null?void 0:I.afterInsideRef,onFocus:q=>{if(a)Se(k()[0]);else if(I!=null&&I.preserveTabOrder&&I.portalNode)if(x&&(W.current=!0),Ue(q,I.portalNode)){const z=ri()||y;z==null||z.focus()}else{var K;(K=I.afterOutsideRef.current)==null||K.focus()}}}))}const $t=new Set,ui=E.forwardRef(function(t,n){let{lockScroll:o=!1,...i}=t;const r=Dt();return ue(()=>{if(!o)return;$t.add(r);const l=/iP(hone|ad|od)|iOS/.test(Lo()),s=document.body.style,f=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",x=window.innerWidth-document.documentElement.clientWidth,m=s.left?parseFloat(s.left):window.pageXOffset,C=s.top?parseFloat(s.top):window.pageYOffset;if(s.overflow="hidden",x&&(s[f]=x+"px"),l){var p,b;const w=((p=window.visualViewport)==null?void 0:p.offsetLeft)||0,g=((b=window.visualViewport)==null?void 0:b.offsetTop)||0;Object.assign(s,{position:"fixed",top:-(C-Math.floor(g))+"px",left:-(m-Math.floor(w))+"px",right:"0"})}return()=>{$t.delete(r),$t.size===0&&(Object.assign(s,{overflow:"",[f]:""}),l&&(Object.assign(s,{position:"",top:"",left:"",right:""}),window.scrollTo(m,C)))}},[r,o]),E.createElement("div",Ne({ref:n},i,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}}))});function _n(e){return oe(e.target)&&e.target.tagName==="BUTTON"}function Hn(e){return $o(e)}function di(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:i,elements:{domReference:r}}=e,{enabled:l=!0,event:s="click",toggle:a=!0,ignoreMouse:f=!1,keyboardHandlers:x=!0}=t,m=E.useRef(),C=E.useRef(!1);return E.useMemo(()=>l?{reference:{onPointerDown(p){m.current=p.pointerType},onMouseDown(p){p.button===0&&(Rn(m.current,!0)&&f||s!=="click"&&(n&&a&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?o(!1,p.nativeEvent,"click"):(p.preventDefault(),o(!0,p.nativeEvent,"click"))))},onClick(p){if(s==="mousedown"&&m.current){m.current=void 0;return}Rn(m.current,!0)&&f||(n&&a&&(!i.current.openEvent||i.current.openEvent.type==="click")?o(!1,p.nativeEvent,"click"):o(!0,p.nativeEvent,"click"))},onKeyDown(p){m.current=void 0,!(p.defaultPrevented||!x||_n(p))&&(p.key===" "&&!Hn(r)&&(p.preventDefault(),C.current=!0),p.key==="Enter"&&o(!(n&&a),p.nativeEvent,"click"))},onKeyUp(p){p.defaultPrevented||!x||_n(p)||Hn(r)||p.key===" "&&C.current&&(C.current=!1,o(!(n&&a),p.nativeEvent,"click"))}}}:{},[l,i,s,f,x,r,a,n,o])}const Ls={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Bs={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Qn=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 fi(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,nodeId:i,elements:{reference:r,domReference:l,floating:s},dataRef:a}=e,{enabled:f=!0,escapeKey:x=!0,outsidePress:m=!0,outsidePressEvent:C="pointerdown",referencePress:p=!1,referencePressEvent:b="pointerdown",ancestorScroll:w=!1,bubbles:g,capture:y}=t,v=gn(),R=Oe(typeof m=="function"?m:()=>!1),T=typeof m=="function"?R:m,A=E.useRef(!1),P=E.useRef(!1),{escapeKey:D,outsidePress:j}=Qn(g),{escapeKey:F,outsidePress:I}=Qn(y),N=Oe(M=>{if(!n||!f||!x||M.key!=="Escape")return;const $=v?Qe(v.nodesRef.current,i):[];if(!D&&(M.stopPropagation(),$.length>0)){let k=!0;if($.forEach(L=>{var ne;if((ne=L.context)!=null&&ne.open&&!L.context.dataRef.current.__escapeKeyBubbles){k=!1;return}}),!k)return}o(!1,yl(M)?M.nativeEvent:M,"escape-key")}),B=Oe(M=>{var $;const k=()=>{var L;N(M),(L=De(M))==null||L.removeEventListener("keydown",k)};($=De(M))==null||$.addEventListener("keydown",k)}),W=Oe(M=>{const $=A.current;A.current=!1;const k=P.current;if(P.current=!1,C==="click"&&k||$||typeof T=="function"&&!T(M))return;const L=De(M),ne="["+Je("inert")+"]",q=be(s).querySelectorAll(ne);let K=X(L)?L:null;for(;K&&!Me(K);){const G=Ae(K);if(Me(G)||!X(G))break;K=G}if(q.length&&X(L)&&!bl(L)&&!le(L,s)&&Array.from(q).every(G=>!le(K,G)))return;if(oe(L)&&s){const G=L.clientWidth>0&&L.scrollWidth>L.clientWidth,Y=L.clientHeight>0&&L.scrollHeight>L.clientHeight;let te=Y&&M.offsetX>L.clientWidth;if(Y&&ae(L).direction==="rtl"&&(te=M.offsetX<=L.offsetWidth-L.clientWidth),te||G&&M.offsetY>L.clientHeight)return}const z=v&&Qe(v.nodesRef.current,i).some(G=>{var Y;return kt(M,(Y=G.context)==null?void 0:Y.elements.floating)});if(kt(M,s)||kt(M,l)||z)return;const H=v?Qe(v.nodesRef.current,i):[];if(H.length>0){let G=!0;if(H.forEach(Y=>{var te;if((te=Y.context)!=null&&te.open&&!Y.context.dataRef.current.__outsidePressBubbles){G=!1;return}}),!G)return}o(!1,M,"outside-press")}),_=Oe(M=>{var $;const k=()=>{var L;W(M),(L=De(M))==null||L.removeEventListener(C,k)};($=De(M))==null||$.addEventListener(C,k)});return E.useEffect(()=>{if(!n||!f)return;a.current.__escapeKeyBubbles=D,a.current.__outsidePressBubbles=j;function M(L){o(!1,L,"ancestor-scroll")}const $=be(s);x&&$.addEventListener("keydown",F?B:N,F),T&&$.addEventListener(C,I?_:W,I);let k=[];return w&&(X(l)&&(k=ve(l)),X(s)&&(k=k.concat(ve(s))),!X(r)&&r&&r.contextElement&&(k=k.concat(ve(r.contextElement)))),k=k.filter(L=>{var ne;return L!==((ne=$.defaultView)==null?void 0:ne.visualViewport)}),k.forEach(L=>{L.addEventListener("scroll",M,{passive:!0})}),()=>{x&&$.removeEventListener("keydown",F?B:N,F),T&&$.removeEventListener(C,I?_:W,I),k.forEach(L=>{L.removeEventListener("scroll",M)})}},[a,s,l,r,x,T,C,n,o,w,f,D,j,N,F,B,W,I,_]),E.useEffect(()=>{A.current=!1},[T,C]),E.useMemo(()=>f?{reference:{onKeyDown:N,[Ls[b]]:M=>{p&&o(!1,M.nativeEvent,"reference-press")}},floating:{onKeyDown:N,onMouseDown(){P.current=!0},onMouseUp(){P.current=!0},[Bs[C]]:()=>{A.current=!0}}}:{},[f,p,C,b,o,N])}let en;process.env.NODE_ENV!=="production"&&(en=new Set);function pi(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:o,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var r;const j="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((r=e.elements)!=null&&r.reference&&!X(e.elements.reference)){var l;if(!((l=en)!=null&&l.has(j))){var s;(s=en)==null||s.add(j),console.error(j)}}}const[a,f]=E.useState(null),x=((t=e.elements)==null?void 0:t.reference)||a,m=es(e),C=gn(),p=Ps()!=null,b=Oe((j,F,I)=>{j&&(g.current.openEvent=F),y.emit("openchange",{open:j,event:F,reason:I,nested:p}),o==null||o(j,F,I)}),w=E.useRef(null),g=E.useRef({}),y=E.useState(()=>Es())[0],v=Dt(),R=E.useCallback(j=>{const F=X(j)?{getBoundingClientRect:()=>j.getBoundingClientRect(),contextElement:j}:j;m.refs.setReference(F)},[m.refs]),T=E.useCallback(j=>{(X(j)||j===null)&&(w.current=j,f(j)),(X(m.refs.reference.current)||m.refs.reference.current===null||j!==null&&!X(j))&&m.refs.setReference(j)},[m.refs]),A=E.useMemo(()=>({...m.refs,setReference:T,setPositionReference:R,domReference:w}),[m.refs,T,R]),P=E.useMemo(()=>({...m.elements,domReference:x}),[m.elements,x]),D=E.useMemo(()=>({...m,refs:A,elements:P,dataRef:g,nodeId:i,floatingId:v,events:y,open:n,onOpenChange:b}),[m,i,v,y,n,b,A,P]);return ue(()=>{const j=C==null?void 0:C.nodesRef.current.find(F=>F.id===i);j&&(j.context=D)}),E.useMemo(()=>({...m,context:D,refs:A,elements:P}),[m,A,P,D])}const Un="active",Gn="selected";function zt(e,t,n){const o=new Map,i=n==="item";let r=e;if(i&&e){const{[Un]:l,[Gn]:s,...a}=e;r=a}return{...n==="floating"&&{tabIndex:-1},...r,...t.map(l=>{const s=l?l[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((l,s)=>(s&&Object.entries(s).forEach(a=>{let[f,x]=a;if(!(i&&[Un,Gn].includes(f)))if(f.indexOf("on")===0){if(o.has(f)||o.set(f,[]),typeof x=="function"){var m;(m=o.get(f))==null||m.push(x),l[f]=function(){for(var C,p=arguments.length,b=new Array(p),w=0;w<p;w++)b[w]=arguments[w];return(C=o.get(f))==null?void 0:C.map(g=>g(...b)).find(g=>g!==void 0)}}}else l[f]=x}),l),{})}}function hi(e){e===void 0&&(e=[]);const t=e,n=E.useCallback(r=>zt(r,e,"reference"),t),o=E.useCallback(r=>zt(r,e,"floating"),t),i=E.useCallback(r=>zt(r,e,"item"),e.map(r=>r==null?void 0:r.item));return E.useMemo(()=>({getReferenceProps:n,getFloatingProps:o,getItemProps:i}),[n,o,i])}function $s(e={}){const{initialOpen:t=!1,open:n,onOpenChange:o}=e,[i,r]=E.useState(t),l=n??i,s=o??r,a=pi({open:l,onOpenChange:s}),f=a.context,x=di(f,{enabled:n==null}),m=fi(f,{outsidePressEvent:"mousedown"}),C=hi([x,m]);return E.useMemo(()=>({open:l,setOpen:s,...C,...a}),[l,s,C,a])}const mi=E.createContext(null),gi=()=>{const e=E.useContext(mi);if(e==null)throw new Error("Dialog components must be wrapped in <Dialog />");return e};function zs({children:e,...t}){const n=$s(t);return c.jsx(mi.Provider,{value:n,children:e})}const yi=V.css`
|
|
150
|
+
*/var rs=["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])"],nn=rs.join(","),ti=typeof Element>"u",Ze=ti?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,At=!ti&&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},Pt=function e(t,n){var o;n===void 0&&(n=!0);var i=t==null||(o=t.getAttribute)===null||o===void 0?void 0:o.call(t,"inert"),r=i===""||i==="true",l=r||n&&t&&e(t.parentNode);return l},ls=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},ss=function(t,n,o){if(Pt(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(nn));return n&&Ze.call(t,nn)&&i.unshift(t),i=i.filter(o),i},as=function e(t,n,o){for(var i=[],r=Array.from(t);r.length;){var l=r.shift();if(!Pt(l,!1))if(l.tagName==="SLOT"){var s=l.assignedElements(),a=s.length?s:l.children,p=e(a,!0,o);o.flatten?i.push.apply(i,p):i.push({scopeParent:l,candidates:p})}else{var C=Ze.call(l,nn);C&&o.filter(l)&&(n||!t.includes(l))&&i.push(l);var y=l.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(l),g=!Pt(y,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(l));if(y&&g){var f=e(y===!0?l.children:y.children,!0,o);o.flatten?i.push.apply(i,f):i.push({scopeParent:l,candidates:f})}else r.unshift.apply(r,l.children)}}return i},ni=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},oi=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||ls(t))&&!ni(t)?0:t.tabIndex},cs=function(t,n){var o=oi(t);return o<0&&n&&!ni(t)?0:o},us=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},ii=function(t){return t.tagName==="INPUT"},ds=function(t){return ii(t)&&t.type==="hidden"},fs=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},ps=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},hs=function(t){if(!t.name)return!0;var n=t.form||At(t),o=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=o(window.CSS.escape(t.name));else try{i=o(t.name)}catch(l){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",l.message),!1}var r=ps(i,t.form);return!r||r===t},ms=function(t){return ii(t)&&t.type==="radio"},ys=function(t){return ms(t)&&!hs(t)},gs=function(t){var n,o=t&&At(t),i=(n=o)===null||n===void 0?void 0:n.host,r=!1;if(o&&o!==t){var l,s,a;for(r=!!((l=i)!==null&&l!==void 0&&(s=l.ownerDocument)!==null&&s!==void 0&&s.contains(i)||t!=null&&(a=t.ownerDocument)!==null&&a!==void 0&&a.contains(t));!r&&i;){var p,C,y;o=At(i),i=(p=o)===null||p===void 0?void 0:p.host,r=!!((C=i)!==null&&C!==void 0&&(y=C.ownerDocument)!==null&&y!==void 0&&y.contains(i))}}return r},$n=function(t){var n=t.getBoundingClientRect(),o=n.width,i=n.height;return o===0&&i===0},bs=function(t,n){var o=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var r=Ze.call(t,"details>summary:first-of-type"),l=r?t.parentElement:t;if(Ze.call(l,"details:not([open]) *"))return!0;if(!o||o==="full"||o==="legacy-full"){if(typeof i=="function"){for(var s=t;t;){var a=t.parentElement,p=At(t);if(a&&!a.shadowRoot&&i(a)===!0)return $n(t);t.assignedSlot?t=t.assignedSlot:!a&&p!==t.ownerDocument?t=p.host:t=a}t=s}if(gs(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return $n(t);return!1},xs=function(t){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(t.tagName))for(var n=t.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var o=0;o<n.children.length;o++){var i=n.children.item(o);if(i.tagName==="LEGEND")return Ze.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},Cs=function(t,n){return!(n.disabled||Pt(n)||ds(n)||bs(n,t)||fs(n)||xs(n))},zn=function(t,n){return!(ys(n)||oi(n)<0||!Cs(t,n))},vs=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},Ss=function e(t){var n=[],o=[];return t.forEach(function(i,r){var l=!!i.scopeParent,s=l?i.scopeParent:i,a=cs(s,l),p=l?e(i.candidates):s;a===0?l?n.push.apply(n,p):n.push(s):o.push({documentOrder:r,tabIndex:a,item:i,isScope:l,content:p})}),o.sort(us).reduce(function(i,r){return r.isScope?i.push.apply(i,r.content):i.push(r.content),i},[]).concat(n)},yn=function(t,n){n=n||{};var o;return n.getShadowRoot?o=as([t],n.includeContainer,{filter:zn.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:vs}):o=ss(t,n.includeContainer,zn.bind(null,n)),Ss(o)};function gn(e){return E.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})},e)}const ws=E["useInsertionEffect".toString()],Ts=ws||(e=>e());function Oe(e){const t=E.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Ts(()=>{t.current=e}),E.useCallback(function(){for(var n=arguments.length,o=new Array(n),i=0;i<n;i++)o[i]=arguments[i];return t.current==null?void 0:t.current(...o)},[])}let Wn=0;function we(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:i=!1}=t;o&&cancelAnimationFrame(Wn);const r=()=>e==null?void 0:e.focus({preventScroll:n});i?r():Wn=requestAnimationFrame(r)}var de=typeof document<"u"?w.useLayoutEffect:w.useEffect;function Ne(){return Ne=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ne.apply(this,arguments)}let zt=!1,Es=0;const Kn=()=>"floating-ui-"+Es++;function Is(){const[e,t]=E.useState(()=>zt?Kn():void 0);return de(()=>{e==null&&t(Kn())},[]),E.useEffect(()=>{zt||(zt=!0)},[]),e}const As=E["useId".toString()],Nt=As||Is,Ps=E.forwardRef(function(t,n){let{context:{placement:o,elements:{floating:i},middlewareData:{arrow:r}},width:l=14,height:s=7,tipRadius:a=0,strokeWidth:p=0,staticOffset:C,stroke:y,d:g,style:{transform:f,...x}={},...v}=t;process.env.NODE_ENV!=="production"&&(n||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const h=Nt();if(!i)return null;p*=2;const b=p/2,S=l/2*(a/-8+1),R=s/2*a/4,[I,A]=o.split("-"),P=Zo.isRTL(i),V=!!g,O=I==="top"||I==="bottom",B=C&&A==="end"?"bottom":"top";let D=C&&A==="end"?"right":"left";C&&P&&(D=A==="end"?"left":"right");const K=(r==null?void 0:r.x)!=null?C||r.x:"",L=(r==null?void 0:r.y)!=null?C||r.y:"",Q=g||"M0,0"+(" H"+l)+(" L"+(l-S)+","+(s-R))+(" Q"+l/2+","+s+" "+S+","+(s-R))+" Z",U={top:V?"rotate(180deg)":"",left:V?"rotate(90deg)":"rotate(-90deg)",bottom:V?"":"rotate(180deg)",right:V?"rotate(-90deg)":"rotate(90deg)"}[I];return E.createElement("svg",Ne({},v,{"aria-hidden":!0,ref:n,width:V?l:l+p,height:l,viewBox:"0 0 "+l+" "+(s>l?s:l),style:{position:"absolute",pointerEvents:"none",[D]:K,[B]:L,[I]:O||V?"100%":"calc(100% - "+p/2+"px)",transform:""+U+(f??""),...x}}),p>0&&E.createElement("path",{clipPath:"url(#"+h+")",fill:"none",stroke:y,strokeWidth:p+(g?0:1),d:Q}),E.createElement("path",{stroke:p&&!g?v.fill:"none",d:Q}),E.createElement("clipPath",{id:h},E.createElement("rect",{x:-b,y:b*(V?-1:1),width:l+p,height:l})))});function Rs(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(i=>i(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var o;e.set(t,((o=e.get(t))==null?void 0:o.filter(i=>i!==n))||[])}}}const Ds=E.createContext(null),js=E.createContext(null),Vs=()=>{var e;return((e=E.useContext(Ds))==null?void 0:e.id)||null},bn=()=>E.useContext(js);function et(e){return"data-floating-ui-"+e}function Wt(e){const t=w.useRef(e);return de(()=>{t.current=e}),t}function Os(e,t){var n;let o=[],i=(n=e.find(r=>r.id===t))==null?void 0:n.parentId;for(;i;){const r=e.find(l=>l.id===i);i=r==null?void 0:r.parentId,r&&(o=o.concat(r))}return o}function Ue(e,t){let n=e.filter(i=>{var r;return i.parentId===t&&((r=i.context)==null?void 0:r.open)}),o=n;for(;o.length;)o=e.filter(i=>{var r;return(r=o)==null?void 0:r.some(l=>{var s;return i.parentId===l.id&&((s=i.context)==null?void 0:s.open)})}),n=n.concat(o);return n}let De=new WeakMap,ut=new WeakSet,dt={},Kt=0;const ks=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,ri=e=>e&&(e.host||ri(e.parentNode)),Fs=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=ri(n);return e.contains(o)?o:null}).filter(n=>n!=null);function Ms(e,t,n,o){const i="data-floating-ui-inert",r=o?"inert":n?"aria-hidden":null,l=Fs(t,e),s=new Set,a=new Set(l),p=[];dt[i]||(dt[i]=new WeakMap);const C=dt[i];l.forEach(y),g(t),s.clear();function y(f){!f||s.has(f)||(s.add(f),f.parentNode&&y(f.parentNode))}function g(f){!f||a.has(f)||Array.prototype.forEach.call(f.children,x=>{if(s.has(x))g(x);else{const v=r?x.getAttribute(r):null,h=v!==null&&v!=="false",b=(De.get(x)||0)+1,S=(C.get(x)||0)+1;De.set(x,b),C.set(x,S),p.push(x),b===1&&h&&ut.add(x),S===1&&x.setAttribute(i,""),!h&&r&&x.setAttribute(r,"true")}})}return Kt++,()=>{p.forEach(f=>{const x=(De.get(f)||0)-1,v=(C.get(f)||0)-1;De.set(f,x),C.set(f,v),x||(!ut.has(f)&&r&&f.removeAttribute(r),ut.delete(f)),v||f.removeAttribute(i)}),Kt--,Kt||(De=new WeakMap,De=new WeakMap,ut=new WeakSet,dt={})}}function Qn(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=be(e[0]).body;return Ms(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const xn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function li(e,t){const n=yn(e,xn());t==="prev"&&n.reverse();const o=n.indexOf(je(be(e)));return n.slice(o+1)[0]}function si(){return li(document.body,"next")}function ai(){return li(document.body,"prev")}function He(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!le(n,o)}function Ns(e){yn(e,xn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function Bs(e){e.querySelectorAll("[data-tabindex]").forEach(n=>{const o=n.dataset.tabindex;delete n.dataset.tabindex,o?n.setAttribute("tabindex",o):n.removeAttribute("tabindex")})}const Cn={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 Ls;function qn(e){e.key==="Tab"&&(e.target,clearTimeout(Ls))}const Rt=E.forwardRef(function(t,n){const[o,i]=E.useState();de(()=>(xl()&&i("button"),document.addEventListener("keydown",qn),()=>{document.removeEventListener("keydown",qn)}),[]);const r={ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[et("focus-guard")]:"",style:Cn};return E.createElement("span",Ne({},t,r))}),ci=E.createContext(null),_n=et("portal");function $s(e){let{id:t,root:n}=e===void 0?{}:e;const[o,i]=E.useState(null),r=Nt(),l=di(),s=E.useRef(null);return de(()=>()=>{o==null||o.remove(),queueMicrotask(()=>{s.current=null})},[o]),de(()=>{if(s.current)return;const a=t?document.getElementById(t):null;if(!a)return;const p=document.createElement("div");p.id=r,p.setAttribute(_n,""),a.appendChild(p),s.current=p,i(p)},[t,r]),de(()=>{if(s.current)return;let a=n||(l==null?void 0:l.portalNode);a&&!Z(a)&&(a=a.current),a=a||document.body;let p=null;t&&(p=document.createElement("div"),p.id=t,a.appendChild(p));const C=document.createElement("div");C.id=r,C.setAttribute(_n,""),a=p||a,a.appendChild(C),s.current=C,i(C)},[t,n,r,l]),o}function ui(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const r=$s({id:n,root:o}),[l,s]=E.useState(null),a=E.useRef(null),p=E.useRef(null),C=E.useRef(null),y=E.useRef(null),g=!!l&&!l.modal&&l.open&&i&&!!(o||r);return E.useEffect(()=>{if(!r||!i||l!=null&&l.modal)return;function f(x){r&&He(x)&&(x.type==="focusin"?Bs:Ns)(r)}return r.addEventListener("focusin",f,!0),r.addEventListener("focusout",f,!0),()=>{r.removeEventListener("focusin",f,!0),r.removeEventListener("focusout",f,!0)}},[r,i,l==null?void 0:l.modal]),E.createElement(ci.Provider,{value:E.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:p,beforeInsideRef:C,afterInsideRef:y,portalNode:r,setFocusManagerState:s}),[i,r])},g&&r&&E.createElement(Rt,{"data-type":"outside",ref:a,onFocus:f=>{if(He(f,r)){var x;(x=C.current)==null||x.focus()}else{const v=ai()||(l==null?void 0:l.refs.domReference.current);v==null||v.focus()}}}),g&&r&&E.createElement("span",{"aria-owns":r.id,style:Cn}),r&&To.createPortal(t,r),g&&r&&E.createElement(Rt,{"data-type":"outside",ref:p,onFocus:f=>{if(He(f,r)){var x;(x=y.current)==null||x.focus()}else{const v=si()||(l==null?void 0:l.refs.domReference.current);v==null||v.focus(),l!=null&&l.closeOnFocusOut&&(l==null||l.onOpenChange(!1,f.nativeEvent))}}}))}const di=()=>E.useContext(ci),Un=20;let Te=[];function Qt(e){Te=Te.filter(t=>t.isConnected),e&&xe(e)!=="body"&&(Te.push(e),Te.length>Un&&(Te=Te.slice(-Un)))}function Hn(){return Te.slice().reverse().find(e=>e.isConnected)}const zs=E.forwardRef(function(t,n){return E.createElement("button",Ne({},t,{type:"button",ref:n,tabIndex:-1,style:Cn}))});function fi(e){const{context:t,children:n,disabled:o=!1,order:i=["content"],guards:r=!0,initialFocus:l=0,returnFocus:s=!0,modal:a=!0,visuallyHiddenDismiss:p=!1,closeOnFocusOut:C=!0}=e,{open:y,refs:g,nodeId:f,onOpenChange:x,events:v,dataRef:h,elements:{domReference:b,floating:S}}=t,R=typeof l=="number"&&l<0,I=Tl(b)&&R,A=ks()?r:!0,P=Wt(i),V=Wt(l),O=Wt(s),B=bn(),D=di(),K=E.useRef(null),L=E.useRef(null),Q=E.useRef(!1),U=E.useRef(!1),T=D!=null,N=E.useCallback(function(q){return q===void 0&&(q=S),q?yn(q,xn()):[]},[S]),j=E.useCallback(q=>{const W=N(q);return P.current.map($=>b&&$==="reference"?b:S&&$==="floating"?S:W).filter(Boolean).flat()},[b,S,P,N]);E.useEffect(()=>{if(o||!a)return;function q($){if($.key==="Tab"){le(S,je(be(S)))&&N().length===0&&!I&&$t($);const _=j(),H=Ve($);P.current[0]==="reference"&&H===b&&($t($),$.shiftKey?we(_[_.length-1]):we(_[1])),P.current[1]==="floating"&&H===S&&$.shiftKey&&($t($),we(_[0]))}}const W=be(S);return W.addEventListener("keydown",q),()=>{W.removeEventListener("keydown",q)}},[o,b,S,a,P,I,N,j]),E.useEffect(()=>{if(o||!C)return;function q(){U.current=!0,setTimeout(()=>{U.current=!1})}function W($){const _=$.relatedTarget;queueMicrotask(()=>{const H=!(le(b,_)||le(S,_)||le(_,S)||le(D==null?void 0:D.portalNode,_)||_!=null&&_.hasAttribute(et("focus-guard"))||B&&(Ue(B.nodesRef.current,f).find(G=>{var J,ue;return le((J=G.context)==null?void 0:J.elements.floating,_)||le((ue=G.context)==null?void 0:ue.elements.domReference,_)})||Os(B.nodesRef.current,f).find(G=>{var J,ue;return((J=G.context)==null?void 0:J.elements.floating)===_||((ue=G.context)==null?void 0:ue.elements.domReference)===_})));_&&H&&!U.current&&_!==Hn()&&(Q.current=!0,x(!1,$))})}if(S&&oe(b))return b.addEventListener("focusout",W),b.addEventListener("pointerdown",q),!a&&S.addEventListener("focusout",W),()=>{b.removeEventListener("focusout",W),b.removeEventListener("pointerdown",q),!a&&S.removeEventListener("focusout",W)}},[o,b,S,a,f,B,D,x,C]),E.useEffect(()=>{var q;if(o)return;const W=Array.from((D==null||(q=D.portalNode)==null?void 0:q.querySelectorAll("["+et("portal")+"]"))||[]);if(S){const $=[S,...W,K.current,L.current,P.current.includes("reference")||I?b:null].filter(H=>H!=null),_=a||I?Qn($,A,!A):Qn($);return()=>{_()}}},[o,b,S,a,P,D,I,A]),de(()=>{if(o||!S)return;const q=be(S),W=je(q);queueMicrotask(()=>{const $=j(S),_=V.current,H=(typeof _=="number"?$[_]:_.current)||S,G=le(S,W);!R&&!G&&y&&we(H,{preventScroll:H===S})})},[o,y,S,R,j,V]),de(()=>{if(o||!S)return;let q=!1;const W=be(S),$=je(W),_=h.current;Qt($);function H(G){let{reason:J,event:ue,nested:_e}=G;J==="escape-key"&&g.domReference.current&&Qt(g.domReference.current),J==="hover"&&ue.type==="mouseleave"&&(Q.current=!0),J==="outside-press"&&(_e?(Q.current=!1,q=!0):Q.current=!(gl(ue)||bl(ue)))}return v.on("openchange",H),()=>{v.off("openchange",H);const G=je(W),J=le(S,G)||B&&Ue(B.nodesRef.current,f).some(wr=>{var En;return le((En=wr.context)==null?void 0:En.elements.floating,G)});(J||_.openEvent&&["click","mousedown"].includes(_.openEvent.type))&&g.domReference.current&&Qt(g.domReference.current);const _e=Hn();O.current&&!Q.current&&oe(_e)&&(!(_e!==G&&G!==W.body)||J)&&we(_e,{cancelPrevious:!1,preventScroll:q})}},[o,S,O,h,g,v,B,f]),de(()=>{if(!(o||!D))return D.setFocusManagerState({modal:a,closeOnFocusOut:C,open:y,onOpenChange:x,refs:g}),()=>{D.setFocusManagerState(null)}},[o,D,a,y,x,g,C]),de(()=>{if(o||!S||typeof MutationObserver!="function"||R)return;const q=()=>{const $=S.getAttribute("tabindex");P.current.includes("floating")||je(be(S))!==g.domReference.current&&N().length===0?$!=="0"&&S.setAttribute("tabindex","0"):$!=="-1"&&S.setAttribute("tabindex","-1")};q();const W=new MutationObserver(q);return W.observe(S,{childList:!0,subtree:!0,attributes:!0}),()=>{W.disconnect()}},[o,S,g,P,N,R]);function F(q){return o||!p||!a?null:E.createElement(zs,{ref:q==="start"?K:L,onClick:W=>x(!1,W.nativeEvent)},typeof p=="string"?p:"Dismiss")}const z=!o&&A&&(T||a);return E.createElement(E.Fragment,null,z&&E.createElement(Rt,{"data-type":"inside",ref:D==null?void 0:D.beforeInsideRef,onFocus:q=>{if(a){const $=j();we(i[0]==="reference"?$[0]:$[$.length-1])}else if(D!=null&&D.preserveTabOrder&&D.portalNode)if(Q.current=!1,He(q,D.portalNode)){const $=si()||b;$==null||$.focus()}else{var W;(W=D.beforeOutsideRef.current)==null||W.focus()}}}),!I&&F("start"),n,F("end"),z&&E.createElement(Rt,{"data-type":"inside",ref:D==null?void 0:D.afterInsideRef,onFocus:q=>{if(a)we(j()[0]);else if(D!=null&&D.preserveTabOrder&&D.portalNode)if(C&&(Q.current=!0),He(q,D.portalNode)){const $=ai()||b;$==null||$.focus()}else{var W;(W=D.afterOutsideRef.current)==null||W.focus()}}}))}const qt=new Set,pi=E.forwardRef(function(t,n){let{lockScroll:o=!1,...i}=t;const r=Nt();return de(()=>{if(!o)return;qt.add(r);const l=/iP(hone|ad|od)|iOS/.test(zo()),s=document.body.style,p=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",C=window.innerWidth-document.documentElement.clientWidth,y=s.left?parseFloat(s.left):window.pageXOffset,g=s.top?parseFloat(s.top):window.pageYOffset;if(s.overflow="hidden",C&&(s[p]=C+"px"),l){var f,x;const v=((f=window.visualViewport)==null?void 0:f.offsetLeft)||0,h=((x=window.visualViewport)==null?void 0:x.offsetTop)||0;Object.assign(s,{position:"fixed",top:-(g-Math.floor(h))+"px",left:-(y-Math.floor(v))+"px",right:"0"})}return()=>{qt.delete(r),qt.size===0&&(Object.assign(s,{overflow:"",[p]:""}),l&&(Object.assign(s,{position:"",top:"",left:"",right:""}),window.scrollTo(y,g)))}},[r,o]),E.createElement("div",Ne({ref:n},i,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}}))});function Gn(e){return oe(e.target)&&e.target.tagName==="BUTTON"}function Xn(e){return Ko(e)}function hi(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:i,elements:{domReference:r}}=e,{enabled:l=!0,event:s="click",toggle:a=!0,ignoreMouse:p=!1,keyboardHandlers:C=!0}=t,y=E.useRef(),g=E.useRef(!1);return E.useMemo(()=>l?{reference:{onPointerDown(f){y.current=f.pointerType},onMouseDown(f){f.button===0&&(On(y.current,!0)&&p||s!=="click"&&(n&&a&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?o(!1,f.nativeEvent,"click"):(f.preventDefault(),o(!0,f.nativeEvent,"click"))))},onClick(f){if(s==="mousedown"&&y.current){y.current=void 0;return}On(y.current,!0)&&p||(n&&a&&(!i.current.openEvent||i.current.openEvent.type==="click")?o(!1,f.nativeEvent,"click"):o(!0,f.nativeEvent,"click"))},onKeyDown(f){y.current=void 0,!(f.defaultPrevented||!C||Gn(f))&&(f.key===" "&&!Xn(r)&&(f.preventDefault(),g.current=!0),f.key==="Enter"&&o(!(n&&a),f.nativeEvent,"click"))},onKeyUp(f){f.defaultPrevented||!C||Gn(f)||Xn(r)||f.key===" "&&g.current&&(g.current=!1,o(!(n&&a),f.nativeEvent,"click"))}}}:{},[l,i,s,p,C,r,a,n,o])}const Ws={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Ks={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Yn=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 mi(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,nodeId:i,elements:{reference:r,domReference:l,floating:s},dataRef:a}=e,{enabled:p=!0,escapeKey:C=!0,outsidePress:y=!0,outsidePressEvent:g="pointerdown",referencePress:f=!1,referencePressEvent:x="pointerdown",ancestorScroll:v=!1,bubbles:h,capture:b}=t,S=bn(),R=Oe(typeof y=="function"?y:()=>!1),I=typeof y=="function"?R:y,A=E.useRef(!1),P=E.useRef(!1),{escapeKey:V,outsidePress:O}=Yn(h),{escapeKey:B,outsidePress:D}=Yn(b),K=Oe(T=>{if(!n||!p||!C||T.key!=="Escape")return;const N=S?Ue(S.nodesRef.current,i):[];if(!V&&(T.stopPropagation(),N.length>0)){let j=!0;if(N.forEach(F=>{var z;if((z=F.context)!=null&&z.open&&!F.context.dataRef.current.__escapeKeyBubbles){j=!1;return}}),!j)return}o(!1,vl(T)?T.nativeEvent:T,"escape-key")}),L=Oe(T=>{var N;const j=()=>{var F;K(T),(F=Ve(T))==null||F.removeEventListener("keydown",j)};(N=Ve(T))==null||N.addEventListener("keydown",j)}),Q=Oe(T=>{const N=A.current;A.current=!1;const j=P.current;if(P.current=!1,g==="click"&&j||N||typeof I=="function"&&!I(T))return;const F=Ve(T),z="["+et("inert")+"]",q=be(s).querySelectorAll(z);let W=Z(F)?F:null;for(;W&&!Fe(W);){const H=Ie(W);if(Fe(H)||!Z(H))break;W=H}if(q.length&&Z(F)&&!Sl(F)&&!le(F,s)&&Array.from(q).every(H=>!le(W,H)))return;if(oe(F)&&s){const H=F.clientWidth>0&&F.scrollWidth>F.clientWidth,G=F.clientHeight>0&&F.scrollHeight>F.clientHeight;let J=G&&T.offsetX>F.clientWidth;if(G&&ae(F).direction==="rtl"&&(J=T.offsetX<=F.offsetWidth-F.clientWidth),J||H&&T.offsetY>F.clientHeight)return}const $=S&&Ue(S.nodesRef.current,i).some(H=>{var G;return Lt(T,(G=H.context)==null?void 0:G.elements.floating)});if(Lt(T,s)||Lt(T,l)||$)return;const _=S?Ue(S.nodesRef.current,i):[];if(_.length>0){let H=!0;if(_.forEach(G=>{var J;if((J=G.context)!=null&&J.open&&!G.context.dataRef.current.__outsidePressBubbles){H=!1;return}}),!H)return}o(!1,T,"outside-press")}),U=Oe(T=>{var N;const j=()=>{var F;Q(T),(F=Ve(T))==null||F.removeEventListener(g,j)};(N=Ve(T))==null||N.addEventListener(g,j)});return E.useEffect(()=>{if(!n||!p)return;a.current.__escapeKeyBubbles=V,a.current.__outsidePressBubbles=O;function T(F){o(!1,F,"ancestor-scroll")}const N=be(s);C&&N.addEventListener("keydown",B?L:K,B),I&&N.addEventListener(g,D?U:Q,D);let j=[];return v&&(Z(l)&&(j=ve(l)),Z(s)&&(j=j.concat(ve(s))),!Z(r)&&r&&r.contextElement&&(j=j.concat(ve(r.contextElement)))),j=j.filter(F=>{var z;return F!==((z=N.defaultView)==null?void 0:z.visualViewport)}),j.forEach(F=>{F.addEventListener("scroll",T,{passive:!0})}),()=>{C&&N.removeEventListener("keydown",B?L:K,B),I&&N.removeEventListener(g,D?U:Q,D),j.forEach(F=>{F.removeEventListener("scroll",T)})}},[a,s,l,r,C,I,g,n,o,v,p,V,O,K,B,L,Q,D,U]),E.useEffect(()=>{A.current=!1},[I,g]),E.useMemo(()=>p?{reference:{onKeyDown:K,[Ws[x]]:T=>{f&&o(!1,T.nativeEvent,"reference-press")}},floating:{onKeyDown:K,onMouseDown(){P.current=!0},onMouseUp(){P.current=!0},[Ks[g]]:()=>{A.current=!0}}}:{},[p,f,g,x,o,K])}let on;process.env.NODE_ENV!=="production"&&(on=new Set);function yi(e){var t;e===void 0&&(e={});const{open:n=!1,onOpenChange:o,nodeId:i}=e;if(process.env.NODE_ENV!=="production"){var r;const O="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((r=e.elements)!=null&&r.reference&&!Z(e.elements.reference)){var l;if(!((l=on)!=null&&l.has(O))){var s;(s=on)==null||s.add(O),console.error(O)}}}const[a,p]=E.useState(null),C=((t=e.elements)==null?void 0:t.reference)||a,y=is(e),g=bn(),f=Vs()!=null,x=Oe((O,B,D)=>{O&&(h.current.openEvent=B),b.emit("openchange",{open:O,event:B,reason:D,nested:f}),o==null||o(O,B,D)}),v=E.useRef(null),h=E.useRef({}),b=E.useState(()=>Rs())[0],S=Nt(),R=E.useCallback(O=>{const B=Z(O)?{getBoundingClientRect:()=>O.getBoundingClientRect(),contextElement:O}:O;y.refs.setReference(B)},[y.refs]),I=E.useCallback(O=>{(Z(O)||O===null)&&(v.current=O,p(O)),(Z(y.refs.reference.current)||y.refs.reference.current===null||O!==null&&!Z(O))&&y.refs.setReference(O)},[y.refs]),A=E.useMemo(()=>({...y.refs,setReference:I,setPositionReference:R,domReference:v}),[y.refs,I,R]),P=E.useMemo(()=>({...y.elements,domReference:C}),[y.elements,C]),V=E.useMemo(()=>({...y,refs:A,elements:P,dataRef:h,nodeId:i,floatingId:S,events:b,open:n,onOpenChange:x}),[y,i,S,b,n,x,A,P]);return de(()=>{const O=g==null?void 0:g.nodesRef.current.find(B=>B.id===i);O&&(O.context=V)}),E.useMemo(()=>({...y,context:V,refs:A,elements:P}),[y,A,P,V])}const Jn="active",Zn="selected";function _t(e,t,n){const o=new Map,i=n==="item";let r=e;if(i&&e){const{[Jn]:l,[Zn]:s,...a}=e;r=a}return{...n==="floating"&&{tabIndex:-1},...r,...t.map(l=>{const s=l?l[n]:null;return typeof s=="function"?e?s(e):null:s}).concat(e).reduce((l,s)=>(s&&Object.entries(s).forEach(a=>{let[p,C]=a;if(!(i&&[Jn,Zn].includes(p)))if(p.indexOf("on")===0){if(o.has(p)||o.set(p,[]),typeof C=="function"){var y;(y=o.get(p))==null||y.push(C),l[p]=function(){for(var g,f=arguments.length,x=new Array(f),v=0;v<f;v++)x[v]=arguments[v];return(g=o.get(p))==null?void 0:g.map(h=>h(...x)).find(h=>h!==void 0)}}}else l[p]=C}),l),{})}}function gi(e){e===void 0&&(e=[]);const t=e,n=E.useCallback(r=>_t(r,e,"reference"),t),o=E.useCallback(r=>_t(r,e,"floating"),t),i=E.useCallback(r=>_t(r,e,"item"),e.map(r=>r==null?void 0:r.item));return E.useMemo(()=>({getReferenceProps:n,getFloatingProps:o,getItemProps:i}),[n,o,i])}function Qs(e={}){const{initialOpen:t=!1,open:n,onOpenChange:o}=e,[i,r]=E.useState(t),l=n??i,s=o??r,a=yi({open:l,onOpenChange:s}),p=a.context,C=hi(p,{enabled:n==null}),y=mi(p,{outsidePressEvent:"mousedown"}),g=gi([C,y]);return E.useMemo(()=>({open:l,setOpen:s,...g,...a}),[l,s,g,a])}const bi=E.createContext(null),xi=()=>{const e=E.useContext(bi);if(e==null)throw new Error("Dialog components must be wrapped in <Dialog />");return e};function qs({children:e,...t}){const n=Qs(t);return d.jsx(bi.Provider,{value:n,children:e})}const Ci=M.css`
|
|
151
151
|
display: flex;
|
|
152
152
|
justify-content: center;
|
|
153
153
|
align-items: center;
|
|
154
154
|
z-index: 100;
|
|
155
155
|
padding: var(--space-md-fixed);
|
|
156
|
-
`,
|
|
157
|
-
${
|
|
158
|
-
`,
|
|
156
|
+
`,_s=M(pi)`
|
|
157
|
+
${Ci};
|
|
158
|
+
`,Us=w.forwardRef((e,t)=>{const{style:n,children:o,components:i,...r}=e,l=xi(),s=gn([l.refs.setFloating,t]),a=(i==null?void 0:i.Overlay)??_s;return d.jsx(ui,{children:d.jsx(a,{lockScroll:!0,children:d.jsx(fi,{context:l.context,children:d.jsx("div",{ref:s,...l.getFloatingProps(r),children:o})})})})}),Hs=Us;function vi(e){const t=w.useContext(Ye),[n,o]=w.useState(t);return d.jsx(Ye.Provider,{value:n,children:e.children})}const Gs=w.forwardRef((e,t)=>{const{setOpen:n}=xi();return d.jsx("button",{type:"button",ref:t,...e,onClick:o=>{var i;(i=e.onClick)==null||i.call(e,o),n(!1)}})}),Xs=Gs,Ys=M.span`
|
|
159
159
|
overflow: hidden;
|
|
160
160
|
white-space: nowrap;
|
|
161
161
|
text-overflow: ellipsis;
|
|
162
|
-
`;function
|
|
162
|
+
`;function Si(e){const{explainQuestion:t}=ce(),{header:n,attributeValue:o}=ze();if(!t)return d.jsx("div",{...e,children:n.subject.generalConflictTitle});const i=k.match(t).returnType().with({subject:u.ExplainQuestionSubject.configuration},()=>n.subject.configurationSubjectTitle).with({subject:u.ExplainQuestionSubject.attribute},l=>nt(l.attributeId)??l.attributeId.localId).with({subject:u.ExplainQuestionSubject.choiceValue},l=>We(l.attributeId).get(l.choiceValueId)??l.choiceValueId).with({subject:u.ExplainQuestionSubject.component,state:u.ComponentDecisionState.Included},()=>o.componentDecisionStateIncludedLabel).with({subject:u.ExplainQuestionSubject.component,state:u.ComponentDecisionState.Excluded},()=>o.componentDecisionStateExcludedLabel).with({subject:u.ExplainQuestionSubject.boolean,state:!0},()=>o.booleanDecisionStateTrueLabel).with({subject:u.ExplainQuestionSubject.boolean,state:!1},()=>o.booleanDecisionStateFalseLabel).with({subject:u.ExplainQuestionSubject.numeric},l=>l.state.toString()).exhaustive(),r=k.match(t).returnType().with({question:u.ExplainQuestionType.whyIsStateNotPossible},()=>n.suffix.isBlockedSuffix).with({question:u.ExplainQuestionType.whyIsNotSatisfied},()=>n.suffix.isNotSatisfiedSuffix).exhaustive();return d.jsxs("div",{...e,style:he(n.suffix),children:[d.jsx(Ys,{style:he(n.subject),children:i})," ",r]})}const Js=M.div`
|
|
163
163
|
position: sticky;
|
|
164
164
|
top: 0;
|
|
165
165
|
transition: all 0.1s;
|
|
@@ -173,7 +173,7 @@ ${f}`);case d.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
173
173
|
@media only screen and (min-resolution: 2dppx) {
|
|
174
174
|
border-top-width: 0.5px;
|
|
175
175
|
}
|
|
176
|
-
`;function
|
|
176
|
+
`;function Zs(e){const[t,n]=w.useState(!1),o=w.useRef(null);return w.useEffect(()=>{const i=new IntersectionObserver(([l])=>n(!l.isIntersecting),{root:null,threshold:1}),r=o.current;return r&&i.observe(r),()=>{r&&i.unobserve(r)}},[]),d.jsxs(d.Fragment,{children:[d.jsx("div",{ref:o}),d.jsx(Js,{...Eo(e,{className:Ir(t&&"active")})})]})}const ea=M(c.motion.div)`
|
|
177
177
|
position: relative;
|
|
178
178
|
outline-offset: -1px;
|
|
179
179
|
display: grid;
|
|
@@ -185,16 +185,16 @@ ${f}`);case d.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
185
185
|
max-height: min(calc(100vh - var(--space-md) * 2), 700px);
|
|
186
186
|
max-width: min(calc(100vw - var(--space-md) * 2), 700px);
|
|
187
187
|
min-width: min(calc(100vw - var(--space-md) * 2), 500px);
|
|
188
|
-
`,
|
|
188
|
+
`,ta=M.div`
|
|
189
189
|
overflow-y: auto;
|
|
190
190
|
grid-area: content;
|
|
191
191
|
padding-left: var(--size-explain-dialog-box-padding-left);
|
|
192
192
|
padding-right: var(--size-explain-dialog-box-padding-right);
|
|
193
193
|
padding-bottom: var(--space-xs-fixed);
|
|
194
|
-
`,
|
|
194
|
+
`,na=M(Zs)`
|
|
195
195
|
margin-left: calc(var(--size-explain-dialog-box-padding-left) * -1);
|
|
196
196
|
margin-right: calc(var(--size-explain-dialog-box-padding-right) * -1);
|
|
197
|
-
`,
|
|
197
|
+
`,oa=M(Xs)`
|
|
198
198
|
position: absolute;
|
|
199
199
|
right: var(--space-sm-fixed);
|
|
200
200
|
top: var(--space-sm-fixed);
|
|
@@ -208,7 +208,7 @@ ${f}`);case d.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
208
208
|
outline: var(--size-button-focus-outline) solid var(--color-button-focus-outline);
|
|
209
209
|
outline-offset: var(--size-button-focus-outline-offset);
|
|
210
210
|
}
|
|
211
|
-
`,
|
|
211
|
+
`,ia=M(Si)`
|
|
212
212
|
grid-area: header;
|
|
213
213
|
margin-bottom: var(--space-xs);
|
|
214
214
|
overflow: hidden;
|
|
@@ -218,7 +218,7 @@ ${f}`);case d.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
218
218
|
margin-right: var(--space-md);
|
|
219
219
|
padding-left: var(--size-explain-dialog-box-padding-left);
|
|
220
220
|
padding-right: var(--size-explain-dialog-box-padding-right);
|
|
221
|
-
`,
|
|
221
|
+
`,ra={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 la(e){const{dialogBox:t,closeButton:n}=Ot(),o={...t,padding:0,isMixedPadding:!1};return d.jsxs(ea,{style:$e(o),variants:ra,initial:"initial",animate:"open",exit:"close",children:[d.jsx(ia,{}),d.jsxs(ta,{children:[d.jsx(na,{}),e.children]}),d.jsx(oa,{style:jt(n),children:d.jsx(bt.FontAwesomeIcon,{icon:gt.faXmark})})]})}const sa=M(Hs)`
|
|
222
222
|
--size-explain-dialog-box-padding-top: ${e=>e.dialogBox.isMixedPadding?e.dialogBox.paddingTop:e.dialogBox.padding}px;
|
|
223
223
|
--size-explain-dialog-box-padding-right: ${e=>e.dialogBox.isMixedPadding?e.dialogBox.paddingRight:e.dialogBox.padding}px;
|
|
224
224
|
--size-explain-dialog-box-padding-bottom: ${e=>e.dialogBox.isMixedPadding?e.dialogBox.paddingBottom:e.dialogBox.padding}px;
|
|
@@ -230,12 +230,12 @@ ${f}`);case d.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
230
230
|
&:focus {
|
|
231
231
|
outline: none;
|
|
232
232
|
}
|
|
233
|
-
`;function
|
|
234
|
-
${
|
|
235
|
-
`;function
|
|
236
|
-
`+i.toString()),
|
|
237
|
-
- `})),
|
|
238
|
-
`+r.toString()))),h.E.map(n),h.E.mapLeft(i=>c.jsx(To,{type:"warning",title:e+" definition is invalid and was ignored",message:i}))))),[o])}const Ei=J.z.object({attributeId:Et,name:J.z.array(J.z.object({localeCode:J.z.string(),translation:J.z.string()}))}),La=Ei.extend({choiceValueId:J.z.string()}),Ba=J.z.object({attributes:Ei.array().optional().nullish(),choiceValues:La.array().optional().nullish()});function Jn(e){return{...it(e.attributeId),name:h.pipe(e.name,h.RA.map(t=>t),h.RA.toArray)}}function $a(e){const t=h.pipe(e.attributes??[],h.RA.map(Jn),h.RA.toArray),n=h.pipe(e.choiceValues??[],h.RA.map(o=>({...Jn(o),choiceValueId:o.choiceValueId})),h.RA.toArray);return{attributes:t,choiceValues:n}}const za=Cn("Localization",Ba,$a),Wa=za,Zn=J.z.object({regex:J.z.string(),direction:J.z.enum(["asc","desc"]),mode:J.z.enum(["isMatch","string","numeric"]),description:J.z.string().optional()}),Ka=J.z.object({defaultRules:Zn.array().optional().nullish(),attributes:J.z.object({attributeId:Et,choiceValues:J.z.string().array(),rules:Zn.array()}).array().optional().nullish()});function qa(e){const t=h.pipe(e.defaultRules??[],h.RA.map(o=>o),h.RA.toArray);return{attributes:h.pipe(e.attributes??[],h.RA.map(o=>({...it(o.attributeId),choiceValues:h.RA.toArray(o.choiceValues),rules:h.pipe(o.rules,h.RA.map(i=>i),h.RA.toArray)})),h.RA.toArray),defaultRules:t}}const _a=Cn("ChoiceValueSorting",Ka,qa),Ha=_a,Qa=J.z.object({attributeId:Et,decisions:Et.array()}),Ua=Qa.array(),Ga=Cn("AttributeRelations",Ua,e=>e),Ya=Ga,Xa={wizardAttributeRelations:{title:"Wizard Attribute Relations",type:u.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{wizardSteps:{title:"Wizard Steps",type:u.ControlType.Array,control:{type:u.ControlType.Object,controls:{name:{title:"Name",type:u.ControlType.String},attributes:{title:"Attributes",type:u.ControlType.Array,control:{type:u.ControlType.Object,controls:re}}}}}}}},Ai=S.createContext(null),Ja=ee(e=>{const{children:t,...n}=e;return c.jsx(Ai.Provider,{value:n,children:t})}),Za=Ja,Ii=ee(e=>{var b,w,g,y;const t=S.useContext(Ai),n=Object.assign({},e,t),{activeLocale:o}=u.useLocaleInfo(),i=o.code;if(S.useEffect(()=>{console.info("[Configuration] Current locale code:",i)},[i]),Q())return c.jsxs(c.Fragment,{children:[n.children,c.jsx(Re,{singletonId:"Configuration",children:c.jsx(Tn,{})})]});const l=Ya((b=n.attributeRelations)==null?void 0:b.jsonDefinition),s=S.useMemo(()=>h.pipe(l,h.O.fromEither,h.O.toNullable),[l]),a=Ha((w=n.choiceValueSorting)==null?void 0:w.jsonDefinition),f=S.useMemo(()=>h.pipe(a,h.E.orElse(()=>h.pipe(n.choiceValueSorting,h.E.fromNullable(null))),h.E.getOrElse(()=>({attributes:[],defaultRules:[]}))),[a,n.choiceValueSorting]),x=Wa((g=n.localization)==null?void 0:g.jsonDefinition),m=S.useMemo(()=>h.pipe(x,h.E.getOrElse(()=>({attributes:[],choiceValues:[]}))),[x]),C=h.pipe((y=n.wizardAttributeRelations)==null?void 0:y.wizardSteps,h.O.fromNullable,h.O.filter(h.RA.isNonEmpty),h.O.map(h.RA.map(v=>({attributes:h.pipe(v.attributes,h.RA.map(Z))}))),h.O.toNullable),p=S.useMemo(()=>({apiBaseUrl:vr(n.hcaBaseUrl,"api","engine"),sessionInitialisationOptions:O.match(n.sessionCreation).with("client-side",()=>({accessToken:n.accessToken})).with("server-side",()=>({sessionCreateUrl:n.sessionCreateUrl})).exhaustive(),configurationModelSource:{type:d.ConfigurationModelSourceType.Channel,channel:n.channel,deploymentName:n.deploymentName},attributeRelations:s,wizardAttributeRelations:C,allowedInExplain:{rules:{type:d.AllowedRulesInExplainType.all}}}),[n.hcaBaseUrl,n.sessionCreation,n.accessToken,n.sessionCreateUrl,n.sessionDeleteUrl,n.channel,n.deploymentName,s]);return c.jsxs(c.Fragment,{children:[c.jsxs(U.Configuration,{sessionContext:p,children:[h.pipe(x,h.E.swap,h.O.fromEither,h.O.toNullable),h.pipe(a,h.E.swap,h.O.fromEither,h.O.toNullable),h.pipe(l,h.E.swap,h.O.fromEither,h.O.toNullable),c.jsx(Nr,{...n}),c.jsx(S.Suspense,{children:c.jsx(Rt.Provider,{value:m,children:c.jsxs(aa,{explainConstraints:n.explainConstraints,children:[c.jsx(on.Provider,{value:{...n.explainPopoverProps,customPopover:n.customExplainPopover},children:c.jsx(Ti.Provider,{value:f,children:n.children})}),c.jsx(ia,{...n.explainDialogProps})]})})})]}),c.jsx(Re,{singletonId:"Configuration",children:c.jsx(Tn,{})})]})}),ec=Ii;u.addPropertyControls(Ii,{children:{title:"Content",type:u.ControlType.ComponentInstance},channel:{type:u.ControlType.String,title:"Channel",defaultValue:"release"},deploymentName:{type:u.ControlType.String,title:"Deployment Name"},hcaBaseUrl:{title:"HCA Base URL",type:u.ControlType.String,defaultValue:"https://spc.viamedici.io/hca"},sessionCreation:{title:"Session Creation",type:u.ControlType.Enum,displaySegmentedControl:!0,segmentedControlDirection:"horizontal",defaultValue:"client-side",options:["client-side","server-side"]},accessToken:{title:"HCA Access Token",type:u.ControlType.String,obscured:!0,hidden:e=>e.sessionCreation!=="client-side"},sessionCreateUrl:{title:"Create Session URl",type:u.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},sessionDeleteUrl:{title:"Close Session URl",type:u.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},configurationModelNotFoundContent:{title:"Content – Configuration Model not found",type:u.ControlType.ComponentInstance},errorContent:{title:"Content – Error",type:u.ControlType.ComponentInstance},accessTokenInvalidContent:{title:"Content – HCA Access Token invalid",type:u.ControlType.ComponentInstance},accessTokenRestrictionContent:{title:"Content – HCA Access Token restriction",type:u.ControlType.ComponentInstance},explainDialogProps:{title:"Explain Dialog",type:u.ControlType.Object,optional:!1,controls:Qr,buttonTitle:"Props…"},explainPopoverProps:{title:"Explain Popover",type:u.ControlType.Object,optional:!1,controls:_r,buttonTitle:"Props…"},customExplainPopover:{title:"Custom Explain Popover",type:u.ControlType.ComponentInstance},explainConstraints:{title:"Explain Constraints",type:u.ControlType.Boolean,defaultValue:!1},attributeRelations:{title:"Attribute Relations",type:u.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:u.ControlType.String,displayTextArea:!0}}},...Xa,...ha,...ja});const Ke={explain:{title:"Explain",type:u.ControlType.Enum,defaultValue:"popover",options:["popover","dialog","disabled"]}},tn={type:u.ControlType.Object,optional:!0,controls:{fill:{title:"Fill",type:u.ControlType.Color,optional:!0},color:{title:"Color",type:u.ControlType.Color,optional:!0},borderColor:{title:"Border Color",type:u.ControlType.Color,optional:!0}}},Pi={...re,...pe({color:"black",text:{fontSize:16,textAlign:"left"}}),...Ye({fill:"#EBEBEB",radius:6}),implicitLabelPrefix:{title:"Implicit Label Prefix",type:u.ControlType.String,defaultValue:"Implicit: "},unsatisfiedColors:{...tn,title:"Unsatisfied Colors"},implicitSelectedColors:{...tn,title:"Implicit Selected Colors"},...Ke},nn=(e,t,n)=>{var r,l,s,a,f,x;const o=$e(e),i=he(e);return{...o,...i,backgroundColor:O.match({isSatisfied:t,isImplicitSelected:n,unsatisfiedFill:(r=e.unsatisfiedColors)==null?void 0:r.fill,implicitSelectedFill:(l=e.implicitSelectedColors)==null?void 0:l.fill}).with({isSatisfied:!1,unsatisfiedFill:O.P.string.minLength(1)},m=>m.unsatisfiedFill).with({isImplicitSelected:!0,implicitSelectedFill:O.P.string.minLength(1)},m=>m.implicitSelectedFill).otherwise(()=>o.backgroundColor),borderColor:O.match({isSatisfied:t,isImplicitSelected:n,unsatisfiedBorderColor:(s=e.unsatisfiedColors)==null?void 0:s.borderColor,implicitSelectedBorderColor:(a=e.implicitSelectedColors)==null?void 0:a.borderColor}).with({isSatisfied:!1,unsatisfiedBorderColor:O.P.string.minLength(1)},m=>m.unsatisfiedBorderColor).with({isImplicitSelected:!0,implicitSelectedBorderColor:O.P.string.minLength(1)},m=>m.implicitSelectedBorderColor).otherwise(()=>o.borderColor),color:O.match({isSatisfied:t,isImplicitSelected:n,unsatisfiedColor:(f=e.unsatisfiedColors)==null?void 0:f.color,implicitSelectedColor:(x=e.implicitSelectedColors)==null?void 0:x.color}).with({isSatisfied:!1,unsatisfiedColor:O.P.string.minLength(1)},m=>m.unsatisfiedColor).with({isImplicitSelected:!0,implicitSelectedColor:O.P.string.minLength(1)},m=>m.implicitSelectedColor).otherwise(()=>i.color),...e.style}},vn={...Pi,resetLabel:{title:"Reset Label",type:u.ControlType.String,defaultValue:"Reset"},blockedLabel:{title:"Blocked Label",type:u.ControlType.String,defaultValue:"Blocked"},appearance:{title:"Appearance",type:u.ControlType.Enum,defaultValue:"auto",displaySegmentedControl:!0,segmentedControlDirection:"horizontal",options:["auto","none"]}},Be=(e,t,n)=>({...nn(e,t,n),appearance:e.appearance});function ge(){const{explain:e,handleExplainAnswer:t}=S.useContext(Ge);return{explain:e,handleExplainAnswer:t}}function tc(e={}){const{initialOpen:t=!1,placement:n="top",modal:o=!1,open:i,onOpenChange:r,arrow:l}=e,[s,a]=S.useState(t),f=i??s,x=r??a,m=pi({placement:n,open:f,onOpenChange:x,whileElementsMounted:Gl,middleware:[Dl(((l==null?void 0:l.height)??0)+5),Xl({crossAxis:n.includes("-"),fallbackAxisSideDirection:"end",padding:5}),Yl({padding:5}),...l?[Zl(l)]:[]]}),C=m.context,p=di(C,{enabled:i==null}),b=fi(C),w=hi([p,b]);return S.useMemo(()=>({open:f,setOpen:x,...w,...m,modal:o,arrow:l}),[f,x,w,m,o,l])}const Ri=S.createContext(null),rt=()=>{const e=S.useContext(Ri);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e};function nc({children:e,...t}){const n=tc(t);return c.jsx(Ri.Provider,{value:n,children:e})}const oc=S.forwardRef(function(t,n){const o=S.Children.toArray(t.children)[0],i=rt(),r=t.children.ref,l=mn([i.refs.setReference,n,r]);return S.isValidElement(o)?S.cloneElement(o,i.getReferenceProps({ref:l,...t,...o.props,"data-state":i.open?"open":"closed"})):c.jsx("span",{children:"Not valid children for PopoverTrigger"})}),ic=oc,rc=V.button`
|
|
233
|
+
`;function aa(e){const t=ce(),n=(t==null?void 0:t.displayMode)==="dialog";return d.jsx(qs,{open:n,onOpenChange:o=>!o&&n&&(t==null?void 0:t.dismiss()),children:d.jsx(ca,{...e,isOpen:n,children:w.Children.toArray(e.content)[0]??d.jsx(la,{children:d.jsx(ml,{})})})})}function ca(e){return d.jsx(c.AnimatePresence,{initial:!1,children:e.isOpen&&d.jsx(sn.Provider,{value:e,children:d.jsx(sa,{...e,components:{Overlay:da},children:d.jsx(vi,{children:e.children})})})})}const ua=M(c.motion(pi))`
|
|
234
|
+
${Ci}
|
|
235
|
+
`;function da(e){return d.jsx(ua,{...e,initial:{backgroundColor:"rgba(0,0,0,0)"},animate:{backgroundColor:"rgba(0,0,0,0.1)"},exit:{backgroundColor:"rgba(0,0,0,0)"}})}function fa(e){const[t,n]=w.useState(null),{explain:o,applySolution:i}=Y.useExplain(),r=w.useRef(null),l=w.useCallback(async(f,x,v,h)=>{const b=Ar.guid();r.current=b,n(null);try{const S=await f(),R=S,I=S,A=(R==null?void 0:R.decisionExplanations)??[],P=(I==null?void 0:I.constraintExplanations)??[];b==r.current&&n({controlId:h,displayMode:A.length===0&&P.length>0?"dialog":v,explainQuestion:x,hasError:!1,decisionExplanations:pa(A),constraintExplanations:P})}catch{b==r.current&&n({controlId:h,displayMode:v,explainQuestion:x,hasError:!0,decisionExplanations:null,constraintExplanations:null})}},[]),s=w.useCallback((f,x,v)=>{const h=typeof f=="function"?f(u.explainQuestionBuilder):f;return l(()=>e.explainConstraints?o(h,"full"):o(h,"decisions"),h,x,v)},[e.explainConstraints,o,l]),a=w.useCallback((f,x,v)=>l(()=>Promise.resolve(f),null,x,v),[l]),p=w.useCallback(()=>{n(null)},[]),C=w.useCallback(f=>(p(),i(f)),[i,p]),y=w.useCallback(f=>{n(x=>x!=null?{...x,displayMode:f}:x)},[]),g=w.useMemo(()=>({process:t,applySolution:C,explain:s,handleExplainAnswer:a,dismiss:p,switchMode:y}),[t,C,s,a,p,y]);return d.jsx(Ye.Provider,{value:g,children:e.children})}function pa(e){const t=m.pipe(m.Bool.Ord,m.Ord.contramap(o=>o.solution==null)),n=m.pipe(m.Num.Ord,m.Ord.contramap(o=>o.causedByDecisions.length));return m.pipe(e,m.RA.sortBy([t,n]))}const Be=new Map;function Re(e){const{singletonId:t,children:n}=e,[o,i]=w.useState(!1),r=w.useRef({chose:()=>i(!0)});return w.useEffect(()=>(ha(t,r.current),()=>ma(t,r.current)),[]),o?d.jsx(d.Fragment,{children:n}):null}function ha(e,t){ga(e).candidates.add(t),wi(e)}function ma(e,t){let n=Be.get(e);n!=null&&(n.candidates.delete(t),n.chosen===t&&(n.chosen=null),ya(e),wi(e))}function wi(e){let t=Be.get(e);if(t==null||t.chosen!=null)return;const n=t.candidates.values().next().value;n!=null&&(t.chosen=n,n.chose())}function ya(e){let t=Be.get(e);t==null||t.candidates.size>0||Be.delete(e)}function ga(e){let t=Be.get(e);return t==null&&(t={chosen:null,candidates:new Set},Be.set(e,t)),t}const re={attributeId:{title:"Attribute Id",type:c.ControlType.String},componentPath:{title:"Component Path",type:c.ControlType.String},sharedConfigurationModel:{title:"Shared Configuration Model",type:c.ControlType.String}},eo={description:{title:"Description",type:c.ControlType.String},regex:{title:"Regex",type:c.ControlType.String},direction:{title:"Direction",type:c.ControlType.Enum,defaultValue:"asc",options:["asc","desc"],displaySegmentedControl:!0},mode:{title:"Mode",type:c.ControlType.Enum,defaultValue:"isMatch",options:["isMatch","string","numeric"]}},ba={choiceValueSorting:{title:"Choice Value Sorting",type:c.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{defaultRules:{title:"Default Rules",type:c.ControlType.Array,control:{type:c.ControlType.Object,controls:eo}},attributes:{title:"Attribute",type:c.ControlType.Array,control:{type:c.ControlType.Object,controls:{...re,choiceValues:{title:"Choice Values",type:c.ControlType.Array,control:{type:c.ControlType.String}},rules:{title:"Rules",type:c.ControlType.Array,control:{type:c.ControlType.Object,controls:eo}}}}},jsonDefinition:{title:"Definition – JSON",type:c.ControlType.String,displayTextArea:!0}}}};function xa(e,t){const n=[],o=(r,l)=>{const s=n.find(p=>e.equals(p.first,r)&&e.equals(p.second,l));if(s)return s.ordering;const a=t.compare(r,l);return n.push({first:r,second:l,ordering:a}),a},i=m.Ord.fromCompare(o);return{cachedOrderings:n,...i}}function Ca(){const e=[];return{getCache:(t,n)=>{const o=e.find(r=>r.eq===t&&r.ord===n);if(o)return o.ordCache;const i=xa(t,n);return e.push({eq:t,ord:n,ordCache:i}),i}}}const Ti=m.Ord.getMonoid(),va=new Intl.Collator("en",{sensitivity:"base"}),Sa=new Intl.Collator("en",{sensitivity:"variant"}),wa={regex:".*",direction:"asc",mode:"string"},Ta=m.pipe([va,Sa],m.RA.map(Va),m.MO.concatAll(m.Ord.getMonoid())),Ea=m.pipe(m.Bool.Ord,m.Ord.contramap(e=>m.O.isSome(e))),Ia=m.Num.Ord;function Aa(e,t){return m.pipe((t==null?void 0:t.attributes)??[],m.RA.findFirst(n=>u.globalAttributeIdEq.equals(te(n),e)),m.O.map(n=>[Pa(n.choiceValues??[]),to(n.rules??[])]),m.O.getOrElse(()=>[to((t==null?void 0:t.defaultRules)??[])]),m.RA.append(Ei(wa)),m.MO.concatAll(Ti))}function Pa(e){return m.pipe(m.Num.Ord,m.Ord.reverse,m.O.getOrd,m.Ord.reverse,m.Ord.contramap(t=>m.pipe(e,m.RA.findIndex(n=>m.Str.Eq.equals(t,n)))))}function to(e){return m.pipe(e,m.RA.map(Ei),m.MO.concatAll(Ti))}function Ei(e){const t=m.O.tryCatch(()=>new RegExp(e.regex)),n=k.match(e.mode).returnType().with("string",()=>Ra(e.direction)).with("numeric",()=>Da(e.direction)).with("isMatch",()=>ja(e.direction)).exhaustive();return m.pipe(n,m.Ord.contramap(o=>m.pipe(t,m.O.chainNullableK(i=>(i.lastIndex=0,i[Symbol.match](o))),m.O.chain(i=>m.pipe(i,m.RA.lookup(1),m.O.alt(()=>m.pipe(i,m.RA.lookup(0))))))))}function Ra(e){return m.pipe(Ta,vn(e),Ii)}function Da(e){return m.pipe(Ia,vn(e),Ii,m.Ord.contramap(m.O.chain(m.Num.parseFloatO)))}function ja(e){return m.pipe(Ea,vn(e))}function Ii(e){return m.pipe(e,m.Ord.reverse,m.O.getOrd,m.Ord.reverse)}function vn(e){return t=>k.match(e).returnType().with("asc",()=>t).with("desc",()=>m.Ord.reverse(t)).exhaustive()}function Va(e){return m.Ord.fromCompare((t,n)=>k.match(e.compare(t,n)).returnType().with(k.P.number.gt(0),()=>1).with(k.P.number.lt(0),()=>-1).otherwise(()=>0))}const Oa=Ca(),Ai=w.createContext(null);function Ge(e,t){const n=w.useContext(Ai),o=w.useMemo(()=>m.pipe(Aa(e,n),r=>Oa.getCache(m.Str.Eq,r),m.Ord.contramap(r=>r.id)),[]),{attribute:i}=Y.useChoiceAttribute(e);return m.pipe(t??(i==null?void 0:i.values)??[],m.RA.sort(o))}const ka={localization:{title:"Localization",type:c.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:c.ControlType.String,displayTextArea:!0}}}};globalThis&&globalThis.__spreadArray;function Fa(e){return e}globalThis&&globalThis.__spreadArray;var Ma=function(e){return{_tag:"Left",left:e}},Na=function(e){return{_tag:"Right",right:e}},Ba=Ma,La=Na,$a=function(e,t){try{return La(e())}catch(n){return Ba(t(n))}},za=function(e){return $a(function(){return JSON.parse(e)},Fa)};const Dt=ee.z.object({localId:ee.z.string(),componentPath:ee.z.string().array().optional().nullish(),sharedConfigurationModelId:ee.z.string().optional().nullish()});function lt(e){var t;return{sharedConfigurationModel:e.sharedConfigurationModelId??"",componentPath:((t=e.componentPath)==null?void 0:t.join(" -> "))??"",attributeId:e.localId}}function Sn(e,t,n){return o=>w.useMemo(()=>m.pipe(o,m.O.fromNullable,m.O.filter(m.P.not(m.Str.isEmpty)),m.E.fromOption(()=>null),m.E.chain(m.flow(za,m.E.mapLeft(i=>`The JSON content could not be parsed. Please check for syntax errors.
|
|
236
|
+
`+i.toString()),m.E.chain(i=>m.pipe(t.safeParse(i),r=>r.success?m.E.right(r.data):m.E.left(r.error),m.E.mapLeft(r=>Pr.fromError(r,{maxIssuesInMessage:5,issueSeparator:`
|
|
237
|
+
- `})),m.E.mapLeft(r=>`The JSON schema is invalid. Ensure all required fields and types are correctly defined.
|
|
238
|
+
`+r.toString()))),m.E.map(n),m.E.mapLeft(i=>d.jsx(Ao,{type:"warning",title:e+" definition is invalid and was ignored",message:i}))))),[o])}const Pi=ee.z.object({attributeId:Dt,name:ee.z.array(ee.z.object({localeCode:ee.z.string(),translation:ee.z.string()}))}),Wa=Pi.extend({choiceValueId:ee.z.string()}),Ka=ee.z.object({attributes:Pi.array().optional().nullish(),choiceValues:Wa.array().optional().nullish()});function no(e){return{...lt(e.attributeId),name:m.pipe(e.name,m.RA.map(t=>t),m.RA.toArray)}}function Qa(e){const t=m.pipe(e.attributes??[],m.RA.map(no),m.RA.toArray),n=m.pipe(e.choiceValues??[],m.RA.map(o=>({...no(o),choiceValueId:o.choiceValueId})),m.RA.toArray);return{attributes:t,choiceValues:n}}const qa=Sn("Localization",Ka,Qa),_a=qa,oo=ee.z.object({regex:ee.z.string(),direction:ee.z.enum(["asc","desc"]),mode:ee.z.enum(["isMatch","string","numeric"]),description:ee.z.string().optional()}),Ua=ee.z.object({defaultRules:oo.array().optional().nullish(),attributes:ee.z.object({attributeId:Dt,choiceValues:ee.z.string().array(),rules:oo.array()}).array().optional().nullish()});function Ha(e){const t=m.pipe(e.defaultRules??[],m.RA.map(o=>o),m.RA.toArray);return{attributes:m.pipe(e.attributes??[],m.RA.map(o=>({...lt(o.attributeId),choiceValues:m.RA.toArray(o.choiceValues),rules:m.pipe(o.rules,m.RA.map(i=>i),m.RA.toArray)})),m.RA.toArray),defaultRules:t}}const Ga=Sn("ChoiceValueSorting",Ua,Ha),Xa=Ga,Ya=ee.z.object({attributeId:Dt,decisions:Dt.array()}),Ja=Ya.array(),Za=Sn("AttributeRelations",Ja,e=>e),ec=Za,tc={wizardAttributeRelations:{title:"Wizard Attribute Relations",type:c.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{wizardSteps:{title:"Wizard Steps",type:c.ControlType.Array,control:{type:c.ControlType.Object,controls:{name:{title:"Name",type:c.ControlType.String},attributes:{title:"Attributes",type:c.ControlType.Array,control:{type:c.ControlType.Object,controls:re}}}}}}}},Ri=w.createContext(null),nc=ne(e=>{const{children:t,...n}=e;return d.jsx(Ri.Provider,{value:n,children:t})}),oc=nc,Di=ne(e=>{var x,v,h,b;const t=w.useContext(Ri),n=Object.assign({},e,t),{activeLocale:o}=c.useLocaleInfo(),i=o.code;if(w.useEffect(()=>{console.info("[Configuration] Current locale code:",i)},[i]),X())return d.jsxs(M.StyleSheetManager,{stylisPlugins:[An],children:[n.children,d.jsx(Re,{singletonId:"Configuration",children:d.jsx(Pn,{})})]});const l=ec((x=n.attributeRelations)==null?void 0:x.jsonDefinition),s=w.useMemo(()=>m.pipe(l,m.O.fromEither,m.O.toNullable),[l]),a=Xa((v=n.choiceValueSorting)==null?void 0:v.jsonDefinition),p=w.useMemo(()=>m.pipe(a,m.E.orElse(()=>m.pipe(n.choiceValueSorting,m.E.fromNullable(null))),m.E.getOrElse(()=>({attributes:[],defaultRules:[]}))),[a,n.choiceValueSorting]),C=_a((h=n.localization)==null?void 0:h.jsonDefinition),y=w.useMemo(()=>m.pipe(C,m.E.getOrElse(()=>({attributes:[],choiceValues:[]}))),[C]),g=m.pipe((b=n.wizardAttributeRelations)==null?void 0:b.wizardSteps,m.O.fromNullable,m.O.filter(m.RA.isNonEmpty),m.O.map(m.RA.map(S=>({attributes:m.pipe(S.attributes,m.RA.map(te))}))),m.O.toNullable),f=w.useMemo(()=>({apiBaseUrl:Tr(n.hcaBaseUrl,"api","engine"),sessionInitialisationOptions:k.match(n.sessionCreation).with("client-side",()=>({accessToken:n.accessToken})).with("server-side",()=>({sessionCreateUrl:n.sessionCreateUrl})).exhaustive(),configurationModelSource:{type:u.ConfigurationModelSourceType.Channel,channel:n.channel,deploymentName:n.deploymentName},attributeRelations:s,wizardAttributeRelations:g,allowedInExplain:{rules:{type:u.AllowedRulesInExplainType.all}},disableConfigurationModelTrimming:!n.trimming}),[n.hcaBaseUrl,n.sessionCreation,n.accessToken,n.sessionCreateUrl,n.sessionDeleteUrl,n.channel,n.deploymentName,s,n.trimming]);return d.jsxs(M.StyleSheetManager,{stylisPlugins:[An],children:[d.jsxs(Y.Configuration,{sessionContext:f,children:[m.pipe(C,m.E.swap,m.O.fromEither,m.O.toNullable),m.pipe(a,m.E.swap,m.O.fromEither,m.O.toNullable),m.pipe(l,m.E.swap,m.O.fromEither,m.O.toNullable),d.jsx(zr,{...n}),d.jsx(w.Suspense,{children:d.jsx(kt.Provider,{value:y,children:d.jsxs(fa,{explainConstraints:n.explainConstraints,children:[d.jsx(ln.Provider,{value:{...n.explainPopoverProps,customPopover:n.customExplainPopover},children:d.jsx(Ai.Provider,{value:p,children:n.children})}),d.jsx(aa,{...n.explainDialogProps})]})})})]}),d.jsx(Re,{singletonId:"Configuration",children:d.jsx(Pn,{})})]})}),ic=Di;c.addPropertyControls(Di,{children:{title:"Content",type:c.ControlType.ComponentInstance},channel:{type:c.ControlType.String,title:"Channel",defaultValue:"release"},deploymentName:{type:c.ControlType.String,title:"Deployment Name"},hcaBaseUrl:{title:"HCA Base URL",type:c.ControlType.String,defaultValue:"https://spc.viamedici.io/hca"},sessionCreation:{title:"Session Creation",type:c.ControlType.Enum,displaySegmentedControl:!0,segmentedControlDirection:"horizontal",defaultValue:"client-side",options:["client-side","server-side"]},accessToken:{title:"HCA Access Token",type:c.ControlType.String,obscured:!0,hidden:e=>e.sessionCreation!=="client-side"},sessionCreateUrl:{title:"Create Session URl",type:c.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},sessionDeleteUrl:{title:"Close Session URl",type:c.ControlType.String,hidden:e=>e.sessionCreation!=="server-side"},configurationModelNotFoundContent:{title:"Content – Configuration Model not found",type:c.ControlType.ComponentInstance},errorContent:{title:"Content – Error",type:c.ControlType.ComponentInstance},accessTokenInvalidContent:{title:"Content – HCA Access Token invalid",type:c.ControlType.ComponentInstance},accessTokenRestrictionContent:{title:"Content – HCA Access Token restriction",type:c.ControlType.ComponentInstance},explainDialogProps:{title:"Explain Dialog",type:c.ControlType.Object,optional:!1,controls:Yr,buttonTitle:"Props…"},explainPopoverProps:{title:"Explain Popover",type:c.ControlType.Object,optional:!1,controls:Gr,buttonTitle:"Props…"},customExplainPopover:{title:"Custom Explain Popover",type:c.ControlType.ComponentInstance},explainConstraints:{title:"Explain Constraints",type:c.ControlType.Boolean,defaultValue:!1},trimming:{title:"Trimming",type:c.ControlType.Boolean,defaultValue:!0},attributeRelations:{title:"Attribute Relations",type:c.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:c.ControlType.String,displayTextArea:!0}}},...tc,...ba,...ka});const Ke={explain:{title:"Explain",type:c.ControlType.Enum,defaultValue:"popover",options:["popover","dialog","disabled"]}},Xe={type:c.ControlType.Object,optional:!0,controls:{fill:{title:"Fill",type:c.ControlType.Color,optional:!0},color:{title:"Color",type:c.ControlType.Color,optional:!0},borderColor:{title:"Border Color",type:c.ControlType.Color,optional:!0}}},ji={...re,...pe({color:"black",text:{fontSize:16,textAlign:"left"}}),...Je({fill:"#EBEBEB",radius:6}),implicitLabelPrefix:{title:"Implicit Label Prefix",type:c.ControlType.String,defaultValue:"Implicit: "},fixedLabelPrefix:{title:"Fixed Label Prefix",type:c.ControlType.String,defaultValue:"Fixed: "},unsatisfiedColors:{...Xe,title:"Unsatisfied Colors"},implicitSelectedColors:{...Xe,title:"Implicit Selected Colors"},fixedColors:{...Xe,title:"Fixed Colors"},...Ke},rn=(e,t,n,o=!1)=>{var l,s,a,p,C,y,g,f,x;const i=$e(e),r=he(e);return{...i,...r,backgroundColor:k.match({isSatisfied:t,isImplicitSelected:n,isFixedSelected:o,unsatisfiedFill:(l=e.unsatisfiedColors)==null?void 0:l.fill,implicitSelectedFill:(s=e.implicitSelectedColors)==null?void 0:s.fill,fixedFill:(a=e.fixedColors)==null?void 0:a.fill}).with({isSatisfied:!1,unsatisfiedFill:k.P.string.minLength(1)},v=>v.unsatisfiedFill).with({isImplicitSelected:!0,implicitSelectedFill:k.P.string.minLength(1)},v=>v.implicitSelectedFill).with({isFixedSelected:!0,fixedFill:k.P.string.minLength(1)},v=>v.fixedFill).otherwise(()=>i.backgroundColor),borderColor:k.match({isSatisfied:t,isImplicitSelected:n,isFixedSelected:o,unsatisfiedBorderColor:(p=e.unsatisfiedColors)==null?void 0:p.borderColor,implicitSelectedBorderColor:(C=e.implicitSelectedColors)==null?void 0:C.borderColor,fixedBorderColor:(y=e.fixedColors)==null?void 0:y.borderColor}).with({isSatisfied:!1,unsatisfiedBorderColor:k.P.string.minLength(1)},v=>v.unsatisfiedBorderColor).with({isImplicitSelected:!0,implicitSelectedBorderColor:k.P.string.minLength(1)},v=>v.implicitSelectedBorderColor).with({isFixedSelected:!0,fixedBorderColor:k.P.string.minLength(1)},v=>v.fixedBorderColor).otherwise(()=>i.borderColor),color:k.match({isSatisfied:t,isImplicitSelected:n,isFixedSelected:o,unsatisfiedColor:(g=e.unsatisfiedColors)==null?void 0:g.color,implicitSelectedColor:(f=e.implicitSelectedColors)==null?void 0:f.color,fixedColor:(x=e.fixedColors)==null?void 0:x.color}).with({isSatisfied:!1,unsatisfiedColor:k.P.string.minLength(1)},v=>v.unsatisfiedColor).with({isImplicitSelected:!0,implicitSelectedColor:k.P.string.minLength(1)},v=>v.implicitSelectedColor).with({isFixedSelected:!0,fixedColor:k.P.string.minLength(1)},v=>v.fixedColor).otherwise(()=>r.color),...e.style}},wn={...ji,resetLabel:{title:"Reset Label",type:c.ControlType.String,defaultValue:"Reset"},blockedLabel:{title:"Blocked Label",type:c.ControlType.String,defaultValue:"Blocked"},unavailableLabel:{title:"Unavailable Label",type:c.ControlType.String,defaultValue:"Unavailable"},excludeUnavailableOptions:{title:"Exclude Unavailable Options",type:c.ControlType.Boolean,defaultValue:!0},allOptionsBlockedColors:{...Xe,title:"All Options Blocked Colors"},noOptionsAvailableColors:{...Xe,title:"No Options Available Colors"},appearance:{title:"Appearance",type:c.ControlType.Enum,defaultValue:"auto",displaySegmentedControl:!0,segmentedControlDirection:"horizontal",options:["auto","none"]}},Le=(e,t,n,o=!1,i=!1,r=!1)=>{var s,a,p,C,y,g;const l={...rn(e,t,n,o),appearance:e.appearance};return{...l,backgroundColor:k.match({allOptionsBlocked:i,noOptionsAvailable:r,allOptionsBlockedFill:(s=e.allOptionsBlockedColors)==null?void 0:s.fill,noOptionsAvailableFill:(a=e.noOptionsAvailableColors)==null?void 0:a.fill}).with({noOptionsAvailable:!0,noOptionsAvailableFill:k.P.string.minLength(1)},f=>f.noOptionsAvailableFill).with({allOptionsBlocked:!0,allOptionsBlockedFill:k.P.string.minLength(1)},f=>f.allOptionsBlockedFill).otherwise(()=>l.backgroundColor),borderColor:k.match({allOptionsBlocked:i,noOptionsAvailable:r,allOptionsBlockedBorderColor:(p=e.allOptionsBlockedColors)==null?void 0:p.borderColor,noOptionsAvailableBorderColor:(C=e.noOptionsAvailableColors)==null?void 0:C.borderColor}).with({noOptionsAvailable:!0,noOptionsAvailableBorderColor:k.P.string.minLength(1)},f=>f.noOptionsAvailableBorderColor).with({allOptionsBlocked:!0,allOptionsBlockedBorderColor:k.P.string.minLength(1)},f=>f.allOptionsBlockedBorderColor).otherwise(()=>l.borderColor),color:k.match({allOptionsBlocked:i,noOptionsAvailable:r,allOptionsBlockedColor:(y=e.allOptionsBlockedColors)==null?void 0:y.color,noOptionsAvailableColor:(g=e.noOptionsAvailableColors)==null?void 0:g.color}).with({noOptionsAvailable:!0,noOptionsAvailableColor:k.P.string.minLength(1)},f=>f.noOptionsAvailableColor).with({allOptionsBlocked:!0,allOptionsBlockedColor:k.P.string.minLength(1)},f=>f.allOptionsBlockedColor).otherwise(()=>l.color)}};function ye(){const{explain:e,handleExplainAnswer:t}=w.useContext(Ye);return{explain:e,handleExplainAnswer:t}}function rc(e={}){const{initialOpen:t=!1,placement:n="top",modal:o=!1,open:i,onOpenChange:r,arrow:l}=e,[s,a]=w.useState(t),p=i??s,C=r??a,y=yi({placement:n,open:p,onOpenChange:C,whileElementsMounted:Zl,middleware:[Ml(((l==null?void 0:l.height)??0)+5),ts({crossAxis:n.includes("-"),fallbackAxisSideDirection:"end",padding:5}),es({padding:5}),...l?[os(l)]:[]]}),g=y.context,f=hi(g,{enabled:i==null}),x=mi(g),v=gi([f,x]);return w.useMemo(()=>({open:p,setOpen:C,...v,...y,modal:o,arrow:l}),[p,C,v,y,o,l])}const Vi=w.createContext(null),st=()=>{const e=w.useContext(Vi);if(e==null)throw new Error("Popover components must be wrapped in <Popover />");return e};function lc({children:e,...t}){const n=rc(t);return d.jsx(Vi.Provider,{value:n,children:e})}const sc=w.forwardRef(function(t,n){const o=w.Children.toArray(t.children)[0],i=st(),r=t.children.ref,l=gn([i.refs.setReference,n,r]);return w.isValidElement(o)?w.cloneElement(o,i.getReferenceProps({ref:l,...t,...o.props,"data-state":i.open?"open":"closed"})):d.jsx("span",{children:"Not valid children for PopoverTrigger"})}),ac=sc,cc=M.button`
|
|
239
239
|
appearance: none;
|
|
240
240
|
border: none;
|
|
241
241
|
text-decoration: underline;
|
|
@@ -250,9 +250,9 @@ ${f}`);case d.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
250
250
|
outline: var(--size-button-focus-outline) solid var(--color-button-focus-outline);
|
|
251
251
|
outline-offset: var(--size-button-focus-outline-offset);
|
|
252
252
|
}
|
|
253
|
-
`;function
|
|
253
|
+
`;function uc(){const{decisionExplanations:e,switchMode:t}=ce(),{showMoreButton:n,showConstraintsButton:o}=tt(),i=e.length-1,r=w.useMemo(()=>i>0&&mt.render(n.staticText,{amount:i}),[n.text,i]),l=i>0?n:o;return d.jsx(cc,{onClick:()=>t("dialog"),style:{...jt(l),...Vt(l)},children:r||l.staticText})}const dc=M.div`
|
|
254
254
|
margin-bottom: var(--space-xs);
|
|
255
|
-
`,
|
|
255
|
+
`,io=M.div`
|
|
256
256
|
height: 1px;
|
|
257
257
|
background-color: var(--color-explain-popover-list-separator);
|
|
258
258
|
margin-left: calc(var(--size-explain-popover-box-padding-left) * -1);
|
|
@@ -261,11 +261,11 @@ ${f}`);case d.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
261
261
|
@media only screen and (min-resolution: 2dppx) {
|
|
262
262
|
height: 0.5px;
|
|
263
263
|
}
|
|
264
|
-
`,
|
|
264
|
+
`,fc=M.div`
|
|
265
265
|
display: flex;
|
|
266
266
|
flex-direction: column;
|
|
267
267
|
container: explain-actions / inline-size;
|
|
268
|
-
`,
|
|
268
|
+
`,pc=M(Fo)`
|
|
269
269
|
display: grid;
|
|
270
270
|
grid-template-columns: [name] minmax(100px, auto) [values] minmax(100px, 1fr);
|
|
271
271
|
gap: var(--space-sm);
|
|
@@ -275,16 +275,16 @@ ${f}`);case d.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
275
275
|
margin-right: calc(var(--size-explain-popover-box-padding-right) * -1);
|
|
276
276
|
overflow: auto;
|
|
277
277
|
max-height: 200px;
|
|
278
|
-
`,
|
|
278
|
+
`,hc=M(Vo)`
|
|
279
279
|
align-self: stretch;
|
|
280
280
|
|
|
281
281
|
@container explain-actions (min-width: 300px) {
|
|
282
282
|
align-self: center;
|
|
283
283
|
}
|
|
284
|
-
`,
|
|
284
|
+
`,Ut=M(No)`
|
|
285
285
|
width: min-content;
|
|
286
286
|
min-width: 300px;
|
|
287
|
-
`;function
|
|
287
|
+
`;function mc(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=ce(),{subline:o}=tt();if(n)return d.jsx(Ut,{variant:"failedToExplain"});const i=e[0];if(!i)return d.jsx(Ut,{variant:"noExplanationFound"});if(!i.solution)return d.jsx(Ut,{variant:"noSolutionFound"});const r=un(i);return d.jsxs(d.Fragment,{children:[d.jsx(dc,{style:Ct(o),children:o.staticText}),d.jsx(io,{}),d.jsx(pc,{attributes:r}),d.jsx(io,{}),d.jsxs(fc,{children:[d.jsx(hc,{explanation:i}),(e.length>1||t.length>0)&&d.jsx(uc,{})]})]})}const Oi=w.createContext(null),ie=()=>w.useContext(Oi);function Qe(e){return w.forwardRef((t,n)=>{const o=w.useId();return d.jsx(Oi.Provider,{value:o,children:d.jsx(e,{...t,ref:n})})})}const yc=w.forwardRef((e,t)=>{const{style:n,children:o,...i}=e,r=st(),l=gn([r.refs.setFloating,t]),s=bc();return d.jsx(ui,{root:s,children:d.jsx(fi,{context:r.context,modal:r.modal,children:d.jsx("div",{ref:l,style:{...r.floatingStyles,...n},...r.getFloatingProps(i),children:o})})})}),gc=yc;function bc(){return typeof document>"u"?null:document.querySelector("[data-framer-root]")}const ki=w.forwardRef((e,t)=>{const n=X(),{appearance:o,style:i,children:r,...l}=e,a={...i,...o?{appearance:o}:{},...o==="none"?{border:"none",background:"transparent",padding:0,outline:"none"}:{}};if(n)return d.jsx("button",{type:"button",ref:t,...l,style:a,children:r});const{setOpen:p}=st();return d.jsx("button",{type:"button",ref:t,...l,style:a,onClick:C=>{var y;(y=e.onClick)==null||y.call(e,C),p(!1)},children:r})}),Fi=ki,xc={children:{title:"Content",type:c.ControlType.ComponentInstance},appearance:{title:"Appearance",type:c.ControlType.Enum,defaultValue:"auto",displaySegmentedControl:!0,segmentedControlDirection:"horizontal",options:["auto","none"]}};c.addPropertyControls(ki,xc);const Cc=M.div`
|
|
288
288
|
--size-explain-popover-box-padding-top: ${e=>e.popoverBox.isMixedPadding?e.popoverBox.paddingTop:e.popoverBox.padding}px;
|
|
289
289
|
--size-explain-popover-box-padding-right: ${e=>e.popoverBox.isMixedPadding?e.popoverBox.paddingRight:e.popoverBox.padding}px;
|
|
290
290
|
--size-explain-popover-box-padding-bottom: ${e=>e.popoverBox.isMixedPadding?e.popoverBox.paddingBottom:e.popoverBox.padding}px;
|
|
@@ -296,7 +296,7 @@ ${f}`);case d.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
296
296
|
border-style: solid;
|
|
297
297
|
min-width: 300px;
|
|
298
298
|
max-width: 500px;
|
|
299
|
-
`,
|
|
299
|
+
`,vc=M(Fi)`
|
|
300
300
|
position: absolute;
|
|
301
301
|
right: var(--space-sm-fixed);
|
|
302
302
|
top: var(--space-sm-fixed);
|
|
@@ -310,66 +310,66 @@ ${f}`);case d.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
310
310
|
outline: var(--size-button-focus-outline) solid var(--color-button-focus-outline);
|
|
311
311
|
outline-offset: var(--size-button-focus-outline-offset);
|
|
312
312
|
}
|
|
313
|
-
`,
|
|
313
|
+
`,Sc=M(Si)`
|
|
314
314
|
margin-bottom: var(--space-xs);
|
|
315
315
|
overflow: hidden;
|
|
316
316
|
display: flex;
|
|
317
317
|
white-space: nowrap;
|
|
318
318
|
text-overflow: ellipsis;
|
|
319
319
|
margin-right: var(--space-md);
|
|
320
|
-
`;function
|
|
320
|
+
`;function wc(e){const t=tt(),{popoverBox:n,closeButton:o}=t;return d.jsxs(Cc,{...t,style:$e(n),children:[d.jsx(Sc,{}),e.children,d.jsx(vc,{style:jt(o),children:d.jsx(bt.FontAwesomeIcon,{icon:gt.faXmark})})]})}const Tc=M(gc)`
|
|
321
321
|
z-index: 10;
|
|
322
322
|
|
|
323
323
|
&:focus {
|
|
324
324
|
outline: none;
|
|
325
325
|
}
|
|
326
|
-
`,
|
|
327
|
-
Please check your internet connection and try again.`)}function
|
|
328
|
-
Please check your internet connection and try again.`)}const
|
|
326
|
+
`,Ec={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 Ic(e){const t=ce(),n=tt(),{useCustomExplain:o,customPopover:i}=n,r=ie(),l=(t==null?void 0:t.displayMode)==="popover"&&(t==null?void 0:t.controlId)===r,s=w.useRef(null);return d.jsxs(lc,{open:l,onOpenChange:a=>!a&&l&&(t==null?void 0:t.dismiss()),arrow:{width:20,height:10,padding:10,element:s},children:[d.jsx(ac,{children:e.children}),d.jsxs(Ac,{isOpen:l,children:[o&&i,!o&&d.jsx(wc,{children:d.jsx(mc,{})}),d.jsx(Pc,{})]})]})}function Ac(e){var y,g;const{middlewareData:t,arrow:n,placement:o}=st(),i=((y=t.arrow)==null?void 0:y.x)??0,r=((g=t.arrow)==null?void 0:g.y)??0,l=(n==null?void 0:n.height)??0,s=(n==null?void 0:n.width)??0,a=i+s/2,p=r+l,C=k.match(o).with("top",()=>`${a}px calc(100% + ${l+5}px)`).with("bottom",()=>`${a}px ${-l-5}px`).with("left",()=>`calc(100% + ${l}px) ${p}px`).with("right",()=>`${-l}px ${p}px`).otherwise(()=>"");return d.jsx(c.AnimatePresence,{initial:!1,children:e.isOpen&&d.jsx(Tc,{children:d.jsx(c.motion.div,{variants:Ec,initial:"initial",animate:"open",exit:"close",style:{transformOrigin:C},children:d.jsx(vi,{children:e.children})})})})}function Pc(){const{context:e,arrow:t}=st(),n=tt();return d.jsx(Ps,{style:Xr(n),ref:t.element,context:e,width:t.width,height:t.height})}function Rc(e){return w.forwardRef((t,n)=>{const o=X();return t.explain!=="popover"||o?d.jsx(e,{...t}):d.jsx(Ic,{children:d.jsx(e,{...t,ref:n})})})}function ge(e){return ne(Qe(Rc(w.forwardRef(e))))}function me(){alert(`Failed to apply your selection.
|
|
327
|
+
Please check your internet connection and try again.`)}function Dc(){alert(`Failed to reset your configuration.
|
|
328
|
+
Please check your internet connection and try again.`)}const ro=M.select`
|
|
329
329
|
color: inherit;
|
|
330
330
|
cursor: inherit;
|
|
331
|
-
`,
|
|
331
|
+
`,lo="<reset>",so="<nothing>",Mi=ge((e,t)=>{if(X()){const T=Le(e,!0,!1);return d.jsx(ro,{style:T})}const o=ie(),i=te(e),r=Y.useChoiceAttribute(i);if(!r)return d.jsx("span",{children:"Choice Attribute not found"});const{explain:l}=ye(),s=We(i),{attribute:a,makeDecision:p,clearDecisions:C,isMultiSelect:y,getIncludedChoiceValues:g,getBlockedChoiceValues:f,getAllowedChoiceValues:x}=r,v=f(),h=Ge(i,x()),b=Ge(i,v.filter(T=>!T.isPossibleDecisionStatesImmutable)),S=Ge(i,v.filter(T=>T.isPossibleDecisionStatesImmutable)),R=g(),I=R.map(T=>T.id),A=I[0]??so,P=R.some(T=>{var N;return((N=T.decision)==null?void 0:N.kind)===u.DecisionKind.Explicit}),V=I.length>=1,O=R.some(T=>{var N;return((N=T.decision)==null?void 0:N.kind)===u.DecisionKind.Implicit&&!T.isPossibleDecisionStatesImmutable}),B=R.some(T=>{var N;return((N=T.decision)==null?void 0:N.kind)===u.DecisionKind.Implicit&&T.isPossibleDecisionStatesImmutable}),D=h.length===0,K=D&&b.length===0,L=e.excludeUnavailableOptions&&K,Q=async T=>{const N=e.explain,j=N!=="disabled"&&(()=>l(F=>F.whyIsStateNotPossible.choice(a.id).choiceValue(T).state(u.ChoiceValueDecisionState.Included),N,o));if(T===lo)try{await C()}catch{me()}else if(h.some(F=>F.id===T)){const F=I.some(z=>z===T)?void 0:u.ChoiceValueDecisionState.Included;try{await p(T,F)}catch(z){if(z.type===u.ConfiguratorErrorType.ConflictWithConsequence&&j){await j();return}me()}}else b.some(F=>F.id===T)&&j&&await j()},U=Le(e,a.isSatisfied,O,B,D,K);return d.jsxs(ro,{ref:t,value:y()?I:A,multiple:y(),onChange:T=>Q(T.currentTarget.value),disabled:L,style:U,children:[!V&&!y()&&d.jsx("option",{value:so}),P&&d.jsx("option",{value:lo,children:e.resetLabel}),h.map(T=>{var F,z;const N=((F=T.decision)==null?void 0:F.kind)===u.DecisionKind.Implicit&&T.isPossibleDecisionStatesImmutable,j=((z=T.decision)==null?void 0:z.kind)===u.DecisionKind.Implicit&&!T.isPossibleDecisionStatesImmutable;return d.jsxs("option",{value:T.id,children:[N?e.fixedLabelPrefix:j?e.implicitLabelPrefix:"",s.get(T.id)??T.id]},T.id)}),b.length>0&&d.jsx("optgroup",{label:e.blockedLabel,children:b.map(T=>d.jsx("option",{value:T.id,children:s.get(T.id)??T.id},T.id))}),!e.excludeUnavailableOptions&&S.length>0&&d.jsx("optgroup",{label:e.unavailableLabel,children:S.map(T=>d.jsx("option",{value:T.id,disabled:!0,children:s.get(T.id)??T.id},T.id))})]})}),jc=Mi,Vc={...wn};c.addPropertyControls(Mi,Vc);const ao=M.select`
|
|
332
332
|
color: inherit;
|
|
333
333
|
cursor: inherit;
|
|
334
|
-
`,
|
|
334
|
+
`,co="<reset>",Ht="<nothing>",ft="yes",Gt="no",Ni=ge((e,t)=>{var T,N,j,F;if(X()){const z=Le(e,!0,!1);return d.jsx(ao,{style:z})}const o=ie(),i=te(e),r=Y.useBooleanAttribute(i),{explain:l}=ye();if(!r)return d.jsx("span",{children:"Boolean Attribute not found"});const{attribute:s,makeDecision:a}=r,p=async z=>{var W;const q=((W=s.decision)==null?void 0:W.kind)===u.DecisionKind.Explicit;if(z===co&&q)try{await a(void 0)}catch{me()}else{const $=z===ft,_=s.possibleDecisionStates.includes($),H=e.explain,G=H!=="disabled"&&(()=>l(J=>J.whyIsStateNotPossible.boolean(s.id).state($),H,o));if(_)try{await a($)}catch(J){if(J.type===u.ConfiguratorErrorType.ConflictWithConsequence&&G){await G();return}me()}else G&&await G()}},C=k.match((T=s.decision)==null?void 0:T.state).with(!0,()=>ft).with(!1,()=>Gt).otherwise(()=>Ht),y=((N=s.decision)==null?void 0:N.kind)===u.DecisionKind.Explicit,g=s.isPossibleDecisionStatesImmutable,f=((j=s.decision)==null?void 0:j.kind)===u.DecisionKind.Implicit&&!g,x=((F=s.decision)==null?void 0:F.kind)===u.DecisionKind.Implicit&&g,v=s.possibleDecisionStates.includes(!0),h=s.possibleDecisionStates.includes(!1),b=!v&&g,S=!h&&g,R=!v&&!g,I=!h&&!g,A=!v&&!h,P=A&&g,V=e.excludeUnavailableOptions&&P,O=Le(e,s.isSatisfied,f,x,A,P),B=d.jsxs("option",{value:ft,children:[uo(s,!0,g,e),e.trueLabel]}),D=d.jsxs("option",{value:Gt,children:[uo(s,!1,g,e),e.falseLabel]}),K=d.jsx("option",{value:ft,disabled:!0,children:e.trueLabel}),L=d.jsx("option",{value:Gt,disabled:!0,children:e.falseLabel}),Q=R||I,U=!e.excludeUnavailableOptions&&(b||S);return d.jsxs(ao,{ref:t,value:C,onChange:z=>p(z.currentTarget.value),disabled:V,style:O,children:[C===Ht&&d.jsx("option",{value:Ht}),y&&d.jsx("option",{value:co,children:e.resetLabel}),v&&B,h&&D,Q&&d.jsxs("optgroup",{label:e.blockedLabel,children:[R&&B,I&&D]}),U&&d.jsxs("optgroup",{label:e.unavailableLabel,children:[b&&K,S&&L]})]})}),Oc=Ni,uo=(e,t,n,o)=>{var i,r;return((i=e.decision)==null?void 0:i.kind)!==u.DecisionKind.Implicit||((r=e.decision)==null?void 0:r.state)!==t?"":n?o.fixedLabelPrefix:o.implicitLabelPrefix},kc={...wn,trueLabel:{title:"True Label",type:c.ControlType.String,defaultValue:"Yes"},falseLabel:{title:"False Label",type:c.ControlType.String,defaultValue:"No"}};c.addPropertyControls(Ni,kc);const fo=M.select`
|
|
335
335
|
color: inherit;
|
|
336
336
|
cursor: inherit;
|
|
337
|
-
`,
|
|
337
|
+
`,po="<reset>",Xt="<nothing>",pt="included",ht="excluded",Bi=ge((e,t)=>{var T,N,j,F;if(X()){const z=Le(e,!0,!1);return d.jsx(fo,{style:z})}const o=ie(),i=te(e),r=Y.useComponentAttribute(i),{explain:l}=ye();if(!r)return d.jsx("span",{children:"Component Attribute not found"});const{attribute:s,makeDecision:a}=r,p=async z=>{const q=s.possibleDecisionStates.includes(z),W=e.explain,$=W!=="disabled"&&(()=>l(_=>_.whyIsStateNotPossible.component(s.id).state(z),W,o));if(q)try{await a(z)}catch(_){if(_.type===u.ConfiguratorErrorType.ConflictWithConsequence&&$){await $();return}me()}else $&&await $()},C=async z=>{var W;const q=((W=s.decision)==null?void 0:W.kind)===u.DecisionKind.Explicit;z===po&&q?await a(void 0):z===pt?await p(u.ComponentDecisionState.Included):z===ht&&await p(u.ComponentDecisionState.Excluded)},y=k.match((T=s.decision)==null?void 0:T.state).with(u.ComponentDecisionState.Included,()=>pt).with(u.ComponentDecisionState.Excluded,()=>ht).otherwise(()=>Xt),g=((N=s.decision)==null?void 0:N.kind)===u.DecisionKind.Explicit,f=s.isPossibleDecisionStatesImmutable,x=((j=s.decision)==null?void 0:j.kind)===u.DecisionKind.Implicit&&!f,v=((F=s.decision)==null?void 0:F.kind)===u.DecisionKind.Implicit&&f,h=s.possibleDecisionStates.includes(u.ComponentDecisionState.Included),b=s.possibleDecisionStates.includes(u.ComponentDecisionState.Excluded),S=!h&&f,R=!b&&f,I=!h&&!f,A=!b&&!f,P=!h&&!b,V=P&&f,O=Le(e,s.isSatisfied,x,v,P,V),B=d.jsxs("option",{value:pt,children:[ho(s,u.ComponentDecisionState.Included,f,e),e.includedLabel]}),D=d.jsxs("option",{value:ht,children:[ho(s,u.ComponentDecisionState.Excluded,f,e),e.excludedLabel]}),K=d.jsx("option",{value:pt,disabled:!0,children:e.includedLabel}),L=d.jsx("option",{value:ht,disabled:!0,children:e.excludedLabel}),Q=I||A,U=!e.excludeUnavailableOptions&&(S||R);return d.jsxs(fo,{ref:t,value:y,onChange:z=>C(z.currentTarget.value),style:O,children:[y===Xt&&d.jsx("option",{value:Xt}),g&&d.jsx("option",{value:po,children:e.resetLabel}),h&&B,b&&D,Q&&d.jsxs("optgroup",{label:e.blockedLabel,children:[I&&B,A&&D]}),U&&d.jsxs("optgroup",{label:e.unavailableLabel,children:[S&&K,R&&L]})]})}),Fc=Bi,ho=(e,t,n,o)=>{var i,r;return((i=e.decision)==null?void 0:i.kind)!==u.DecisionKind.Implicit||((r=e.decision)==null?void 0:r.state)!==t?"":n?o.fixedLabelPrefix:o.implicitLabelPrefix},Mc={...wn,includedLabel:{title:"Included Label",type:c.ControlType.String,defaultValue:"Included"},excludedLabel:{title:"Excluded Label",type:c.ControlType.String,defaultValue:"Excluded"}};c.addPropertyControls(Bi,Mc);function Li(e,t,n,o,i=1e3){const[r]=jr.useForceUpdate(),l=Dr.useDebouncedCallback(g=>{t(g),r()},i),s=w.useRef(n),a=w.useRef(e),p=l.isPending(),C=w.useRef(p);w.useEffect(()=>{e!==a.current&&(a.current=e,p&&(l.cancel(),r()),e!==n&&o(e)),n!==s.current&&(s.current=n,n!==e?(l(n),r()):p&&(l.cancel(),r())),p!==C.current&&(C.current=p,!p&&e!==n&&o(e))},[e,n,l,p]);const y=w.useCallback(()=>{l.isPending()&&l.flush()},[l]);return w.useEffect(()=>()=>y(),[y]),{flush:y}}const mo=M(Rr)`
|
|
338
338
|
color: inherit;
|
|
339
|
-
`,Ni=ye((e,t)=>{var v,R;if(Q()){const T=nn(e,!0,!1);return c.jsx(fo,{style:T})}const o=ie(),i=Z(e),r=U.useNumericAttribute(i),{explain:l}=ge();if(!r)return c.jsx("span",{children:"Numeric Attribute not found"});const{attribute:s,makeDecision:a}=r,f=((v=s.decision)==null?void 0:v.kind)===d.DecisionKind.Implicit,x=nn(e,s.isSatisfied,f),m=(R=s.decision)==null?void 0:R.state,[C,p]=S.useState(m),{min:b,max:w}=s.range,y=Fi(m,async T=>{if(T<b){alert(`The value must be smaller than or equal to ${b}.`);return}if(T>w){alert(`The value must be greater than or equal to ${w}.`);return}try{await a(T)}catch(A){A.type===d.ConfiguratorErrorType.SetDecisionConflict?e.explain!=="disabled"&&await l(j=>j.whyIsStateNotPossible.numeric(s.id).state(T),e.explain,o):me()}},C,T=>p(T),e.wait);return c.jsx(fo,{getInputRef:t,thousandsGroupStyle:"thousand",decimalSeparator:e.decimalSeparator,thousandSeparator:e.thousandSeparator,allowNegative:!0,fixedDecimalScale:!0,decimalScale:s.decimalPlaces,allowEmptyFormatting:!1,displayType:"input",placeholder:e.placeholder,prefix:Mc(s,e.implicitLabelPrefix),onBlur:()=>{y.flush()},onKeyPress:T=>{T.key==="Enter"&&y.flush()},onValueChange:T=>p(T.floatValue),value:C??"",style:x})}),kc=Ni,Mc=(e,t)=>{var n;return((n=e.decision)==null?void 0:n.kind)===d.DecisionKind.Implicit?t:""},Fc={...Pi,wait:{title:"Debounce Delay",type:u.ControlType.Number,defaultValue:2e3,min:0,unit:"ms"},decimalSeparator:{title:"Decimal Separator",type:u.ControlType.String,defaultValue:",",maxLength:1},thousandSeparator:{title:"Thousand Separator",type:u.ControlType.String,defaultValue:".",maxLength:1},placeholder:{title:"Placeholder",type:u.ControlType.String,defaultValue:""}};u.addPropertyControls(Ni,Fc);const _e={choiceValueId:{title:"Choice Value Id",type:u.ControlType.String}};function fe(e,t){return S.Children.map(e,n=>{if(S.isValidElement(n)){const o=wo(n.props,t);return S.cloneElement(n,o)}return n})}const Li=ye((e,t)=>{if(Q())return e.children;const o=ie(),{makeDecision:i}=U.useMakeDecision(),r=Z(e),l=e.choiceValueId??"",s=l.length>0,a=U.useAttributes([r],!1)[0],{explain:f}=ge();if(!a)return c.jsx("span",{children:"Attribute not found"});const x=a.type===d.AttributeType.Choice,m=a.type===d.AttributeType.Numeric,C=a.type===d.AttributeType.Boolean,p=a.type===d.AttributeType.Component;if(!x&&s)return c.jsx("span",{children:"Attribute is not a Choice Attribute"});if(m)return c.jsx("span",{children:"Numeric Attribute is not supported"});let b=x?a.values.get(l):null;if(s&&b==null)return c.jsx("span",{children:"Choice Value not found"});const w=R=>O.match({state:R,attribute:a}).with({attribute:{type:d.AttributeType.Choice},state:"undefined"},()=>b.decision==null).with({attribute:{type:d.AttributeType.Choice},state:"included"},()=>{var T,A;return((T=b.decision)==null?void 0:T.state)===d.ChoiceValueDecisionState.Included&&((A=b.decision)==null?void 0:A.kind)===d.DecisionKind.Explicit}).with({attribute:{type:d.AttributeType.Choice},state:"excluded"},()=>{var T,A;return((T=b.decision)==null?void 0:T.state)===d.ChoiceValueDecisionState.Excluded&&((A=b.decision)==null?void 0:A.kind)===d.DecisionKind.Explicit}).with({attribute:{type:d.AttributeType.Boolean},state:"undefined"},{attribute:{type:d.AttributeType.Component},state:"undefined"},({attribute:T})=>T.decision==null).with({attribute:{type:d.AttributeType.Boolean},state:"true"},({attribute:T})=>{var A,P;return((A=T.decision)==null?void 0:A.state)===!0&&((P=T.decision)==null?void 0:P.kind)===d.DecisionKind.Explicit}).with({attribute:{type:d.AttributeType.Boolean},state:"false"},({attribute:T})=>{var A,P;return((A=T.decision)==null?void 0:A.state)===!1&&((P=T.decision)==null?void 0:P.kind)===d.DecisionKind.Explicit}).with({attribute:{type:d.AttributeType.Component},state:"included"},({attribute:T})=>{var A,P;return((A=T.decision)==null?void 0:A.state)===d.ComponentDecisionState.Included&&((P=T.decision)==null?void 0:P.kind)===d.DecisionKind.Explicit}).with({attribute:{type:d.AttributeType.Component},state:"excluded"},({attribute:T})=>{var A,P;return((A=T.decision)==null?void 0:A.state)===d.ComponentDecisionState.Excluded&&((P=T.decision)==null?void 0:P.kind)===d.DecisionKind.Explicit}).otherwise(()=>!1),g=R=>O.match({isChoiceAttribute:x,isBooleanAttribute:C,isComponentAttribute:p,state:R}).with({isChoiceAttribute:!0,state:"included"},()=>d.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,state:"excluded"},()=>d.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>d.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>d.ComponentDecisionState.Excluded).otherwise(()=>null);w(e.toggleFrom);const y=w(e.toggleTo),v=async()=>{const R=y?e.toggleFrom:e.toggleTo,T=g(R),A=p?a.possibleDecisionStates.includes(T):!1,P=C?a.possibleDecisionStates.includes(T):!1,j=(x?b.possibleDecisionStates.includes(T):!1)||P||A,F=e.explain,I=F!=="disabled"&&(async()=>{const N=O.match({isComponentAttribute:p,isBooleanAttribute:C,isChoiceAttribute:x}).returnType().with({isChoiceAttribute:!0},()=>d.ExplainQuestionSubject.choiceValue).with({isBooleanAttribute:!0},()=>d.ExplainQuestionSubject.boolean).with({isComponentAttribute:!0},()=>d.ExplainQuestionSubject.component).otherwise(()=>null);N&&await f({question:d.ExplainQuestionType.whyIsStateNotPossible,subject:N,attributeId:r,choiceValueId:l,state:T},F,o)});if(j||T==null)try{await i({type:a.type,attributeId:r,choiceValueId:l,state:T})}catch(N){if(N.type===d.ConfiguratorErrorType.ConflictWithConsequence&&I){await I();return}me()}else I&&await I()};return fe(e.children,{onClick:v,ref:t})}),Nc=Li,Lc={...re,..._e,children:{title:"Content",type:u.ControlType.ComponentInstance},toggleFrom:{title:"Toggle From",type:u.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false"]},toggleTo:{title:"Toggle To",type:u.ControlType.Enum,defaultValue:"included",options:["undefined","included","excluded","true","false"]},...Ke};u.addPropertyControls(Li,Lc);const Bi=ye((e,t)=>{if(Q())return e.children;const o=ie(),{makeDecision:i}=U.useMakeDecision(),r=Z(e),l=e.choiceValueId??"",s=l.length>0,a=U.useAttributes([r],!1)[0],f=U.useChoiceAttribute(r),{explain:x}=ge();if(!a)return c.jsx("span",{children:"Attribute not found"});const m=a.type===d.AttributeType.Choice,C=a.type===d.AttributeType.Numeric,p=a.type===d.AttributeType.Boolean,b=a.type===d.AttributeType.Component;if(!m&&s)return c.jsx("span",{children:"Attribute is not a Choice Attribute"});let w=m?a.values.get(l):null;if(s&&w==null)return c.jsx("span",{children:"Choice Value not found"});const g=()=>O.match({isChoiceAttribute:m,isBooleanAttribute:p,isComponentAttribute:b,isNumericAttribute:C,hasChoiceValueId:s,state:e.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>d.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>d.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>d.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>d.ComponentDecisionState.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>e.numericValue).otherwise(()=>null),y=async()=>{if(m&&!s&&e.setSelection==="undefined")try{await f.clearDecisions()}catch{me()}else{const v=g(),R=b?a.possibleDecisionStates.includes(v):!1,T=p?a.possibleDecisionStates.includes(v):!1,P=(m?w.possibleDecisionStates.includes(v):!1)||T||R,D=e.explain,j=D!=="disabled"&&(async()=>{const F=O.match({isComponentAttribute:b,isBooleanAttribute:p,isChoiceAttribute:m,isNumericAttribute:C}).returnType().with({isChoiceAttribute:!0},()=>d.ExplainQuestionSubject.choiceValue).with({isBooleanAttribute:!0},()=>d.ExplainQuestionSubject.boolean).with({isComponentAttribute:!0},()=>d.ExplainQuestionSubject.component).with({isNumericAttribute:!0},()=>d.ExplainQuestionSubject.numeric).otherwise(()=>null);F&&await x({question:d.ExplainQuestionType.whyIsStateNotPossible,subject:F,attributeId:r,choiceValueId:l,state:v},D,o)});if(C||P||v==null)try{await i({type:a.type,attributeId:r,choiceValueId:l,state:v})}catch(F){const I=F;if((I.type===d.ConfiguratorErrorType.ConflictWithConsequence||I.type===d.ConfiguratorErrorType.SetDecisionConflict)&&j){await j();return}me()}else j&&await j()}};return fe(e.children,{onClick:y,ref:t})}),Bc=Bi,$c={...re,..._e,children:{title:"Content",type:u.ControlType.ComponentInstance},setSelection:{title:"Set Selection To",type:u.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:u.ControlType.Number,defaultValue:0},...Ke};u.addPropertyControls(Bi,$c);const $i=ye((e,t)=>{var m;if(Q())return e.children;const o=ie(),{makeManyDecisions:i}=U.useMakeDecision(),{handleExplainAnswer:r}=ge(),l=e.attributes.map(Z),s=U.useAttributes(l,!1).map((C,p)=>{if(!C)return{error:c.jsx("span",{children:"Attribute not found"})};const b=e.attributes[p],w=b.choiceValueId??"",g=w.length>0,y=C.type===d.AttributeType.Choice,v=C.type===d.AttributeType.Numeric,R=C.type===d.AttributeType.Boolean,T=C.type===d.AttributeType.Component;if(!y&&g)return{error:c.jsx("span",{children:"Attribute is not a Choice Attribute"})};let A=y?C.values.get(w):null;if(g&&A==null)return{error:c.jsx("span",{children:"Choice Value not found"})};const P=()=>O.match({isChoiceAttribute:y,isBooleanAttribute:R,isComponentAttribute:T,isNumericAttribute:v,hasChoiceValueId:g,state:b.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>d.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>d.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>d.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>d.ComponentDecisionState.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>b.numericValue).otherwise(()=>null);return{getDecisions:()=>y&&!g&&b.setSelection==="undefined"?[...C.values.values()].filter(D=>{var j;return((j=D.decision)==null?void 0:j.kind)===d.DecisionKind.Explicit}).map(D=>({type:C.type,attributeId:C.id,choiceValueId:D.id,state:null})):[{type:C.type,attributeId:C.id,choiceValueId:w,state:P()}]}}),a=(m=s.find(C=>C.error))==null?void 0:m.error;if(a)return a;const f=async()=>{const C=s.reduce((b,w)=>[...b,...w.getDecisions()],new Array),p=O.match(e.existingSelections).with("keep",()=>({type:"KeepExistingDecisions"})).with("drop",()=>({type:"DropExistingDecisions",conflictHandling:O.match(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()})).exhaustive();try{await i(C,p)}catch(b){const w=b;if(console.debug("SetMany failed",w),(w==null?void 0:w.type)===d.ConfiguratorErrorType.MakeManyDecisionsConflict&&w.decisionExplanations){e.explain!=="disabled"&&await r(w,e.explain,o);return}me();return}},x=()=>{e.trigger==="click"&&f()};return S.useEffect(()=>{e.trigger==="auto"&&f()},[]),fe(e.children,{onClick:x,ref:t})}),zc=$i,Wc={children:{title:"Content",type:u.ControlType.ComponentInstance},attributes:{title:"Attributes",type:u.ControlType.Array,control:{type:u.ControlType.Object,controls:{...re,..._e,setSelection:{title:"Set Selection To",type:u.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:u.ControlType.Number,defaultValue:0}}}},existingSelections:{title:"Existing Selections",type:u.ControlType.Enum,defaultValue:"keep",options:["keep","drop"]},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:u.ControlType.Boolean,defaultValue:!0,hidden:e=>e.existingSelections!=="drop"},trigger:{title:"Trigger",type:u.ControlType.Enum,defaultValue:"click",options:["click","auto"],displaySegmentedControl:!0,segmentedControlDirection:"horizontal"},...Ke};u.addPropertyControls($i,Wc);const zi=ee(e=>{if(Q())return e.enabledChildren;const{canResetConfiguration:n,resetConfiguration:o}=U.useConfigurationReset(),i=async()=>{if(n)try{await o()}catch{Ac()}},r=n?e.enabledChildren:e.disabledChildren;return fe(r,{onClick:i})}),Kc=zi,qc={enabledChildren:{title:"Content – Enabled",type:u.ControlType.ComponentInstance},disabledChildren:{title:"Content – Disabled",type:u.ControlType.ComponentInstance}};u.addPropertyControls(zi,qc);const Wi=ye((e,t)=>{if(Q())return e.unsatisfiedChildren;const o=ie(),{isSatisfied:i}=U.useConfigurationSatisfaction(),{explain:r}=ge(),s=[...e.attributeId.length>0?[Z(e)]:[],...e.attributes.map(Z)],a=()=>{var p;const m=U.useAttributes(s,!1).map(b=>b?{isSatisfied:b.isSatisfied}:{error:c.jsx("span",{children:"Attribute not found"})}),C=(p=m.find(b=>b.error))==null?void 0:p.error;return C||m.every(b=>b.isSatisfied)},f=async()=>{e.explain!=="disabled"&&(s.length===0?await r(m=>m.whyIsNotSatisfied.configuration,e.explain,o):s.length===1&&await r(m=>m.whyIsNotSatisfied.attribute(s[0]),e.explain,o))};return(s.length>0?a():i)?e.satisfiedChildren:fe(e.unsatisfiedChildren,{onClick:f,ref:t})}),_c=Wi,Hc={satisfiedChildren:{title:"Content – Satisfied",type:u.ControlType.ComponentInstance},unsatisfiedChildren:{title:"Content – Unsatisfied",type:u.ControlType.ComponentInstance},...re,attributes:{title:"Attributes",type:u.ControlType.Array,control:{type:u.ControlType.Object,controls:{...re}}},...Ke};u.addPropertyControls(Wi,Hc);const Ki=ee(S.forwardRef(function(t,n){const o=b=>O.match(b).with(1,()=>t.content1).with(2,()=>t.content2).with(3,()=>t.content3).with(4,()=>t.content4).with(5,()=>t.content5).with(6,()=>t.content6).with(7,()=>t.content7).with(8,()=>t.content8).with(9,()=>t.content9).with(10,()=>t.content10).otherwise(()=>null),i=t.variants.find(b=>b.useInDesignTime)||t.variants[0];if(Q())return i&&o(i.content);const l=Z(t),s=t.choiceValueId??"",a=s.length>0,f=U.useAttributes([l],!1)[0];if(!f)return c.jsx("span",{children:"Attribute not found"});const x=f.type===d.AttributeType.Choice;if(!x&&a)return c.jsx("span",{children:"Attribute is not a Choice Attribute"});const m=x&&a?f.values.get(s):null;if(a&&m==null)return c.jsx("span",{children:"Choice Value not found"});const C=b=>()=>m?b(m):O.match(t.filterMode).with("some",()=>[...f.values.values()].some(b)).with("every",()=>[...f.values.values()].every(b)).exhaustive(),p=[...t.variants].find(({selection:b,condition:w})=>O.match({selection:b,condition:w,attribute:f}).with({attribute:{type:d.AttributeType.Choice},selection:"included",condition:"blocked"},C(g=>!g.possibleDecisionStates.includes(d.ChoiceValueDecisionState.Included))).with({attribute:{type:d.AttributeType.Choice},selection:"included",condition:"available"},C(g=>g.possibleDecisionStates.includes(d.ChoiceValueDecisionState.Included))).with({attribute:{type:d.AttributeType.Choice},selection:"included",condition:"implicit"},C(g=>{var y,v;return((y=g.decision)==null?void 0:y.state)===d.ChoiceValueDecisionState.Included&&((v=g.decision)==null?void 0:v.kind)===d.DecisionKind.Implicit})).with({attribute:{type:d.AttributeType.Choice},selection:"included",condition:"explicit"},C(g=>{var y,v;return((y=g.decision)==null?void 0:y.state)===d.ChoiceValueDecisionState.Included&&((v=g.decision)==null?void 0:v.kind)===d.DecisionKind.Explicit})).with({attribute:{type:d.AttributeType.Choice},selection:"included",condition:"none"},C(g=>{var y;return((y=g.decision)==null?void 0:y.state)===d.ChoiceValueDecisionState.Included})).with({attribute:{type:d.AttributeType.Choice},selection:"excluded",condition:"blocked"},C(g=>!g.possibleDecisionStates.includes(d.ChoiceValueDecisionState.Excluded))).with({attribute:{type:d.AttributeType.Choice},selection:"excluded",condition:"available"},C(g=>g.possibleDecisionStates.includes(d.ChoiceValueDecisionState.Excluded))).with({attribute:{type:d.AttributeType.Choice},selection:"excluded",condition:"implicit"},C(g=>{var y,v;return((y=g.decision)==null?void 0:y.state)===d.ChoiceValueDecisionState.Excluded&&((v=g.decision)==null?void 0:v.kind)===d.DecisionKind.Implicit})).with({attribute:{type:d.AttributeType.Choice},selection:"excluded",condition:"explicit"},C(g=>{var y,v;return((y=g.decision)==null?void 0:y.state)===d.ChoiceValueDecisionState.Excluded&&((v=g.decision)==null?void 0:v.kind)===d.DecisionKind.Explicit})).with({attribute:{type:d.AttributeType.Choice},selection:"excluded",condition:"none"},C(g=>{var y;return((y=g.decision)==null?void 0:y.state)===d.ChoiceValueDecisionState.Excluded})).with({attribute:{type:d.AttributeType.Boolean},selection:"true",condition:"blocked"},({attribute:g})=>!g.possibleDecisionStates.includes(!0)).with({attribute:{type:d.AttributeType.Boolean},selection:"true",condition:"available"},({attribute:g})=>g.possibleDecisionStates.includes(!0)).with({attribute:{type:d.AttributeType.Boolean},selection:"true",condition:"implicit"},({attribute:g})=>{var y,v;return((y=g.decision)==null?void 0:y.state)===!0&&((v=g.decision)==null?void 0:v.kind)===d.DecisionKind.Implicit}).with({attribute:{type:d.AttributeType.Boolean},selection:"true",condition:"explicit"},({attribute:g})=>{var y,v;return((y=g.decision)==null?void 0:y.state)===!0&&((v=g.decision)==null?void 0:v.kind)===d.DecisionKind.Explicit}).with({attribute:{type:d.AttributeType.Boolean},selection:"true",condition:"none"},({attribute:g})=>{var y;return((y=g.decision)==null?void 0:y.state)===!0}).with({attribute:{type:d.AttributeType.Boolean},selection:"false",condition:"blocked"},({attribute:g})=>!g.possibleDecisionStates.includes(!1)).with({attribute:{type:d.AttributeType.Boolean},selection:"false",condition:"available"},({attribute:g})=>g.possibleDecisionStates.includes(!1)).with({attribute:{type:d.AttributeType.Boolean},selection:"false",condition:"implicit"},({attribute:g})=>{var y,v;return((y=g.decision)==null?void 0:y.state)===!1&&((v=g.decision)==null?void 0:v.kind)===d.DecisionKind.Implicit}).with({attribute:{type:d.AttributeType.Boolean},selection:"false",condition:"explicit"},({attribute:g})=>{var y,v;return((y=g.decision)==null?void 0:y.state)===!1&&((v=g.decision)==null?void 0:v.kind)===d.DecisionKind.Explicit}).with({attribute:{type:d.AttributeType.Boolean},selection:"false",condition:"none"},({attribute:g})=>{var y;return((y=g.decision)==null?void 0:y.state)===!1}).with({attribute:{type:d.AttributeType.Component},selection:"included",condition:"blocked"},({attribute:g})=>!g.possibleDecisionStates.includes(d.ComponentDecisionState.Included)).with({attribute:{type:d.AttributeType.Component},selection:"included",condition:"available"},({attribute:g})=>g.possibleDecisionStates.includes(d.ComponentDecisionState.Included)).with({attribute:{type:d.AttributeType.Component},selection:"included",condition:"implicit"},({attribute:g})=>{var y,v;return((y=g.decision)==null?void 0:y.state)===d.ComponentDecisionState.Included&&((v=g.decision)==null?void 0:v.kind)===d.DecisionKind.Implicit}).with({attribute:{type:d.AttributeType.Component},selection:"included",condition:"explicit"},({attribute:g})=>{var y,v;return((y=g.decision)==null?void 0:y.state)===d.ComponentDecisionState.Included&&((v=g.decision)==null?void 0:v.kind)===d.DecisionKind.Explicit}).with({attribute:{type:d.AttributeType.Component},selection:"included",condition:"none"},({attribute:g})=>{var y;return((y=g.decision)==null?void 0:y.state)===d.ComponentDecisionState.Included}).with({attribute:{type:d.AttributeType.Component},selection:"excluded",condition:"blocked"},({attribute:g})=>!g.possibleDecisionStates.includes(d.ComponentDecisionState.Excluded)).with({attribute:{type:d.AttributeType.Component},selection:"excluded",condition:"available"},({attribute:g})=>g.possibleDecisionStates.includes(d.ComponentDecisionState.Excluded)).with({attribute:{type:d.AttributeType.Component},selection:"excluded",condition:"implicit"},({attribute:g})=>{var y,v;return((y=g.decision)==null?void 0:y.state)===d.ComponentDecisionState.Excluded&&((v=g.decision)==null?void 0:v.kind)===d.DecisionKind.Implicit}).with({attribute:{type:d.AttributeType.Component},selection:"excluded",condition:"explicit"},({attribute:g})=>{var y,v;return((y=g.decision)==null?void 0:y.state)===d.ComponentDecisionState.Excluded&&((v=g.decision)==null?void 0:v.kind)===d.DecisionKind.Explicit}).with({attribute:{type:d.AttributeType.Component},selection:"excluded",condition:"none"},({attribute:g})=>{var y;return((y=g.decision)==null?void 0:y.state)===d.ComponentDecisionState.Excluded}).with({attribute:{type:d.AttributeType.Numeric},selection:"numeric",condition:"implicit"},({attribute:g})=>{var y;return((y=g.decision)==null?void 0:y.kind)===d.DecisionKind.Implicit}).with({attribute:{type:d.AttributeType.Numeric},selection:"numeric",condition:"explicit"},({attribute:g})=>{var y;return((y=g.decision)==null?void 0:y.kind)===d.DecisionKind.Explicit}).with({attribute:{type:d.AttributeType.Numeric},selection:"numeric",condition:"none"},({attribute:g})=>g.decision!=null).with({attribute:{type:d.AttributeType.Choice},selection:"undefined"},C(g=>g.decision==null)).with({attribute:{type:d.AttributeType.Boolean},selection:"undefined"},{attribute:{type:d.AttributeType.Component},selection:"undefined"},{attribute:{type:d.AttributeType.Numeric},selection:"undefined"},({attribute:g})=>g.decision==null).otherwise(()=>!1));return p&&fe(o(p.content),{ref:n})})),Qc=Ki,Uc={...re,..._e,filterMode:{title:"Filter Mode",type:u.ControlType.Enum,defaultValue:"some",options:["some","every"],displaySegmentedControl:!0,description:"Only applies for Choice Attributes without a specified Choice Value."},variants:{title:"Variants",type:u.ControlType.Array,maxCount:10,control:{type:u.ControlType.Object,controls:{selection:{title:"Selection",type:u.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},condition:{title:"Condition",type:u.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked","available"]},content:{title:"Content",type:u.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5,6,7,8,9,10]},useInDesignTime:{title:"Design Time",type:u.ControlType.Boolean,defaultValue:!1}}}},content1:{title:"Content 1",type:u.ControlType.ComponentInstance},content2:{title:"Content 2",type:u.ControlType.ComponentInstance},content3:{title:"Content 3",type:u.ControlType.ComponentInstance},content4:{title:"Content 4",type:u.ControlType.ComponentInstance},content5:{title:"Content 5",type:u.ControlType.ComponentInstance},content6:{title:"Content 6",type:u.ControlType.ComponentInstance},content7:{title:"Content 7",type:u.ControlType.ComponentInstance},content8:{title:"Content 8",type:u.ControlType.ComponentInstance},content9:{title:"Content 9",type:u.ControlType.ComponentInstance},content10:{title:"Content 10",type:u.ControlType.ComponentInstance}};u.addPropertyControls(Ki,Uc);const qi=ee(e=>{const t=S.useRef(),[n,o]=S.useState(null),i=S.useRef(n),r=S.useMemo(()=>e.color.startsWith("var"),[e.color]),l=r?n:e.color,s=S.useMemo(()=>{if(!l)return;const a=Vr(l);return jr.hexToCSSFilter(`#${a}`,{acceptanceLossPercentage:1,maxChecks:30}).filter.replace(";","")},[l]);return S.useLayoutEffect(()=>{if(r){const a=t.current&&getComputedStyle(t.current).color;a!=i.current&&(i.current=a,o(a))}}),c.jsx("div",{ref:t,style:{...e.style,color:e.color,filter:s},children:e.children})}),Gc=qi,Yc={children:{title:"Content",type:u.ControlType.ComponentInstance},color:{title:"Color",type:u.ControlType.Color,defaultValue:"#0000ff"}};u.addPropertyControls(qi,Yc);const _i=ee(e=>{if(Q())return e.children;const{error:n}=U.useConfigurationInitialization();return n?fe(e.children,{onClick:n.retry}):null}),Xc=_i,Jc={children:{title:"Content",type:u.ControlType.ComponentInstance}};u.addPropertyControls(_i,Jc);function Zc(e){return S.forwardRef((t,n)=>{const o={...t.style,width:"100%",height:"100%"};return c.jsx(e,{...t,ref:n,style:o})})}const eu=V.div`
|
|
339
|
+
`,$i=ge((e,t)=>{var I,A,P;if(X()){const V=rn(e,!0,!1);return d.jsx(mo,{style:V})}const o=ie(),i=te(e),r=Y.useNumericAttribute(i),{explain:l}=ye();if(!r)return d.jsx("span",{children:"Numeric Attribute not found"});const{attribute:s,makeDecision:a}=r,p=s.isPossibleDecisionStatesImmutable,C=((I=s.decision)==null?void 0:I.kind)===u.DecisionKind.Implicit&&!p,y=((A=s.decision)==null?void 0:A.kind)===u.DecisionKind.Implicit&&p,g=rn(e,s.isSatisfied,C,y),f=(P=s.decision)==null?void 0:P.state,[x,v]=w.useState(f),{min:h,max:b}=s.range,R=Li(f,async V=>{if(V<h){alert(`The value must be smaller than or equal to ${h}.`);return}if(V>b){alert(`The value must be greater than or equal to ${b}.`);return}try{await a(V)}catch(O){O.type===u.ConfiguratorErrorType.SetDecisionConflict?e.explain!=="disabled"&&await l(K=>K.whyIsStateNotPossible.numeric(s.id).state(V),e.explain,o):me()}},x,V=>v(V),e.wait);return d.jsx(mo,{getInputRef:t,thousandsGroupStyle:"thousand",decimalSeparator:e.decimalSeparator,thousandSeparator:e.thousandSeparator,allowNegative:!0,fixedDecimalScale:!0,decimalScale:s.decimalPlaces,allowEmptyFormatting:!1,displayType:"input",placeholder:e.placeholder,prefix:Bc(s,p,e),readOnly:p,onBlur:()=>{R.flush()},onKeyPress:V=>{V.key==="Enter"&&R.flush()},onValueChange:V=>v(V.floatValue),value:x??"",style:g})}),Nc=$i,Bc=(e,t,n)=>{var o;return((o=e.decision)==null?void 0:o.kind)!==u.DecisionKind.Implicit?"":t?n.fixedLabelPrefix:n.implicitLabelPrefix},Lc={...ji,wait:{title:"Debounce Delay",type:c.ControlType.Number,defaultValue:2e3,min:0,unit:"ms"},decimalSeparator:{title:"Decimal Separator",type:c.ControlType.String,defaultValue:",",maxLength:1},thousandSeparator:{title:"Thousand Separator",type:c.ControlType.String,defaultValue:".",maxLength:1},placeholder:{title:"Placeholder",type:c.ControlType.String,defaultValue:""}};c.addPropertyControls($i,Lc);const qe={choiceValueId:{title:"Choice Value Id",type:c.ControlType.String}};function fe(e,t){return w.Children.map(e,n=>{if(w.isValidElement(n)){const o=Eo(n.props,t);return w.cloneElement(n,o)}return n})}const zi=ge((e,t)=>{if(X())return e.children;const o=ie(),{makeDecision:i}=Y.useMakeDecision(),r=te(e),l=e.choiceValueId??"",s=l.length>0,a=Y.useAttributes([r],!1)[0],{explain:p}=ye();if(!a)return d.jsx("span",{children:"Attribute not found"});const C=a.type===u.AttributeType.Choice,y=a.type===u.AttributeType.Numeric,g=a.type===u.AttributeType.Boolean,f=a.type===u.AttributeType.Component;if(!C&&s)return d.jsx("span",{children:"Attribute is not a Choice Attribute"});if(y)return d.jsx("span",{children:"Numeric Attribute is not supported"});let x=C?a.values.get(l):null;if(s&&x==null)return d.jsx("span",{children:"Choice Value not found"});const v=R=>k.match({state:R,attribute:a}).with({attribute:{type:u.AttributeType.Choice},state:"undefined"},()=>x.decision==null).with({attribute:{type:u.AttributeType.Choice},state:"included"},()=>{var I,A;return((I=x.decision)==null?void 0:I.state)===u.ChoiceValueDecisionState.Included&&((A=x.decision)==null?void 0:A.kind)===u.DecisionKind.Explicit}).with({attribute:{type:u.AttributeType.Choice},state:"excluded"},()=>{var I,A;return((I=x.decision)==null?void 0:I.state)===u.ChoiceValueDecisionState.Excluded&&((A=x.decision)==null?void 0:A.kind)===u.DecisionKind.Explicit}).with({attribute:{type:u.AttributeType.Boolean},state:"undefined"},{attribute:{type:u.AttributeType.Component},state:"undefined"},({attribute:I})=>I.decision==null).with({attribute:{type:u.AttributeType.Boolean},state:"true"},({attribute:I})=>{var A,P;return((A=I.decision)==null?void 0:A.state)===!0&&((P=I.decision)==null?void 0:P.kind)===u.DecisionKind.Explicit}).with({attribute:{type:u.AttributeType.Boolean},state:"false"},({attribute:I})=>{var A,P;return((A=I.decision)==null?void 0:A.state)===!1&&((P=I.decision)==null?void 0:P.kind)===u.DecisionKind.Explicit}).with({attribute:{type:u.AttributeType.Component},state:"included"},({attribute:I})=>{var A,P;return((A=I.decision)==null?void 0:A.state)===u.ComponentDecisionState.Included&&((P=I.decision)==null?void 0:P.kind)===u.DecisionKind.Explicit}).with({attribute:{type:u.AttributeType.Component},state:"excluded"},({attribute:I})=>{var A,P;return((A=I.decision)==null?void 0:A.state)===u.ComponentDecisionState.Excluded&&((P=I.decision)==null?void 0:P.kind)===u.DecisionKind.Explicit}).otherwise(()=>!1),h=R=>k.match({isChoiceAttribute:C,isBooleanAttribute:g,isComponentAttribute:f,state:R}).with({isChoiceAttribute:!0,state:"included"},()=>u.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,state:"excluded"},()=>u.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>u.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>u.ComponentDecisionState.Excluded).otherwise(()=>null);v(e.toggleFrom);const b=v(e.toggleTo),S=async()=>{const R=b?e.toggleFrom:e.toggleTo,I=h(R),A=f?a.possibleDecisionStates.includes(I):!1,P=g?a.possibleDecisionStates.includes(I):!1,O=(C?x.possibleDecisionStates.includes(I):!1)||P||A,B=k.match(a).with({type:u.AttributeType.Choice},()=>(x==null?void 0:x.isPossibleDecisionStatesImmutable)??!1).with({type:u.AttributeType.Boolean},L=>L.isPossibleDecisionStatesImmutable).with({type:u.AttributeType.Component},L=>L.isPossibleDecisionStatesImmutable).otherwise(()=>!1),D=e.explain,K=D!=="disabled"&&(async()=>{const L=k.match({isComponentAttribute:f,isBooleanAttribute:g,isChoiceAttribute:C}).returnType().with({isChoiceAttribute:!0},()=>u.ExplainQuestionSubject.choiceValue).with({isBooleanAttribute:!0},()=>u.ExplainQuestionSubject.boolean).with({isComponentAttribute:!0},()=>u.ExplainQuestionSubject.component).otherwise(()=>null);L&&await p({question:u.ExplainQuestionType.whyIsStateNotPossible,subject:L,attributeId:r,choiceValueId:l,state:I},D,o)});if(!B)if(O||I==null)try{await i({type:a.type,attributeId:r,choiceValueId:l,state:I})}catch(L){if(L.type===u.ConfiguratorErrorType.ConflictWithConsequence&&K){await K();return}me()}else K&&await K()};return fe(e.children,{onClick:S,ref:t})}),$c=zi,zc={...re,...qe,children:{title:"Content",type:c.ControlType.ComponentInstance},toggleFrom:{title:"Toggle From",type:c.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false"]},toggleTo:{title:"Toggle To",type:c.ControlType.Enum,defaultValue:"included",options:["undefined","included","excluded","true","false"]},...Ke};c.addPropertyControls(zi,zc);const Wi=ge((e,t)=>{if(X())return e.children;const o=ie(),{makeDecision:i}=Y.useMakeDecision(),r=te(e),l=e.choiceValueId??"",s=l.length>0,a=Y.useAttributes([r],!1)[0],p=Y.useChoiceAttribute(r),{explain:C}=ye();if(!a)return d.jsx("span",{children:"Attribute not found"});const y=a.type===u.AttributeType.Choice,g=a.type===u.AttributeType.Numeric,f=a.type===u.AttributeType.Boolean,x=a.type===u.AttributeType.Component;if(!y&&s)return d.jsx("span",{children:"Attribute is not a Choice Attribute"});let v=y?a.values.get(l):null;if(s&&v==null)return d.jsx("span",{children:"Choice Value not found"});const h=()=>k.match({isChoiceAttribute:y,isBooleanAttribute:f,isComponentAttribute:x,isNumericAttribute:g,hasChoiceValueId:s,state:e.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>u.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>u.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>u.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>u.ComponentDecisionState.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>e.numericValue).otherwise(()=>null),b=async()=>{if(y&&!s&&e.setSelection==="undefined")try{await p.clearDecisions()}catch{me()}else{const S=h(),R=x?a.possibleDecisionStates.includes(S):!1,I=f?a.possibleDecisionStates.includes(S):!1,P=(y?v.possibleDecisionStates.includes(S):!1)||I||R,V=k.match(a).with({type:u.AttributeType.Choice},()=>(v==null?void 0:v.isPossibleDecisionStatesImmutable)??!1).with({type:u.AttributeType.Boolean},D=>D.isPossibleDecisionStatesImmutable).with({type:u.AttributeType.Component},D=>D.isPossibleDecisionStatesImmutable).otherwise(()=>!1),O=e.explain,B=O!=="disabled"&&(async()=>{const D=k.match({isComponentAttribute:x,isBooleanAttribute:f,isChoiceAttribute:y,isNumericAttribute:g}).returnType().with({isChoiceAttribute:!0},()=>u.ExplainQuestionSubject.choiceValue).with({isBooleanAttribute:!0},()=>u.ExplainQuestionSubject.boolean).with({isComponentAttribute:!0},()=>u.ExplainQuestionSubject.component).with({isNumericAttribute:!0},()=>u.ExplainQuestionSubject.numeric).otherwise(()=>null);D&&await C({question:u.ExplainQuestionType.whyIsStateNotPossible,subject:D,attributeId:r,choiceValueId:l,state:S},O,o)});if(!V)if(g||P||S==null)try{await i({type:a.type,attributeId:r,choiceValueId:l,state:S})}catch(D){const K=D;if((K.type===u.ConfiguratorErrorType.ConflictWithConsequence||K.type===u.ConfiguratorErrorType.SetDecisionConflict)&&B){await B();return}me()}else B&&await B()}};return fe(e.children,{onClick:b,ref:t})}),Wc=Wi,Kc={...re,...qe,children:{title:"Content",type:c.ControlType.ComponentInstance},setSelection:{title:"Set Selection To",type:c.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:c.ControlType.Number,defaultValue:0},...Ke};c.addPropertyControls(Wi,Kc);const Ki=ge((e,t)=>{var y;if(X())return e.children;const o=ie(),{makeManyDecisions:i}=Y.useMakeDecision(),{handleExplainAnswer:r}=ye(),l=e.attributes.map(te),s=Y.useAttributes(l,!1).map((g,f)=>{if(!g)return{error:d.jsx("span",{children:"Attribute not found"})};const x=e.attributes[f],v=x.choiceValueId??"",h=v.length>0,b=g.type===u.AttributeType.Choice,S=g.type===u.AttributeType.Numeric,R=g.type===u.AttributeType.Boolean,I=g.type===u.AttributeType.Component;if(!b&&h)return{error:d.jsx("span",{children:"Attribute is not a Choice Attribute"})};let A=b?g.values.get(v):null;if(h&&A==null)return{error:d.jsx("span",{children:"Choice Value not found"})};const P=()=>k.match({isChoiceAttribute:b,isBooleanAttribute:R,isComponentAttribute:I,isNumericAttribute:S,hasChoiceValueId:h,state:x.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>u.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>u.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>u.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>u.ComponentDecisionState.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>x.numericValue).otherwise(()=>null);return{getDecisions:()=>b&&!h&&x.setSelection==="undefined"?[...g.values.values()].filter(V=>{var O;return((O=V.decision)==null?void 0:O.kind)===u.DecisionKind.Explicit}).map(V=>({type:g.type,attributeId:g.id,choiceValueId:V.id,state:null})):[{type:g.type,attributeId:g.id,choiceValueId:v,state:P()}]}}),a=(y=s.find(g=>g.error))==null?void 0:y.error;if(a)return a;const p=async()=>{const g=s.reduce((x,v)=>[...x,...v.getDecisions()],new Array),f=k.match(e.existingSelections).with("keep",()=>({type:"KeepExistingDecisions"})).with("drop",()=>({type:"DropExistingDecisions",conflictHandling:k.match(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()})).exhaustive();try{await i(g,f)}catch(x){const v=x;if(console.debug("SetMany failed",v),(v==null?void 0:v.type)===u.ConfiguratorErrorType.MakeManyDecisionsConflict&&v.decisionExplanations){e.explain!=="disabled"&&await r(v,e.explain,o);return}me();return}},C=()=>{e.trigger==="click"&&p()};return w.useEffect(()=>{e.trigger==="auto"&&p()},[]),fe(e.children,{onClick:C,ref:t})}),Qc=Ki,qc={children:{title:"Content",type:c.ControlType.ComponentInstance},attributes:{title:"Attributes",type:c.ControlType.Array,control:{type:c.ControlType.Object,controls:{...re,...qe,setSelection:{title:"Set Selection To",type:c.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:c.ControlType.Number,defaultValue:0}}}},existingSelections:{title:"Existing Selections",type:c.ControlType.Enum,defaultValue:"keep",options:["keep","drop"]},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:c.ControlType.Boolean,defaultValue:!0,hidden:e=>e.existingSelections!=="drop"},trigger:{title:"Trigger",type:c.ControlType.Enum,defaultValue:"click",options:["click","auto"],displaySegmentedControl:!0,segmentedControlDirection:"horizontal"},...Ke};c.addPropertyControls(Ki,qc);const Qi=ne(e=>{if(X())return e.enabledChildren;const{canResetConfiguration:n,resetConfiguration:o}=Y.useConfigurationReset(),i=async()=>{if(n)try{await o()}catch{Dc()}},r=n?e.enabledChildren:e.disabledChildren;return fe(r,{onClick:i})}),_c=Qi,Uc={enabledChildren:{title:"Content – Enabled",type:c.ControlType.ComponentInstance},disabledChildren:{title:"Content – Disabled",type:c.ControlType.ComponentInstance}};c.addPropertyControls(Qi,Uc);const qi=ge((e,t)=>{if(X())return e.unsatisfiedChildren;const o=ie(),{isSatisfied:i}=Y.useConfigurationSatisfaction(),{explain:r}=ye(),s=[...e.attributeId.length>0?[te(e)]:[],...e.attributes.map(te)],a=()=>{var f;const y=Y.useAttributes(s,!1).map(x=>x?{isSatisfied:x.isSatisfied}:{error:d.jsx("span",{children:"Attribute not found"})}),g=(f=y.find(x=>x.error))==null?void 0:f.error;return g||y.every(x=>x.isSatisfied)},p=async()=>{e.explain!=="disabled"&&(s.length===0?await r(y=>y.whyIsNotSatisfied.configuration,e.explain,o):s.length===1&&await r(y=>y.whyIsNotSatisfied.attribute(s[0]),e.explain,o))};return(s.length>0?a():i)?e.satisfiedChildren:fe(e.unsatisfiedChildren,{onClick:p,ref:t})}),Hc=qi,Gc={satisfiedChildren:{title:"Content – Satisfied",type:c.ControlType.ComponentInstance},unsatisfiedChildren:{title:"Content – Unsatisfied",type:c.ControlType.ComponentInstance},...re,attributes:{title:"Attributes",type:c.ControlType.Array,control:{type:c.ControlType.Object,controls:{...re}}},...Ke};c.addPropertyControls(qi,Gc);const _i=ne(w.forwardRef(function(t,n){const o=x=>k.match(x).with(1,()=>t.content1).with(2,()=>t.content2).with(3,()=>t.content3).with(4,()=>t.content4).with(5,()=>t.content5).with(6,()=>t.content6).with(7,()=>t.content7).with(8,()=>t.content8).with(9,()=>t.content9).with(10,()=>t.content10).otherwise(()=>null),i=t.variants.find(x=>x.useInDesignTime)||t.variants[0];if(X())return i&&o(i.content);const l=te(t),s=t.choiceValueId??"",a=s.length>0,p=Y.useAttributes([l],!1)[0];if(!p)return d.jsx("span",{children:"Attribute not found"});const C=p.type===u.AttributeType.Choice;if(!C&&a)return d.jsx("span",{children:"Attribute is not a Choice Attribute"});const y=C&&a?p.values.get(s):null;if(a&&y==null)return d.jsx("span",{children:"Choice Value not found"});const g=x=>()=>y?x(y):k.match(t.filterMode).with("some",()=>[...p.values.values()].some(x)).with("every",()=>[...p.values.values()].every(x)).exhaustive(),f=[...t.variants].find(({selection:x,condition:v})=>k.match({selection:x,condition:v,attribute:p}).with({attribute:{type:u.AttributeType.Choice},selection:"included",condition:"blocked"},g(h=>!h.possibleDecisionStates.includes(u.ChoiceValueDecisionState.Included))).with({attribute:{type:u.AttributeType.Choice},selection:"included",condition:"available"},g(h=>h.possibleDecisionStates.includes(u.ChoiceValueDecisionState.Included))).with({attribute:{type:u.AttributeType.Choice},selection:"included",condition:"immutable"},g(h=>h.isPossibleDecisionStatesImmutable&&h.possibleDecisionStates.includes(u.ChoiceValueDecisionState.Included))).with({attribute:{type:u.AttributeType.Choice},selection:"included",condition:"implicit"},g(h=>{var b,S;return((b=h.decision)==null?void 0:b.state)===u.ChoiceValueDecisionState.Included&&((S=h.decision)==null?void 0:S.kind)===u.DecisionKind.Implicit})).with({attribute:{type:u.AttributeType.Choice},selection:"included",condition:"explicit"},g(h=>{var b,S;return((b=h.decision)==null?void 0:b.state)===u.ChoiceValueDecisionState.Included&&((S=h.decision)==null?void 0:S.kind)===u.DecisionKind.Explicit})).with({attribute:{type:u.AttributeType.Choice},selection:"included",condition:"none"},g(h=>{var b;return((b=h.decision)==null?void 0:b.state)===u.ChoiceValueDecisionState.Included})).with({attribute:{type:u.AttributeType.Choice},selection:"excluded",condition:"blocked"},g(h=>!h.possibleDecisionStates.includes(u.ChoiceValueDecisionState.Excluded))).with({attribute:{type:u.AttributeType.Choice},selection:"excluded",condition:"available"},g(h=>h.possibleDecisionStates.includes(u.ChoiceValueDecisionState.Excluded))).with({attribute:{type:u.AttributeType.Choice},selection:"excluded",condition:"immutable"},g(h=>h.isPossibleDecisionStatesImmutable&&h.possibleDecisionStates.includes(u.ChoiceValueDecisionState.Excluded))).with({attribute:{type:u.AttributeType.Choice},selection:"excluded",condition:"implicit"},g(h=>{var b,S;return((b=h.decision)==null?void 0:b.state)===u.ChoiceValueDecisionState.Excluded&&((S=h.decision)==null?void 0:S.kind)===u.DecisionKind.Implicit})).with({attribute:{type:u.AttributeType.Choice},selection:"excluded",condition:"explicit"},g(h=>{var b,S;return((b=h.decision)==null?void 0:b.state)===u.ChoiceValueDecisionState.Excluded&&((S=h.decision)==null?void 0:S.kind)===u.DecisionKind.Explicit})).with({attribute:{type:u.AttributeType.Choice},selection:"excluded",condition:"none"},g(h=>{var b;return((b=h.decision)==null?void 0:b.state)===u.ChoiceValueDecisionState.Excluded})).with({attribute:{type:u.AttributeType.Boolean},selection:"true",condition:"blocked"},({attribute:h})=>!h.possibleDecisionStates.includes(!0)).with({attribute:{type:u.AttributeType.Boolean},selection:"true",condition:"available"},({attribute:h})=>h.possibleDecisionStates.includes(!0)).with({attribute:{type:u.AttributeType.Boolean},selection:"true",condition:"immutable"},({attribute:h})=>h.isPossibleDecisionStatesImmutable&&h.possibleDecisionStates.includes(!0)).with({attribute:{type:u.AttributeType.Boolean},selection:"true",condition:"implicit"},({attribute:h})=>{var b,S;return((b=h.decision)==null?void 0:b.state)===!0&&((S=h.decision)==null?void 0:S.kind)===u.DecisionKind.Implicit}).with({attribute:{type:u.AttributeType.Boolean},selection:"true",condition:"explicit"},({attribute:h})=>{var b,S;return((b=h.decision)==null?void 0:b.state)===!0&&((S=h.decision)==null?void 0:S.kind)===u.DecisionKind.Explicit}).with({attribute:{type:u.AttributeType.Boolean},selection:"true",condition:"none"},({attribute:h})=>{var b;return((b=h.decision)==null?void 0:b.state)===!0}).with({attribute:{type:u.AttributeType.Boolean},selection:"false",condition:"blocked"},({attribute:h})=>!h.possibleDecisionStates.includes(!1)).with({attribute:{type:u.AttributeType.Boolean},selection:"false",condition:"available"},({attribute:h})=>h.possibleDecisionStates.includes(!1)).with({attribute:{type:u.AttributeType.Boolean},selection:"false",condition:"immutable"},({attribute:h})=>h.isPossibleDecisionStatesImmutable&&h.possibleDecisionStates.includes(!1)).with({attribute:{type:u.AttributeType.Boolean},selection:"false",condition:"implicit"},({attribute:h})=>{var b,S;return((b=h.decision)==null?void 0:b.state)===!1&&((S=h.decision)==null?void 0:S.kind)===u.DecisionKind.Implicit}).with({attribute:{type:u.AttributeType.Boolean},selection:"false",condition:"explicit"},({attribute:h})=>{var b,S;return((b=h.decision)==null?void 0:b.state)===!1&&((S=h.decision)==null?void 0:S.kind)===u.DecisionKind.Explicit}).with({attribute:{type:u.AttributeType.Boolean},selection:"false",condition:"none"},({attribute:h})=>{var b;return((b=h.decision)==null?void 0:b.state)===!1}).with({attribute:{type:u.AttributeType.Component},selection:"included",condition:"blocked"},({attribute:h})=>!h.possibleDecisionStates.includes(u.ComponentDecisionState.Included)).with({attribute:{type:u.AttributeType.Component},selection:"included",condition:"available"},({attribute:h})=>h.possibleDecisionStates.includes(u.ComponentDecisionState.Included)).with({attribute:{type:u.AttributeType.Component},selection:"included",condition:"immutable"},({attribute:h})=>h.isPossibleDecisionStatesImmutable&&h.possibleDecisionStates.includes(u.ComponentDecisionState.Included)).with({attribute:{type:u.AttributeType.Component},selection:"included",condition:"implicit"},({attribute:h})=>{var b,S;return((b=h.decision)==null?void 0:b.state)===u.ComponentDecisionState.Included&&((S=h.decision)==null?void 0:S.kind)===u.DecisionKind.Implicit}).with({attribute:{type:u.AttributeType.Component},selection:"included",condition:"explicit"},({attribute:h})=>{var b,S;return((b=h.decision)==null?void 0:b.state)===u.ComponentDecisionState.Included&&((S=h.decision)==null?void 0:S.kind)===u.DecisionKind.Explicit}).with({attribute:{type:u.AttributeType.Component},selection:"included",condition:"none"},({attribute:h})=>{var b;return((b=h.decision)==null?void 0:b.state)===u.ComponentDecisionState.Included}).with({attribute:{type:u.AttributeType.Component},selection:"excluded",condition:"blocked"},({attribute:h})=>!h.possibleDecisionStates.includes(u.ComponentDecisionState.Excluded)).with({attribute:{type:u.AttributeType.Component},selection:"excluded",condition:"available"},({attribute:h})=>h.possibleDecisionStates.includes(u.ComponentDecisionState.Excluded)).with({attribute:{type:u.AttributeType.Component},selection:"excluded",condition:"immutable"},({attribute:h})=>h.isPossibleDecisionStatesImmutable&&h.possibleDecisionStates.includes(u.ComponentDecisionState.Excluded)).with({attribute:{type:u.AttributeType.Component},selection:"excluded",condition:"implicit"},({attribute:h})=>{var b,S;return((b=h.decision)==null?void 0:b.state)===u.ComponentDecisionState.Excluded&&((S=h.decision)==null?void 0:S.kind)===u.DecisionKind.Implicit}).with({attribute:{type:u.AttributeType.Component},selection:"excluded",condition:"explicit"},({attribute:h})=>{var b,S;return((b=h.decision)==null?void 0:b.state)===u.ComponentDecisionState.Excluded&&((S=h.decision)==null?void 0:S.kind)===u.DecisionKind.Explicit}).with({attribute:{type:u.AttributeType.Component},selection:"excluded",condition:"none"},({attribute:h})=>{var b;return((b=h.decision)==null?void 0:b.state)===u.ComponentDecisionState.Excluded}).with({attribute:{type:u.AttributeType.Numeric},selection:"numeric",condition:"implicit"},({attribute:h})=>{var b;return((b=h.decision)==null?void 0:b.kind)===u.DecisionKind.Implicit}).with({attribute:{type:u.AttributeType.Numeric},selection:"numeric",condition:"explicit"},({attribute:h})=>{var b;return((b=h.decision)==null?void 0:b.kind)===u.DecisionKind.Explicit}).with({attribute:{type:u.AttributeType.Numeric},selection:"numeric",condition:"none"},({attribute:h})=>h.decision!=null).with({attribute:{type:u.AttributeType.Numeric},selection:"numeric",condition:"immutable"},({attribute:h})=>h.isPossibleDecisionStatesImmutable).with({attribute:{type:u.AttributeType.Boolean},selection:"undefined",condition:"immutable"},{attribute:{type:u.AttributeType.Numeric},selection:"undefined",condition:"immutable"},({attribute:h})=>h.decision==null&&h.isPossibleDecisionStatesImmutable).with({attribute:{type:u.AttributeType.Choice},selection:"undefined"},g(h=>h.decision==null)).with({attribute:{type:u.AttributeType.Boolean},selection:"undefined"},{attribute:{type:u.AttributeType.Component},selection:"undefined"},{attribute:{type:u.AttributeType.Numeric},selection:"undefined"},({attribute:h})=>h.decision==null).otherwise(()=>!1));return f&&fe(o(f.content),{ref:n})})),Xc=_i,Yc={...re,...qe,filterMode:{title:"Filter Mode",type:c.ControlType.Enum,defaultValue:"some",options:["some","every"],displaySegmentedControl:!0,description:"Only applies for Choice Attributes without a specified Choice Value."},variants:{title:"Variants",type:c.ControlType.Array,maxCount:10,control:{type:c.ControlType.Object,controls:{selection:{title:"Selection",type:c.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},condition:{title:"Condition",type:c.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked","available","immutable"]},content:{title:"Content",type:c.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5,6,7,8,9,10]},useInDesignTime:{title:"Design Time",type:c.ControlType.Boolean,defaultValue:!1}}}},content1:{title:"Content 1",type:c.ControlType.ComponentInstance},content2:{title:"Content 2",type:c.ControlType.ComponentInstance},content3:{title:"Content 3",type:c.ControlType.ComponentInstance},content4:{title:"Content 4",type:c.ControlType.ComponentInstance},content5:{title:"Content 5",type:c.ControlType.ComponentInstance},content6:{title:"Content 6",type:c.ControlType.ComponentInstance},content7:{title:"Content 7",type:c.ControlType.ComponentInstance},content8:{title:"Content 8",type:c.ControlType.ComponentInstance},content9:{title:"Content 9",type:c.ControlType.ComponentInstance},content10:{title:"Content 10",type:c.ControlType.ComponentInstance}};c.addPropertyControls(_i,Yc);const Ui=ne(e=>{const t=w.useRef(),[n,o]=w.useState(null),i=w.useRef(n),r=w.useMemo(()=>e.color.startsWith("var"),[e.color]),l=r?n:e.color,s=w.useMemo(()=>{if(!l)return;const a=Or(l);return Vr.hexToCSSFilter(`#${a}`,{acceptanceLossPercentage:1,maxChecks:30}).filter.replace(";","")},[l]);return w.useLayoutEffect(()=>{if(r){const a=t.current&&getComputedStyle(t.current).color;a!=i.current&&(i.current=a,o(a))}}),d.jsx("div",{ref:t,style:{...e.style,color:e.color,filter:s},children:e.children})}),Jc=Ui,Zc={children:{title:"Content",type:c.ControlType.ComponentInstance},color:{title:"Color",type:c.ControlType.Color,defaultValue:"#0000ff"}};c.addPropertyControls(Ui,Zc);const Hi=ne(e=>{if(X())return e.children;const{error:n}=Y.useConfigurationInitialization();return n?fe(e.children,{onClick:n.retry}):null}),eu=Hi,tu={children:{title:"Content",type:c.ControlType.ComponentInstance}};c.addPropertyControls(Hi,tu);function nu(e){return w.forwardRef((t,n)=>{const o={...t.style,width:"100%",height:"100%"};return d.jsx(e,{...t,ref:n,style:o})})}const ou=M.div`
|
|
340
340
|
width: 10px;
|
|
341
341
|
height: 10px;
|
|
342
342
|
background-color: greenyellow;
|
|
343
|
-
`;function
|
|
343
|
+
`;function Gi(e){const t=w.useRef(null);return w.useEffect(()=>{if(!t.current)return;const n=setTimeout(()=>{t.current.scrollIntoView()},e.delay);return()=>clearTimeout(n)},[t.current]),d.jsx(ou,{ref:t})}const iu={delay:{title:"Delay",type:c.ControlType.Number,min:0,unit:"ms",defaultValue:0,step:1}};c.addPropertyControls(Gi,iu);function at(e){const t=n=>{var r;const o=w.Children.toArray(n)[0],i=(r=o==null?void 0:o.props)==null?void 0:r.children;return i?t(i):o??null};return t(e)}const Xi=M.div`
|
|
344
344
|
display: contents;
|
|
345
|
-
`,
|
|
345
|
+
`,ru=M.createGlobalStyle`
|
|
346
346
|
:root {
|
|
347
|
-
*:has(> ${
|
|
347
|
+
*:has(> ${Xi}) {
|
|
348
348
|
display: contents !important;
|
|
349
349
|
}
|
|
350
350
|
}
|
|
351
|
-
`,Ui=ee(qe(e=>{var C;const t=ie(),n=Q(),o=lt(e.itemTemplate);if(!o)return c.jsx("span",{children:"Choice Value Template not defined"});const i=(p,b)=>p.map(w=>S.cloneElement(o,{key:w,layoutId:`${t}_${w}`,attributeId:e.attributeId,componentPath:e.componentPath,sharedConfigurationModel:e.sharedConfigurationModel,choiceValueId:w,choiceValueName:b.get(w)??w}));if(n){const p=Math.max(1,Math.floor(e.designTimeItemCount??3)),b=((C=e.designTimeChoiceValueName)==null?void 0:C.trim())||"Choice Value",w=Array.from({length:p},(g,y)=>p===1?b:`${b} ${y+1}`);return c.jsx(po,{...e,children:i(w,h.RM.empty)})}const r=Z(e),l=U.useChoiceAttribute(r);if(!l)return c.jsx("span",{children:"Choice Attribute not found"});const s=We(r),a=e.filter??new Array,f=[...l.attribute.values.values()].filter(p=>a.length===0||a.some(({selection:b,condition:w})=>O.match({selection:b,condition:w}).with({selection:"included",condition:"blocked"},()=>!p.possibleDecisionStates.includes(d.ChoiceValueDecisionState.Included)).with({selection:"included",condition:"available"},()=>p.possibleDecisionStates.includes(d.ChoiceValueDecisionState.Included)).with({selection:"included",condition:"implicit"},()=>{var g,y;return((g=p.decision)==null?void 0:g.state)===d.ChoiceValueDecisionState.Included&&((y=p.decision)==null?void 0:y.kind)===d.DecisionKind.Implicit}).with({selection:"included",condition:"explicit"},()=>{var g,y;return((g=p.decision)==null?void 0:g.state)===d.ChoiceValueDecisionState.Included&&((y=p.decision)==null?void 0:y.kind)===d.DecisionKind.Explicit}).with({selection:"included",condition:"none"},()=>{var g;return((g=p.decision)==null?void 0:g.state)===d.ChoiceValueDecisionState.Included}).with({selection:"excluded",condition:"blocked"},()=>!p.possibleDecisionStates.includes(d.ChoiceValueDecisionState.Excluded)).with({selection:"excluded",condition:"available"},()=>p.possibleDecisionStates.includes(d.ChoiceValueDecisionState.Excluded)).with({selection:"excluded",condition:"implicit"},()=>{var g,y;return((g=p.decision)==null?void 0:g.state)===d.ChoiceValueDecisionState.Excluded&&((y=p.decision)==null?void 0:y.kind)===d.DecisionKind.Implicit}).with({selection:"excluded",condition:"explicit"},()=>{var g,y;return((g=p.decision)==null?void 0:g.state)===d.ChoiceValueDecisionState.Excluded&&((y=p.decision)==null?void 0:y.kind)===d.DecisionKind.Explicit}).with({selection:"excluded",condition:"none"},()=>{var g;return((g=p.decision)==null?void 0:g.state)===d.ChoiceValueDecisionState.Excluded}).with({selection:"undefined"},()=>p.decision==null).otherwise(()=>!1))),m=Tt(r,f).map(p=>p.id);return c.jsx(po,{...e,children:i(m,s)})}));function po(e){return c.jsxs(c.Fragment,{children:[c.jsx(Re,{singletonId:"ChoiceValueList",children:c.jsx(nu,{})}),c.jsx(Qi,{style:e.style,children:e.children})]})}const Gi=Ui,ou={...re,itemTemplate:{title:"Choice Value Template",type:u.ControlType.ComponentInstance},designTimeItemCount:{title:"Design Time Items",type:u.ControlType.Number,defaultValue:3,min:1,step:1,displayStepper:!0},designTimeChoiceValueName:{title:"Design Time Name",type:u.ControlType.String,defaultValue:"Choice Value"},filter:{title:"Filter",type:u.ControlType.Array,control:{type:u.ControlType.Object,controls:{selection:{title:"Selection",type:u.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded"]},condition:{title:"Condition",type:u.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked","available"]}}}}};u.addPropertyControls(Ui,ou);const{isValidElement:ho,cloneElement:mo}=E;function iu(e,t){return t?(Array.isArray(t)&&(t=t.map((n,o)=>ho(n)&&typeof n.props=="object"?mo(n,{...n.props,key:o}):n)),!e||Array.isArray(e)?t:ho(e)?mo(e,{...e.props,children:t}):e):e}const{isValidElement:ru}=E;function Yi(e,t,n){function o(r,l){return t.visit(r,n,l)}function i(r,l){return Yi(r,t,l||n)}if(ru(e)){if(typeof e.type=="function")return"prototype"in e.type&&e.type.prototype.isReactComponent?e=new e.type(e.props).render():e=e.type(e.props),i(e);if(e.props&&"children"in e.props){const r=e.props.children;return o(e,s=>Array.isArray(r)?r.map(a=>i(a,s)):i(r,s))}}else if(Array.isArray(e)){const r=e;return o(e,s=>r.map(a=>i(a,s)))}return o(e)}const{isValidElement:go}=E;function lu(e,t){let n;const{replace:o,updateState:i}=t;return"matchElement"in t?n=r=>go(r)&&r.type===t.matchElement:"matchLiteral"in t?n=r=>!Array.isArray(r)&&!go(r)&&t.matchLiteral(r):n=t.match,Yi(e,{visit(r,l,s){const a=i?i(l):l,f=s?s(a):void 0,x=iu(r,f);return n(x,a)?o(x,a):x}},t.initialState)}function yo(e){return c.jsx(c.Fragment,{children:lu(e.children,e)})}function su(e){return h.pipe(e,h.Str.replace(/[\s\u2013]/g,"-"),Dr)}const au=ee(e=>{const{children:t,mode:n,replaceString:o,propName:i,elementName:r,text:l}=e;return n==="replace"?c.jsx(yo,{match:s=>typeof s=="string",replace:s=>s===o?l:s,children:t}):n==="set-prop"?c.jsx(yo,{match:s=>{var a;return((a=s.type)==null?void 0:a.displayName)===r},replace:s=>S.cloneElement(s,{[su(i)]:l}),children:t}):t}),Ot=au,wn=e=>({children:{title:"Content",type:u.ControlType.ComponentInstance},mode:{title:"Mode",type:u.ControlType.Enum,defaultValue:"replace",options:["replace","set-prop"],displaySegmentedControl:!0},replaceString:{title:"Replace Text",type:u.ControlType.String,defaultValue:e,hidden:t=>t.mode!=="replace"},elementName:{title:"Element Name",type:u.ControlType.String,hidden:t=>t.mode!=="set-prop"},propName:{title:"Property Name",type:u.ControlType.String,hidden:t=>t.mode!=="set-prop"}}),Xi=ee(e=>{const{attributeId:t,children:n,customName:o}=e,i=Z(e),r=(o==null?void 0:o.length)>0,l=Q(),a=r?o:l?t:(()=>U.useAttributes([i],!1)[0]?et(i)??t:"Attribute not found")();return c.jsx(Ot,{...e,text:a})}),cu=Xi,uu={...re,customName:{title:"Custom Name",type:u.ControlType.String},...wn("<AttributeName>")};u.addPropertyControls(Xi,uu);const Ji=ee(e=>{const{choiceValueId:t,children:n,customName:o,mode:i,replaceString:r,propName:l,elementName:s}=e,a=Z(e),f=o.length>0,x=t.length>0,m=Q(),p=f?o:m?t.length>0?t:"Choice Value":(()=>{const b=U.useChoiceAttribute(a);return b?x?b.attribute.values.get(t)==null?"Choice Value not found":jo(a,t)??t:"Choice Value Id missing":"Choice Attribute not found"})();return c.jsx(Ot,{...e,text:p})}),du=Ji,fu={...re,..._e,customName:{title:"Custom Name",type:u.ControlType.String},...wn("<ChoiceValueName>")};u.addPropertyControls(Ji,fu);function Zi(e){return e.children}const pu={children:{title:"Content",type:u.ControlType.ComponentInstance}};u.addPropertyControls(Zi,pu);const er=[1,2,3,4,5],tr=S.createContext(null),nr=ee(e=>{const t=S.useContext(tr);return(t==null?void 0:t.get(e.index))??c.jsxs("span",{children:["No content found for slot ",e.index]})}),hu=nr,mu={index:{title:"Index",type:u.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5]}};u.addPropertyControls(nr,mu);const or=ee(e=>{const t=S.useMemo(()=>new Map(er.map(n=>[n,e[`content${n}`]])),[e.content1,e.content2,e.content3,e.content4,e.content5]);return c.jsx(tr.Provider,{value:t,children:e.template})}),gu=or,yu={template:{title:"Template",type:u.ControlType.ComponentInstance},...xu()};u.addPropertyControls(or,yu);function bu(e){return{title:`Content ${e}`,type:u.ControlType.ComponentInstance}}function xu(){return Object.fromEntries(er.map(e=>[`content${e}`,bu(e)]))}function ir(e){const{children:t,fileExtension:n,fileName:o,target:i}=e;if(Q())return t;const{storeConfiguration:l}=U.useConfigurationStoring();return fe(t,{onClick:async()=>{const f={type:"spc-stored-configuration",storedConfiguration:await l()};i==="file"?vu(f,`${o}.${n}`):i==="clipboard"&&wu(f)}})}const Cu={children:{title:"Content",type:u.ControlType.ComponentInstance},target:{title:"Target",type:u.ControlType.Enum,defaultValue:"file",options:["file","clipboard"],optionTitles:["File","Clipboard"],displaySegmentedControl:!0,segmentedControlDirection:"vertical"},fileName:{title:"File Name",type:u.ControlType.String,defaultValue:"configuration",hidden:e=>e.target!=="file"},fileExtension:{title:"File Extension",type:u.ControlType.String,defaultValue:"json",hidden:e=>e.target!=="file"}};u.addPropertyControls(ir,Cu);function vu(e,t){const n=JSON.stringify(e),o=new Blob([n],{type:"application/json"}),i=window.URL.createObjectURL(o),r=document.createElement("a");r.href=i,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(i)}function wu(e){const t=JSON.stringify(e);navigator.clipboard.writeText(t).catch(n=>{alert("Failed to copy the configuration to clipboard: "+n)})}var rr=(e=>(e[e.parseError=0]="parseError",e[e.noConfiguration=1]="noConfiguration",e[e.noFileSelected=2]="noFileSelected",e[e.fileReadError=3]="fileReadError",e[e.noClipboardData=4]="noClipboardData",e[e.clipboardReadError=5]="clipboardReadError",e))(rr||{});const lr=ye((e,t)=>{const{children:n,fileExtension:o,source:i}=e;if(Q())return n;const l=ie(),{restoreConfiguration:s}=U.useConfigurationStoring(),{handleExplainAnswer:a}=ge();return fe(n,{onClick:async()=>{const x=h.pipe(await Iu(i,o),h.O.toNullable);if(!x)return;const m={type:"DropExistingDecisions",conflictHandling:O.match(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()};try{await s(x,m)}catch(C){const p=C;if(console.debug("Failed to restore stored configuration",p),p.type===d.ConfiguratorErrorType.StoredConfigurationInvalid){alert("The specific configuration is not supported. Maybe the configuration was created with new application version than the current one.");return}if((p==null?void 0:p.type)===d.ConfiguratorErrorType.MakeManyDecisionsConflict&&p.decisionExplanations){e.explain!=="disabled"&&await a(p,e.explain,l);return}alert("Failed to restore your configuration.");return}},ref:t})}),Su=lr,Tu={children:{title:"Content",type:u.ControlType.ComponentInstance},source:{title:"Source",type:u.ControlType.Enum,defaultValue:"file",options:["file","clipboard"],optionTitles:["File","Clipboard"],displaySegmentedControl:!0,segmentedControlDirection:"vertical"},fileExtension:{title:"File Extension",type:u.ControlType.String,defaultValue:"json",hidden:e=>e.source!=="file"},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:u.ControlType.Boolean,defaultValue:!0},...Ke};u.addPropertyControls(lr,Tu);function Eu(e){return()=>new Promise(t=>{const n=document.createElement("input");n.type="file",n.accept=`.${e}`,n.onchange=o=>{const i=o.target;if(!i.files||i.files.length===0){t(h.left(2));return}const r=i.files[0],l=new FileReader;l.onload=()=>{t(h.right(l.result))},l.onerror=()=>{t(h.left(3))},l.readAsText(r)},n.oncancel=()=>{t(h.left(2))},n.click()})}function Au(){return()=>navigator.clipboard.readText().then(e=>e?h.right(e):h.left(4)).catch(()=>h.left(5))}function Iu(e,t){return h.pipe(e==="file"?Eu(t):Au(),h.TE.chainEitherK(n=>h.E.tryCatch(()=>JSON.parse(n),()=>0)),h.TE.filterOrElse(n=>n.type==="spc-stored-configuration",()=>1),h.TE.map(n=>n.storedConfiguration),h.TE.doIfLeft(n=>()=>{console.debug(`Failed to load stored configuration: ${rr[n]}`),n==3?alert("Failed to read the selected file. Maybe it is damaged."):n==1||n==0?e==="file"?alert("The selected file doesn't contain a valid configuration."):e==="clipboard"&&alert("The clipboard doesn't contain a valid configuration."):n==5?alert("Can't read the clipboard. Make to give a permission for reading the clipboard."):n==4&&alert("The clipboard doesn't contain a configuration.")}),h.TO.fromTaskEither)()}const sr=ee(e=>{const{fallback:t}=e,n=Z(e),r=Q()?"0.0":(()=>{var a;const l=U.useNumericAttribute(n);if(!l)return"Numeric Attribute not found";const s=(a=l.attribute.decision)==null?void 0:a.state;return s!=null?s.toLocaleString():t})();return c.jsx(Ot,{...e,text:r})}),Pu=sr,Ru={...re,fallback:{title:"Unselected Text",type:u.ControlType.String,defaultValue:""},...wn("<NumericValue>")};u.addPropertyControls(sr,Ru);function ar(e){if(Q())return c.jsx("div",{style:{width:"100%"},children:e.children});const n=S.useRef(0),[o,i]=S.useState(null),r=s=>{window.parent.postMessage({type:"spc.configurator.height",height:s},"*")};function l(s=o){if(!s)return;const a=s.offsetHeight;a!==n.current&&(n.current=a,r(a))}return S.useEffect(()=>{const s=o;if(!s)return;l(s);const a=new ResizeObserver(()=>{l(s)});return a.observe(s),()=>{a.disconnect()}},[o]),c.jsx("div",{ref:i,style:{width:"100%"},children:e.children})}u.addPropertyControls(ar,{children:{title:"Content",type:u.ControlType.ComponentInstance}});const cr=S.createContext(null);function ur(){return S.useContext(cr)}const ju=cr,dr=ee(e=>{if(Q())return e.children;const n=ce(),o=ur(),i=(o==null?void 0:o.solution)??null;if(!i)return null;const r=async()=>{!i||!n||await n.applySolution(i)};return fe(e.children,{onClick:r})}),Vu=dr,Du={children:{title:"Content",type:u.ControlType.ComponentInstance}};u.addPropertyControls(dr,Du);const fr=S.createContext(null);function Ou(){return S.useContext(fr)}const ku=fr,pr=V.div`
|
|
351
|
+
`,Yi=ne(Qe(e=>{var g;const t=ie(),n=X(),o=at(e.itemTemplate);if(!o)return d.jsx("span",{children:"Choice Value Template not defined"});const i=(f,x)=>f.map(v=>w.cloneElement(o,{key:v,layoutId:`${t}_${v}`,attributeId:e.attributeId,componentPath:e.componentPath,sharedConfigurationModel:e.sharedConfigurationModel,choiceValueId:v,choiceValueName:x.get(v)??v}));if(n){const f=Math.max(1,Math.floor(e.designTimeItemCount??3)),x=((g=e.designTimeChoiceValueName)==null?void 0:g.trim())||"Choice Value",v=Array.from({length:f},(h,b)=>f===1?x:`${x} ${b+1}`);return d.jsx(yo,{...e,children:i(v,m.RM.empty)})}const r=te(e),l=Y.useChoiceAttribute(r);if(!l)return d.jsx("span",{children:"Choice Attribute not found"});const s=We(r),a=e.filter??new Array,p=[...l.attribute.values.values()].filter(f=>a.length===0||a.some(({selection:x,condition:v})=>k.match({selection:x,condition:v}).with({selection:"included",condition:"blocked"},()=>!f.possibleDecisionStates.includes(u.ChoiceValueDecisionState.Included)).with({selection:"included",condition:"available"},()=>f.possibleDecisionStates.includes(u.ChoiceValueDecisionState.Included)).with({selection:"included",condition:"interactive"},()=>!f.isPossibleDecisionStatesImmutable).with({selection:"included",condition:"implicit"},()=>{var h,b;return((h=f.decision)==null?void 0:h.state)===u.ChoiceValueDecisionState.Included&&((b=f.decision)==null?void 0:b.kind)===u.DecisionKind.Implicit}).with({selection:"included",condition:"explicit"},()=>{var h,b;return((h=f.decision)==null?void 0:h.state)===u.ChoiceValueDecisionState.Included&&((b=f.decision)==null?void 0:b.kind)===u.DecisionKind.Explicit}).with({selection:"included",condition:"none"},()=>{var h;return((h=f.decision)==null?void 0:h.state)===u.ChoiceValueDecisionState.Included}).with({selection:"excluded",condition:"blocked"},()=>!f.possibleDecisionStates.includes(u.ChoiceValueDecisionState.Excluded)).with({selection:"excluded",condition:"available"},()=>f.possibleDecisionStates.includes(u.ChoiceValueDecisionState.Excluded)).with({selection:"excluded",condition:"implicit"},()=>{var h,b;return((h=f.decision)==null?void 0:h.state)===u.ChoiceValueDecisionState.Excluded&&((b=f.decision)==null?void 0:b.kind)===u.DecisionKind.Implicit}).with({selection:"excluded",condition:"explicit"},()=>{var h,b;return((h=f.decision)==null?void 0:h.state)===u.ChoiceValueDecisionState.Excluded&&((b=f.decision)==null?void 0:b.kind)===u.DecisionKind.Explicit}).with({selection:"excluded",condition:"none"},()=>{var h;return((h=f.decision)==null?void 0:h.state)===u.ChoiceValueDecisionState.Excluded}).with({selection:"undefined"},()=>f.decision==null).otherwise(()=>!1))),y=Ge(r,p).map(f=>f.id);return d.jsx(yo,{...e,children:i(y,s)})}));function yo(e){return d.jsxs(d.Fragment,{children:[d.jsx(Re,{singletonId:"ChoiceValueList",children:d.jsx(ru,{})}),d.jsx(Xi,{style:e.style,children:e.children})]})}const Ji=Yi,lu={...re,itemTemplate:{title:"Choice Value Template",type:c.ControlType.ComponentInstance},designTimeItemCount:{title:"Design Time Items",type:c.ControlType.Number,defaultValue:3,min:1,step:1,displayStepper:!0},designTimeChoiceValueName:{title:"Design Time Name",type:c.ControlType.String,defaultValue:"Choice Value"},filter:{title:"Filter",type:c.ControlType.Array,defaultValue:[{selection:"included",condition:"available"},{selection:"included",condition:"interactive"}],control:{type:c.ControlType.Object,controls:{selection:{title:"Selection",type:c.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded"]},condition:{title:"Condition",type:c.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked","available","interactive"]}}}}};c.addPropertyControls(Yi,lu);const{isValidElement:go,cloneElement:bo}=E;function su(e,t){return t?(Array.isArray(t)&&(t=t.map((n,o)=>go(n)&&typeof n.props=="object"?bo(n,{...n.props,key:o}):n)),!e||Array.isArray(e)?t:go(e)?bo(e,{...e.props,children:t}):e):e}const{isValidElement:au}=E;function Zi(e,t,n){function o(r,l){return t.visit(r,n,l)}function i(r,l){return Zi(r,t,l||n)}if(au(e)){if(typeof e.type=="function")return"prototype"in e.type&&e.type.prototype.isReactComponent?e=new e.type(e.props).render():e=e.type(e.props),i(e);if(e.props&&"children"in e.props){const r=e.props.children;return o(e,s=>Array.isArray(r)?r.map(a=>i(a,s)):i(r,s))}}else if(Array.isArray(e)){const r=e;return o(e,s=>r.map(a=>i(a,s)))}return o(e)}const{isValidElement:xo}=E;function cu(e,t){let n;const{replace:o,updateState:i}=t;return"matchElement"in t?n=r=>xo(r)&&r.type===t.matchElement:"matchLiteral"in t?n=r=>!Array.isArray(r)&&!xo(r)&&t.matchLiteral(r):n=t.match,Zi(e,{visit(r,l,s){const a=i?i(l):l,p=s?s(a):void 0,C=su(r,p);return n(C,a)?o(C,a):C}},t.initialState)}function Co(e){return d.jsx(d.Fragment,{children:cu(e.children,e)})}function uu(e){return m.pipe(e,m.Str.replace(/[\s\u2013]/g,"-"),kr)}const du=ne(e=>{const{children:t,mode:n,replaceString:o,propName:i,elementName:r,text:l}=e;return n==="replace"?d.jsx(Co,{match:s=>typeof s=="string",replace:s=>s===o?l:s,children:t}):n==="set-prop"?d.jsx(Co,{match:s=>{var a;return((a=s.type)==null?void 0:a.displayName)===r},replace:s=>w.cloneElement(s,{[uu(i)]:l}),children:t}):t}),Bt=du,Tn=e=>({children:{title:"Content",type:c.ControlType.ComponentInstance},mode:{title:"Mode",type:c.ControlType.Enum,defaultValue:"replace",options:["replace","set-prop"],displaySegmentedControl:!0},replaceString:{title:"Replace Text",type:c.ControlType.String,defaultValue:e,hidden:t=>t.mode!=="replace"},elementName:{title:"Element Name",type:c.ControlType.String,hidden:t=>t.mode!=="set-prop"},propName:{title:"Property Name",type:c.ControlType.String,hidden:t=>t.mode!=="set-prop"}}),er=ne(e=>{const{attributeId:t,children:n,customName:o}=e,i=te(e),r=(o==null?void 0:o.length)>0,l=X(),a=r?o:l?t:(()=>Y.useAttributes([i],!1)[0]?nt(i)??t:"Attribute not found")();return d.jsx(Bt,{...e,text:a})}),fu=er,pu={...re,customName:{title:"Custom Name",type:c.ControlType.String},...Tn("<AttributeName>")};c.addPropertyControls(er,pu);const tr=ne(e=>{const{choiceValueId:t,children:n,customName:o,mode:i,replaceString:r,propName:l,elementName:s}=e,a=te(e),p=o.length>0,C=t.length>0,y=X(),f=p?o:y?t.length>0?t:"Choice Value":(()=>{const x=Y.useChoiceAttribute(a);return x?C?x.attribute.values.get(t)==null?"Choice Value not found":Oo(a,t)??t:"Choice Value Id missing":"Choice Attribute not found"})();return d.jsx(Bt,{...e,text:f})}),hu=tr,mu={...re,...qe,customName:{title:"Custom Name",type:c.ControlType.String},...Tn("<ChoiceValueName>")};c.addPropertyControls(tr,mu);function nr(e){return e.children}const yu={children:{title:"Content",type:c.ControlType.ComponentInstance}};c.addPropertyControls(nr,yu);const or=[1,2,3,4,5],ir=w.createContext(null),rr=ne(e=>{const t=w.useContext(ir);return(t==null?void 0:t.get(e.index))??d.jsxs("span",{children:["No content found for slot ",e.index]})}),gu=rr,bu={index:{title:"Index",type:c.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5]}};c.addPropertyControls(rr,bu);const lr=ne(e=>{const t=w.useMemo(()=>new Map(or.map(n=>[n,e[`content${n}`]])),[e.content1,e.content2,e.content3,e.content4,e.content5]);return d.jsx(ir.Provider,{value:t,children:e.template})}),xu=lr,Cu={template:{title:"Template",type:c.ControlType.ComponentInstance},...Su()};c.addPropertyControls(lr,Cu);function vu(e){return{title:`Content ${e}`,type:c.ControlType.ComponentInstance}}function Su(){return Object.fromEntries(or.map(e=>[`content${e}`,vu(e)]))}function sr(e){const{children:t,fileExtension:n,fileName:o,target:i}=e;if(X())return t;const{storeConfiguration:l}=Y.useConfigurationStoring();return fe(t,{onClick:async()=>{const p={type:"spc-stored-configuration",storedConfiguration:await l()};i==="file"?Tu(p,`${o}.${n}`):i==="clipboard"&&Eu(p)}})}const wu={children:{title:"Content",type:c.ControlType.ComponentInstance},target:{title:"Target",type:c.ControlType.Enum,defaultValue:"file",options:["file","clipboard"],optionTitles:["File","Clipboard"],displaySegmentedControl:!0,segmentedControlDirection:"vertical"},fileName:{title:"File Name",type:c.ControlType.String,defaultValue:"configuration",hidden:e=>e.target!=="file"},fileExtension:{title:"File Extension",type:c.ControlType.String,defaultValue:"json",hidden:e=>e.target!=="file"}};c.addPropertyControls(sr,wu);function Tu(e,t){const n=JSON.stringify(e),o=new Blob([n],{type:"application/json"}),i=window.URL.createObjectURL(o),r=document.createElement("a");r.href=i,r.download=t,document.body.appendChild(r),r.click(),document.body.removeChild(r),window.URL.revokeObjectURL(i)}function Eu(e){const t=JSON.stringify(e);navigator.clipboard.writeText(t).catch(n=>{alert("Failed to copy the configuration to clipboard: "+n)})}var ar=(e=>(e[e.parseError=0]="parseError",e[e.noConfiguration=1]="noConfiguration",e[e.noFileSelected=2]="noFileSelected",e[e.fileReadError=3]="fileReadError",e[e.noClipboardData=4]="noClipboardData",e[e.clipboardReadError=5]="clipboardReadError",e))(ar||{});const cr=ge((e,t)=>{const{children:n,fileExtension:o,source:i}=e;if(X())return n;const l=ie(),{restoreConfiguration:s}=Y.useConfigurationStoring(),{handleExplainAnswer:a}=ye();return fe(n,{onClick:async()=>{const C=m.pipe(await Du(i,o),m.O.toNullable);if(!C)return;const y={type:"DropExistingDecisions",conflictHandling:k.match(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()};try{await s(C,y)}catch(g){const f=g;if(console.debug("Failed to restore stored configuration",f),f.type===u.ConfiguratorErrorType.StoredConfigurationInvalid){alert("The specific configuration is not supported. Maybe the configuration was created with new application version than the current one.");return}if((f==null?void 0:f.type)===u.ConfiguratorErrorType.MakeManyDecisionsConflict&&f.decisionExplanations){e.explain!=="disabled"&&await a(f,e.explain,l);return}alert("Failed to restore your configuration.");return}},ref:t})}),Iu=cr,Au={children:{title:"Content",type:c.ControlType.ComponentInstance},source:{title:"Source",type:c.ControlType.Enum,defaultValue:"file",options:["file","clipboard"],optionTitles:["File","Clipboard"],displaySegmentedControl:!0,segmentedControlDirection:"vertical"},fileExtension:{title:"File Extension",type:c.ControlType.String,defaultValue:"json",hidden:e=>e.source!=="file"},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:c.ControlType.Boolean,defaultValue:!0},...Ke};c.addPropertyControls(cr,Au);function Pu(e){return()=>new Promise(t=>{const n=document.createElement("input");n.type="file",n.accept=`.${e}`,n.onchange=o=>{const i=o.target;if(!i.files||i.files.length===0){t(m.left(2));return}const r=i.files[0],l=new FileReader;l.onload=()=>{t(m.right(l.result))},l.onerror=()=>{t(m.left(3))},l.readAsText(r)},n.oncancel=()=>{t(m.left(2))},n.click()})}function Ru(){return()=>navigator.clipboard.readText().then(e=>e?m.right(e):m.left(4)).catch(()=>m.left(5))}function Du(e,t){return m.pipe(e==="file"?Pu(t):Ru(),m.TE.chainEitherK(n=>m.E.tryCatch(()=>JSON.parse(n),()=>0)),m.TE.filterOrElse(n=>n.type==="spc-stored-configuration",()=>1),m.TE.map(n=>n.storedConfiguration),m.TE.doIfLeft(n=>()=>{console.debug(`Failed to load stored configuration: ${ar[n]}`),n==3?alert("Failed to read the selected file. Maybe it is damaged."):n==1||n==0?e==="file"?alert("The selected file doesn't contain a valid configuration."):e==="clipboard"&&alert("The clipboard doesn't contain a valid configuration."):n==5?alert("Can't read the clipboard. Make to give a permission for reading the clipboard."):n==4&&alert("The clipboard doesn't contain a configuration.")}),m.TO.fromTaskEither)()}const ur=ne(e=>{const{fallback:t}=e,n=te(e),r=X()?"0.0":(()=>{var a;const l=Y.useNumericAttribute(n);if(!l)return"Numeric Attribute not found";const s=(a=l.attribute.decision)==null?void 0:a.state;return s!=null?s.toLocaleString():t})();return d.jsx(Bt,{...e,text:r})}),ju=ur,Vu={...re,fallback:{title:"Unselected Text",type:c.ControlType.String,defaultValue:""},...Tn("<NumericValue>")};c.addPropertyControls(ur,Vu);function dr(e){if(X())return d.jsx("div",{style:{width:"100%"},children:e.children});const n=w.useRef(0),[o,i]=w.useState(null),r=s=>{window.parent.postMessage({type:"spc.configurator.height",height:s},"*")};function l(s=o){if(!s)return;const a=s.offsetHeight;a!==n.current&&(n.current=a,r(a))}return w.useEffect(()=>{const s=o;if(!s)return;l(s);const a=new ResizeObserver(()=>{l(s)});return a.observe(s),()=>{a.disconnect()}},[o]),d.jsx("div",{ref:i,style:{width:"100%"},children:e.children})}c.addPropertyControls(dr,{children:{title:"Content",type:c.ControlType.ComponentInstance}});const fr=w.createContext(null);function pr(){return w.useContext(fr)}const Ou=fr,hr=ne(e=>{if(X())return e.children;const n=ce(),o=pr(),i=(o==null?void 0:o.solution)??null;if(!i)return null;const r=async()=>{!i||!n||await n.applySolution(i)};return fe(e.children,{onClick:r})}),ku=hr,Fu={children:{title:"Content",type:c.ControlType.ComponentInstance}};c.addPropertyControls(hr,Fu);const mr=w.createContext(null);function Mu(){return w.useContext(mr)}const Nu=mr,yr=M.div`
|
|
352
352
|
display: contents;
|
|
353
|
-
`,
|
|
353
|
+
`,Bu=M.createGlobalStyle`
|
|
354
354
|
:root {
|
|
355
|
-
*:has(> ${
|
|
355
|
+
*:has(> ${yr}) {
|
|
356
356
|
display: contents !important;
|
|
357
357
|
}
|
|
358
358
|
}
|
|
359
|
-
`,
|
|
359
|
+
`,gr=ne(Qe(e=>{const t=ie(),n=X(),o=at(e.itemTemplate);if(!o)return d.jsx("span",{children:"Attribute Template not defined"});if(n){const l=Wu();return d.jsx(vo,{style:e.style,children:l.map(s=>d.jsx(zu,{attribute:s,itemTemplate:o,controlId:t},s.key))})}const i=pr();if(!i)return null;const r=un(i,e.intentionFilter);return d.jsx(vo,{style:e.style,children:r.map(l=>d.jsx($u,{attribute:l,itemTemplate:o,controlId:t},l.key))})})),Lu=gr;function vo(e){return d.jsxs(d.Fragment,{children:[d.jsx(Re,{singletonId:"CustomExplainAttributeList",children:d.jsx(Bu,{})}),d.jsx(yr,{style:e.style,children:e.children})]})}function $u(e){const{attribute:t,itemTemplate:n,controlId:o}=e,i=nt(t.attributeId)??t.attributeId.localId,r=We(t.attributeId),{attributeId:l,componentPath:s,sharedConfigurationModel:a}=lt(t.attributeId),p={attributeId:t.attributeId,attributeName:i,decisions:t.decisions,choiceValueNames:r};return d.jsx(Nu.Provider,{value:p,children:w.cloneElement(n,{key:t.key,layoutId:`${o}_${t.key}`,attributeId:l,componentPath:s,sharedConfigurationModel:a,attributeName:i})})}function zu(e){const{attribute:t,itemTemplate:n,controlId:o}=e,{attributeId:i,componentPath:r,sharedConfigurationModel:l}=lt(t.attributeId),s=i;return w.cloneElement(n,{key:t.key,layoutId:`${o}_${t.key}`,attributeId:i,componentPath:r,sharedConfigurationModel:l,attributeName:s})}function Wu(){const e=t=>({localId:t,componentPath:[],sharedConfigurationModelId:null});return m.pipe(["Attribute A","Attribute B","Attribute C"],m.RA.map(t=>{const n=e(t);return{key:t,attributeId:n,decisions:[]}}))}const Ku={itemTemplate:{title:"Attribute Template",type:c.ControlType.ComponentInstance},intentionFilter:{title:"Intention Filter",type:c.ControlType.Enum,defaultValue:"any",options:["any","add","remove"]}};c.addPropertyControls(gr,Ku);const br=M.div`
|
|
360
360
|
display: contents;
|
|
361
|
-
`,
|
|
361
|
+
`,Qu=M.createGlobalStyle`
|
|
362
362
|
:root {
|
|
363
|
-
*:has(> ${
|
|
363
|
+
*:has(> ${br}) {
|
|
364
364
|
display: contents !important;
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
|
-
`,
|
|
367
|
+
`,xr=ne(Qe(e=>{const t=ie(),n=X(),o=Mu(),i=ze(),r=at(e.itemTemplate);if(!r)return d.jsx("span",{children:"Attribute Value Template not defined"});if(n)return d.jsx(So,{style:e.style,children:_u(r,t)});if(!o)return null;const l=Mo(o.attributeId),a=ko(o.decisions,o.choiceValueNames,i).map((p,C)=>{const y=an(p,o.choiceValueNames,i),g=`${t}_${l}_${C}`;return w.cloneElement(r,{key:g,layoutId:g,displayName:y,intention:p.intention})});return d.jsx(So,{style:e.style,children:a})})),qu=xr;function So(e){return d.jsxs(d.Fragment,{children:[d.jsx(Re,{singletonId:"CustomExplainAttributeValueList",children:d.jsx(Qu,{})}),d.jsx(br,{style:e.style,children:e.children})]})}function _u(e,t){return[{displayName:"Value A",intention:"add"},{displayName:"Value B",intention:"remove"},{displayName:"Value C",intention:"remove"}].map((o,i)=>{const r=`${t}_placeholder_${i}`;return w.cloneElement(e,{key:r,layoutId:r,displayName:o.displayName,intention:o.intention})})}const Uu={itemTemplate:{title:"Attribute Value Template",type:c.ControlType.ComponentInstance}};c.addPropertyControls(xr,Uu);const Cr=ne(e=>{var i;if(X())return e.content;const n=ce();if(!n)return null;const o=(i=n.decisionExplanations)==null?void 0:i[0];return d.jsx(Ou.Provider,{value:o,children:d.jsx(Gu,{...e,hasError:n.hasError,hasSolution:!!(o!=null&&o.solution)})})}),Hu=Cr;function Gu(e){const{content:t,failedToExplainContent:n,noExplanationFoundContent:o,noSolutionFoundContent:i,hasError:r,hasSolution:l}=e;return r?w.Children.toArray(n).length>0?n:d.jsx("span",{children:"Failed to explain."}):Xu()?w.Children.toArray(o).length>0?o:d.jsx("span",{children:"No explanation found."}):l?t??null:w.Children.toArray(i).length>0?i:d.jsx("span",{children:"No solution found."})}function Xu(){var e,t;return!((t=(e=ce())==null?void 0:e.decisionExplanations)!=null&&t[0])}const Yu={content:{title:"Content",type:c.ControlType.ComponentInstance},failedToExplainContent:{title:"Content – Failed to Explain",type:c.ControlType.ComponentInstance},noExplanationFoundContent:{title:"Content – No Explanation Found",type:c.ControlType.ComponentInstance},noSolutionFoundContent:{title:"Content – No Solution Found",type:c.ControlType.ComponentInstance}};c.addPropertyControls(Cr,Yu);const vr=M.div`
|
|
368
368
|
display: contents;
|
|
369
|
-
`,
|
|
369
|
+
`,Ju=M.createGlobalStyle`
|
|
370
370
|
:root {
|
|
371
|
-
*:has(> ${
|
|
371
|
+
*:has(> ${vr}) {
|
|
372
372
|
display: contents !important;
|
|
373
373
|
}
|
|
374
374
|
}
|
|
375
|
-
`,
|
|
375
|
+
`,Sr=ne(Qe(e=>{const t=ie(),n=X(),o=at(e.template);if(!o)return d.jsx("span",{children:"Template not defined."});if(n)return e.useInDesignTime&&d.jsx(wo,{children:td(o,t)});const i=ce(),r=(i==null?void 0:i.explainQuestion)??null;if(!r||!nd(r,e.filter))return null;const l=ed(r),s=t;return d.jsx(wo,{children:w.cloneElement(o,{key:s,layoutId:s,...l})})})),Zu=Sr;function wo(e){return d.jsxs(d.Fragment,{children:[d.jsx(Re,{singletonId:"CustomExplainQuestion",children:d.jsx(Ju,{})}),d.jsx(vr,{children:e.children})]})}function ed(e){const t="attributeId"in e?e.attributeId:null,n="choiceValueId"in e?e.choiceValueId:null,o=t?lt(t):null,i=k.match(e).with({subject:u.ExplainQuestionSubject.component,state:u.ComponentDecisionState.Included},()=>"included").with({subject:u.ExplainQuestionSubject.component,state:u.ComponentDecisionState.Excluded},()=>"excluded").with({subject:u.ExplainQuestionSubject.boolean,state:!0},()=>"true").with({subject:u.ExplainQuestionSubject.boolean,state:!1},()=>"false").otherwise(()=>""),r=k.match(e).with({subject:u.ExplainQuestionSubject.numeric},l=>l.state).otherwise(()=>null);return{question:e.question,subject:e.subject,attributeId:(o==null?void 0:o.attributeId)??"",componentPath:(o==null?void 0:o.componentPath)??"",sharedConfigurationModel:(o==null?void 0:o.sharedConfigurationModel)??"",choiceValueId:n??"",value:i,numericValue:r}}function td(e,t){const n=`${t}_placeholder`;return w.cloneElement(e,{key:n,layoutId:n,question:"why-is-state-not-possible",subject:"choice-value",attributeId:"Color",componentPath:"",sharedConfigurationModel:"",choiceValueId:"Red",value:null,numericValue:null})}function nd(e,t){return t==="any"?!0:k.match(t).with("configurationNotSatisfied",()=>k.match(e).with({question:u.ExplainQuestionType.whyIsNotSatisfied,subject:u.ExplainQuestionSubject.configuration},()=>!0).otherwise(()=>!1)).with("attributeNotSatisfied",()=>k.match(e).with({question:u.ExplainQuestionType.whyIsNotSatisfied,subject:u.ExplainQuestionSubject.attribute},()=>!0).otherwise(()=>!1)).with("choiceValueBlocked",()=>k.match(e).with({question:u.ExplainQuestionType.whyIsStateNotPossible,subject:u.ExplainQuestionSubject.choiceValue},()=>!0).otherwise(()=>!1)).with("componentValueBlocked",()=>k.match(e).with({question:u.ExplainQuestionType.whyIsStateNotPossible,subject:u.ExplainQuestionSubject.component},()=>!0).otherwise(()=>!1)).with("booleanValueBlocked",()=>k.match(e).with({question:u.ExplainQuestionType.whyIsStateNotPossible,subject:u.ExplainQuestionSubject.boolean},()=>!0).otherwise(()=>!1)).with("numericValueBlocked",()=>k.match(e).with({question:u.ExplainQuestionType.whyIsStateNotPossible,subject:u.ExplainQuestionSubject.numeric},()=>!0).otherwise(()=>!1)).exhaustive()}const od={template:{title:"Template",type:c.ControlType.ComponentInstance},filter:{title:"Filter",type:c.ControlType.Enum,defaultValue:"any",options:["any","configurationNotSatisfied","attributeNotSatisfied","choiceValueBlocked","componentValueBlocked","booleanValueBlocked","numericValueBlocked"]},useInDesignTime:{title:"Design Time",type:c.ControlType.Boolean,defaultValue:!0}};c.addPropertyControls(Sr,od);exports.AttributeName=fu;exports.BooleanSelect=Oc;exports.ChoiceSelect=jc;exports.ChoiceValueList=Ji;exports.ChoiceValueListRenderer=Ji;exports.ChoiceValueName=hu;exports.Colorize=Jc;exports.ComponentSelect=Fc;exports.Configuration=ic;exports.ConfigurationPropsProvider=oc;exports.CustomExplainApplySolution=ku;exports.CustomExplainAttributeList=Lu;exports.CustomExplainAttributeValueList=qu;exports.CustomExplainPopover=Hu;exports.CustomExplainQuestion=Zu;exports.InitializationRetry=eu;exports.NumericInput=Nc;exports.PopoverClose=Fi;exports.PropagateHeight=dr;exports.ReplaceText=Bt;exports.ResetConfiguration=_c;exports.RestoreConfiguration=Iu;exports.SatisfactionIndicator=Hc;exports.ScrollIntoView=Gi;exports.SelectedNumericValue=ju;exports.SelectionIndicator=Xc;exports.SelectionToggle=$c;exports.SetSelection=Wc;exports.SetSelections=Qc;exports.SetTemplateSlots=xu;exports.Singleton=Re;exports.Slot=nr;exports.StoreConfiguration=sr;exports.TemplateSlot=gu;exports.attributeIdPropertyControls=re;exports.choiceValueIdPropertyControls=qe;exports.cloneChildrenWithProps=fe;exports.explainableComponent=ge;exports.getItemTemplate=at;exports.parseGlobalAttributeId=te;exports.useAttributeName=nt;exports.useChoiceValueName=Oo;exports.useChoiceValueNames=We;exports.useControlId=ie;exports.useDebounceValue=Li;exports.useExplain=ye;exports.useExplainProcess=ce;exports.useRenderPlaceholder=X;exports.useSortedChoiceValues=Ge;exports.withControlId=Qe;exports.withErrorBoundary=ne;exports.withFullSize=nu;
|