@viamedici-spc/configurator-framer 3.0.0 → 3.1.0-alpha13
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/README.md +7 -8
- package/dist/index.cjs +91 -70
- package/dist/index.d.ts +142 -8
- package/dist/index.js +3212 -2767
- 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 c=require("react/jsx-runtime"),u=require("framer"),d=require("@viamedici-spc/configurator-ts"),U=require("@viamedici-spc/configurator-react"),S=require("react"),vr=require("url-join"),O=require("ts-pattern"),V=require("styled-components"),wr=require("react-error-boundary"),dt=require("@fortawesome/free-solid-svg-icons"),ft=require("@fortawesome/react-fontawesome"),h=require("@viamedici-spc/fp-ts-extensions"),vo=require("react-dom"),Sr=require("clsx"),wo=require("merge-props"),Tr=require("dyna-guid"),J=require("zod"),Er=require("zod-validation-error"),Ar=require("mustache"),Ir=require("react-number-format"),Pr=require("use-debounce"),Rr=require("framer-motion"),jr=require("hex-to-css-filter"),Vr=require("rgb-hex"),Dr=require("camelcase");function So(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=So(S),Or=So(vo);function Q(){return u.RenderTarget.current()!==u.RenderTarget.preview}const kr=V.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
|
+
`,Mr=V.h3`
|
|
17
17
|
margin: 0 0 var(--space-xs);
|
|
18
|
-
`,
|
|
18
|
+
`,Fr=V.div`
|
|
19
19
|
white-space: break-spaces;
|
|
20
|
-
`;function
|
|
20
|
+
`;function To(e){return c.jsxs(kr,{className:e.type,children:[c.jsx(Mr,{children:e.title}),c.jsx(Fr,{children:e.message})]})}function Nr(e){var i,r,l;if(Q())return null;const{error:n}=U.useConfigurationInitialization();if(!n)return null;const o=s=>c.jsx(To,{type:"error",title:"Configuration initialization failed",message:s});switch(n.type){case d.ConfiguratorErrorType.ConfigurationModelNotFound:return S.Children.toArray(e.configurationModelNotFoundContent).length>0?e.configurationModelNotFoundContent:o("The Configuration Model was not found for the specified deployment name.");case d.ConfiguratorErrorType.AuthenticationFailure:return S.Children.toArray(e.accessTokenInvalidContent).length>0?e.accessTokenInvalidContent:o("The HCA access token is invalid.");case d.ConfiguratorErrorType.SpecifiedDeploymentForbidden:return S.Children.toArray(e.accessTokenRestrictionContent).length>0?e.accessTokenRestrictionContent:o("The HCA access token does not permit using the specified Configuration Model.");case d.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(" -> "))??""}`,f=`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
|
+
${f}`);case d.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configuration Session parameters are invalid: ${n.detail}`);default:return S.Children.toArray(e.errorContent).length>0?e.errorContent:o("An error occurred while initializing the configuration.")}}function ee(e){return S.forwardRef((t,n)=>c.jsx(wr.ErrorBoundary,{fallbackRender:()=>c.jsx("span",{children:"Component crashed"}),children:c.jsx(e,{...t,ref:n})}))}const Lr=V.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 @@ ${c}`);case h.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
|
+
`,Br=Lr,$r=V.createGlobalStyle`
|
|
44
44
|
:root {
|
|
45
45
|
--space-unit: 1em;
|
|
46
46
|
--space-xxs: calc(0.25 * var(--space-unit));
|
|
@@ -60,14 +60,14 @@ ${c}`);case h.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
|
+
`,zr=$r,Wr=V.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
|
-
`,yr=mr;function Cn(){return f.jsxs(f.Fragment,{children:[f.jsx(yr,{}),f.jsx(gr,{}),f.jsx(pr,{})]})}const He=T.createContext(null);function xe(){const{process:e,switchMode:t,applySolution:n,dismiss:o}=T.useContext(He);return e?{...e,switchMode:t,applySolution:n,dismiss:o}:null}const bo=(e={})=>({padding:{type:d.ControlType.FusedNumber,title:"Padding",toggleKey:"isMixedPadding",toggleTitles:["Padding","Padding per Side"],valueKeys:["paddingTop","paddingRight","paddingBottom","paddingLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:e.padding??0}}),xo=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}),Ht=(e={})=>{var t,n;return{radius:{title:"Radius",type:d.ControlType.Number,defaultValue:e.radius??0},border:{title:"Border",type:d.ControlType.Object,controls:{color:{type:d.ControlType.Color,title:"Color",defaultValue:(t=e.border)==null?void 0:t.color},width:{type:d.ControlType.FusedNumber,title:"Width",toggleKey:"isMixedWidth",toggleTitles:["Width","Width per Side"],valueKeys:["widthTop","widthRight","widthBottom","widthLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:((n=e.border)==null?void 0:n.width)??0}}}}},Co=e=>{var t,n,o,i,r,l,s,a,c,x,g,C,u;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?(c=e.border)==null?void 0:c.widthBottom:(x=e.border)==null?void 0:x.width,borderLeftWidth:(g=e.border)!=null&&g.isMixedWidth?(C=e.border)==null?void 0:C.widthLeft:(u=e.border)==null?void 0:u.width,borderStyle:"solid"}},_e=(e={})=>({fill:{title:"Fill",type:d.ControlType.Color,defaultValue:e.fill},backdropFilter:{title:"Backdrop Filter",type:d.ControlType.String,defaultValue:e.backdropFilter??"none"},shadow:{title:"Shadow",type:d.ControlType.String,defaultValue:e.shadow??"none"},filter:{title:"Filter",type:d.ControlType.String,defaultValue:e.filter??"none"},...bo(e),...Ht(e)}),Be=e=>({...xo(e),...Co(e),backgroundColor:e.fill,backdropFilter:e.backdropFilter,boxShadow:e.shadow,filter:e.filter}),de=(e={})=>{var t,n;return{color:{title:"Color",type:d.ControlType.Color,defaultValue:e.color??"black"},text:{title:"Text",type:d.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}}}},fe=e=>({...e.text,color:e.color}),st=(e={})=>({staticText:{title:"Text",type:d.ControlType.String,defaultValue:e.staticText},...de(e)}),at=e=>fe(e),ct=(e={})=>{var t,n,o;return{fillHover:{title:"Fill – Hover",type:d.ControlType.Color,defaultValue:e.fillHover},focusOutline:{title:"Focus Outline",type:d.ControlType.Object,controls:{color:{title:"Color",type:d.ControlType.Color,defaultValue:(t=e.focusOutline)==null?void 0:t.color},size:{title:"Size",type:d.ControlType.Number,defaultValue:(n=e.focusOutline)==null?void 0:n.size},offset:{title:"Offset",type:d.ControlType.Number,defaultValue:(o=e.focusOutline)==null?void 0:o.offset}}},..._e(e),...st(e)}},vt=e=>({...Be(e),...at(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`}),ut=(e={})=>({margin:{type:d.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}}),wt=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}),br=(e={})=>{var t,n,o,i;return{subject:{title:"Subject",type:d.ControlType.Object,controls:{...de(e.subject??{}),configurationSubjectTitle:{title:"Configuration Subject Title",type:d.ControlType.String,defaultValue:((t=e.subject)==null?void 0:t.configurationSubjectTitle)??"Configuration"},generalConflictTitle:{title:"General Conflict Title",type:d.ControlType.String,defaultValue:((n=e.subject)==null?void 0:n.generalConflictTitle)??"Conflict"}}},suffix:{title:"Suffix",type:d.ControlType.Object,controls:{...de(e.suffix??{}),isBlockedSuffix:{title:"Is Blocked Suffix",type:d.ControlType.String,defaultValue:((o=e.suffix)==null?void 0:o.isBlockedSuffix)??"is blocked"},isNotSatisfiedSuffix:{title:"Is Not Satisfied Suffix",type:d.ControlType.String,defaultValue:((i=e.suffix)==null?void 0:i.isNotSatisfiedSuffix)??"is not satisfied"}}}}},vo=(e={})=>{var t,n,o,i,r,l,s,a,c,x,g,C,u,b,w,y,m,v,P,S;return{header:{title:"Header",type:d.ControlType.Object,controls:{...br(e.header??{})}},attributeName:{title:"Attribute Name",type:d.ControlType.Object,controls:{...de(e.attributeName??{})}},attributeValue:{title:"Attribute Value",type:d.ControlType.Object,controls:{add:{title:"Adding",type:d.ControlType.Object,controls:{...de(((t=e.attributeValue)==null?void 0:t.add)??{}),...Ht(((n=e.attributeValue)==null?void 0:n.add)??{}),fill:{title:"Fill",type:d.ControlType.Color,defaultValue:(i=(o=e.attributeValue)==null?void 0:o.add)==null?void 0:i.fill},iconFill:{title:"Icon Fill",type:d.ControlType.Color,defaultValue:(l=(r=e.attributeValue)==null?void 0:r.add)==null?void 0:l.iconFill},iconColor:{title:"Icon Color",type:d.ControlType.Color,defaultValue:(a=(s=e.attributeValue)==null?void 0:s.add)==null?void 0:a.iconColor}}},remove:{title:"Removing",type:d.ControlType.Object,controls:{...de(((c=e.attributeValue)==null?void 0:c.remove)??{}),...Ht(((x=e.attributeValue)==null?void 0:x.remove)??{}),fill:{title:"Fill",type:d.ControlType.Color,defaultValue:(C=(g=e.attributeValue)==null?void 0:g.remove)==null?void 0:C.fill},iconFill:{title:"Icon Fill",type:d.ControlType.Color,defaultValue:(b=(u=e.attributeValue)==null?void 0:u.remove)==null?void 0:b.iconFill},iconColor:{title:"Icon Color",type:d.ControlType.Color,defaultValue:(y=(w=e.attributeValue)==null?void 0:w.remove)==null?void 0:y.iconColor}}},...bo(e.attributeValue??{}),componentDecisionStateIncludedLabel:{title:"Component Decision State Included Label",type:d.ControlType.String,defaultValue:((m=e.attributeValue)==null?void 0:m.componentDecisionStateIncludedLabel)??"Included"},componentDecisionStateExcludedLabel:{title:"Component Decision State Excluded Label",type:d.ControlType.String,defaultValue:((v=e.attributeValue)==null?void 0:v.componentDecisionStateExcludedLabel)??"Excluded"},booleanDecisionStateTrueLabel:{title:"Boolean Decision State True Label",type:d.ControlType.String,defaultValue:((P=e.attributeValue)==null?void 0:P.booleanDecisionStateTrueLabel)??"Yes"},booleanDecisionStateFalseLabel:{title:"Boolean Decision State False Label",type:d.ControlType.String,defaultValue:((S=e.attributeValue)==null?void 0:S.booleanDecisionStateFalseLabel)??"No"}}},applySolutionButton:{title:"Apply Solution Button",type:d.ControlType.Object,controls:{...ct(e.applySolutionButton??{}),...ut(e.applySolutionButton??{})}},closeButton:{title:"Close Button",type:d.ControlType.Object,controls:{...ct(e.closeButton??{})}},infoMessage:{title:"Info Message",type:d.ControlType.Object,controls:{...de(e.infoMessage??{})}}}},xr={popoverBox:{title:"Popover Box",type:d.ControlType.Object,controls:_e({fill:"#002134",radius:12,padding:18,isMixedPadding:!1,filter:"drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.4))"})},subline:{title:"Subline",type:d.ControlType.Object,controls:{...st({color:"white",staticText:"Solution",text:{fontWeight:"500",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})}},...vo({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:d.ControlType.Object,controls:{...ct({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}}),...ut({marginTop:13})}},showMoreButton:{title:"Show More Button",type:d.ControlType.Object,controls:{...ct({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}}),...ut({marginTop:13})}},listSeparator:{title:"List Separator",type:d.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.3)"}},en=T.createContext(null),St=()=>T.useContext(en),Cr={dialogBox:{title:"Dialog Box",type:d.ControlType.Object,controls:_e({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:d.ControlType.Object,controls:{..._e({fill:"white",shadow:"2px 1px 10px -5px rgba(0, 0, 0, 0.4)",radius:7,padding:12,isMixedPadding:!1}),...ut({marginLeft:-12,marginRight:-12,isMixedMargin:!0})}},constraintExplanation:{title:"Constraint Explanation",type:d.ControlType.Object,controls:{configurationModelId:{title:"Configuration Model Id",type:d.ControlType.Object,controls:de({color:"#171717",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})},ruleId:{title:"Rule Id",type:d.ControlType.Object,controls:de({color:"#171717",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})}}},...vo({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:d.ControlType.Object,controls:{...st({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:d.ControlType.Object,controls:{...st({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:d.ControlType.Color,defaultValue:"rgba(0, 0, 0, 0.3)"}},tn=T.createContext(null),Tt=()=>T.useContext(tn),vr=()=>T.useContext(en)||T.useContext(tn),Ye=vr,wr=k.button`
|
|
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`
|
|
71
71
|
appearance: none;
|
|
72
72
|
cursor: pointer;
|
|
73
73
|
|
|
@@ -79,12 +79,12 @@ ${c}`);case h.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 Ro(e){const{explanation:t,...n}=e,o=ce(),{applySolutionButton:i}=ze();return c.jsx(Gr,{...n,onClick:()=>o.applySolution(t.solution),style:{...At(i),...It(i)},children:i.staticText})}function ln(e,t,n){return O.match(e).returnType().with({type:d.AttributeType.Choice},o=>t.get(o.choiceValueId)??o.choiceValueId).with({type:d.AttributeType.Boolean,state:!0},()=>n.attributeValue.booleanDecisionStateTrueLabel).with({type:d.AttributeType.Boolean,state:!1},()=>n.attributeValue.booleanDecisionStateFalseLabel).with({type:d.AttributeType.Component,state:d.ComponentDecisionState.Included},()=>n.attributeValue.componentDecisionStateIncludedLabel).with({type:d.AttributeType.Component,state:d.ComponentDecisionState.Excluded},()=>n.attributeValue.componentDecisionStateExcludedLabel).with({type:d.AttributeType.Numeric},o=>o.state.toString()).exhaustive()}const Yr=V.div`
|
|
83
83
|
display: flex;
|
|
84
84
|
gap: var(--space-xs);
|
|
85
85
|
align-items: center;
|
|
86
86
|
min-width: 0;
|
|
87
|
-
`,
|
|
87
|
+
`,Xr=V.div`
|
|
88
88
|
display: grid;
|
|
89
89
|
place-content: center;
|
|
90
90
|
border-top-left-radius: 360px;
|
|
@@ -92,74 +92,74 @@ ${c}`);case h.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
92
92
|
height: 1.5em;
|
|
93
93
|
width: 1.5em;
|
|
94
94
|
flex-shrink: 0;
|
|
95
|
-
`,
|
|
95
|
+
`,Jr=V.div`
|
|
96
96
|
white-space: nowrap;
|
|
97
97
|
overflow: hidden;
|
|
98
98
|
text-overflow: ellipsis;
|
|
99
|
-
`;function
|
|
99
|
+
`;function Zr(e){const{decision:t,choiceValuesNames:n}=e,o=t.intention,i=ze(),r=ln(t,n,i),l=O.match(o).with("remove",()=>i.attributeValue.remove).with("add",()=>i.attributeValue.add).exhaustive();return c.jsxs(Yr,{style:{...Ao(i.attributeValue),...he(l),...Io(l),backgroundColor:l.fill},children:[c.jsxs(Xr,{style:{backgroundColor:l.iconFill,color:l.iconColor},children:[o==="remove"&&c.jsx(ft.FontAwesomeIcon,{icon:dt.faMinus}),o==="add"&&c.jsx(ft.FontAwesomeIcon,{icon:dt.faPlus})]}),c.jsx(Jr,{children:r})]})}function Z(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 Rt=S.createContext(null);function et(e){const{attributes:t}=S.useContext(Rt),{activeLocale:n}=u.useLocaleInfo(),o=n.code;return S.useMemo(()=>h.pipe(t,h.RA.findFirst(i=>d.globalAttributeIdEq.equals(Z(i),e)),h.O.map(i=>i.name),h.RA.fromOption,h.RA.flatten,sn(o),h.O.toUndefined),[t,o,e.localId,e.componentPath,e.sharedConfigurationModelId])}function We(e){const{choiceValues:t}=S.useContext(Rt),{activeLocale:n}=u.useLocaleInfo(),o=U.useChoiceAttribute(e);if(!o)return h.RM.empty;const i=S.useMemo(()=>h.pipe(t,h.RA.filter(s=>d.globalAttributeIdEq.equals(Z(s),e))),[t,e.localId,e.componentPath,e.sharedConfigurationModelId]),r=n.code,l=o.attribute.values;return S.useMemo(()=>h.pipe(l,h.RM.mapWithIndex((s,a)=>h.pipe(i,h.RA.findFirst(f=>f.choiceValueId===s),h.O.map(f=>f.name),h.RA.fromOption,h.RA.flatten,sn(r))),h.RM.compact),[l,i,r])}function jo(e,t){const{choiceValues:n}=S.useContext(Rt),{activeLocale:o}=u.useLocaleInfo(),i=o.code;return S.useMemo(()=>h.pipe(n,h.RA.findFirst(r=>d.globalAttributeIdEq.equals(Z(r),e)&&r.choiceValueId===t),h.O.map(r=>r.name),h.RA.fromOption,h.RA.flatten,sn(i),h.O.toUndefined),[n,i,e.localId,e.componentPath,e.sharedConfigurationModelId,t])}function sn(e){return h.flow(h.RA.findFirst(t=>t.localeCode.localeCompare(e,void 0,{sensitivity:"accent"})===0),h.O.map(t=>t.translation))}function Vo(e,t,n){const o=h.pipe(h.Str.Ord,h.Ord.contramap(i=>ln(i,t,n)));return h.pipe(e,h.RA.sort(o))}const el=V.div`
|
|
100
100
|
display: grid;
|
|
101
101
|
grid-template-columns: subgrid;
|
|
102
102
|
grid-column: span 2;
|
|
103
103
|
align-items: center;
|
|
104
|
-
`,
|
|
104
|
+
`,tl=V.div`
|
|
105
105
|
grid-area: name;
|
|
106
106
|
white-space: nowrap;
|
|
107
107
|
overflow: hidden;
|
|
108
108
|
text-overflow: ellipsis;
|
|
109
|
-
`,
|
|
109
|
+
`,nl=V.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 ol(e){const{decisions:t}=e,n=t[0].attributeId,o=We(n),i=et(n),r=ze(),l=Vo(t,o,r);return c.jsxs(el,{children:[c.jsx(tl,{style:he(r.attributeName),children:i??n.localId}),c.jsx(nl,{children:l.map((s,a)=>c.jsx(Zr,{decision:s,choiceValuesNames:o},a))})]})}function Do(e){const{attributes:t,...n}=e;return c.jsx("div",{...n,children:t.map(o=>c.jsx(ol,{decisions:o.decisions},o.key))})}function Oo(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 il=h.pipe(h.Str.Ord,h.Ord.contramap(e=>e.attributeId.localId));function an(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=O.match(t).with("add",()=>a=>a.intention==="add").with("remove",()=>a=>a.intention==="remove").otherwise(()=>h.constTrue);return h.pipe(i,h.RA.filter(r),h.RNEA.groupBy(a=>Oo(a.attributeId)),h.RR.collect(h.Ord.trivial)((a,f)=>({key:a,attributeId:h.RNEA.head(f).attributeId,decisions:f})),h.RA.sort(il))}const rl=V(Do)`
|
|
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 ll(e){const{explanation:t}=e,{explanationCard:n}=Pt(),o=an(t);return c.jsxs("div",{style:{...$e(n),...It(n)},children:[c.jsx(rl,{attributes:o}),c.jsx(Ro,{explanation:t})]})}const sl=V.div`
|
|
120
120
|
ul {
|
|
121
121
|
margin: 0;
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
line-height: 1.5em;
|
|
125
|
-
`,
|
|
125
|
+
`,al=V.ul`
|
|
126
126
|
list-style-type: none;
|
|
127
127
|
margin-inline-start: 0;
|
|
128
128
|
padding-inline-start: 0;
|
|
129
|
-
`,
|
|
129
|
+
`,En=V.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 cl(e){const{explanation:t}=e,{explanationCard:n,constraintExplanation:o}=Pt(),i=t.causedByCardinalities,r=h.pipe(t.causedByRules,h.RNEA.groupBy(l=>l.configurationModelId),h.RR.collect(h.Str.Ord)((l,s)=>({configurationModelId:l,rules:h.pipe(s,h.RA.map(a=>a.localId),h.RA.sort(h.Str.Ord))})));return c.jsx(sl,{style:{...$e(n),...It(n)},children:c.jsxs(al,{children:[r.map(l=>c.jsxs("li",{children:[c.jsx("span",{style:he(o.configurationModelId),children:l.configurationModelId}),c.jsx(En,{style:he(o.ruleId),children:l.rules.map(s=>c.jsx("li",{children:s}))})]})),i.length>0&&c.jsxs("li",{style:he(o.ruleId),children:[c.jsx("span",{children:"Cardinality"}),c.jsx(En,{children:i.map(l=>c.jsx("li",{children:l.localId}))})]})]})})}function ko(e){const{variant:t,...n}=e,{explainQuestion:o}=ce(),{infoMessage:i}=ze(),r=O.match(o).returnType().with({question:d.ExplainQuestionType.whyIsStateNotPossible},()=>"why your selection is not possible").with({question:d.ExplainQuestionType.whyIsNotSatisfied,subject:d.ExplainQuestionSubject.configuration},()=>"why your configuration is not satisfied").with({question:d.ExplainQuestionType.whyIsNotSatisfied,subject:d.ExplainQuestionSubject.attribute},()=>"why your attribute is not satisfied").with(O.P.nullish,()=>"why your selections are not possible").exhaustive(),l=O.match(t).returnType().with("failedToExplain",()=>c.jsxs(c.Fragment,{children:["Failed to explain ",r,".",c.jsx("br",{}),"Please check your internet connection and try again."]})).with("noExplanationFound",()=>c.jsxs(c.Fragment,{children:["There was no explanation found for ",r,"."]})).with("noSolutionFound",()=>c.jsxs(c.Fragment,{children:["There was no solution found for ",r,"."]})).exhaustive();return c.jsx("div",{...n,style:he(i),children:l})}const An=V.div`
|
|
134
134
|
margin-bottom: var(--space-xs);
|
|
135
|
-
`,
|
|
135
|
+
`,In=V.div`
|
|
136
136
|
display: flex;
|
|
137
137
|
flex-direction: column;
|
|
138
138
|
gap: var(--space-xs);
|
|
139
|
-
`,
|
|
139
|
+
`,ul=V.div`
|
|
140
140
|
display: flex;
|
|
141
141
|
flex-direction: column;
|
|
142
142
|
gap: var(--space-md);
|
|
143
|
-
`,
|
|
143
|
+
`,Pn=V(ko)`
|
|
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 Br(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=xe(),{decisionExplanationSolutionsTitle:o,constraintExplanationSolutionsTitle:i}=Tt();return n?f.jsx(Tn,{variant:"failedToExplain"}):e.length===0&&t.length===0?f.jsx(Tn,{variant:"noExplanationFound"}):f.jsxs(Nr,{children:[e.length>0&&f.jsxs("div",{children:[f.jsx(wn,{style:at(o),children:o.staticText}),f.jsx(Sn,{children:e.map(r=>f.jsx(kr,{explanation:r},e.indexOf(r)))})]}),t.length>0&&f.jsxs("div",{children:[f.jsx(wn,{style:at(i),children:i.staticText}),f.jsx(Sn,{children:t.map(r=>f.jsx(Lr,{explanation:r},t.indexOf(r)))})]})]})}function be(e){return Io(e)?(e.nodeName||"").toLowerCase():"#document"}function re(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ce(e){var t;return(t=(Io(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Io(e){return e instanceof Node||e instanceof re(e).Node}function X(e){return e instanceof Element||e instanceof re(e).Element}function ne(e){return e instanceof HTMLElement||e instanceof re(e).HTMLElement}function _t(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof re(e).ShadowRoot}function Xe(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=le(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function $r(e){return["table","td","th"].includes(be(e))}function on(e){const t=rn(),n=le(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 Ro(e){let t=Ae(e);for(;ne(t)&&!ke(t);){if(on(t))return t;t=Ae(t)}return null}function rn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ke(e){return["html","body","#document"].includes(be(e))}function le(e){return re(e).getComputedStyle(e)}function It(e){return X(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ae(e){if(be(e)==="html")return e;const t=e.assignedSlot||e.parentNode||_t(e)&&e.host||Ce(e);return _t(t)?t.host:t}function Po(e){const t=Ae(e);return ke(t)?e.ownerDocument?e.ownerDocument.body:e.body:ne(t)&&Xe(t)?t:Po(t)}function ve(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=Po(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),l=re(i);return r?t.concat(l,l.visualViewport||[],Xe(i)?i:[],l.frameElement&&n?ve(l.frameElement):[]):t.concat(i,ve(i,[],n))}function Oe(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 ie(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&_t(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Oo(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Do(){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 zr(e){return e.mozInputSource===0&&e.isTrusted?!0:Ut()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function Wr(e){return qr()?!1:!Ut()&&e.width===0&&e.height===0||Ut()&&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 Kr(){return/apple/i.test(navigator.vendor)}function Ut(){const e=/android/i;return e.test(Oo())||e.test(Do())}function qr(){return Do().includes("jsdom/")}function En(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function Hr(e){return"nativeEvent"in e}function _r(e){return e.matches("html,body")}function ye(e){return(e==null?void 0:e.ownerDocument)||document}function Dt(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 Ur="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Vo(e){return ne(e)&&e.matches(Ur)}function Vt(e){e.preventDefault(),e.stopPropagation()}function Qr(e){return e?e.getAttribute("role")==="combobox"&&Vo(e):!1}const Me=Math.min,Ee=Math.max,dt=Math.round,tt=Math.floor,we=e=>({x:e,y:e}),Yr={left:"right",right:"left",bottom:"top",top:"bottom"},Gr={start:"end",end:"start"};function Qt(e,t,n){return Ee(e,Me(t,n))}function Je(e,t){return typeof e=="function"?e(t):e}function Ie(e){return e.split("-")[0]}function Ze(e){return e.split("-")[1]}function jo(e){return e==="x"?"y":"x"}function ln(e){return e==="y"?"height":"width"}function Rt(e){return["top","bottom"].includes(Ie(e))?"y":"x"}function sn(e){return jo(Rt(e))}function Xr(e,t,n){n===void 0&&(n=!1);const o=Ze(e),i=sn(e),r=ln(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=ft(l)),[l,ft(l)]}function Jr(e){const t=ft(e);return[Yt(e),t,Yt(t)]}function Yt(e){return e.replace(/start|end/g,t=>Gr[t])}function Zr(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 el(e,t,n,o){const i=Ze(e);let r=Zr(Ie(e),n==="start",o);return i&&(r=r.map(l=>l+"-"+i),t&&(r=r.concat(r.map(Yt)))),r}function ft(e){return e.replace(/left|right|bottom|top/g,t=>Yr[t])}function tl(e){return{top:0,right:0,bottom:0,left:0,...e}}function ko(e){return typeof e!="number"?tl(e):{top:e,right:e,bottom:e,left:e}}function pt(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function An(e,t,n){let{reference:o,floating:i}=e;const r=Rt(t),l=sn(t),s=ln(l),a=Ie(t),c=r==="y",x=o.x+o.width/2-i.width/2,g=o.y+o.height/2-i.height/2,C=o[s]/2-i[s]/2;let u;switch(a){case"top":u={x,y:o.y-i.height};break;case"bottom":u={x,y:o.y+o.height};break;case"right":u={x:o.x+o.width,y:g};break;case"left":u={x:o.x-i.width,y:g};break;default:u={x:o.x,y:o.y}}switch(Ze(t)){case"start":u[l]-=C*(n&&c?-1:1);break;case"end":u[l]+=C*(n&&c?-1:1);break}return u}const nl=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 c=await l.getElementRects({reference:e,floating:t,strategy:i}),{x,y:g}=An(c,o,a),C=o,u={},b=0;for(let w=0;w<s.length;w++){const{name:y,fn:m}=s[w],{x:v,y:P,data:S,reset:I}=await m({x,y:g,initialPlacement:o,placement:C,strategy:i,middlewareData:u,rects:c,platform:l,elements:{reference:e,floating:t}});x=v??x,g=P??g,u={...u,[y]:{...u[y],...S}},I&&b<=50&&(b++,typeof I=="object"&&(I.placement&&(C=I.placement),I.rects&&(c=I.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):I.rects),{x,y:g}=An(c,C,a)),w=-1)}return{x,y:g,placement:C,strategy:i,middlewareData:u}};async function Mo(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:r,rects:l,elements:s,strategy:a}=e,{boundary:c="clippingAncestors",rootBoundary:x="viewport",elementContext:g="floating",altBoundary:C=!1,padding:u=0}=Je(t,e),b=ko(u),y=s[C?g==="floating"?"reference":"floating":g],m=pt(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(y)))==null||n?y:y.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:x,strategy:a})),v=g==="floating"?{...l.floating,x:o,y:i}:l.reference,P=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s.floating)),S=await(r.isElement==null?void 0:r.isElement(P))?await(r.getScale==null?void 0:r.getScale(P))||{x:1,y:1}:{x:1,y:1},I=pt(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:v,offsetParent:P,strategy:a}):v);return{top:(m.top-I.top+b.top)/S.y,bottom:(I.bottom-m.bottom+b.bottom)/S.y,left:(m.left-I.left+b.left)/S.x,right:(I.right-m.right+b.right)/S.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:c,padding:x=0}=Je(e,t)||{};if(c==null)return{};const g=ko(x),C={x:n,y:o},u=sn(i),b=ln(u),w=await l.getDimensions(c),y=u==="y",m=y?"top":"left",v=y?"bottom":"right",P=y?"clientHeight":"clientWidth",S=r.reference[b]+r.reference[u]-C[u]-r.floating[b],I=C[u]-r.reference[u],R=await(l.getOffsetParent==null?void 0:l.getOffsetParent(c));let D=R?R[P]:0;(!D||!await(l.isElement==null?void 0:l.isElement(R)))&&(D=s.floating[P]||r.floating[b]);const O=S/2-I/2,j=D/2-w[b]/2-1,A=Me(g[m],j),F=Me(g[v],j),B=A,W=D-w[b]-F,H=D/2-w[b]/2+O,M=Qt(B,H,W),$=!a.arrow&&Ze(i)!=null&&H!==M&&r.reference[b]/2-(H<B?A:F)-w[b]/2<0,V=$?H<B?H-B:H-W:0;return{[u]:C[u]+V,data:{[u]:M,centerOffset:H-M-V,...$&&{alignmentOffset:V}},reset:$}}}),il=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:c}=t,{mainAxis:x=!0,crossAxis:g=!0,fallbackPlacements:C,fallbackStrategy:u="bestFit",fallbackAxisSideDirection:b="none",flipAlignment:w=!0,...y}=Je(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const m=Ie(i),v=Ie(s)===s,P=await(a.isRTL==null?void 0:a.isRTL(c.floating)),S=C||(v||!w?[ft(s)]:Jr(s));!C&&b!=="none"&&S.push(...el(s,w,b,P));const I=[s,...S],R=await Mo(t,y),D=[];let O=((o=r.flip)==null?void 0:o.overflows)||[];if(x&&D.push(R[m]),g){const B=Xr(i,l,P);D.push(R[B[0]],R[B[1]])}if(O=[...O,{placement:i,overflows:D}],!D.every(B=>B<=0)){var j,A;const B=(((j=r.flip)==null?void 0:j.index)||0)+1,W=I[B];if(W)return{data:{index:B,overflows:O},reset:{placement:W}};let H=(A=O.filter(M=>M.overflows[0]<=0).sort((M,$)=>M.overflows[1]-$.overflows[1])[0])==null?void 0:A.placement;if(!H)switch(u){case"bestFit":{var F;const M=(F=O.map($=>[$.placement,$.overflows.filter(V=>V>0).reduce((V,L)=>V+L,0)]).sort(($,V)=>$[1]-V[1])[0])==null?void 0:F[0];M&&(H=M);break}case"initialPlacement":H=s;break}if(i!==H)return{reset:{placement:H}}}return{}}}};async function rl(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=Ze(n),a=Rt(n)==="y",c=["left","top"].includes(l)?-1:1,x=r&&a?-1:1,g=Je(t,e);let{mainAxis:C,crossAxis:u,alignmentAxis:b}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...g};return s&&typeof b=="number"&&(u=s==="end"?b*-1:b),a?{x:u*x,y:C*c}:{x:C*c,y:u*x}}const ll=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 rl(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}}}}},sl=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:y=>{let{x:m,y:v}=y;return{x:m,y:v}}},...a}=Je(e,t),c={x:n,y:o},x=await Mo(t,a),g=Rt(Ie(i)),C=jo(g);let u=c[C],b=c[g];if(r){const y=C==="y"?"top":"left",m=C==="y"?"bottom":"right",v=u+x[y],P=u-x[m];u=Qt(v,u,P)}if(l){const y=g==="y"?"top":"left",m=g==="y"?"bottom":"right",v=b+x[y],P=b-x[m];b=Qt(v,b,P)}const w=s.fn({...t,[C]:u,[g]:b});return{...w,data:{x:w.x-n,y:w.y-o}}}}};function Fo(e){const t=le(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=ne(e),r=i?e.offsetWidth:n,l=i?e.offsetHeight:o,s=dt(n)!==r||dt(o)!==l;return s&&(n=r,o=l),{width:n,height:o,$:s}}function an(e){return X(e)?e:e.contextElement}function je(e){const t=an(e);if(!ne(t))return we(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=Fo(t);let l=(r?dt(n.width):n.width)/o,s=(r?dt(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const al=we(0);function Lo(e){const t=re(e);return!rn()||!t.visualViewport?al:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function cl(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==re(e)?!1:t}function Re(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=an(e);let l=we(1);t&&(o?X(o)&&(l=je(o)):l=je(e));const s=cl(r,n,o)?Lo(r):we(0);let a=(i.left+s.x)/l.x,c=(i.top+s.y)/l.y,x=i.width/l.x,g=i.height/l.y;if(r){const C=re(r),u=o&&X(o)?re(o):o;let b=C.frameElement;for(;b&&o&&u!==C;){const w=je(b),y=b.getBoundingClientRect(),m=le(b),v=y.left+(b.clientLeft+parseFloat(m.paddingLeft))*w.x,P=y.top+(b.clientTop+parseFloat(m.paddingTop))*w.y;a*=w.x,c*=w.y,x*=w.x,g*=w.y,a+=v,c+=P,b=re(b).frameElement}}return pt({width:x,height:g,x:a,y:c})}const ul=[":popover-open",":modal"];function No(e){let t=!1,n=0,o=0;function i(r){try{t=t||e.matches(r)}catch{}}if(ul.forEach(r=>{i(r)}),t){const r=Ro(e);if(r){const l=r.getBoundingClientRect();n=l.x,o=l.y}}return[t,n,o]}function dl(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=Ce(o),[l]=t?No(t.floating):[!1];if(o===r||l)return n;let s={scrollLeft:0,scrollTop:0},a=we(1);const c=we(0),x=ne(o);if((x||!x&&i!=="fixed")&&((be(o)!=="body"||Xe(r))&&(s=It(o)),ne(o))){const g=Re(o);a=je(o),c.x=g.x+o.clientLeft,c.y=g.y+o.clientTop}return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-s.scrollLeft*a.x+c.x,y:n.y*a.y-s.scrollTop*a.y+c.y}}function fl(e){return Array.from(e.getClientRects())}function Bo(e){return Re(Ce(e)).left+It(e).scrollLeft}function pl(e){const t=Ce(e),n=It(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+Bo(e);const s=-n.scrollTop;return le(o).direction==="rtl"&&(l+=Ee(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:s}}function hl(e,t){const n=re(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 c=rn();(!c||c&&t==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}return{width:r,height:l,x:s,y:a}}function gl(e,t){const n=Re(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=ne(e)?je(e):we(1),l=e.clientWidth*r.x,s=e.clientHeight*r.y,a=i*r.x,c=o*r.y;return{width:l,height:s,x:a,y:c}}function In(e,t,n){let o;if(t==="viewport")o=hl(e,n);else if(t==="document")o=pl(Ce(e));else if(X(t))o=gl(t,n);else{const i=Lo(e);o={...t,x:t.x-i.x,y:t.y-i.y}}return pt(o)}function $o(e,t){const n=Ae(e);return n===t||!X(n)||ke(n)?!1:le(n).position==="fixed"||$o(n,t)}function ml(e,t){const n=t.get(e);if(n)return n;let o=ve(e,[],!1).filter(s=>X(s)&&be(s)!=="body"),i=null;const r=le(e).position==="fixed";let l=r?Ae(e):e;for(;X(l)&&!ke(l);){const s=le(l),a=on(l);!a&&s.position==="fixed"&&(i=null),(r?!a&&!i:!a&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||Xe(l)&&!a&&$o(e,l))?o=o.filter(x=>x!==l):i=s,l=Ae(l)}return t.set(e,o),o}function yl(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const l=[...n==="clippingAncestors"?ml(t,this._c):[].concat(n),o],s=l[0],a=l.reduce((c,x)=>{const g=In(t,x,i);return c.top=Ee(g.top,c.top),c.right=Me(g.right,c.right),c.bottom=Me(g.bottom,c.bottom),c.left=Ee(g.left,c.left),c},In(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function bl(e){const{width:t,height:n}=Fo(e);return{width:t,height:n}}function xl(e,t,n,o){const i=ne(t),r=Ce(t),l=n==="fixed",s=Re(e,!0,l,t);let a={scrollLeft:0,scrollTop:0};const c=we(0);if(i||!i&&!l)if((be(t)!=="body"||Xe(r))&&(a=It(t)),i){const w=Re(t,!0,l,t);c.x=w.x+t.clientLeft,c.y=w.y+t.clientTop}else r&&(c.x=Bo(r));let x=s.left+a.scrollLeft-c.x,g=s.top+a.scrollTop-c.y;const[C,u,b]=No(o);return C&&(x+=u,g+=b,i&&(x+=t.clientLeft,g+=t.clientTop)),{x,y:g,width:s.width,height:s.height}}function Rn(e,t){return!ne(e)||le(e).position==="fixed"?null:t?t(e):e.offsetParent}function zo(e,t){const n=re(e);if(!ne(e))return n;let o=Rn(e,t);for(;o&&$r(o)&&le(o).position==="static";)o=Rn(o,t);return o&&(be(o)==="html"||be(o)==="body"&&le(o).position==="static"&&!on(o))?n:o||Ro(e)||n}const Cl=async function(e){const t=this.getOffsetParent||zo,n=this.getDimensions;return{reference:xl(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}};function vl(e){return le(e).direction==="rtl"}const Wo={convertOffsetParentRelativeRectToViewportRelativeRect:dl,getDocumentElement:Ce,getClippingRect:yl,getOffsetParent:zo,getElementRects:Cl,getClientRects:fl,getDimensions:bl,getScale:je,isElement:X,isRTL:vl};function wl(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:c,top:x,width:g,height:C}=e.getBoundingClientRect();if(s||t(),!g||!C)return;const u=tt(x),b=tt(i.clientWidth-(c+g)),w=tt(i.clientHeight-(x+C)),y=tt(c),v={rootMargin:-u+"px "+-b+"px "+-w+"px "+-y+"px",threshold:Ee(0,Me(1,a))||1};let P=!0;function S(I){const R=I[0].intersectionRatio;if(R!==a){if(!P)return l();R?l(!1,R):o=setTimeout(()=>{l(!1,1e-7)},100)}P=!1}try{n=new IntersectionObserver(S,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(S,v)}n.observe(e)}return l(!0),r}function Sl(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,c=an(e),x=i||r?[...c?ve(c):[],...ve(t)]:[];x.forEach(m=>{i&&m.addEventListener("scroll",n,{passive:!0}),r&&m.addEventListener("resize",n)});const g=c&&s?wl(c,n):null;let C=-1,u=null;l&&(u=new ResizeObserver(m=>{let[v]=m;v&&v.target===c&&u&&(u.unobserve(t),cancelAnimationFrame(C),C=requestAnimationFrame(()=>{var P;(P=u)==null||P.observe(t)})),n()}),c&&!a&&u.observe(c),u.observe(t));let b,w=a?Re(e):null;a&&y();function y(){const m=Re(e);w&&(m.x!==w.x||m.y!==w.y||m.width!==w.width||m.height!==w.height)&&n(),w=m,b=requestAnimationFrame(y)}return n(),()=>{var m;x.forEach(v=>{i&&v.removeEventListener("scroll",n),r&&v.removeEventListener("resize",n)}),g==null||g(),(m=u)==null||m.disconnect(),u=null,a&&cancelAnimationFrame(b)}}const Tl=sl,El=il,Pn=ol,Al=(e,t,n)=>{const o=new Map,i={platform:Wo,...n},r={...i.platform,_c:o};return nl(e,t,{...i,platform:r})},Il=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?Pn({element:o.current,padding:i}).fn(n):{}:o?Pn({element:o,padding:i}).fn(n):{}}}};var it=typeof document<"u"?T.useLayoutEffect:T.useEffect;function ht(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(!ht(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)&&!ht(e[r],t[r]))return!1}return!0}return e!==e&&t!==t}function Ko(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function On(e,t){const n=Ko(e);return Math.round(t*n)/n}function Dn(e){const t=E.useRef(e);return it(()=>{t.current=e}),t}function Rl(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:c}=e,[x,g]=E.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[C,u]=E.useState(o);ht(C,o)||u(o);const[b,w]=E.useState(null),[y,m]=E.useState(null),v=E.useCallback(V=>{V!==R.current&&(R.current=V,w(V))},[]),P=E.useCallback(V=>{V!==D.current&&(D.current=V,m(V))},[]),S=r||b,I=l||y,R=E.useRef(null),D=E.useRef(null),O=E.useRef(x),j=a!=null,A=Dn(a),F=Dn(i),B=E.useCallback(()=>{if(!R.current||!D.current)return;const V={placement:t,strategy:n,middleware:C};F.current&&(V.platform=F.current),Al(R.current,D.current,V).then(L=>{const te={...L,isPositioned:!0};W.current&&!ht(O.current,te)&&(O.current=te,sr.flushSync(()=>{g(te)}))})},[C,t,n,F]);it(()=>{c===!1&&O.current.isPositioned&&(O.current.isPositioned=!1,g(V=>({...V,isPositioned:!1})))},[c]);const W=E.useRef(!1);it(()=>(W.current=!0,()=>{W.current=!1}),[]),it(()=>{if(S&&(R.current=S),I&&(D.current=I),S&&I){if(A.current)return A.current(S,I,B);B()}},[S,I,B,A,j]);const H=E.useMemo(()=>({reference:R,floating:D,setReference:v,setFloating:P}),[v,P]),M=E.useMemo(()=>({reference:S,floating:I}),[S,I]),$=E.useMemo(()=>{const V={position:n,left:0,top:0};if(!M.floating)return V;const L=On(M.floating,x.x),te=On(M.floating,x.y);return s?{...V,transform:"translate("+L+"px, "+te+"px)",...Ko(M.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:L,top:te}},[n,s,M.floating,x.x,x.y]);return E.useMemo(()=>({...x,update:B,refs:H,elements:M,floatingStyles:$}),[x,B,H,M,$])}/*!
|
|
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,$])}/*!
|
|
148
148
|
* tabbable 6.2.0
|
|
149
149
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
150
|
-
*/var Pl=["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])"],Gt=Pl.join(","),qo=typeof Element>"u",Ue=qo?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,gt=!qo&&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},mt=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},Ol=function(t){var n,o=t==null||(n=t.getAttribute)===null||n===void 0?void 0:n.call(t,"contenteditable");return o===""||o==="true"},Dl=function(t,n,o){if(mt(t))return[];var i=Array.prototype.slice.apply(t.querySelectorAll(Gt));return n&&Ue.call(t,Gt)&&i.unshift(t),i=i.filter(o),i},Vl=function e(t,n,o){for(var i=[],r=Array.from(t);r.length;){var l=r.shift();if(!mt(l,!1))if(l.tagName==="SLOT"){var s=l.assignedElements(),a=s.length?s:l.children,c=e(a,!0,o);o.flatten?i.push.apply(i,c):i.push({scopeParent:l,candidates:c})}else{var x=Ue.call(l,Gt);x&&o.filter(l)&&(n||!t.includes(l))&&i.push(l);var g=l.shadowRoot||typeof o.getShadowRoot=="function"&&o.getShadowRoot(l),C=!mt(g,!1)&&(!o.shadowRootFilter||o.shadowRootFilter(l));if(g&&C){var u=e(g===!0?l.children:g.children,!0,o);o.flatten?i.push.apply(i,u):i.push({scopeParent:l,candidates:u})}else r.unshift.apply(r,l.children)}}return i},Ho=function(t){return!isNaN(parseInt(t.getAttribute("tabindex"),10))},_o=function(t){if(!t)throw new Error("No node provided");return t.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(t.tagName)||Ol(t))&&!Ho(t)?0:t.tabIndex},jl=function(t,n){var o=_o(t);return o<0&&n&&!Ho(t)?0:o},kl=function(t,n){return t.tabIndex===n.tabIndex?t.documentOrder-n.documentOrder:t.tabIndex-n.tabIndex},Uo=function(t){return t.tagName==="INPUT"},Ml=function(t){return Uo(t)&&t.type==="hidden"},Fl=function(t){var n=t.tagName==="DETAILS"&&Array.prototype.slice.apply(t.children).some(function(o){return o.tagName==="SUMMARY"});return n},Ll=function(t,n){for(var o=0;o<t.length;o++)if(t[o].checked&&t[o].form===n)return t[o]},Nl=function(t){if(!t.name)return!0;var n=t.form||gt(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=Ll(i,t.form);return!r||r===t},Bl=function(t){return Uo(t)&&t.type==="radio"},$l=function(t){return Bl(t)&&!Nl(t)},zl=function(t){var n,o=t&>(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 c,x,g;o=gt(i),i=(c=o)===null||c===void 0?void 0:c.host,r=!!((x=i)!==null&&x!==void 0&&(g=x.ownerDocument)!==null&&g!==void 0&&g.contains(i))}}return r},Vn=function(t){var n=t.getBoundingClientRect(),o=n.width,i=n.height;return o===0&&i===0},Wl=function(t,n){var o=n.displayCheck,i=n.getShadowRoot;if(getComputedStyle(t).visibility==="hidden")return!0;var r=Ue.call(t,"details>summary:first-of-type"),l=r?t.parentElement:t;if(Ue.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,c=gt(t);if(a&&!a.shadowRoot&&i(a)===!0)return Vn(t);t.assignedSlot?t=t.assignedSlot:!a&&c!==t.ownerDocument?t=c.host:t=a}t=s}if(zl(t))return!t.getClientRects().length;if(o!=="legacy-full")return!0}else if(o==="non-zero-area")return Vn(t);return!1},Kl=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 Ue.call(n,"fieldset[disabled] *")?!0:!i.contains(t)}return!0}n=n.parentElement}return!1},ql=function(t,n){return!(n.disabled||mt(n)||Ml(n)||Wl(n,t)||Fl(n)||Kl(n))},jn=function(t,n){return!($l(n)||_o(n)<0||!ql(t,n))},Hl=function(t){var n=parseInt(t.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},_l=function e(t){var n=[],o=[];return t.forEach(function(i,r){var l=!!i.scopeParent,s=l?i.scopeParent:i,a=jl(s,l),c=l?e(i.candidates):s;a===0?l?n.push.apply(n,c):n.push(s):o.push({documentOrder:r,tabIndex:a,item:i,isScope:l,content:c})}),o.sort(kl).reduce(function(i,r){return r.isScope?i.push.apply(i,r.content):i.push(r.content),i},[]).concat(n)},cn=function(t,n){n=n||{};var o;return n.getShadowRoot?o=Vl([t],n.includeContainer,{filter:jn.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Hl}):o=Dl(t,n.includeContainer,jn.bind(null,n)),_l(o)};function un(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 Ul=E["useInsertionEffect".toString()],Ql=Ul||(e=>e());function Ve(e){const t=E.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Ql(()=>{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 kn=0;function Se(e,t){t===void 0&&(t={});const{preventScroll:n=!1,cancelPrevious:o=!0,sync:i=!1}=t;o&&cancelAnimationFrame(kn);const r=()=>e==null?void 0:e.focus({preventScroll:n});i?r():kn=requestAnimationFrame(r)}var se=typeof document<"u"?T.useLayoutEffect:T.useEffect;function Fe(){return Fe=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},Fe.apply(this,arguments)}let jt=!1,Yl=0;const Mn=()=>"floating-ui-"+Yl++;function Gl(){const[e,t]=E.useState(()=>jt?Mn():void 0);return se(()=>{e==null&&t(Mn())},[]),E.useEffect(()=>{jt||(jt=!0)},[]),e}const Xl=E["useId".toString()],Pt=Xl||Gl,Jl=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:c=0,staticOffset:x,stroke:g,d:C,style:{transform:u,...b}={},...w}=t;process.env.NODE_ENV!=="production"&&(n||console.warn("Floating UI: The `ref` prop is required for the `FloatingArrow`","component."));const y=Pt();if(!i)return null;c*=2;const m=c/2,v=l/2*(a/-8+1),P=s/2*a/4,[S,I]=o.split("-"),R=Wo.isRTL(i),D=!!C,O=S==="top"||S==="bottom",j=x&&I==="end"?"bottom":"top";let A=x&&I==="end"?"right":"left";x&&R&&(A=I==="end"?"left":"right");const F=(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-P))+(" Q"+l/2+","+s+" "+v+","+(s-P))+" Z",H={top:D?"rotate(180deg)":"",left:D?"rotate(90deg)":"rotate(-90deg)",bottom:D?"":"rotate(180deg)",right:D?"rotate(-90deg)":"rotate(90deg)"}[S];return E.createElement("svg",Fe({},w,{"aria-hidden":!0,ref:n,width:D?l:l+c,height:l,viewBox:"0 0 "+l+" "+(s>l?s:l),style:{position:"absolute",pointerEvents:"none",[A]:F,[j]:B,[S]:O||D?"100%":"calc(100% - "+c/2+"px)",transform:""+H+(u??""),...b}}),c>0&&E.createElement("path",{clipPath:"url(#"+y+")",fill:"none",stroke:g,strokeWidth:c+(C?0:1),d:W}),E.createElement("path",{stroke:c&&!C?w.fill:"none",d:W}),E.createElement("clipPath",{id:y},E.createElement("rect",{x:-m,y:m*(D?-1:1),width:l+c,height:l})))});function Zl(){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 es=E.createContext(null),ts=E.createContext(null),ns=()=>{var e;return((e=E.useContext(es))==null?void 0:e.id)||null},dn=()=>E.useContext(ts);function Qe(e){return"data-floating-ui-"+e}function kt(e){const t=T.useRef(e);return se(()=>{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 Ke(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 Pe=new WeakMap,nt=new WeakSet,ot={},Mt=0;const is=()=>typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype,Qo=e=>e&&(e.host||Qo(e.parentNode)),rs=(e,t)=>t.map(n=>{if(e.contains(n))return n;const o=Qo(n);return e.contains(o)?o:null}).filter(n=>n!=null);function ls(e,t,n,o){const i="data-floating-ui-inert",r=o?"inert":n?"aria-hidden":null,l=rs(t,e),s=new Set,a=new Set(l),c=[];ot[i]||(ot[i]=new WeakMap);const x=ot[i];l.forEach(g),C(t),s.clear();function g(u){!u||s.has(u)||(s.add(u),u.parentNode&&g(u.parentNode))}function C(u){!u||a.has(u)||Array.prototype.forEach.call(u.children,b=>{if(s.has(b))C(b);else{const w=r?b.getAttribute(r):null,y=w!==null&&w!=="false",m=(Pe.get(b)||0)+1,v=(x.get(b)||0)+1;Pe.set(b,m),x.set(b,v),c.push(b),m===1&&y&&nt.add(b),v===1&&b.setAttribute(i,""),!y&&r&&b.setAttribute(r,"true")}})}return Mt++,()=>{c.forEach(u=>{const b=(Pe.get(u)||0)-1,w=(x.get(u)||0)-1;Pe.set(u,b),x.set(u,w),b||(!nt.has(u)&&r&&u.removeAttribute(r),nt.delete(u)),w||u.removeAttribute(i)}),Mt--,Mt||(Pe=new WeakMap,Pe=new WeakMap,nt=new WeakSet,ot={})}}function Fn(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=ye(e[0]).body;return ls(e.concat(Array.from(o.querySelectorAll("[aria-live]"))),o,t,n)}const fn=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function Yo(e,t){const n=cn(e,fn());t==="prev"&&n.reverse();const o=n.indexOf(Oe(ye(e)));return n.slice(o+1)[0]}function Go(){return Yo(document.body,"next")}function Xo(){return Yo(document.body,"prev")}function qe(e,t){const n=t||e.currentTarget,o=e.relatedTarget;return!o||!ie(n,o)}function ss(e){cn(e,fn()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function as(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 pn={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 cs;function Ln(e){e.key==="Tab"&&(e.target,clearTimeout(cs))}const yt=E.forwardRef(function(t,n){const[o,i]=E.useState();se(()=>(Kr()&&i("button"),document.addEventListener("keydown",Ln),()=>{document.removeEventListener("keydown",Ln)}),[]);const r={ref:n,tabIndex:0,role:o,"aria-hidden":o?void 0:!0,[Qe("focus-guard")]:"",style:pn};return E.createElement("span",Fe({},t,r))}),Jo=E.createContext(null),Nn=Qe("portal");function us(e){let{id:t,root:n}=e===void 0?{}:e;const[o,i]=E.useState(null),r=Pt(),l=ei(),s=E.useRef(null);return se(()=>()=>{o==null||o.remove(),queueMicrotask(()=>{s.current=null})},[o]),se(()=>{if(s.current)return;const a=t?document.getElementById(t):null;if(!a)return;const c=document.createElement("div");c.id=r,c.setAttribute(Nn,""),a.appendChild(c),s.current=c,i(c)},[t,r]),se(()=>{if(s.current)return;let a=n||(l==null?void 0:l.portalNode);a&&!X(a)&&(a=a.current),a=a||document.body;let c=null;t&&(c=document.createElement("div"),c.id=t,a.appendChild(c));const x=document.createElement("div");x.id=r,x.setAttribute(Nn,""),a=c||a,a.appendChild(x),s.current=x,i(x)},[t,n,r,l]),o}function Zo(e){let{children:t,id:n,root:o=null,preserveTabOrder:i=!0}=e;const r=us({id:n,root:o}),[l,s]=E.useState(null),a=E.useRef(null),c=E.useRef(null),x=E.useRef(null),g=E.useRef(null),C=!!l&&!l.modal&&l.open&&i&&!!(o||r);return E.useEffect(()=>{if(!r||!i||l!=null&&l.modal)return;function u(b){r&&qe(b)&&(b.type==="focusin"?as:ss)(r)}return r.addEventListener("focusin",u,!0),r.addEventListener("focusout",u,!0),()=>{r.removeEventListener("focusin",u,!0),r.removeEventListener("focusout",u,!0)}},[r,i,l==null?void 0:l.modal]),E.createElement(Jo.Provider,{value:E.useMemo(()=>({preserveTabOrder:i,beforeOutsideRef:a,afterOutsideRef:c,beforeInsideRef:x,afterInsideRef:g,portalNode:r,setFocusManagerState:s}),[i,r])},C&&r&&E.createElement(yt,{"data-type":"outside",ref:a,onFocus:u=>{if(qe(u,r)){var b;(b=x.current)==null||b.focus()}else{const w=Xo()||(l==null?void 0:l.refs.domReference.current);w==null||w.focus()}}}),C&&r&&E.createElement("span",{"aria-owns":r.id,style:pn}),r&&ho.createPortal(t,r),C&&r&&E.createElement(yt,{"data-type":"outside",ref:c,onFocus:u=>{if(qe(u,r)){var b;(b=g.current)==null||b.focus()}else{const w=Go()||(l==null?void 0:l.refs.domReference.current);w==null||w.focus(),l!=null&&l.closeOnFocusOut&&(l==null||l.onOpenChange(!1,u.nativeEvent))}}}))}const ei=()=>E.useContext(Jo),Bn=20;let Te=[];function Ft(e){Te=Te.filter(t=>t.isConnected),e&&be(e)!=="body"&&(Te.push(e),Te.length>Bn&&(Te=Te.slice(-Bn)))}function $n(){return Te.slice().reverse().find(e=>e.isConnected)}const ds=E.forwardRef(function(t,n){return E.createElement("button",Fe({},t,{type:"button",ref:n,tabIndex:-1,style:pn}))});function ti(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:c=!1,closeOnFocusOut:x=!0}=e,{open:g,refs:C,nodeId:u,onOpenChange:b,events:w,dataRef:y,elements:{domReference:m,floating:v}}=t,P=typeof l=="number"&&l<0,S=Qr(m)&&P,I=is()?r:!0,R=kt(i),D=kt(l),O=kt(s),j=dn(),A=ei(),F=E.useRef(null),B=E.useRef(null),W=E.useRef(!1),H=E.useRef(!1),M=A!=null,$=E.useCallback(function(q){return q===void 0&&(q=v),q?cn(q,fn()):[]},[v]),V=E.useCallback(q=>{const K=$(q);return R.current.map(z=>m&&z==="reference"?m:v&&z==="floating"?v:K).filter(Boolean).flat()},[m,v,R,$]);E.useEffect(()=>{if(o||!a)return;function q(z){if(z.key==="Tab"){ie(v,Oe(ye(v)))&&$().length===0&&!S&&Vt(z);const _=V(),Q=De(z);R.current[0]==="reference"&&Q===m&&(Vt(z),z.shiftKey?Se(_[_.length-1]):Se(_[1])),R.current[1]==="floating"&&Q===v&&z.shiftKey&&(Vt(z),Se(_[0]))}}const K=ye(v);return K.addEventListener("keydown",q),()=>{K.removeEventListener("keydown",q)}},[o,m,v,a,R,S,$,V]),E.useEffect(()=>{if(o||!x)return;function q(){H.current=!0,setTimeout(()=>{H.current=!1})}function K(z){const _=z.relatedTarget;queueMicrotask(()=>{const Q=!(ie(m,_)||ie(v,_)||ie(_,v)||ie(A==null?void 0:A.portalNode,_)||_!=null&&_.hasAttribute(Qe("focus-guard"))||j&&(Ke(j.nodesRef.current,u).find(Y=>{var ee,ue;return ie((ee=Y.context)==null?void 0:ee.elements.floating,_)||ie((ue=Y.context)==null?void 0:ue.elements.domReference,_)})||os(j.nodesRef.current,u).find(Y=>{var ee,ue;return((ee=Y.context)==null?void 0:ee.elements.floating)===_||((ue=Y.context)==null?void 0:ue.elements.domReference)===_})));_&&Q&&!H.current&&_!==$n()&&(W.current=!0,b(!1,z))})}if(v&&ne(m))return m.addEventListener("focusout",K),m.addEventListener("pointerdown",q),!a&&v.addEventListener("focusout",K),()=>{m.removeEventListener("focusout",K),m.removeEventListener("pointerdown",q),!a&&v.removeEventListener("focusout",K)}},[o,m,v,a,u,j,A,b,x]),E.useEffect(()=>{var q;if(o)return;const K=Array.from((A==null||(q=A.portalNode)==null?void 0:q.querySelectorAll("["+Qe("portal")+"]"))||[]);if(v){const z=[v,...K,F.current,B.current,R.current.includes("reference")||S?m:null].filter(Q=>Q!=null),_=a||S?Fn(z,I,!I):Fn(z);return()=>{_()}}},[o,m,v,a,R,A,S,I]),se(()=>{if(o||!v)return;const q=ye(v),K=Oe(q);queueMicrotask(()=>{const z=V(v),_=D.current,Q=(typeof _=="number"?z[_]:_.current)||v,Y=ie(v,K);!P&&!Y&&g&&Se(Q,{preventScroll:Q===v})})},[o,g,v,P,V,D]),se(()=>{if(o||!v)return;let q=!1;const K=ye(v),z=Oe(K),_=y.current;Ft(z);function Q(Y){let{reason:ee,event:ue,nested:We}=Y;ee==="escape-key"&&C.domReference.current&&Ft(C.domReference.current),ee==="hover"&&ue.type==="mouseleave"&&(W.current=!0),ee==="outside-press"&&(We?(W.current=!1,q=!0):W.current=!(zr(ue)||Wr(ue)))}return w.on("openchange",Q),()=>{w.off("openchange",Q);const Y=Oe(K),ee=ie(v,Y)||j&&Ke(j.nodesRef.current,u).some(Qi=>{var xn;return ie((xn=Qi.context)==null?void 0:xn.elements.floating,Y)});(ee||_.openEvent&&["click","mousedown"].includes(_.openEvent.type))&&C.domReference.current&&Ft(C.domReference.current);const We=$n();O.current&&!W.current&&ne(We)&&(!(We!==Y&&Y!==K.body)||ee)&&Se(We,{cancelPrevious:!1,preventScroll:q})}},[o,v,O,y,C,w,j,u]),se(()=>{if(!(o||!A))return A.setFocusManagerState({modal:a,closeOnFocusOut:x,open:g,onOpenChange:b,refs:C}),()=>{A.setFocusManagerState(null)}},[o,A,a,g,b,C,x]),se(()=>{if(o||!v||typeof MutationObserver!="function"||P)return;const q=()=>{const z=v.getAttribute("tabindex");R.current.includes("floating")||Oe(ye(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,R,$,P]);function L(q){return o||!c||!a?null:E.createElement(ds,{ref:q==="start"?F:B,onClick:K=>b(!1,K.nativeEvent)},typeof c=="string"?c:"Dismiss")}const te=!o&&I&&(M||a);return E.createElement(E.Fragment,null,te&&E.createElement(yt,{"data-type":"inside",ref:A==null?void 0:A.beforeInsideRef,onFocus:q=>{if(a){const z=V();Se(i[0]==="reference"?z[0]:z[z.length-1])}else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(W.current=!1,qe(q,A.portalNode)){const z=Go()||m;z==null||z.focus()}else{var K;(K=A.beforeOutsideRef.current)==null||K.focus()}}}),!S&&L("start"),n,L("end"),te&&E.createElement(yt,{"data-type":"inside",ref:A==null?void 0:A.afterInsideRef,onFocus:q=>{if(a)Se(V()[0]);else if(A!=null&&A.preserveTabOrder&&A.portalNode)if(x&&(W.current=!0),qe(q,A.portalNode)){const z=Xo()||m;z==null||z.focus()}else{var K;(K=A.afterOutsideRef.current)==null||K.focus()}}}))}const Lt=new Set,ni=E.forwardRef(function(t,n){let{lockScroll:o=!1,...i}=t;const r=Pt();return se(()=>{if(!o)return;Lt.add(r);const l=/iP(hone|ad|od)|iOS/.test(Oo()),s=document.body.style,c=Math.round(document.documentElement.getBoundingClientRect().left)+document.documentElement.scrollLeft?"paddingLeft":"paddingRight",x=window.innerWidth-document.documentElement.clientWidth,g=s.left?parseFloat(s.left):window.pageXOffset,C=s.top?parseFloat(s.top):window.pageYOffset;if(s.overflow="hidden",x&&(s[c]=x+"px"),l){var u,b;const w=((u=window.visualViewport)==null?void 0:u.offsetLeft)||0,y=((b=window.visualViewport)==null?void 0:b.offsetTop)||0;Object.assign(s,{position:"fixed",top:-(C-Math.floor(y))+"px",left:-(g-Math.floor(w))+"px",right:"0"})}return()=>{Lt.delete(r),Lt.size===0&&(Object.assign(s,{overflow:"",[c]:""}),l&&(Object.assign(s,{position:"",top:"",left:"",right:""}),window.scrollTo(g,C)))}},[r,o]),E.createElement("div",Fe({ref:n},i,{style:{position:"fixed",overflow:"auto",top:0,right:0,bottom:0,left:0,...i.style}}))});function zn(e){return ne(e.target)&&e.target.tagName==="BUTTON"}function Wn(e){return Vo(e)}function oi(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:c=!1,keyboardHandlers:x=!0}=t,g=E.useRef(),C=E.useRef(!1);return E.useMemo(()=>l?{reference:{onPointerDown(u){g.current=u.pointerType},onMouseDown(u){u.button===0&&(En(g.current,!0)&&c||s!=="click"&&(n&&a&&(!i.current.openEvent||i.current.openEvent.type==="mousedown")?o(!1,u.nativeEvent,"click"):(u.preventDefault(),o(!0,u.nativeEvent,"click"))))},onClick(u){if(s==="mousedown"&&g.current){g.current=void 0;return}En(g.current,!0)&&c||(n&&a&&(!i.current.openEvent||i.current.openEvent.type==="click")?o(!1,u.nativeEvent,"click"):o(!0,u.nativeEvent,"click"))},onKeyDown(u){g.current=void 0,!(u.defaultPrevented||!x||zn(u))&&(u.key===" "&&!Wn(r)&&(u.preventDefault(),C.current=!0),u.key==="Enter"&&o(!(n&&a),u.nativeEvent,"click"))},onKeyUp(u){u.defaultPrevented||!x||zn(u)||Wn(r)||u.key===" "&&C.current&&(C.current=!1,o(!(n&&a),u.nativeEvent,"click"))}}}:{},[l,i,s,c,x,r,a,n,o])}const fs={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},ps={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Kn=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 ii(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,nodeId:i,elements:{reference:r,domReference:l,floating:s},dataRef:a}=e,{enabled:c=!0,escapeKey:x=!0,outsidePress:g=!0,outsidePressEvent:C="pointerdown",referencePress:u=!1,referencePressEvent:b="pointerdown",ancestorScroll:w=!1,bubbles:y,capture:m}=t,v=dn(),P=Ve(typeof g=="function"?g:()=>!1),S=typeof g=="function"?P:g,I=E.useRef(!1),R=E.useRef(!1),{escapeKey:D,outsidePress:O}=Kn(y),{escapeKey:j,outsidePress:A}=Kn(m),F=Ve(M=>{if(!n||!c||!x||M.key!=="Escape")return;const $=v?Ke(v.nodesRef.current,i):[];if(!D&&(M.stopPropagation(),$.length>0)){let V=!0;if($.forEach(L=>{var te;if((te=L.context)!=null&&te.open&&!L.context.dataRef.current.__escapeKeyBubbles){V=!1;return}}),!V)return}o(!1,Hr(M)?M.nativeEvent:M,"escape-key")}),B=Ve(M=>{var $;const V=()=>{var L;F(M),(L=De(M))==null||L.removeEventListener("keydown",V)};($=De(M))==null||$.addEventListener("keydown",V)}),W=Ve(M=>{const $=I.current;I.current=!1;const V=R.current;if(R.current=!1,C==="click"&&V||$||typeof S=="function"&&!S(M))return;const L=De(M),te="["+Qe("inert")+"]",q=ye(s).querySelectorAll(te);let K=X(L)?L:null;for(;K&&!ke(K);){const Q=Ae(K);if(ke(Q)||!X(Q))break;K=Q}if(q.length&&X(L)&&!_r(L)&&!ie(L,s)&&Array.from(q).every(Q=>!ie(K,Q)))return;if(ne(L)&&s){const Q=L.clientWidth>0&&L.scrollWidth>L.clientWidth,Y=L.clientHeight>0&&L.scrollHeight>L.clientHeight;let ee=Y&&M.offsetX>L.clientWidth;if(Y&&le(L).direction==="rtl"&&(ee=M.offsetX<=L.offsetWidth-L.clientWidth),ee||Q&&M.offsetY>L.clientHeight)return}const z=v&&Ke(v.nodesRef.current,i).some(Q=>{var Y;return Dt(M,(Y=Q.context)==null?void 0:Y.elements.floating)});if(Dt(M,s)||Dt(M,l)||z)return;const _=v?Ke(v.nodesRef.current,i):[];if(_.length>0){let Q=!0;if(_.forEach(Y=>{var ee;if((ee=Y.context)!=null&&ee.open&&!Y.context.dataRef.current.__outsidePressBubbles){Q=!1;return}}),!Q)return}o(!1,M,"outside-press")}),H=Ve(M=>{var $;const V=()=>{var L;W(M),(L=De(M))==null||L.removeEventListener(C,V)};($=De(M))==null||$.addEventListener(C,V)});return E.useEffect(()=>{if(!n||!c)return;a.current.__escapeKeyBubbles=D,a.current.__outsidePressBubbles=O;function M(L){o(!1,L,"ancestor-scroll")}const $=ye(s);x&&$.addEventListener("keydown",j?B:F,j),S&&$.addEventListener(C,A?H:W,A);let V=[];return w&&(X(l)&&(V=ve(l)),X(s)&&(V=V.concat(ve(s))),!X(r)&&r&&r.contextElement&&(V=V.concat(ve(r.contextElement)))),V=V.filter(L=>{var te;return L!==((te=$.defaultView)==null?void 0:te.visualViewport)}),V.forEach(L=>{L.addEventListener("scroll",M,{passive:!0})}),()=>{x&&$.removeEventListener("keydown",j?B:F,j),S&&$.removeEventListener(C,A?H:W,A),V.forEach(L=>{L.removeEventListener("scroll",M)})}},[a,s,l,r,x,S,C,n,o,w,c,D,O,F,j,B,W,A,H]),E.useEffect(()=>{I.current=!1},[S,C]),E.useMemo(()=>c?{reference:{onKeyDown:F,[fs[b]]:M=>{u&&o(!1,M.nativeEvent,"reference-press")}},floating:{onKeyDown:F,onMouseDown(){R.current=!0},onMouseUp(){R.current=!0},[ps[C]]:()=>{I.current=!0}}}:{},[c,u,C,b,o,F])}let Xt;process.env.NODE_ENV!=="production"&&(Xt=new Set);function ri(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&&!X(e.elements.reference)){var l;if(!((l=Xt)!=null&&l.has(O))){var s;(s=Xt)==null||s.add(O),console.error(O)}}}const[a,c]=E.useState(null),x=((t=e.elements)==null?void 0:t.reference)||a,g=Rl(e),C=dn(),u=ns()!=null,b=Ve((O,j,A)=>{O&&(y.current.openEvent=j),m.emit("openchange",{open:O,event:j,reason:A,nested:u}),o==null||o(O,j,A)}),w=E.useRef(null),y=E.useRef({}),m=E.useState(()=>Zl())[0],v=Pt(),P=E.useCallback(O=>{const j=X(O)?{getBoundingClientRect:()=>O.getBoundingClientRect(),contextElement:O}:O;g.refs.setReference(j)},[g.refs]),S=E.useCallback(O=>{(X(O)||O===null)&&(w.current=O,c(O)),(X(g.refs.reference.current)||g.refs.reference.current===null||O!==null&&!X(O))&&g.refs.setReference(O)},[g.refs]),I=E.useMemo(()=>({...g.refs,setReference:S,setPositionReference:P,domReference:w}),[g.refs,S,P]),R=E.useMemo(()=>({...g.elements,domReference:x}),[g.elements,x]),D=E.useMemo(()=>({...g,refs:I,elements:R,dataRef:y,nodeId:i,floatingId:v,events:m,open:n,onOpenChange:b}),[g,i,v,m,n,b,I,R]);return se(()=>{const O=C==null?void 0:C.nodesRef.current.find(j=>j.id===i);O&&(O.context=D)}),E.useMemo(()=>({...g,context:D,refs:I,elements:R}),[g,I,R,D])}const qn="active",Hn="selected";function Nt(e,t,n){const o=new Map,i=n==="item";let r=e;if(i&&e){const{[qn]:l,[Hn]: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[c,x]=a;if(!(i&&[qn,Hn].includes(c)))if(c.indexOf("on")===0){if(o.has(c)||o.set(c,[]),typeof x=="function"){var g;(g=o.get(c))==null||g.push(x),l[c]=function(){for(var C,u=arguments.length,b=new Array(u),w=0;w<u;w++)b[w]=arguments[w];return(C=o.get(c))==null?void 0:C.map(y=>y(...b)).find(y=>y!==void 0)}}}else l[c]=x}),l),{})}}function li(e){e===void 0&&(e=[]);const t=e,n=E.useCallback(r=>Nt(r,e,"reference"),t),o=E.useCallback(r=>Nt(r,e,"floating"),t),i=E.useCallback(r=>Nt(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 hs(e={}){const{initialOpen:t=!1,open:n,onOpenChange:o}=e,[i,r]=E.useState(t),l=n??i,s=o??r,a=ri({open:l,onOpenChange:s}),c=a.context,x=oi(c,{enabled:n==null}),g=ii(c,{outsidePressEvent:"mousedown"}),C=li([x,g]);return E.useMemo(()=>({open:l,setOpen:s,...C,...a}),[l,s,C,a])}const si=E.createContext(null),ai=()=>{const e=E.useContext(si);if(e==null)throw new Error("Dialog components must be wrapped in <Dialog />");return e};function gs({children:e,...t}){const n=hs(t);return f.jsx(si.Provider,{value:n,children:e})}const ci=k.css`
|
|
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`
|
|
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
|
+
`,Ws=V(ui)`
|
|
157
|
+
${yi};
|
|
158
|
+
`,Ks=S.forwardRef((e,t)=>{const{style:n,children:o,components:i,...r}=e,l=gi(),s=mn([l.refs.setFloating,t]),a=(i==null?void 0:i.Overlay)??Ws;return c.jsx(si,{children:c.jsx(a,{lockScroll:!0,children:c.jsx(ci,{context:l.context,children:c.jsx("div",{ref:s,...l.getFloatingProps(r),children:o})})})})}),qs=Ks;function bi(e){const t=S.useContext(Ge),[n,o]=S.useState(t);return c.jsx(Ge.Provider,{value:n,children:e.children})}const _s=S.forwardRef((e,t)=>{const{setOpen:n}=gi();return c.jsx("button",{type:"button",ref:t,...e,onClick:o=>{var i;(i=e.onClick)==null||i.call(e,o),n(!1)}})}),Hs=_s,Qs=V.span`
|
|
159
159
|
overflow: hidden;
|
|
160
160
|
white-space: nowrap;
|
|
161
161
|
text-overflow: ellipsis;
|
|
162
|
-
`;function
|
|
162
|
+
`;function xi(e){const{explainQuestion:t}=ce(),{header:n,attributeValue:o}=ze();if(!t)return c.jsx("div",{...e,children:n.subject.generalConflictTitle});const i=O.match(t).returnType().with({subject:d.ExplainQuestionSubject.configuration},()=>n.subject.configurationSubjectTitle).with({subject:d.ExplainQuestionSubject.attribute},l=>et(l.attributeId)??l.attributeId.localId).with({subject:d.ExplainQuestionSubject.choiceValue},l=>We(l.attributeId).get(l.choiceValueId)??l.choiceValueId).with({subject:d.ExplainQuestionSubject.component,state:d.ComponentDecisionState.Included},()=>o.componentDecisionStateIncludedLabel).with({subject:d.ExplainQuestionSubject.component,state:d.ComponentDecisionState.Excluded},()=>o.componentDecisionStateExcludedLabel).with({subject:d.ExplainQuestionSubject.boolean,state:!0},()=>o.booleanDecisionStateTrueLabel).with({subject:d.ExplainQuestionSubject.boolean,state:!1},()=>o.booleanDecisionStateFalseLabel).with({subject:d.ExplainQuestionSubject.numeric},l=>l.state.toString()).exhaustive(),r=O.match(t).returnType().with({question:d.ExplainQuestionType.whyIsStateNotPossible},()=>n.suffix.isBlockedSuffix).with({question:d.ExplainQuestionType.whyIsNotSatisfied},()=>n.suffix.isNotSatisfiedSuffix).exhaustive();return c.jsxs("div",{...e,style:he(n.suffix),children:[c.jsx(Qs,{style:he(n.subject),children:i})," ",r]})}const Us=V.div`
|
|
163
163
|
position: sticky;
|
|
164
164
|
top: 0;
|
|
165
165
|
transition: all 0.1s;
|
|
@@ -173,7 +173,7 @@ ${c}`);case h.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 Gs(e){const[t,n]=S.useState(!1),o=S.useRef(null);return S.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)}},[]),c.jsxs(c.Fragment,{children:[c.jsx("div",{ref:o}),c.jsx(Us,{...wo(e,{className:Sr(t&&"active")})})]})}const Ys=V(u.motion.div)`
|
|
177
177
|
position: relative;
|
|
178
178
|
outline-offset: -1px;
|
|
179
179
|
display: grid;
|
|
@@ -185,16 +185,16 @@ ${c}`);case h.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
|
+
`,Xs=V.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
|
+
`,Js=V(Gs)`
|
|
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
|
+
`,Zs=V(Hs)`
|
|
198
198
|
position: absolute;
|
|
199
199
|
right: var(--space-sm-fixed);
|
|
200
200
|
top: var(--space-sm-fixed);
|
|
@@ -208,7 +208,7 @@ ${c}`);case h.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
|
+
`,ea=V(xi)`
|
|
212
212
|
grid-area: header;
|
|
213
213
|
margin-bottom: var(--space-xs);
|
|
214
214
|
overflow: hidden;
|
|
@@ -218,7 +218,7 @@ ${c}`);case h.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
|
+
`,ta={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 na(e){const{dialogBox:t,closeButton:n}=Pt(),o={...t,padding:0,isMixedPadding:!1};return c.jsxs(Ys,{style:$e(o),variants:ta,initial:"initial",animate:"open",exit:"close",children:[c.jsx(ea,{}),c.jsxs(Xs,{children:[c.jsx(Js,{}),e.children]}),c.jsx(Zs,{style:At(n),children:c.jsx(ft.FontAwesomeIcon,{icon:dt.faXmark})})]})}const oa=V(qs)`
|
|
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 @@ ${c}`);case h.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()))),
|
|
233
|
+
`;function ia(e){const t=ce(),n=(t==null?void 0:t.displayMode)==="dialog";return c.jsx(zs,{open:n,onOpenChange:o=>!o&&n&&(t==null?void 0:t.dismiss()),children:c.jsx(ra,{...e,isOpen:n,children:S.Children.toArray(e.content)[0]??c.jsx(na,{children:c.jsx(dl,{})})})})}function ra(e){return c.jsx(u.AnimatePresence,{initial:!1,children:e.isOpen&&c.jsx(rn.Provider,{value:e,children:c.jsx(oa,{...e,components:{Overlay:sa},children:c.jsx(bi,{children:e.children})})})})}const la=V(u.motion(ui))`
|
|
234
|
+
${yi}
|
|
235
|
+
`;function sa(e){return c.jsx(la,{...e,initial:{backgroundColor:"rgba(0,0,0,0)"},animate:{backgroundColor:"rgba(0,0,0,0.1)"},exit:{backgroundColor:"rgba(0,0,0,0)"}})}function aa(e){const[t,n]=S.useState(null),{explain:o,applySolution:i}=U.useExplain(),r=S.useRef(null),l=S.useCallback(async(p,b,w,g)=>{const y=Tr.guid();r.current=y,n(null);try{const v=await p(),R=v,T=v,A=(R==null?void 0:R.decisionExplanations)??[],P=(T==null?void 0:T.constraintExplanations)??[];y==r.current&&n({controlId:g,displayMode:A.length===0&&P.length>0?"dialog":w,explainQuestion:b,hasError:!1,decisionExplanations:ca(A),constraintExplanations:P})}catch{y==r.current&&n({controlId:g,displayMode:w,explainQuestion:b,hasError:!0,decisionExplanations:null,constraintExplanations:null})}},[]),s=S.useCallback((p,b,w)=>{const g=typeof p=="function"?p(d.explainQuestionBuilder):p;return l(()=>e.explainConstraints?o(g,"full"):o(g,"decisions"),g,b,w)},[e.explainConstraints,o,l]),a=S.useCallback((p,b,w)=>l(()=>Promise.resolve(p),null,b,w),[l]),f=S.useCallback(()=>{n(null)},[]),x=S.useCallback(p=>(f(),i(p)),[i,f]),m=S.useCallback(p=>{n(b=>b!=null?{...b,displayMode:p}:b)},[]),C=S.useMemo(()=>({process:t,applySolution:x,explain:s,handleExplainAnswer:a,dismiss:f,switchMode:m}),[t,x,s,a,f,m]);return c.jsx(Ge.Provider,{value:C,children:e.children})}function ca(e){const t=h.pipe(h.Bool.Ord,h.Ord.contramap(o=>o.solution==null)),n=h.pipe(h.Num.Ord,h.Ord.contramap(o=>o.causedByDecisions.length));return h.pipe(e,h.RA.sortBy([t,n]))}const Le=new Map;function Re(e){const{singletonId:t,children:n}=e,[o,i]=S.useState(!1),r=S.useRef({chose:()=>i(!0)});return S.useEffect(()=>(ua(t,r.current),()=>da(t,r.current)),[]),o?c.jsx(c.Fragment,{children:n}):null}function ua(e,t){pa(e).candidates.add(t),Ci(e)}function da(e,t){let n=Le.get(e);n!=null&&(n.candidates.delete(t),n.chosen===t&&(n.chosen=null),fa(e),Ci(e))}function Ci(e){let t=Le.get(e);if(t==null||t.chosen!=null)return;const n=t.candidates.values().next().value;n!=null&&(t.chosen=n,n.chose())}function fa(e){let t=Le.get(e);t==null||t.candidates.size>0||Le.delete(e)}function pa(e){let t=Le.get(e);return t==null&&(t={chosen:null,candidates:new Set},Le.set(e,t)),t}const re={attributeId:{title:"Attribute Id",type:u.ControlType.String},componentPath:{title:"Component Path",type:u.ControlType.String},sharedConfigurationModel:{title:"Shared Configuration Model",type:u.ControlType.String}},Yn={description:{title:"Description",type:u.ControlType.String},regex:{title:"Regex",type:u.ControlType.String},direction:{title:"Direction",type:u.ControlType.Enum,defaultValue:"asc",options:["asc","desc"],displaySegmentedControl:!0},mode:{title:"Mode",type:u.ControlType.Enum,defaultValue:"isMatch",options:["isMatch","string","numeric"]}},ha={choiceValueSorting:{title:"Choice Value Sorting",type:u.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{defaultRules:{title:"Default Rules",type:u.ControlType.Array,control:{type:u.ControlType.Object,controls:Yn}},attributes:{title:"Attribute",type:u.ControlType.Array,control:{type:u.ControlType.Object,controls:{...re,choiceValues:{title:"Choice Values",type:u.ControlType.Array,control:{type:u.ControlType.String}},rules:{title:"Rules",type:u.ControlType.Array,control:{type:u.ControlType.Object,controls:Yn}}}}},jsonDefinition:{title:"Definition – JSON",type:u.ControlType.String,displayTextArea:!0}}}};function ma(e,t){const n=[],o=(r,l)=>{const s=n.find(f=>e.equals(f.first,r)&&e.equals(f.second,l));if(s)return s.ordering;const a=t.compare(r,l);return n.push({first:r,second:l,ordering:a}),a},i=h.Ord.fromCompare(o);return{cachedOrderings:n,...i}}function ga(){const e=[];return{getCache:(t,n)=>{const o=e.find(r=>r.eq===t&&r.ord===n);if(o)return o.ordCache;const i=ma(t,n);return e.push({eq:t,ord:n,ordCache:i}),i}}}const vi=h.Ord.getMonoid(),ya=new Intl.Collator("en",{sensitivity:"base"}),ba=new Intl.Collator("en",{sensitivity:"variant"}),xa={regex:".*",direction:"asc",mode:"string"},Ca=h.pipe([ya,ba],h.RA.map(Pa),h.MO.concatAll(h.Ord.getMonoid())),va=h.pipe(h.Bool.Ord,h.Ord.contramap(e=>h.O.isSome(e))),wa=h.Num.Ord;function Sa(e,t){return h.pipe((t==null?void 0:t.attributes)??[],h.RA.findFirst(n=>d.globalAttributeIdEq.equals(Z(n),e)),h.O.map(n=>[Ta(n.choiceValues??[]),Xn(n.rules??[])]),h.O.getOrElse(()=>[Xn((t==null?void 0:t.defaultRules)??[])]),h.RA.append(wi(xa)),h.MO.concatAll(vi))}function Ta(e){return h.pipe(h.Num.Ord,h.Ord.reverse,h.O.getOrd,h.Ord.reverse,h.Ord.contramap(t=>h.pipe(e,h.RA.findIndex(n=>h.Str.Eq.equals(t,n)))))}function Xn(e){return h.pipe(e,h.RA.map(wi),h.MO.concatAll(vi))}function wi(e){const t=h.O.tryCatch(()=>new RegExp(e.regex)),n=O.match(e.mode).returnType().with("string",()=>Ea(e.direction)).with("numeric",()=>Aa(e.direction)).with("isMatch",()=>Ia(e.direction)).exhaustive();return h.pipe(n,h.Ord.contramap(o=>h.pipe(t,h.O.chainNullableK(i=>(i.lastIndex=0,i[Symbol.match](o))),h.O.chain(i=>h.pipe(i,h.RA.lookup(1),h.O.alt(()=>h.pipe(i,h.RA.lookup(0))))))))}function Ea(e){return h.pipe(Ca,xn(e),Si)}function Aa(e){return h.pipe(wa,xn(e),Si,h.Ord.contramap(h.O.chain(h.Num.parseFloatO)))}function Ia(e){return h.pipe(va,xn(e))}function Si(e){return h.pipe(e,h.Ord.reverse,h.O.getOrd,h.Ord.reverse)}function xn(e){return t=>O.match(e).returnType().with("asc",()=>t).with("desc",()=>h.Ord.reverse(t)).exhaustive()}function Pa(e){return h.Ord.fromCompare((t,n)=>O.match(e.compare(t,n)).returnType().with(O.P.number.gt(0),()=>1).with(O.P.number.lt(0),()=>-1).otherwise(()=>0))}const Ra=ga(),Ti=S.createContext(null);function Tt(e,t){const n=S.useContext(Ti),o=S.useMemo(()=>h.pipe(Sa(e,n),r=>Ra.getCache(h.Str.Eq,r),h.Ord.contramap(r=>r.id)),[]),{attribute:i}=U.useChoiceAttribute(e);return h.pipe(t??(i==null?void 0:i.values)??[],h.RA.sort(o))}const ja={localization:{title:"Localization",type:u.ControlType.Object,defaultValue:null,buttonTitle:"Definition…",controls:{jsonDefinition:{title:"Definition – JSON",type:u.ControlType.String,displayTextArea:!0}}}};globalThis&&globalThis.__spreadArray;function Va(e){return e}globalThis&&globalThis.__spreadArray;var Da=function(e){return{_tag:"Left",left:e}},Oa=function(e){return{_tag:"Right",right:e}},ka=Da,Ma=Oa,Fa=function(e,t){try{return Ma(e())}catch(n){return ka(t(n))}},Na=function(e){return Fa(function(){return JSON.parse(e)},Va)};const Et=J.z.object({localId:J.z.string(),componentPath:J.z.string().array().optional().nullish(),sharedConfigurationModelId:J.z.string().optional().nullish()});function it(e){var t;return{sharedConfigurationModel:e.sharedConfigurationModelId??"",componentPath:((t=e.componentPath)==null?void 0:t.join(" -> "))??"",attributeId:e.localId}}function Cn(e,t,n){return o=>S.useMemo(()=>h.pipe(o,h.O.fromNullable,h.O.filter(h.P.not(h.Str.isEmpty)),h.E.fromOption(()=>null),h.E.chain(h.flow(Na,h.E.mapLeft(i=>`The JSON content could not be parsed. Please check for syntax errors.
|
|
236
|
+
`+i.toString()),h.E.chain(i=>h.pipe(t.safeParse(i),r=>r.success?h.E.right(r.data):h.E.left(r.error),h.E.mapLeft(r=>Er.fromError(r,{maxIssuesInMessage:5,issueSeparator:`
|
|
237
|
+
- `})),h.E.mapLeft(r=>`The JSON schema is invalid. Ensure all required fields and types are correctly defined.
|
|
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`
|
|
239
239
|
appearance: none;
|
|
240
240
|
border: none;
|
|
241
241
|
text-decoration: underline;
|
|
@@ -250,9 +250,9 @@ ${c}`);case h.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 lc(){const{decisionExplanations:e,switchMode:t}=ce(),{showMoreButton:n,showConstraintsButton:o}=Ze(),i=e.length-1,r=S.useMemo(()=>i>0&&Ar.render(n.staticText,{amount:i}),[n.text,i]),l=i>0?n:o;return c.jsx(rc,{onClick:()=>t("dialog"),style:{...At(l),...It(l)},children:r||l.staticText})}const sc=V.div`
|
|
254
254
|
margin-bottom: var(--space-xs);
|
|
255
|
-
`,
|
|
255
|
+
`,eo=V.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 @@ ${c}`);case h.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
261
261
|
@media only screen and (min-resolution: 2dppx) {
|
|
262
262
|
height: 0.5px;
|
|
263
263
|
}
|
|
264
|
-
`,
|
|
264
|
+
`,ac=V.div`
|
|
265
265
|
display: flex;
|
|
266
266
|
flex-direction: column;
|
|
267
267
|
container: explain-actions / inline-size;
|
|
268
|
-
`,
|
|
268
|
+
`,cc=V(Do)`
|
|
269
269
|
display: grid;
|
|
270
270
|
grid-template-columns: [name] minmax(100px, auto) [values] minmax(100px, 1fr);
|
|
271
271
|
gap: var(--space-sm);
|
|
@@ -275,22 +275,28 @@ ${c}`);case h.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
|
+
`,uc=V(Ro)`
|
|
279
279
|
align-self: stretch;
|
|
280
280
|
|
|
281
281
|
@container explain-actions (min-width: 300px) {
|
|
282
282
|
align-self: center;
|
|
283
283
|
}
|
|
284
|
-
`,
|
|
284
|
+
`,Wt=V(ko)`
|
|
285
285
|
width: min-content;
|
|
286
286
|
min-width: 300px;
|
|
287
|
-
`;function
|
|
287
|
+
`;function dc(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=ce(),{subline:o}=Ze();if(n)return c.jsx(Wt,{variant:"failedToExplain"});const i=e[0];if(!i)return c.jsx(Wt,{variant:"noExplanationFound"});if(!i.solution)return c.jsx(Wt,{variant:"noSolutionFound"});const r=an(i);return c.jsxs(c.Fragment,{children:[c.jsx(sc,{style:ht(o),children:o.staticText}),c.jsx(eo,{}),c.jsx(cc,{attributes:r}),c.jsx(eo,{}),c.jsxs(ac,{children:[c.jsx(uc,{explanation:i}),(e.length>1||t.length>0)&&c.jsx(lc,{})]})]})}const ji=S.createContext(null),ie=()=>S.useContext(ji);function qe(e){return S.forwardRef((t,n)=>{const o=S.useId();return c.jsx(ji.Provider,{value:o,children:c.jsx(e,{...t,ref:n})})})}const fc=S.forwardRef((e,t)=>{const{style:n,children:o,...i}=e,r=rt(),l=mn([r.refs.setFloating,t]),s=hc();return c.jsx(si,{root:s,children:c.jsx(ci,{context:r.context,modal:r.modal,children:c.jsx("div",{ref:l,style:{...r.floatingStyles,...n},...r.getFloatingProps(i),children:o})})})}),pc=fc;function hc(){return typeof document>"u"?null:document.querySelector("[data-framer-root]")}const Vi=S.forwardRef((e,t)=>{const n=Q(),{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 c.jsx("button",{type:"button",ref:t,...l,style:a,children:r});const{setOpen:f}=rt();return c.jsx("button",{type:"button",ref:t,...l,style:a,onClick:x=>{var m;(m=e.onClick)==null||m.call(e,x),f(!1)},children:r})}),Di=Vi,mc={children:{title:"Content",type:u.ControlType.ComponentInstance},appearance:{title:"Appearance",type:u.ControlType.Enum,defaultValue:"auto",displaySegmentedControl:!0,segmentedControlDirection:"horizontal",options:["auto","none"]}};u.addPropertyControls(Vi,mc);const gc=V.div`
|
|
288
|
+
--size-explain-popover-box-padding-top: ${e=>e.popoverBox.isMixedPadding?e.popoverBox.paddingTop:e.popoverBox.padding}px;
|
|
289
|
+
--size-explain-popover-box-padding-right: ${e=>e.popoverBox.isMixedPadding?e.popoverBox.paddingRight:e.popoverBox.padding}px;
|
|
290
|
+
--size-explain-popover-box-padding-bottom: ${e=>e.popoverBox.isMixedPadding?e.popoverBox.paddingBottom:e.popoverBox.padding}px;
|
|
291
|
+
--size-explain-popover-box-padding-left: ${e=>e.popoverBox.isMixedPadding?e.popoverBox.paddingLeft:e.popoverBox.padding}px;
|
|
292
|
+
--color-explain-popover-list-separator: ${e=>e.listSeparator};
|
|
293
|
+
|
|
288
294
|
position: relative;
|
|
289
295
|
outline-offset: -1px;
|
|
290
296
|
border-style: solid;
|
|
291
297
|
min-width: 300px;
|
|
292
298
|
max-width: 500px;
|
|
293
|
-
`,
|
|
299
|
+
`,yc=V(Di)`
|
|
294
300
|
position: absolute;
|
|
295
301
|
right: var(--space-sm-fixed);
|
|
296
302
|
top: var(--space-sm-fixed);
|
|
@@ -304,51 +310,66 @@ ${c}`);case h.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configura
|
|
|
304
310
|
outline: var(--size-button-focus-outline) solid var(--color-button-focus-outline);
|
|
305
311
|
outline-offset: var(--size-button-focus-outline-offset);
|
|
306
312
|
}
|
|
307
|
-
`,
|
|
313
|
+
`,bc=V(xi)`
|
|
308
314
|
margin-bottom: var(--space-xs);
|
|
309
315
|
overflow: hidden;
|
|
310
316
|
display: flex;
|
|
311
317
|
white-space: nowrap;
|
|
312
318
|
text-overflow: ellipsis;
|
|
313
319
|
margin-right: var(--space-md);
|
|
314
|
-
`;function
|
|
315
|
-
--color-explain-popover-box-fill: ${e=>e.popoverBox.fill};
|
|
316
|
-
--size-explain-popover-box-padding-top: ${e=>e.popoverBox.isMixedPadding?e.popoverBox.paddingTop:e.popoverBox.padding}px;
|
|
317
|
-
--size-explain-popover-box-padding-right: ${e=>e.popoverBox.isMixedPadding?e.popoverBox.paddingRight:e.popoverBox.padding}px;
|
|
318
|
-
--size-explain-popover-box-padding-bottom: ${e=>e.popoverBox.isMixedPadding?e.popoverBox.paddingBottom:e.popoverBox.padding}px;
|
|
319
|
-
--size-explain-popover-box-padding-left: ${e=>e.popoverBox.isMixedPadding?e.popoverBox.paddingLeft:e.popoverBox.padding}px;
|
|
320
|
-
--color-explain-popover-list-separator: ${e=>e.listSeparator};
|
|
321
|
-
|
|
320
|
+
`;function xc(e){const t=Ze(),{popoverBox:n,closeButton:o}=t;return c.jsxs(gc,{...t,style:$e(n),children:[c.jsx(bc,{}),e.children,c.jsx(yc,{style:At(o),children:c.jsx(ft.FontAwesomeIcon,{icon:dt.faXmark})})]})}const Cc=V(pc)`
|
|
322
321
|
z-index: 10;
|
|
323
322
|
|
|
324
323
|
&:focus {
|
|
325
324
|
outline: none;
|
|
326
325
|
}
|
|
327
|
-
`,
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
Please check your internet connection and try again.`)}function Za(){alert(`Failed to reset your configuration.
|
|
331
|
-
Please check your internet connection and try again.`)}const Xn=k.select`
|
|
326
|
+
`,vc={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 wc(e){const t=ce(),n=Ze(),{useCustomExplain:o,customPopover:i}=n,r=ie(),l=(t==null?void 0:t.displayMode)==="popover"&&(t==null?void 0:t.controlId)===r,s=S.useRef(null);return c.jsxs(nc,{open:l,onOpenChange:a=>!a&&l&&(t==null?void 0:t.dismiss()),arrow:{width:20,height:10,padding:10,element:s},children:[c.jsx(ic,{children:e.children}),c.jsxs(Sc,{isOpen:l,children:[o&&i,!o&&c.jsx(xc,{children:c.jsx(dc,{})}),c.jsx(Tc,{})]})]})}function Sc(e){var m,C;const{middlewareData:t,arrow:n,placement:o}=rt(),i=((m=t.arrow)==null?void 0:m.x)??0,r=((C=t.arrow)==null?void 0:C.y)??0,l=(n==null?void 0:n.height)??0,s=(n==null?void 0:n.width)??0,a=i+s/2,f=r+l,x=O.match(o).with("top",()=>`${a}px calc(100% + ${l+5}px)`).with("bottom",()=>`${a}px ${-l-5}px`).with("left",()=>`calc(100% + ${l}px) ${f}px`).with("right",()=>`${-l}px ${f}px`).otherwise(()=>"");return c.jsx(u.AnimatePresence,{initial:!1,children:e.isOpen&&c.jsx(Cc,{children:c.jsx(u.motion.div,{variants:vc,initial:"initial",animate:"open",exit:"close",style:{transformOrigin:x},children:c.jsx(bi,{children:e.children})})})})}function Tc(){const{context:e,arrow:t}=rt(),n=Ze();return c.jsx(Ts,{style:Hr(n),ref:t.element,context:e,width:t.width,height:t.height})}function Ec(e){return S.forwardRef((t,n)=>{const o=Q();return t.explain!=="popover"||o?c.jsx(e,{...t}):c.jsx(wc,{children:c.jsx(e,{...t,ref:n})})})}function ye(e){return ee(qe(Ec(S.forwardRef(e))))}function me(){alert(`Failed to apply your selection.
|
|
327
|
+
Please check your internet connection and try again.`)}function Ac(){alert(`Failed to reset your configuration.
|
|
328
|
+
Please check your internet connection and try again.`)}const to=V.select`
|
|
332
329
|
color: inherit;
|
|
333
330
|
cursor: inherit;
|
|
334
|
-
`,
|
|
331
|
+
`,no="<reset>",oo="<nothing>",Oi=ye((e,t)=>{if(Q()){const I=Be(e,!0,!1);return c.jsx(to,{style:I})}const o=ie(),i=Z(e),r=U.useChoiceAttribute(i);if(!r)return c.jsx("span",{children:"Choice Attribute not found"});const{explain:l}=ge(),s=We(i),{attribute:a,makeDecision:f,clearDecisions:x,isMultiSelect:m,getIncludedChoiceValues:C,getBlockedChoiceValues:p,getAllowedChoiceValues:b}=r,w=Tt(i,b()),g=Tt(i,p()),y=C(),v=y.map(I=>I.id),R=v[0]??oo,T=y.some(I=>{var N;return((N=I.decision)==null?void 0:N.kind)===d.DecisionKind.Explicit}),A=v.length>=1,P=y.some(I=>{var N;return((N=I.decision)==null?void 0:N.kind)===d.DecisionKind.Implicit}),D=w.length===0,j=async I=>{const N=e.explain,B=N!=="disabled"&&(()=>l(W=>W.whyIsStateNotPossible.choice(a.id).choiceValue(I).state(d.ChoiceValueDecisionState.Included),N,o));if(I===no)try{await x()}catch{me()}else if(w.some(W=>W.id===I)){const W=v.some(_=>_===I)?void 0:d.ChoiceValueDecisionState.Included;try{await f(I,W)}catch(_){if(_.type===d.ConfiguratorErrorType.ConflictWithConsequence&&B){await B();return}me()}}else g.some(W=>W.id===I)&&B&&await B()},F=Rc(e,a.isSatisfied,P,D);return c.jsxs(to,{ref:t,value:m()?v:R,multiple:m(),onChange:I=>j(I.currentTarget.value),style:F,children:[!A&&!m()&&c.jsx("option",{value:oo}),T&&c.jsx("option",{value:no,children:e.resetLabel}),w.map(I=>{var N;return c.jsxs("option",{value:I.id,children:[((N=I.decision)==null?void 0:N.kind)===d.DecisionKind.Implicit?e.implicitLabelPrefix:"",s.get(I.id)??I.id]},I.id)}),g.length>0&&c.jsx("optgroup",{label:e.blockedLabel,children:g.map(I=>c.jsx("option",{value:I.id,children:s.get(I.id)??I.id},I.id))})]})}),Ic=Oi,Pc={...vn,noOptionsAvailableColors:{...tn,title:"No Options Available Colors"}};u.addPropertyControls(Oi,Pc);const Rc=(e,t,n,o)=>{var r,l,s;const i=Be(e,t,n);return{...i,backgroundColor:O.match({noOptionsAvailable:o,noOptionsAvailableFill:(r=e.noOptionsAvailableColors)==null?void 0:r.fill}).with({noOptionsAvailable:!0,noOptionsAvailableFill:O.P.string.minLength(1)},a=>a.noOptionsAvailableFill).otherwise(()=>i.backgroundColor),borderColor:O.match({noOptionsAvailable:o,noOptionsAvailableBorderColor:(l=e.noOptionsAvailableColors)==null?void 0:l.borderColor}).with({noOptionsAvailable:!0,noOptionsAvailableBorderColor:O.P.string.minLength(1)},a=>a.noOptionsAvailableBorderColor).otherwise(()=>i.borderColor),color:O.match({noOptionsAvailable:o,noOptionsAvailableColor:(s=e.noOptionsAvailableColors)==null?void 0:s.color}).with({noOptionsAvailable:!0,noOptionsAvailableColor:O.P.string.minLength(1)},a=>a.noOptionsAvailableColor).otherwise(()=>i.color)}},io=V.select`
|
|
335
332
|
color: inherit;
|
|
336
333
|
cursor: inherit;
|
|
337
|
-
`,
|
|
334
|
+
`,ro="<reset>",Kt="<nothing>",qt="yes",lo="no",ki=ye((e,t)=>{var v,R,T;if(Q()){const A=Be(e,!0,!1);return c.jsx(io,{style:A})}const o=ie(),i=Z(e),r=U.useBooleanAttribute(i),{explain:l}=ge();if(!r)return c.jsx("span",{children:"Boolean Attribute not found"});const{attribute:s,makeDecision:a}=r,f=async A=>{var D;const P=((D=s.decision)==null?void 0:D.kind)===d.DecisionKind.Explicit;if(A===ro&&P)try{await a(void 0)}catch{me()}else{const j=A===qt,F=s.possibleDecisionStates.includes(j),I=e.explain,N=I!=="disabled"&&(()=>l(B=>B.whyIsStateNotPossible.boolean(s.id).state(j),I,o));if(F)try{await a(j)}catch(B){if(B.type===d.ConfiguratorErrorType.ConflictWithConsequence&&N){await N();return}me()}else N&&await N()}},x=O.match((v=s.decision)==null?void 0:v.state).with(!0,()=>qt).with(!1,()=>lo).otherwise(()=>Kt),m=((R=s.decision)==null?void 0:R.kind)===d.DecisionKind.Explicit,C=((T=s.decision)==null?void 0:T.kind)===d.DecisionKind.Implicit,p=Be(e,s.isSatisfied,C),b=s.possibleDecisionStates.includes(!0),w=s.possibleDecisionStates.includes(!1),g=c.jsxs("option",{value:qt,children:[so(s,!0,e.implicitLabelPrefix),e.trueLabel]}),y=c.jsxs("option",{value:lo,children:[so(s,!1,e.implicitLabelPrefix),e.falseLabel]});return c.jsxs(io,{ref:t,value:x,onChange:A=>f(A.currentTarget.value),style:p,children:[x===Kt&&c.jsx("option",{value:Kt}),m&&c.jsx("option",{value:ro,children:e.resetLabel}),b&&g,w&&y,(!b||!w)&&c.jsxs("optgroup",{label:e.blockedLabel,children:[!b&&g,!w&&y]})]})}),jc=ki,so=(e,t,n)=>{var o,i;return((o=e.decision)==null?void 0:o.kind)===d.DecisionKind.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},Vc={...vn,trueLabel:{title:"True Label",type:u.ControlType.String,defaultValue:"Yes"},falseLabel:{title:"False Label",type:u.ControlType.String,defaultValue:"No"}};u.addPropertyControls(ki,Vc);const ao=V.select`
|
|
338
335
|
color: inherit;
|
|
339
336
|
cursor: inherit;
|
|
340
|
-
`,
|
|
337
|
+
`,co="<reset>",_t="<nothing>",Ht="included",Qt="excluded",Mi=ye((e,t)=>{var R,T,A;if(Q()){const P=Be(e,!0,!1);return c.jsx(ao,{style:P})}const o=ie(),i=Z(e),r=U.useComponentAttribute(i),{explain:l}=ge();if(!r)return c.jsx("span",{children:"Component Attribute not found"});const{attribute:s,makeDecision:a}=r,f=async P=>{const D=s.possibleDecisionStates.includes(P),j=e.explain,F=j!=="disabled"&&(()=>l(I=>I.whyIsStateNotPossible.component(s.id).state(P),j,o));if(D)try{await a(P)}catch(I){if(I.type===d.ConfiguratorErrorType.ConflictWithConsequence&&F){await F();return}me()}else F&&await F()},x=async P=>{var j;const D=((j=s.decision)==null?void 0:j.kind)===d.DecisionKind.Explicit;P===co&&D?await a(void 0):P===Ht?await f(d.ComponentDecisionState.Included):P===Qt&&await f(d.ComponentDecisionState.Excluded)},m=O.match((R=s.decision)==null?void 0:R.state).with(d.ComponentDecisionState.Included,()=>Ht).with(d.ComponentDecisionState.Excluded,()=>Qt).otherwise(()=>_t),C=((T=s.decision)==null?void 0:T.kind)===d.DecisionKind.Explicit,p=((A=s.decision)==null?void 0:A.kind)===d.DecisionKind.Implicit,b=Be(e,s.isSatisfied,p),w=s.possibleDecisionStates.includes(d.ComponentDecisionState.Included),g=s.possibleDecisionStates.includes(d.ComponentDecisionState.Excluded),y=c.jsxs("option",{value:Ht,children:[uo(s,d.ComponentDecisionState.Included,e.implicitLabelPrefix),e.includedLabel]}),v=c.jsxs("option",{value:Qt,children:[uo(s,d.ComponentDecisionState.Excluded,e.implicitLabelPrefix),e.excludedLabel]});return c.jsxs(ao,{ref:t,value:m,onChange:P=>x(P.currentTarget.value),style:b,children:[m===_t&&c.jsx("option",{value:_t}),C&&c.jsx("option",{value:co,children:e.resetLabel}),w&&y,g&&v,(!w||!g)&&c.jsxs("optgroup",{label:e.blockedLabel,children:[!w&&y,!g&&v]})]})}),Dc=Mi,uo=(e,t,n)=>{var o,i;return((o=e.decision)==null?void 0:o.kind)===d.DecisionKind.Implicit&&((i=e.decision)==null?void 0:i.state)===t?n:""},Oc={...vn,includedLabel:{title:"Included Label",type:u.ControlType.String,defaultValue:"Included"},excludedLabel:{title:"Excluded Label",type:u.ControlType.String,defaultValue:"Excluded"}};u.addPropertyControls(Mi,Oc);function Fi(e,t,n,o,i=1e3){const[r]=Rr.useForceUpdate(),l=Pr.useDebouncedCallback(C=>{t(C),r()},i),s=S.useRef(n),a=S.useRef(e),f=l.isPending(),x=S.useRef(f);S.useEffect(()=>{e!==a.current&&(a.current=e,f&&(l.cancel(),r()),e!==n&&o(e)),n!==s.current&&(s.current=n,n!==e?(l(n),r()):f&&(l.cancel(),r())),f!==x.current&&(x.current=f,!f&&e!==n&&o(e))},[e,n,l,f]);const m=S.useCallback(()=>{l.isPending()&&l.flush()},[l]);return S.useEffect(()=>()=>m(),[m]),{flush:m}}const fo=V(Ir)`
|
|
341
338
|
color: inherit;
|
|
342
|
-
`,Ii=ge((e,t)=>{var v,P;if(G()){const S=Zt(e,!0,!1);return f.jsx(so,{style:S})}const o=ce(),i=Z(e),r=U.useNumericAttribute(i),{explain:l}=he();if(!r)return f.jsx("span",{children:"Numeric Attribute not found"});const{attribute:s,makeDecision:a}=r,c=((v=s.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit,x=Zt(e,s.isSatisfied,c),g=(P=s.decision)==null?void 0:P.state,[C,u]=T.useState(g),{min:b,max:w}=s.range,m=Ai(g,async S=>{if(S<b){alert(`The value must be smaller than or equal to ${b}.`);return}if(S>w){alert(`The value must be greater than or equal to ${w}.`);return}try{await a(S)}catch(I){I.type===h.ConfiguratorErrorType.SetDecisionConflict?e.explain!=="disabled"&&await l(O=>O.whyIsStateNotPossible.numeric(s.id).state(S),e.explain,o):pe()}},C,S=>u(S),e.wait);return f.jsx(so,{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:ac(s,e.implicitLabelPrefix),onBlur:()=>{m.flush()},onKeyPress:S=>{S.key==="Enter"&&m.flush()},onValueChange:S=>u(S.floatValue),value:C??"",style:x})}),sc=Ii,ac=(e,t)=>{var n;return((n=e.decision)==null?void 0:n.kind)===h.DecisionKind.Implicit?t:""},cc={...Ci,wait:{title:"Debounce Delay",type:d.ControlType.Number,defaultValue:2e3,min:0,unit:"ms"},decimalSeparator:{title:"Decimal Separator",type:d.ControlType.String,defaultValue:",",maxLength:1},thousandSeparator:{title:"Thousand Separator",type:d.ControlType.String,defaultValue:".",maxLength:1},placeholder:{title:"Placeholder",type:d.ControlType.String,defaultValue:""}};d.addPropertyControls(Ii,cc);const ze={choiceValueId:{title:"Choice Value Id",type:d.ControlType.String}};function me(e,t){return T.Children.map(e,n=>{if(T.isValidElement(n)){const o=go(n.props,t);return T.cloneElement(n,o)}return n})}const Ri=ge((e,t)=>{if(G())return e.children;const o=ce(),{makeDecision:i}=U.useMakeDecision(),r=Z(e),l=e.choiceValueId??"",s=l.length>0,a=U.useAttributes([r],!1)[0],{explain:c}=he();if(!a)return f.jsx("span",{children:"Attribute not found"});const x=a.type===h.AttributeType.Choice,g=a.type===h.AttributeType.Numeric,C=a.type===h.AttributeType.Boolean,u=a.type===h.AttributeType.Component;if(!x&&s)return f.jsx("span",{children:"Attribute is not a Choice Attribute"});if(g)return f.jsx("span",{children:"Numeric Attribute is not supported"});let b=x?a.values.get(l):null;if(s&&b==null)return f.jsx("span",{children:"Choice Value not found"});const w=P=>N.match({state:P,attribute:a}).with({attribute:{type:h.AttributeType.Choice},state:"undefined"},()=>b.decision==null).with({attribute:{type:h.AttributeType.Choice},state:"included"},()=>{var S,I;return((S=b.decision)==null?void 0:S.state)===h.ChoiceValueDecisionState.Included&&((I=b.decision)==null?void 0:I.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Choice},state:"excluded"},()=>{var S,I;return((S=b.decision)==null?void 0:S.state)===h.ChoiceValueDecisionState.Excluded&&((I=b.decision)==null?void 0:I.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Boolean},state:"undefined"},{attribute:{type:h.AttributeType.Component},state:"undefined"},({attribute:S})=>S.decision==null).with({attribute:{type:h.AttributeType.Boolean},state:"true"},({attribute:S})=>{var I,R;return((I=S.decision)==null?void 0:I.state)===!0&&((R=S.decision)==null?void 0:R.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Boolean},state:"false"},({attribute:S})=>{var I,R;return((I=S.decision)==null?void 0:I.state)===!1&&((R=S.decision)==null?void 0:R.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Component},state:"included"},({attribute:S})=>{var I,R;return((I=S.decision)==null?void 0:I.state)===h.ComponentDecisionState.Included&&((R=S.decision)==null?void 0:R.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Component},state:"excluded"},({attribute:S})=>{var I,R;return((I=S.decision)==null?void 0:I.state)===h.ComponentDecisionState.Excluded&&((R=S.decision)==null?void 0:R.kind)===h.DecisionKind.Explicit}).otherwise(()=>!1),y=P=>N.match({isChoiceAttribute:x,isBooleanAttribute:C,isComponentAttribute:u,state:P}).with({isChoiceAttribute:!0,state:"included"},()=>h.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,state:"excluded"},()=>h.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>h.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>h.ComponentDecisionState.Excluded).otherwise(()=>null);w(e.toggleFrom);const m=w(e.toggleTo),v=async()=>{const P=m?e.toggleFrom:e.toggleTo,S=y(P),I=u?a.possibleDecisionStates.includes(S):!1,R=C?a.possibleDecisionStates.includes(S):!1,O=(x?b.possibleDecisionStates.includes(S):!1)||R||I,j=e.explain,A=j!=="disabled"&&(async()=>{const F=N.match({isComponentAttribute:u,isBooleanAttribute:C,isChoiceAttribute:x}).returnType().with({isChoiceAttribute:!0},()=>h.ExplainQuestionSubject.choiceValue).with({isBooleanAttribute:!0},()=>h.ExplainQuestionSubject.boolean).with({isComponentAttribute:!0},()=>h.ExplainQuestionSubject.component).otherwise(()=>null);F&&await c({question:h.ExplainQuestionType.whyIsStateNotPossible,subject:F,attributeId:r,choiceValueId:l,state:S},j,o)});if(O||S==null)try{await i({type:a.type,attributeId:r,choiceValueId:l,state:S})}catch(F){if(F.type===h.ConfiguratorErrorType.ConflictWithConsequence&&A){await A();return}pe()}else A&&await A()};return me(e.children,{onClick:v,ref:t})}),uc=Ri,dc={...oe,...ze,children:{title:"Content",type:d.ControlType.ComponentInstance},toggleFrom:{title:"Toggle From",type:d.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false"]},toggleTo:{title:"Toggle To",type:d.ControlType.Enum,defaultValue:"included",options:["undefined","included","excluded","true","false"]},...$e};d.addPropertyControls(Ri,dc);const Pi=ge((e,t)=>{if(G())return e.children;const o=ce(),{makeDecision:i}=U.useMakeDecision(),r=Z(e),l=e.choiceValueId??"",s=l.length>0,a=U.useAttributes([r],!1)[0],c=U.useChoiceAttribute(r),{explain:x}=he();if(!a)return f.jsx("span",{children:"Attribute not found"});const g=a.type===h.AttributeType.Choice,C=a.type===h.AttributeType.Numeric,u=a.type===h.AttributeType.Boolean,b=a.type===h.AttributeType.Component;if(!g&&s)return f.jsx("span",{children:"Attribute is not a Choice Attribute"});let w=g?a.values.get(l):null;if(s&&w==null)return f.jsx("span",{children:"Choice Value not found"});const y=()=>N.match({isChoiceAttribute:g,isBooleanAttribute:u,isComponentAttribute:b,isNumericAttribute:C,hasChoiceValueId:s,state:e.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>h.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>h.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>h.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>h.ComponentDecisionState.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>e.numericValue).otherwise(()=>null),m=async()=>{if(g&&!s&&e.setSelection==="undefined")try{await c.clearDecisions()}catch{pe()}else{const v=y(),P=b?a.possibleDecisionStates.includes(v):!1,S=u?a.possibleDecisionStates.includes(v):!1,R=(g?w.possibleDecisionStates.includes(v):!1)||S||P,D=e.explain,O=D!=="disabled"&&(async()=>{const j=N.match({isComponentAttribute:b,isBooleanAttribute:u,isChoiceAttribute:g,isNumericAttribute:C}).returnType().with({isChoiceAttribute:!0},()=>h.ExplainQuestionSubject.choiceValue).with({isBooleanAttribute:!0},()=>h.ExplainQuestionSubject.boolean).with({isComponentAttribute:!0},()=>h.ExplainQuestionSubject.component).with({isNumericAttribute:!0},()=>h.ExplainQuestionSubject.numeric).otherwise(()=>null);j&&await x({question:h.ExplainQuestionType.whyIsStateNotPossible,subject:j,attributeId:r,choiceValueId:l,state:v},D,o)});if(C||R||v==null)try{await i({type:a.type,attributeId:r,choiceValueId:l,state:v})}catch(j){const A=j;if((A.type===h.ConfiguratorErrorType.ConflictWithConsequence||A.type===h.ConfiguratorErrorType.SetDecisionConflict)&&O){await O();return}pe()}else O&&await O()}};return me(e.children,{onClick:m,ref:t})}),fc=Pi,pc={...oe,...ze,children:{title:"Content",type:d.ControlType.ComponentInstance},setSelection:{title:"Set Selection To",type:d.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:d.ControlType.Number,defaultValue:0},...$e};d.addPropertyControls(Pi,pc);const Oi=ge((e,t)=>{var g;if(G())return e.children;const o=ce(),{makeManyDecisions:i}=U.useMakeDecision(),{handleExplainAnswer:r}=he(),l=e.attributes.map(Z),s=U.useAttributes(l,!1).map((C,u)=>{if(!C)return{error:f.jsx("span",{children:"Attribute not found"})};const b=e.attributes[u],w=b.choiceValueId??"",y=w.length>0,m=C.type===h.AttributeType.Choice,v=C.type===h.AttributeType.Numeric,P=C.type===h.AttributeType.Boolean,S=C.type===h.AttributeType.Component;if(!m&&y)return{error:f.jsx("span",{children:"Attribute is not a Choice Attribute"})};let I=m?C.values.get(w):null;if(y&&I==null)return{error:f.jsx("span",{children:"Choice Value not found"})};const R=()=>N.match({isChoiceAttribute:m,isBooleanAttribute:P,isComponentAttribute:S,isNumericAttribute:v,hasChoiceValueId:y,state:b.setSelection}).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"included"},()=>h.ChoiceValueDecisionState.Included).with({isChoiceAttribute:!0,hasChoiceValueId:!0,state:"excluded"},()=>h.ChoiceValueDecisionState.Excluded).with({isBooleanAttribute:!0,state:"true"},()=>!0).with({isBooleanAttribute:!0,state:"false"},()=>!1).with({isComponentAttribute:!0,state:"included"},()=>h.ComponentDecisionState.Included).with({isComponentAttribute:!0,state:"excluded"},()=>h.ComponentDecisionState.Excluded).with({isNumericAttribute:!0,state:"numeric"},()=>b.numericValue).otherwise(()=>null);return{getDecisions:()=>m&&!y&&b.setSelection==="undefined"?[...C.values.values()].filter(D=>{var O;return((O=D.decision)==null?void 0:O.kind)===h.DecisionKind.Explicit}).map(D=>({type:C.type,attributeId:C.id,choiceValueId:D.id,state:null})):[{type:C.type,attributeId:C.id,choiceValueId:w,state:R()}]}}),a=(g=s.find(C=>C.error))==null?void 0:g.error;if(a)return a;const c=async()=>{const C=s.reduce((b,w)=>[...b,...w.getDecisions()],new Array),u=N.match(e.existingSelections).with("keep",()=>({type:"KeepExistingDecisions"})).with("drop",()=>({type:"DropExistingDecisions",conflictHandling:N.match(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()})).exhaustive();try{await i(C,u)}catch(b){const w=b;if(console.debug("SetMany failed",w),(w==null?void 0:w.type)===h.ConfiguratorErrorType.MakeManyDecisionsConflict&&w.decisionExplanations){e.explain!=="disabled"&&await r(w,e.explain,o);return}pe();return}},x=()=>{e.trigger==="click"&&c()};return T.useEffect(()=>{e.trigger==="auto"&&c()},[]),me(e.children,{onClick:x,ref:t})}),hc=Oi,gc={children:{title:"Content",type:d.ControlType.ComponentInstance},attributes:{title:"Attributes",type:d.ControlType.Array,control:{type:d.ControlType.Object,controls:{...oe,...ze,setSelection:{title:"Set Selection To",type:d.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},numericValue:{title:"Numeric Value",type:d.ControlType.Number,defaultValue:0}}}},existingSelections:{title:"Existing Selections",type:d.ControlType.Enum,defaultValue:"keep",options:["keep","drop"]},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:d.ControlType.Boolean,defaultValue:!0,hidden:e=>e.existingSelections!=="drop"},trigger:{title:"Trigger",type:d.ControlType.Enum,defaultValue:"click",options:["click","auto"],displaySegmentedControl:!0,segmentedControlDirection:"horizontal"},...$e};d.addPropertyControls(Oi,gc);const Di=ae(e=>{if(G())return e.enabledChildren;const{canResetConfiguration:n,resetConfiguration:o}=U.useConfigurationReset(),i=async()=>{if(n)try{await o()}catch{Za()}},r=n?e.enabledChildren:e.disabledChildren;return me(r,{onClick:i})}),mc=Di,yc={enabledChildren:{title:"Content – Enabled",type:d.ControlType.ComponentInstance},disabledChildren:{title:"Content – Disabled",type:d.ControlType.ComponentInstance}};d.addPropertyControls(Di,yc);const Vi=ge((e,t)=>{if(G())return e.unsatisfiedChildren;const o=ce(),{isSatisfied:i}=U.useConfigurationSatisfaction(),{explain:r}=he(),s=[...e.attributeId.length>0?[Z(e)]:[],...e.attributes.map(Z)],a=()=>{var u;const g=U.useAttributes(s,!1).map(b=>b?{isSatisfied:b.isSatisfied}:{error:f.jsx("span",{children:"Attribute not found"})}),C=(u=g.find(b=>b.error))==null?void 0:u.error;return C||g.every(b=>b.isSatisfied)},c=async()=>{e.explain!=="disabled"&&(s.length===0?await r(g=>g.whyIsNotSatisfied.configuration,e.explain,o):s.length===1&&await r(g=>g.whyIsNotSatisfied.attribute(s[0]),e.explain,o))};return(s.length>0?a():i)?e.satisfiedChildren:me(e.unsatisfiedChildren,{onClick:c,ref:t})}),bc=Vi,xc={satisfiedChildren:{title:"Content – Satisfied",type:d.ControlType.ComponentInstance},unsatisfiedChildren:{title:"Content – Unsatisfied",type:d.ControlType.ComponentInstance},...oe,attributes:{title:"Attributes",type:d.ControlType.Array,control:{type:d.ControlType.Object,controls:{...oe}}},...$e};d.addPropertyControls(Vi,xc);const ji=ae(T.forwardRef(function(t,n){const o=b=>N.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(G())return i&&o(i.content);const l=Z(t),s=t.choiceValueId??"",a=s.length>0,c=U.useAttributes([l],!1)[0];if(!c)return f.jsx("span",{children:"Attribute not found"});const x=c.type===h.AttributeType.Choice;if(!x&&a)return f.jsx("span",{children:"Attribute is not a Choice Attribute"});const g=x&&a?c.values.get(s):null;if(a&&g==null)return f.jsx("span",{children:"Choice Value not found"});const C=b=>()=>g?b(g):[...c.values.values()].some(b),u=[...t.variants].find(({selection:b,condition:w})=>N.match({selection:b,condition:w,attribute:c}).with({attribute:{type:h.AttributeType.Choice},selection:"included",condition:"blocked"},C(y=>!y.possibleDecisionStates.includes(h.ChoiceValueDecisionState.Included))).with({attribute:{type:h.AttributeType.Choice},selection:"included",condition:"implicit"},C(y=>{var m,v;return((m=y.decision)==null?void 0:m.state)===h.ChoiceValueDecisionState.Included&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit})).with({attribute:{type:h.AttributeType.Choice},selection:"included",condition:"explicit"},C(y=>{var m,v;return((m=y.decision)==null?void 0:m.state)===h.ChoiceValueDecisionState.Included&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Explicit})).with({attribute:{type:h.AttributeType.Choice},selection:"included",condition:"none"},C(y=>{var m;return((m=y.decision)==null?void 0:m.state)===h.ChoiceValueDecisionState.Included})).with({attribute:{type:h.AttributeType.Choice},selection:"excluded",condition:"blocked"},C(y=>!y.possibleDecisionStates.includes(h.ChoiceValueDecisionState.Excluded))).with({attribute:{type:h.AttributeType.Choice},selection:"excluded",condition:"implicit"},C(y=>{var m,v;return((m=y.decision)==null?void 0:m.state)===h.ChoiceValueDecisionState.Excluded&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit})).with({attribute:{type:h.AttributeType.Choice},selection:"excluded",condition:"explicit"},C(y=>{var m,v;return((m=y.decision)==null?void 0:m.state)===h.ChoiceValueDecisionState.Excluded&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Explicit})).with({attribute:{type:h.AttributeType.Choice},selection:"excluded",condition:"none"},C(y=>{var m;return((m=y.decision)==null?void 0:m.state)===h.ChoiceValueDecisionState.Excluded})).with({attribute:{type:h.AttributeType.Boolean},selection:"true",condition:"blocked"},({attribute:y})=>!y.possibleDecisionStates.includes(!0)).with({attribute:{type:h.AttributeType.Boolean},selection:"true",condition:"implicit"},({attribute:y})=>{var m,v;return((m=y.decision)==null?void 0:m.state)===!0&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit}).with({attribute:{type:h.AttributeType.Boolean},selection:"true",condition:"explicit"},({attribute:y})=>{var m,v;return((m=y.decision)==null?void 0:m.state)===!0&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Boolean},selection:"true",condition:"none"},({attribute:y})=>{var m;return((m=y.decision)==null?void 0:m.state)===!0}).with({attribute:{type:h.AttributeType.Boolean},selection:"false",condition:"blocked"},({attribute:y})=>!y.possibleDecisionStates.includes(!1)).with({attribute:{type:h.AttributeType.Boolean},selection:"false",condition:"implicit"},({attribute:y})=>{var m,v;return((m=y.decision)==null?void 0:m.state)===!1&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit}).with({attribute:{type:h.AttributeType.Boolean},selection:"false",condition:"explicit"},({attribute:y})=>{var m,v;return((m=y.decision)==null?void 0:m.state)===!1&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Boolean},selection:"false",condition:"none"},({attribute:y})=>{var m;return((m=y.decision)==null?void 0:m.state)===!1}).with({attribute:{type:h.AttributeType.Component},selection:"included",condition:"blocked"},({attribute:y})=>!y.possibleDecisionStates.includes(h.ComponentDecisionState.Included)).with({attribute:{type:h.AttributeType.Component},selection:"included",condition:"implicit"},({attribute:y})=>{var m,v;return((m=y.decision)==null?void 0:m.state)===h.ComponentDecisionState.Included&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit}).with({attribute:{type:h.AttributeType.Component},selection:"included",condition:"explicit"},({attribute:y})=>{var m,v;return((m=y.decision)==null?void 0:m.state)===h.ComponentDecisionState.Included&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Component},selection:"included",condition:"none"},({attribute:y})=>{var m;return((m=y.decision)==null?void 0:m.state)===h.ComponentDecisionState.Included}).with({attribute:{type:h.AttributeType.Component},selection:"excluded",condition:"blocked"},({attribute:y})=>!y.possibleDecisionStates.includes(h.ComponentDecisionState.Excluded)).with({attribute:{type:h.AttributeType.Component},selection:"excluded",condition:"implicit"},({attribute:y})=>{var m,v;return((m=y.decision)==null?void 0:m.state)===h.ComponentDecisionState.Excluded&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Implicit}).with({attribute:{type:h.AttributeType.Component},selection:"excluded",condition:"explicit"},({attribute:y})=>{var m,v;return((m=y.decision)==null?void 0:m.state)===h.ComponentDecisionState.Excluded&&((v=y.decision)==null?void 0:v.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Component},selection:"excluded",condition:"none"},({attribute:y})=>{var m;return((m=y.decision)==null?void 0:m.state)===h.ComponentDecisionState.Excluded}).with({attribute:{type:h.AttributeType.Numeric},selection:"numeric",condition:"implicit"},({attribute:y})=>{var m;return((m=y.decision)==null?void 0:m.kind)===h.DecisionKind.Implicit}).with({attribute:{type:h.AttributeType.Numeric},selection:"numeric",condition:"explicit"},({attribute:y})=>{var m;return((m=y.decision)==null?void 0:m.kind)===h.DecisionKind.Explicit}).with({attribute:{type:h.AttributeType.Numeric},selection:"numeric",condition:"none"},({attribute:y})=>y.decision!=null).with({attribute:{type:h.AttributeType.Choice},selection:"undefined"},()=>g.decision==null).with({attribute:{type:h.AttributeType.Boolean},selection:"undefined"},{attribute:{type:h.AttributeType.Component},selection:"undefined"},{attribute:{type:h.AttributeType.Numeric},selection:"undefined"},({attribute:y})=>y.decision==null).otherwise(()=>!1));return u&&me(o(u.content),{ref:n})})),Cc=ji,vc={...oe,...ze,variants:{title:"Variants",type:d.ControlType.Array,maxCount:10,control:{type:d.ControlType.Object,controls:{selection:{title:"Selection",type:d.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded","true","false","numeric"]},condition:{title:"Condition",type:d.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]},content:{title:"Content",type:d.ControlType.Enum,defaultValue:1,options:[1,2,3,4,5,6,7,8,9,10]},useInDesignTime:{title:"Design Time",type:d.ControlType.Boolean,defaultValue:!1}}}},content1:{title:"Content 1",type:d.ControlType.ComponentInstance},content2:{title:"Content 2",type:d.ControlType.ComponentInstance},content3:{title:"Content 3",type:d.ControlType.ComponentInstance},content4:{title:"Content 4",type:d.ControlType.ComponentInstance},content5:{title:"Content 5",type:d.ControlType.ComponentInstance},content6:{title:"Content 6",type:d.ControlType.ComponentInstance},content7:{title:"Content 7",type:d.ControlType.ComponentInstance},content8:{title:"Content 8",type:d.ControlType.ComponentInstance},content9:{title:"Content 9",type:d.ControlType.ComponentInstance},content10:{title:"Content 10",type:d.ControlType.ComponentInstance}};d.addPropertyControls(ji,vc);const ki=ae(e=>{const t=T.useRef(),[n,o]=T.useState(null),i=T.useRef(n),r=T.useMemo(()=>e.color.startsWith("var"),[e.color]),l=r?n:e.color,s=T.useMemo(()=>{if(!l)return;const a=rr(l);return ir.hexToCSSFilter(`#${a}`,{acceptanceLossPercentage:1,maxChecks:30}).filter.replace(";","")},[l]);return T.useLayoutEffect(()=>{if(r){const a=t.current&&getComputedStyle(t.current).color;a!=i.current&&(i.current=a,o(a))}}),f.jsx("div",{ref:t,style:{...e.style,color:e.color,filter:s},children:e.children})}),wc=ki,Sc={children:{title:"Content",type:d.ControlType.ComponentInstance},color:{title:"Color",type:d.ControlType.Color,defaultValue:"#0000ff"}};d.addPropertyControls(ki,Sc);const Mi=ae(e=>{if(G())return e.children;const{error:n}=U.useConfigurationInitialization();return n?me(e.children,{onClick:n.retry}):null}),Tc=Mi,Ec={children:{title:"Content",type:d.ControlType.ComponentInstance}};d.addPropertyControls(Mi,Ec);function Ac(e){return T.forwardRef((t,n)=>{const o={...t.style,width:"100%",height:"100%"};return f.jsx(e,{...t,ref:n,style:o})})}const Ic=k.div`
|
|
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`
|
|
343
340
|
width: 10px;
|
|
344
341
|
height: 10px;
|
|
345
342
|
background-color: greenyellow;
|
|
346
|
-
`;function
|
|
343
|
+
`;function Hi(e){const t=S.useRef(null);return S.useEffect(()=>{if(!t.current)return;const n=setTimeout(()=>{t.current.scrollIntoView()},e.delay);return()=>clearTimeout(n)},[t.current]),c.jsx(eu,{ref:t})}const tu={delay:{title:"Delay",type:u.ControlType.Number,min:0,unit:"ms",defaultValue:0,step:1}};u.addPropertyControls(Hi,tu);function lt(e){const t=n=>{var r;const o=S.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 Qi=V.div`
|
|
344
|
+
display: contents;
|
|
345
|
+
`,nu=V.createGlobalStyle`
|
|
346
|
+
:root {
|
|
347
|
+
*:has(> ${Qi}) {
|
|
348
|
+
display: contents !important;
|
|
349
|
+
}
|
|
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`
|
|
352
|
+
display: contents;
|
|
353
|
+
`,Mu=V.createGlobalStyle`
|
|
354
|
+
:root {
|
|
355
|
+
*:has(> ${pr}) {
|
|
356
|
+
display: contents !important;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
`,hr=ee(qe(e=>{const t=ie(),n=Q(),o=lt(e.itemTemplate);if(!o)return c.jsx("span",{children:"Attribute Template not defined"});if(n){const l=Bu();return c.jsx(bo,{style:e.style,children:l.map(s=>c.jsx(Lu,{attribute:s,itemTemplate:o,controlId:t},s.key))})}const i=ur();if(!i)return null;const r=an(i,e.intentionFilter);return c.jsx(bo,{style:e.style,children:r.map(l=>c.jsx(Nu,{attribute:l,itemTemplate:o,controlId:t},l.key))})})),Fu=hr;function bo(e){return c.jsxs(c.Fragment,{children:[c.jsx(Re,{singletonId:"CustomExplainAttributeList",children:c.jsx(Mu,{})}),c.jsx(pr,{style:e.style,children:e.children})]})}function Nu(e){const{attribute:t,itemTemplate:n,controlId:o}=e,i=et(t.attributeId)??t.attributeId.localId,r=We(t.attributeId),{attributeId:l,componentPath:s,sharedConfigurationModel:a}=it(t.attributeId),f={attributeId:t.attributeId,attributeName:i,decisions:t.decisions,choiceValueNames:r};return c.jsx(ku.Provider,{value:f,children:S.cloneElement(n,{key:t.key,layoutId:`${o}_${t.key}`,attributeId:l,componentPath:s,sharedConfigurationModel:a,attributeName:i})})}function Lu(e){const{attribute:t,itemTemplate:n,controlId:o}=e,{attributeId:i,componentPath:r,sharedConfigurationModel:l}=it(t.attributeId),s=i;return S.cloneElement(n,{key:t.key,layoutId:`${o}_${t.key}`,attributeId:i,componentPath:r,sharedConfigurationModel:l,attributeName:s})}function Bu(){const e=t=>({localId:t,componentPath:[],sharedConfigurationModelId:null});return h.pipe(["Attribute A","Attribute B","Attribute C"],h.RA.map(t=>{const n=e(t);return{key:t,attributeId:n,decisions:[]}}))}const $u={itemTemplate:{title:"Attribute Template",type:u.ControlType.ComponentInstance},intentionFilter:{title:"Intention Filter",type:u.ControlType.Enum,defaultValue:"any",options:["any","add","remove"]}};u.addPropertyControls(hr,$u);const mr=V.div`
|
|
360
|
+
display: contents;
|
|
361
|
+
`,zu=V.createGlobalStyle`
|
|
362
|
+
:root {
|
|
363
|
+
*:has(> ${mr}) {
|
|
364
|
+
display: contents !important;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
`,gr=ee(qe(e=>{const t=ie(),n=Q(),o=Ou(),i=ze(),r=lt(e.itemTemplate);if(!r)return c.jsx("span",{children:"Attribute Value Template not defined"});if(n)return c.jsx(xo,{style:e.style,children:Ku(r,t)});if(!o)return null;const l=Oo(o.attributeId),a=Vo(o.decisions,o.choiceValueNames,i).map((f,x)=>{const m=ln(f,o.choiceValueNames,i),C=`${t}_${l}_${x}`;return S.cloneElement(r,{key:C,layoutId:C,displayName:m,intention:f.intention})});return c.jsx(xo,{style:e.style,children:a})})),Wu=gr;function xo(e){return c.jsxs(c.Fragment,{children:[c.jsx(Re,{singletonId:"CustomExplainAttributeValueList",children:c.jsx(zu,{})}),c.jsx(mr,{style:e.style,children:e.children})]})}function Ku(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 S.cloneElement(e,{key:r,layoutId:r,displayName:o.displayName,intention:o.intention})})}const qu={itemTemplate:{title:"Attribute Value Template",type:u.ControlType.ComponentInstance}};u.addPropertyControls(gr,qu);const yr=ee(e=>{var i;if(Q())return e.content;const n=ce();if(!n)return null;const o=(i=n.decisionExplanations)==null?void 0:i[0];return c.jsx(ju.Provider,{value:o,children:c.jsx(Hu,{...e,hasError:n.hasError,hasSolution:!!(o!=null&&o.solution)})})}),_u=yr;function Hu(e){const{content:t,failedToExplainContent:n,noExplanationFoundContent:o,noSolutionFoundContent:i,hasError:r,hasSolution:l}=e;return r?S.Children.toArray(n).length>0?n:c.jsx("span",{children:"Failed to explain."}):Qu()?S.Children.toArray(o).length>0?o:c.jsx("span",{children:"No explanation found."}):l?t??null:S.Children.toArray(i).length>0?i:c.jsx("span",{children:"No solution found."})}function Qu(){var e,t;return!((t=(e=ce())==null?void 0:e.decisionExplanations)!=null&&t[0])}const Uu={content:{title:"Content",type:u.ControlType.ComponentInstance},failedToExplainContent:{title:"Content – Failed to Explain",type:u.ControlType.ComponentInstance},noExplanationFoundContent:{title:"Content – No Explanation Found",type:u.ControlType.ComponentInstance},noSolutionFoundContent:{title:"Content – No Solution Found",type:u.ControlType.ComponentInstance}};u.addPropertyControls(yr,Uu);const br=V.div`
|
|
347
368
|
display: contents;
|
|
348
|
-
`,
|
|
369
|
+
`,Gu=V.createGlobalStyle`
|
|
349
370
|
:root {
|
|
350
|
-
*:has(> ${
|
|
371
|
+
*:has(> ${br}) {
|
|
351
372
|
display: contents !important;
|
|
352
373
|
}
|
|
353
374
|
}
|
|
354
|
-
`,Ni=ae(yn(e=>{const t=ce(),n=G(),i=(()=>{const u=b=>{var m;const w=T.Children.toArray(b)[0],y=(m=w.props)==null?void 0:m.children;return y?u(y):w};return u(e.itemTemplate)})();if(!i)return f.jsx("span",{children:"Choice Value Template not defined"});const r=(u,b)=>u.map(w=>T.cloneElement(i,{key:w,layoutId:`${t}_${w}`,attributeId:e.attributeId,componentPath:e.componentPath,sharedConfigurationModel:e.sharedConfigurationModel,choiceValueId:w,choiceValueName:b.get(w)??w}));if(n)return f.jsx(ao,{...e,children:r(["Choice Value 1","Choice Value 2","Choice Value 3"],p.RM.empty)});const l=Z(e),s=U.useChoiceAttribute(l);if(!s)return f.jsx("span",{children:"Choice Attribute not found"});const a=Ge(l),c=e.filter??new Array,x=[...s.attribute.values.values()].filter(u=>c.length===0||c.some(({selection:b,condition:w})=>N.match({selection:b,condition:w}).with({selection:"included",condition:"blocked"},()=>!u.possibleDecisionStates.includes(h.ChoiceValueDecisionState.Included)).with({selection:"included",condition:"implicit"},()=>{var y,m;return((y=u.decision)==null?void 0:y.state)===h.ChoiceValueDecisionState.Included&&((m=u.decision)==null?void 0:m.kind)===h.DecisionKind.Implicit}).with({selection:"included",condition:"explicit"},()=>{var y,m;return((y=u.decision)==null?void 0:y.state)===h.ChoiceValueDecisionState.Included&&((m=u.decision)==null?void 0:m.kind)===h.DecisionKind.Explicit}).with({selection:"included",condition:"none"},()=>{var y;return((y=u.decision)==null?void 0:y.state)===h.ChoiceValueDecisionState.Included}).with({selection:"excluded",condition:"blocked"},()=>!u.possibleDecisionStates.includes(h.ChoiceValueDecisionState.Excluded)).with({selection:"excluded",condition:"implicit"},()=>{var y,m;return((y=u.decision)==null?void 0:y.state)===h.ChoiceValueDecisionState.Excluded&&((m=u.decision)==null?void 0:m.kind)===h.DecisionKind.Implicit}).with({selection:"excluded",condition:"explicit"},()=>{var y,m;return((y=u.decision)==null?void 0:y.state)===h.ChoiceValueDecisionState.Excluded&&((m=u.decision)==null?void 0:m.kind)===h.DecisionKind.Explicit}).with({selection:"excluded",condition:"none"},()=>{var y;return((y=u.decision)==null?void 0:y.state)===h.ChoiceValueDecisionState.Excluded}).with({selection:"undefined"},()=>u.decision==null).otherwise(()=>!1))),C=xt(l,x).map(u=>u.id);return f.jsx(ao,{...e,children:r(C,a)})}));function ao(e){return f.jsxs(f.Fragment,{children:[f.jsx(bt,{singletonId:"ChoiceValueListRenderer",children:f.jsx(Pc,{})}),f.jsx(Li,{style:e.style,children:e.children})]})}const Oc=Ni,Dc={...oe,itemTemplate:{title:"Choice Value Template",type:d.ControlType.ComponentInstance},filter:{title:"Filter",type:d.ControlType.Array,control:{type:d.ControlType.Object,controls:{selection:{title:"Selection",type:d.ControlType.Enum,defaultValue:"undefined",options:["undefined","included","excluded"]},condition:{title:"Condition",type:d.ControlType.Enum,defaultValue:"none",options:["none","explicit","implicit","blocked"]}}}}};d.addPropertyControls(Ni,Dc);const{isValidElement:co,cloneElement:uo}=E;function Vc(e,t){return t?(Array.isArray(t)&&(t=t.map((n,o)=>co(n)&&typeof n.props=="object"?uo(n,{...n.props,key:o}):n)),!e||Array.isArray(e)?t:co(e)?uo(e,{...e.props,children:t}):e):e}const{isValidElement:jc}=E;function Bi(e,t,n){function o(r,l){return t.visit(r,n,l)}function i(r,l){return Bi(r,t,l||n)}if(jc(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:fo}=E;function kc(e,t){let n;const{replace:o,updateState:i}=t;return"matchElement"in t?n=r=>fo(r)&&r.type===t.matchElement:"matchLiteral"in t?n=r=>!Array.isArray(r)&&!fo(r)&&t.matchLiteral(r):n=t.match,Bi(e,{visit(r,l,s){const a=i?i(l):l,c=s?s(a):void 0,x=Vc(r,c);return n(x,a)?o(x,a):x}},t.initialState)}function po(e){return f.jsx(f.Fragment,{children:kc(e.children,e)})}function Mc(e){return p.pipe(e,p.Str.replace(/[\s\u2013]/g,"-"),lr)}const Fc=ae(e=>{const{children:t,mode:n,replaceString:o,propName:i,elementName:r,text:l}=e;return n==="replace"?f.jsx(po,{match:s=>typeof s=="string",replace:s=>s===o?l:s,children:t}):n==="set-prop"?f.jsx(po,{match:s=>{var a;return((a=s.type)==null?void 0:a.displayName)===r},replace:s=>T.cloneElement(s,{[Mc(i)]:l}),children:t}):t}),Ot=Fc,bn=e=>({children:{title:"Content",type:d.ControlType.ComponentInstance},mode:{title:"Mode",type:d.ControlType.Enum,defaultValue:"replace",options:["replace","set-prop"],displaySegmentedControl:!0},replaceString:{title:"Replace Text",type:d.ControlType.String,defaultValue:e,hidden:t=>t.mode!=="replace"},elementName:{title:"Element Name",type:d.ControlType.String,hidden:t=>t.mode!=="set-prop"},propName:{title:"Property Name",type:d.ControlType.String,hidden:t=>t.mode!=="set-prop"}}),$i=ae(e=>{const{attributeId:t,children:n,customName:o}=e,i=Z(e),r=(o==null?void 0:o.length)>0,l=G(),a=r?o:l?t:(()=>U.useAttributes([i],!1)[0]?At(i)??t:"Attribute not found")();return f.jsx(Ot,{...e,text:a})}),Lc=$i,Nc={...oe,customName:{title:"Custom Name",type:d.ControlType.String},...bn("<AttributeName>")};d.addPropertyControls($i,Nc);const zi=ae(e=>{const{choiceValueId:t,children:n,customName:o,mode:i,replaceString:r,propName:l,elementName:s}=e,a=Z(e),c=o.length>0,x=t.length>0,g=G(),u=c?o:g?t.length>0?t:"Choice Value":(()=>{const b=U.useChoiceAttribute(a);return b?x?b.attribute.values.get(t)==null?"Choice Value not found":To(a,t)??t:"Choice Value Id missing":"Choice Attribute not found"})();return f.jsx(Ot,{...e,text:u})}),Bc=zi,$c={...oe,...ze,customName:{title:"Custom Name",type:d.ControlType.String},...bn("<ChoiceValueName>")};d.addPropertyControls(zi,$c);function Wi(e){return e.children}const zc={children:{title:"Content",type:d.ControlType.ComponentInstance}};d.addPropertyControls(Wi,zc);function Ki(e){const{children:t,fileExtension:n,fileName:o,target:i}=e;if(G())return t;const{storeConfiguration:l}=U.useConfigurationStoring();return me(t,{onClick:async()=>{const c={type:"spc-stored-configuration",storedConfiguration:await l()};i==="file"?Kc(c,`${o}.${n}`):i==="clipboard"&&qc(c)}})}const Wc={children:{title:"Content",type:d.ControlType.ComponentInstance},target:{title:"Target",type:d.ControlType.Enum,defaultValue:"file",options:["file","clipboard"],optionTitles:["File","Clipboard"],displaySegmentedControl:!0,segmentedControlDirection:"vertical"},fileName:{title:"File Name",type:d.ControlType.String,defaultValue:"configuration",hidden:e=>e.target!=="file"},fileExtension:{title:"File Extension",type:d.ControlType.String,defaultValue:"json",hidden:e=>e.target!=="file"}};d.addPropertyControls(Ki,Wc);function Kc(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 qc(e){const t=JSON.stringify(e);navigator.clipboard.writeText(t).catch(n=>{alert("Failed to copy the configuration to clipboard: "+n)})}var qi=(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))(qi||{});const Hi=ge((e,t)=>{const{children:n,fileExtension:o,source:i}=e;if(G())return n;const l=ce(),{restoreConfiguration:s}=U.useConfigurationStoring(),{handleExplainAnswer:a}=he();return me(n,{onClick:async()=>{const x=p.pipe(await Yc(i,o),p.O.toNullable);if(!x)return;const g={type:"DropExistingDecisions",conflictHandling:N.match(e.autoResolveConflicts).with(!1,()=>({type:"Manual",includeConstraintsInConflictExplanation:!1})).with(!0,()=>({type:"Automatic"})).exhaustive()};try{await s(x,g)}catch(C){const u=C;if(console.debug("Failed to restore stored configuration",u),u.type===h.ConfiguratorErrorType.StoredConfigurationInvalid){alert("The specific configuration is not supported. Maybe the configuration was created with new application version than the current one.");return}if((u==null?void 0:u.type)===h.ConfiguratorErrorType.MakeManyDecisionsConflict&&u.decisionExplanations){e.explain!=="disabled"&&await a(u,e.explain,l);return}alert("Failed to restore your configuration.");return}},ref:t})}),Hc=Hi,_c={children:{title:"Content",type:d.ControlType.ComponentInstance},source:{title:"Source",type:d.ControlType.Enum,defaultValue:"file",options:["file","clipboard"],optionTitles:["File","Clipboard"],displaySegmentedControl:!0,segmentedControlDirection:"vertical"},fileExtension:{title:"File Extension",type:d.ControlType.String,defaultValue:"json",hidden:e=>e.source!=="file"},autoResolveConflicts:{title:"Auto Resolve Conflicts",type:d.ControlType.Boolean,defaultValue:!0},...$e};d.addPropertyControls(Hi,_c);function Uc(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(p.left(2));return}const r=i.files[0],l=new FileReader;l.onload=()=>{t(p.right(l.result))},l.onerror=()=>{t(p.left(3))},l.readAsText(r)},n.oncancel=()=>{t(p.left(2))},n.click()})}function Qc(){return()=>navigator.clipboard.readText().then(e=>e?p.right(e):p.left(4)).catch(()=>p.left(5))}function Yc(e,t){return p.pipe(e==="file"?Uc(t):Qc(),p.TE.chainEitherK(n=>p.E.tryCatch(()=>JSON.parse(n),()=>0)),p.TE.filterOrElse(n=>n.type==="spc-stored-configuration",()=>1),p.TE.map(n=>n.storedConfiguration),p.TE.doIfLeft(n=>()=>{console.debug(`Failed to load stored configuration: ${qi[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.")}),p.TO.fromTaskEither)()}const _i=ae(e=>{const{fallback:t}=e,n=Z(e),r=G()?"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 f.jsx(Ot,{...e,text:r})}),Gc=_i,Xc={...oe,fallback:{title:"Unselected Text",type:d.ControlType.String,defaultValue:""},...bn("<NumericValue>")};d.addPropertyControls(_i,Xc);function Ui(e){if(G())return f.jsx("div",{style:{width:"100%"},children:e.children});const n=T.useRef(0),[o,i]=T.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 T.useEffect(()=>{const s=o;if(!s)return;l(s);const a=new ResizeObserver(()=>{l(s)});return a.observe(s),()=>{a.disconnect()}},[o]),f.jsx("div",{ref:i,style:{width:"100%"},children:e.children})}d.addPropertyControls(Ui,{children:{title:"Content",type:d.ControlType.ComponentInstance}});exports.AttributeName=Lc;exports.BooleanSelect=oc;exports.ChoiceSelect=ec;exports.ChoiceValueListRenderer=Oc;exports.ChoiceValueName=Bc;exports.Colorize=wc;exports.ComponentSelect=rc;exports.Configuration=Aa;exports.InitializationRetry=Tc;exports.NumericInput=sc;exports.PropagateHeight=Ui;exports.ReplaceText=Ot;exports.ResetConfiguration=mc;exports.RestoreConfiguration=Hc;exports.SatisfactionIndicator=bc;exports.ScrollIntoView=Fi;exports.SelectedNumericValue=Gc;exports.SelectionIndicator=Cc;exports.SelectionToggle=uc;exports.SetSelection=fc;exports.SetSelections=hc;exports.Singleton=bt;exports.Slot=Wi;exports.StoreConfiguration=Ki;exports.attributeIdPropertyControls=oe;exports.choiceValueIdPropertyControls=ze;exports.cloneChildrenWithProps=me;exports.explainableComponent=ge;exports.parseGlobalAttributeId=Z;exports.useAttributeName=At;exports.useChoiceValueName=To;exports.useChoiceValueNames=Ge;exports.useControlId=ce;exports.useDebounceValue=Ai;exports.useExplain=he;exports.useExplainProcess=xe;exports.useRenderPlaceholder=G;exports.useSortedChoiceValues=xt;exports.withControlId=yn;exports.withErrorBoundary=ae;exports.withFullSize=Ac;
|
|
375
|
+
`,xr=ee(qe(e=>{const t=ie(),n=Q(),o=lt(e.template);if(!o)return c.jsx("span",{children:"Template not defined."});if(n)return e.useInDesignTime&&c.jsx(Co,{children:Ju(o,t)});const i=ce(),r=(i==null?void 0:i.explainQuestion)??null;if(!r||!Zu(r,e.filter))return null;const l=Xu(r),s=t;return c.jsx(Co,{children:S.cloneElement(o,{key:s,layoutId:s,...l})})})),Yu=xr;function Co(e){return c.jsxs(c.Fragment,{children:[c.jsx(Re,{singletonId:"CustomExplainQuestion",children:c.jsx(Gu,{})}),c.jsx(br,{children:e.children})]})}function Xu(e){const t="attributeId"in e?e.attributeId:null,n="choiceValueId"in e?e.choiceValueId:null,o=t?it(t):null,i=O.match(e).with({subject:d.ExplainQuestionSubject.component,state:d.ComponentDecisionState.Included},()=>"included").with({subject:d.ExplainQuestionSubject.component,state:d.ComponentDecisionState.Excluded},()=>"excluded").with({subject:d.ExplainQuestionSubject.boolean,state:!0},()=>"true").with({subject:d.ExplainQuestionSubject.boolean,state:!1},()=>"false").otherwise(()=>""),r=O.match(e).with({subject:d.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 Ju(e,t){const n=`${t}_placeholder`;return S.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 Zu(e,t){return t==="any"?!0:O.match(t).with("configurationNotSatisfied",()=>O.match(e).with({question:d.ExplainQuestionType.whyIsNotSatisfied,subject:d.ExplainQuestionSubject.configuration},()=>!0).otherwise(()=>!1)).with("attributeNotSatisfied",()=>O.match(e).with({question:d.ExplainQuestionType.whyIsNotSatisfied,subject:d.ExplainQuestionSubject.attribute},()=>!0).otherwise(()=>!1)).with("choiceValueBlocked",()=>O.match(e).with({question:d.ExplainQuestionType.whyIsStateNotPossible,subject:d.ExplainQuestionSubject.choiceValue},()=>!0).otherwise(()=>!1)).with("componentValueBlocked",()=>O.match(e).with({question:d.ExplainQuestionType.whyIsStateNotPossible,subject:d.ExplainQuestionSubject.component},()=>!0).otherwise(()=>!1)).with("booleanValueBlocked",()=>O.match(e).with({question:d.ExplainQuestionType.whyIsStateNotPossible,subject:d.ExplainQuestionSubject.boolean},()=>!0).otherwise(()=>!1)).with("numericValueBlocked",()=>O.match(e).with({question:d.ExplainQuestionType.whyIsStateNotPossible,subject:d.ExplainQuestionSubject.numeric},()=>!0).otherwise(()=>!1)).exhaustive()}const ed={template:{title:"Template",type:u.ControlType.ComponentInstance},filter:{title:"Filter",type:u.ControlType.Enum,defaultValue:"any",options:["any","configurationNotSatisfied","attributeNotSatisfied","choiceValueBlocked","componentValueBlocked","booleanValueBlocked","numericValueBlocked"]},useInDesignTime:{title:"Design Time",type:u.ControlType.Boolean,defaultValue:!0}};u.addPropertyControls(xr,ed);exports.AttributeName=cu;exports.BooleanSelect=jc;exports.ChoiceSelect=Ic;exports.ChoiceValueList=Gi;exports.ChoiceValueListRenderer=Gi;exports.ChoiceValueName=du;exports.Colorize=Gc;exports.ComponentSelect=Dc;exports.Configuration=ec;exports.ConfigurationPropsProvider=Za;exports.CustomExplainApplySolution=Vu;exports.CustomExplainAttributeList=Fu;exports.CustomExplainAttributeValueList=Wu;exports.CustomExplainPopover=_u;exports.CustomExplainQuestion=Yu;exports.InitializationRetry=Xc;exports.NumericInput=kc;exports.PopoverClose=Di;exports.PropagateHeight=ar;exports.ReplaceText=Ot;exports.ResetConfiguration=Kc;exports.RestoreConfiguration=Su;exports.SatisfactionIndicator=_c;exports.ScrollIntoView=Hi;exports.SelectedNumericValue=Pu;exports.SelectionIndicator=Qc;exports.SelectionToggle=Nc;exports.SetSelection=Bc;exports.SetSelections=zc;exports.SetTemplateSlots=gu;exports.Singleton=Re;exports.Slot=Zi;exports.StoreConfiguration=ir;exports.TemplateSlot=hu;exports.attributeIdPropertyControls=re;exports.choiceValueIdPropertyControls=_e;exports.cloneChildrenWithProps=fe;exports.explainableComponent=ye;exports.getItemTemplate=lt;exports.parseGlobalAttributeId=Z;exports.useAttributeName=et;exports.useChoiceValueName=jo;exports.useChoiceValueNames=We;exports.useControlId=ie;exports.useDebounceValue=Fi;exports.useExplain=ge;exports.useExplainProcess=ce;exports.useRenderPlaceholder=Q;exports.useSortedChoiceValues=Tt;exports.withControlId=qe;exports.withErrorBoundary=ee;exports.withFullSize=Zc;
|