UNPKG

@viamedici-spc/configurator-framer

Version:

Component library to build configurator apps with Framer based on Viamedici SPC.

147 lines (138 loc) 170 kB
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime"),c=require("framer"),M=require("styled-components"),u=require("@viamedici-spc/configurator-ts"),Y=require("@viamedici-spc/configurator-react"),w=require("react"),Tr=require("url-join"),k=require("ts-pattern"),Er=require("react-error-boundary"),gt=require("@fortawesome/free-solid-svg-icons"),bt=require("@fortawesome/react-fontawesome"),m=require("@viamedici-spc/fp-ts-extensions"),mt=require("mustache"),To=require("react-dom"),Ir=require("clsx"),Eo=require("merge-props"),Ar=require("dyna-guid"),ee=require("zod"),Pr=require("zod-validation-error"),Rr=require("react-number-format"),Dr=require("use-debounce"),jr=require("framer-motion"),Vr=require("hex-to-css-filter"),Or=require("rgb-hex"),kr=require("camelcase");function Io(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const E=Io(w),Fr=Io(To),In="--spc-",Mr=/var\(--(?!spc-)(?!framer-)/g,Nr="var(--spc-";function An(e){if(e.type!=="decl")return;const t=e.props,n=e.children,o=t.startsWith("--")&&!t.startsWith(In),i=typeof n=="string"&&n.includes("var(--");if(!o&&!i)return;const r=o?In+t.slice(2):t,l=i?n.replace(Mr,Nr):n;o&&(e.props=r),e.return=`${r}:${l};`}function X(){return c.RenderTarget.current()!==c.RenderTarget.preview}const Br=M.div` padding: var(--space-md); margin: var(--space-md); border-radius: var(--shape-border-radius-sm); background: white; &.warning { border: 1px solid orange; border-left-width: 15px; } &.error { border: 1px solid #DB0100; border-left-width: 15px; } `,Lr=M.h3` margin: 0 0 var(--space-xs); `,$r=M.div` white-space: break-spaces; `;function Ao(e){return d.jsxs(Br,{className:e.type,children:[d.jsx(Lr,{children:e.title}),d.jsx($r,{children:e.message})]})}function zr(e){var i,r,l;if(X())return null;const{error:n}=Y.useConfigurationInitialization();if(!n)return null;const o=s=>d.jsx(Ao,{type:"error",title:"Configuration initialization failed",message:s});switch(n.type){case u.ConfiguratorErrorType.ConfigurationModelNotFound:return w.Children.toArray(e.configurationModelNotFoundContent).length>0?e.configurationModelNotFoundContent:o("The Configuration Model was not found for the specified deployment name.");case u.ConfiguratorErrorType.AuthenticationFailure:return w.Children.toArray(e.accessTokenInvalidContent).length>0?e.accessTokenInvalidContent:o("The HCA access token is invalid.");case u.ConfiguratorErrorType.SpecifiedDeploymentForbidden:return w.Children.toArray(e.accessTokenRestrictionContent).length>0?e.accessTokenRestrictionContent:o("The HCA access token does not permit using the specified Configuration Model.");case u.ConfiguratorErrorType.DecisionsToRespectInvalid:const s=`Attribute Id: ${((i=n.globalAttributeId)==null?void 0:i.localId)??""}`,a=`Component Path: ${((r=n.globalAttributeId.componentPath)==null?void 0:r.join(" -> "))??""}`,p=`Shared Configuration Model: ${((l=n.globalAttributeId)==null?void 0:l.sharedConfigurationModelId)??""}`;return o(`The definition of Attribute Relations is invalid: ${n.validationMessage} ${s} ${a} ${p}`);case u.ConfiguratorErrorType.SessionParametersInvalid:return o(`Configuration Session parameters are invalid: ${n.detail}`);default:return w.Children.toArray(e.errorContent).length>0?e.errorContent:o("An error occurred while initializing the configuration.")}}function ne(e){return w.forwardRef((t,n)=>d.jsx(Er.ErrorBoundary,{fallbackRender:()=>d.jsx("span",{children:"Component crashed"}),children:d.jsx(e,{...t,ref:n})}))}const Wr=M.createGlobalStyle` :root { --font-primary: var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif); --font-heading: "Inter-Medium", "Inter", "Inter Placeholder", sans-serif; } /* font sizes */ :root { --text-base-size: calc(var(--framer-font-size, 16px) * var(--framer-font-size-scale, 1)); --text-scale-ratio: 1.2; --text-xs: calc(1em / (var(--text-scale-ratio) * var(--text-scale-ratio))); --text-sm: calc(1em / var(--text-scale-ratio)); --text-md: calc(1em * var(--text-scale-ratio)); --text-lg: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio)); --text-xl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio)); --text-xxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio)); --text-xxxl: calc(1em * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio) * var(--text-scale-ratio)); } `,Kr=Wr,Qr=M.createGlobalStyle` :root { --space-unit: 1em; --space-xxs: calc(0.25 * var(--space-unit)); --space-xs: calc(0.5 * var(--space-unit)); --space-sm: calc(0.75 * var(--space-unit)); --space-md: calc(1.25 * var(--space-unit)); --space-lg: calc(2 * var(--space-unit)); --space-xl: calc(3.25 * var(--space-unit)); --space-xxl: calc(5.25 * var(--space-unit)); --space-unit-fixed: var(--text-base-size); --space-xxs-fixed: calc(0.25 * var(--space-unit-fixed)); --space-xs-fixed: calc(0.5 * var(--space-unit-fixed)); --space-sm-fixed: calc(0.75 * var(--space-unit-fixed)); --space-md-fixed: calc(1.25 * var(--space-unit-fixed)); --space-lg-fixed: calc(2 * var(--space-unit-fixed)); --space-xl-fixed: calc(3.25 * var(--space-unit-fixed)); --space-xxl-fixed: calc(5.25 * var(--space-unit-fixed)); } `,qr=Qr,_r=M.createGlobalStyle` :root { --shape-border-radius-xs: 5px; --shape-border-radius-sm: 7px; --shape-border-radius-md: 12px; --shape-border-radius-lg: 20px; } `,Ur=_r;function Pn(){return d.jsxs(d.Fragment,{children:[d.jsx(Ur,{}),d.jsx(qr,{}),d.jsx(Kr,{})]})}const Ye=w.createContext(null);function ce(){const{process:e,switchMode:t,applySolution:n,dismiss:o}=w.useContext(Ye);return e?{...e,switchMode:t,applySolution:n,dismiss:o}:null}const Po=(e={})=>({padding:{type:c.ControlType.FusedNumber,title:"Padding",toggleKey:"isMixedPadding",toggleTitles:["Padding","Padding per Side"],valueKeys:["paddingTop","paddingRight","paddingBottom","paddingLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:e.padding??0}}),Ro=e=>({paddingTop:e.isMixedPadding?e.paddingTop:e.padding,paddingRight:e.isMixedPadding?e.paddingRight:e.padding,paddingBottom:e.isMixedPadding?e.paddingBottom:e.padding,paddingLeft:e.isMixedPadding?e.paddingLeft:e.padding}),Yt=(e={})=>{var t,n;return{radius:{title:"Radius",type:c.ControlType.Number,defaultValue:e.radius??0},border:{title:"Border",type:c.ControlType.Object,controls:{color:{type:c.ControlType.Color,title:"Color",defaultValue:(t=e.border)==null?void 0:t.color},width:{type:c.ControlType.FusedNumber,title:"Width",toggleKey:"isMixedWidth",toggleTitles:["Width","Width per Side"],valueKeys:["widthTop","widthRight","widthBottom","widthLeft"],valueLabels:["Top","Right","Bottom","Left"],min:0,defaultValue:((n=e.border)==null?void 0:n.width)??0}}}}},Do=e=>{var t,n,o,i,r,l,s,a,p,C,y,g,f;return{borderRadius:e.radius,borderColor:(t=e.border)==null?void 0:t.color,borderTopWidth:(n=e.border)!=null&&n.isMixedWidth?(o=e.border)==null?void 0:o.widthTop:(i=e.border)==null?void 0:i.width,borderRightWidth:(r=e.border)!=null&&r.isMixedWidth?(l=e.border)==null?void 0:l.widthRight:(s=e.border)==null?void 0:s.width,borderBottomWidth:(a=e.border)!=null&&a.isMixedWidth?(p=e.border)==null?void 0:p.widthBottom:(C=e.border)==null?void 0:C.width,borderLeftWidth:(y=e.border)!=null&&y.isMixedWidth?(g=e.border)==null?void 0:g.widthLeft:(f=e.border)==null?void 0:f.width,borderStyle:"solid"}},Je=(e={})=>({fill:{title:"Fill",type:c.ControlType.Color,defaultValue:e.fill},backdropFilter:{title:"Backdrop Filter",type:c.ControlType.String,defaultValue:e.backdropFilter??"none"},shadow:{title:"Shadow",type:c.ControlType.String,defaultValue:e.shadow??"none"},filter:{title:"Filter",type:c.ControlType.String,defaultValue:e.filter??"none"},...Po(e),...Yt(e)}),$e=e=>({...Ro(e),...Do(e),backgroundColor:e.fill,backdropFilter:e.backdropFilter,boxShadow:e.shadow,filter:e.filter}),pe=(e={})=>{var t,n;return{color:{title:"Color",type:c.ControlType.Color,defaultValue:e.color??"black"},text:{title:"Text",type:c.ControlType.Font,controls:"basic",displayTextAlignment:!0,displayFontSize:!0,defaultValue:{fontSize:(t=e.text)==null?void 0:t.fontSize,textAlign:(n=e.text)==null?void 0:n.textAlign}}}},he=e=>({...e.text,color:e.color}),xt=(e={})=>({staticText:{title:"Text",type:c.ControlType.String,defaultValue:e.staticText},...pe(e)}),Ct=e=>he(e),vt=(e={})=>{var t,n,o;return{fillHover:{title:"Fill – Hover",type:c.ControlType.Color,defaultValue:e.fillHover},focusOutline:{title:"Focus Outline",type:c.ControlType.Object,controls:{color:{title:"Color",type:c.ControlType.Color,defaultValue:(t=e.focusOutline)==null?void 0:t.color},size:{title:"Size",type:c.ControlType.Number,defaultValue:(n=e.focusOutline)==null?void 0:n.size},offset:{title:"Offset",type:c.ControlType.Number,defaultValue:(o=e.focusOutline)==null?void 0:o.offset}}},...Je(e),...xt(e)}},jt=e=>({...$e(e),...Ct(e),"--spc-color-button-fill-hover":e.fillHover,"--spc-color-button-focus-outline":e.focusOutline.color,"--spc-size-button-focus-outline":`${e.focusOutline.size}px`,"--spc-size-button-focus-outline-offset":`${e.focusOutline.offset}px`}),St=(e={})=>({margin:{type:c.ControlType.FusedNumber,title:"Margin",toggleKey:"isMixedMargin",toggleTitles:["Margin","Margin per Side"],valueKeys:["marginTop","marginRight","marginBottom","marginLeft"],valueLabels:["Top","Right","Bottom","Left"],defaultValue:e.margin??0}}),Vt=e=>({marginTop:e.isMixedMargin?e.marginTop:e.margin,marginRight:e.isMixedMargin?e.marginRight:e.margin,marginBottom:e.isMixedMargin?e.marginBottom:e.margin,marginLeft:e.isMixedMargin?e.marginLeft:e.margin}),Hr=(e={})=>{var t,n,o,i;return{subject:{title:"Subject",type:c.ControlType.Object,controls:{...pe(e.subject??{}),configurationSubjectTitle:{title:"Configuration Subject Title",type:c.ControlType.String,defaultValue:((t=e.subject)==null?void 0:t.configurationSubjectTitle)??"Configuration"},generalConflictTitle:{title:"General Conflict Title",type:c.ControlType.String,defaultValue:((n=e.subject)==null?void 0:n.generalConflictTitle)??"Conflict"}}},suffix:{title:"Suffix",type:c.ControlType.Object,controls:{...pe(e.suffix??{}),isBlockedSuffix:{title:"Is Blocked Suffix",type:c.ControlType.String,defaultValue:((o=e.suffix)==null?void 0:o.isBlockedSuffix)??"is blocked"},isNotSatisfiedSuffix:{title:"Is Not Satisfied Suffix",type:c.ControlType.String,defaultValue:((i=e.suffix)==null?void 0:i.isNotSatisfiedSuffix)??"is not satisfied"}}}}},jo=(e={})=>{var t,n,o,i,r,l,s,a,p,C,y,g,f,x,v,h,b,S,R,I,A,P,V,O,B,D,K,L;return{header:{title:"Header",type:c.ControlType.Object,controls:{...Hr(e.header??{})},hidden:Q=>Q.useCustomExplain},attributeName:{title:"Attribute Name",type:c.ControlType.Object,controls:{...pe(e.attributeName??{})},hidden:Q=>Q.useCustomExplain},attributeValue:{title:"Attribute Value",type:c.ControlType.Object,controls:{add:{title:"Adding",type:c.ControlType.Object,controls:{...pe(((t=e.attributeValue)==null?void 0:t.add)??{}),...Yt(((n=e.attributeValue)==null?void 0:n.add)??{}),fill:{title:"Fill",type:c.ControlType.Color,defaultValue:(i=(o=e.attributeValue)==null?void 0:o.add)==null?void 0:i.fill},iconFill:{title:"Icon Fill",type:c.ControlType.Color,defaultValue:(l=(r=e.attributeValue)==null?void 0:r.add)==null?void 0:l.iconFill},iconColor:{title:"Icon Color",type:c.ControlType.Color,defaultValue:(a=(s=e.attributeValue)==null?void 0:s.add)==null?void 0:a.iconColor}}},remove:{title:"Removing",type:c.ControlType.Object,controls:{...pe(((p=e.attributeValue)==null?void 0:p.remove)??{}),...Yt(((C=e.attributeValue)==null?void 0:C.remove)??{}),fill:{title:"Fill",type:c.ControlType.Color,defaultValue:(g=(y=e.attributeValue)==null?void 0:y.remove)==null?void 0:g.fill},iconFill:{title:"Icon Fill",type:c.ControlType.Color,defaultValue:(x=(f=e.attributeValue)==null?void 0:f.remove)==null?void 0:x.iconFill},iconColor:{title:"Icon Color",type:c.ControlType.Color,defaultValue:(h=(v=e.attributeValue)==null?void 0:v.remove)==null?void 0:h.iconColor}}},...Po(e.attributeValue??{}),componentDecisionStateIncludedLabel:{title:"Component Decision State Included Label",type:c.ControlType.String,defaultValue:((b=e.attributeValue)==null?void 0:b.componentDecisionStateIncludedLabel)??"Included"},componentDecisionStateExcludedLabel:{title:"Component Decision State Excluded Label",type:c.ControlType.String,defaultValue:((S=e.attributeValue)==null?void 0:S.componentDecisionStateExcludedLabel)??"Excluded"},booleanDecisionStateTrueLabel:{title:"Boolean Decision State True Label",type:c.ControlType.String,defaultValue:((R=e.attributeValue)==null?void 0:R.booleanDecisionStateTrueLabel)??"Yes"},booleanDecisionStateFalseLabel:{title:"Boolean Decision State False Label",type:c.ControlType.String,defaultValue:((I=e.attributeValue)==null?void 0:I.booleanDecisionStateFalseLabel)??"No"}}},applySolutionButton:{title:"Apply Solution Button",type:c.ControlType.Object,controls:{...vt(e.applySolutionButton??{}),...St(e.applySolutionButton??{})},hidden:Q=>Q.useCustomExplain},closeButton:{title:"Close Button",type:c.ControlType.Object,controls:{...vt(e.closeButton??{})},hidden:Q=>Q.useCustomExplain},infoMessage:{title:"Info Message",type:c.ControlType.Object,controls:{...pe(e.infoMessage??{}),whyIsStateNotPossibleQuestion:{title:"Why Is State Not Possible Question",type:c.ControlType.String,defaultValue:((A=e.infoMessage)==null?void 0:A.whyIsStateNotPossibleQuestion)??"why your selection is not possible"},whyConfigurationIsNotSatisfiedQuestion:{title:"Why Configuration Is Not Satisfied Question",type:c.ControlType.String,defaultValue:((P=e.infoMessage)==null?void 0:P.whyConfigurationIsNotSatisfiedQuestion)??"why your configuration is not satisfied"},whyAttributeIsNotSatisfiedQuestion:{title:"Why Attribute Is Not Satisfied Question",type:c.ControlType.String,defaultValue:((V=e.infoMessage)==null?void 0:V.whyAttributeIsNotSatisfiedQuestion)??"why your attribute is not satisfied"},generalConflictQuestion:{title:"General Conflict Question",type:c.ControlType.String,defaultValue:((O=e.infoMessage)==null?void 0:O.generalConflictQuestion)??"why your selections are not possible"},failedToExplainText:{title:"Failed To Explain Text",type:c.ControlType.String,defaultValue:((B=e.infoMessage)==null?void 0:B.failedToExplainText)??"Failed to explain {{question}}."},failedToExplainHintText:{title:"Failed To Explain Hint Text",type:c.ControlType.String,defaultValue:((D=e.infoMessage)==null?void 0:D.failedToExplainHintText)??"Please check your internet connection and try again."},noExplanationFoundText:{title:"No Explanation Found Text",type:c.ControlType.String,defaultValue:((K=e.infoMessage)==null?void 0:K.noExplanationFoundText)??"There was no explanation found for {{question}}."},noSolutionFoundText:{title:"No Solution Found Text",type:c.ControlType.String,defaultValue:((L=e.infoMessage)==null?void 0:L.noSolutionFoundText)??"There was no solution found for {{question}}."}},hidden:Q=>Q.useCustomExplain}}},Gr={popoverBox:{title:"Popover Box",type:c.ControlType.Object,controls:Je({fill:"#002134",radius:12,padding:18,isMixedPadding:!1,filter:"drop-shadow(5px 5px 10px rgba(0, 0, 0, 0.4))"}),hidden:e=>e.useCustomExplain},subline:{title:"Subline",type:c.ControlType.Object,controls:{...xt({color:"white",staticText:"Solution",text:{fontWeight:"500",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})},hidden:e=>e.useCustomExplain},...jo({header:{subject:{color:"rgb(0, 161, 230)",text:{fontWeight:"500",fontSize:19,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}},suffix:{color:"white",text:{fontWeight:"500",fontSize:19,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}}},attributeName:{color:"white",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}},attributeValue:{add:{color:"white",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},radius:300,fill:"rgba(255, 255, 255, 0.2)",iconFill:"rgba(47, 255, 0, 0.2)",iconColor:"#63e446"},remove:{color:"white",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},radius:300,fill:"rgba(255, 255, 255, 0.2)",iconFill:"#ff00004a",iconColor:"#ff6060"},paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:10,isMixedPadding:!0},applySolutionButton:{fill:"rgb(0, 161, 230)",fillHover:"#15ACED",radius:300,paddingTop:9,paddingBottom:9,paddingLeft:29,paddingRight:29,isMixedPadding:!0,color:"white",staticText:"Apply Solution",text:{textAlign:"center",fontWeight:"600",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"rgba(255, 255, 255, 0.8)",size:2,offset:-1},marginTop:18,isMixedMargin:!0},closeButton:{fill:"transparent",fillHover:"#FFFFFF26",radius:300,paddingTop:2,paddingBottom:2,paddingLeft:6,paddingRight:6,isMixedPadding:!0,color:"white",staticText:"Close",text:{textAlign:"center",fontWeight:"400",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"rgba(255, 255, 255, 0.8)",size:2,offset:-1}},infoMessage:{color:"white",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}}}),showConstraintsButton:{title:"Show Constraints Button",type:c.ControlType.Object,controls:{...vt({fill:"transparent",fillHover:"transparent",radius:5,paddingTop:1,paddingBottom:1,paddingLeft:6,paddingRight:6,isMixedPadding:!0,color:"white",staticText:"Show Constraints",text:{textAlign:"center",fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"rgba(255, 255, 255, 0.8)",size:2,offset:-1}}),...St({marginTop:13})},hidden:e=>e.useCustomExplain},showMoreButton:{title:"Show More Button",type:c.ControlType.Object,controls:{...vt({fill:"transparent",fillHover:"transparent",radius:5,paddingTop:1,paddingBottom:1,paddingLeft:6,paddingRight:6,isMixedPadding:!0,color:"white",staticText:"Show more ({{amount}})",text:{textAlign:"center",fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"rgba(255, 255, 255, 0.8)",size:2,offset:-1}}),...St({marginTop:13})},hidden:e=>e.useCustomExplain},listSeparator:{title:"List Separator",type:c.ControlType.Color,defaultValue:"rgba(255, 255, 255, 0.3)",hidden:e=>e.useCustomExplain},arrow:{title:"Arrow",type:c.ControlType.Color,defaultValue:"#002134"},useCustomExplain:{title:"Use Custom Popover",type:c.ControlType.Boolean,defaultValue:!1}},Xr=e=>{var t;return{fill:e.arrow??((t=e.popoverBox)==null?void 0:t.fill)}},ln=w.createContext(null),tt=()=>w.useContext(ln),Yr={dialogBox:{title:"Dialog Box",type:c.ControlType.Object,controls:Je({fill:"rgba(255, 255, 255, 0.7)",backdropFilter:"blur(10px) saturate(200%)",shadow:"0.2px 0.4px 2.3px rgba(0, 0, 0, 0.02), 0.6px 1px 5.7px rgba(0, 0, 0, 0.025), 1.2px 2.1px 10.6px rgba(0, 0, 0, 0.03), 2.3px 4px 17.2px rgba(0, 0, 0, 0.034), 4.2px 7.2px 25.9px rgba(0, 0, 0, 0.04), 7.6px 12.8px 37.7px rgba(0, 0, 0, 0.048), 13.9px 23.6px 54.7px rgba(0, 0, 0, 0.061), 40px 68px 96px rgba(0, 0, 0, 0.1)",radius:12,paddingTop:18,paddingBottom:0,paddingLeft:24,paddingRight:24,isMixedPadding:!0})},explanationCard:{title:"Explanation Card",type:c.ControlType.Object,controls:{...Je({fill:"white",shadow:"2px 1px 10px -5px rgba(0, 0, 0, 0.4)",radius:7,padding:12,isMixedPadding:!1}),...St({marginLeft:-12,marginRight:-12,isMixedMargin:!0})}},constraintExplanation:{title:"Constraint Explanation",type:c.ControlType.Object,controls:{configurationModelId:{title:"Configuration Model Id",type:c.ControlType.Object,controls:pe({color:"#171717",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})},ruleId:{title:"Rule Id",type:c.ControlType.Object,controls:pe({color:"#171717",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})}}},...jo({header:{subject:{color:"rgb(0, 161, 230)",text:{fontWeight:"500",fontSize:19,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}},suffix:{color:"#171717",text:{fontWeight:"500",fontSize:19,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}}},attributeName:{color:"#171717",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}},attributeValue:{add:{color:"#171717",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},radius:300,fill:"#efefef",iconFill:"#cfefc7",iconColor:"#48c52b"},remove:{color:"#171717",text:{fontWeight:"500",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},radius:300,fill:"#efefef",iconFill:"#ffdada",iconColor:"#c52b2b"},paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:10,isMixedPadding:!0},applySolutionButton:{fill:"#F2F2F2",fillHover:"#F7F7F7",radius:7,paddingTop:9,paddingBottom:9,paddingLeft:29,paddingRight:29,isMixedPadding:!0,color:"#171717",staticText:"Apply Solution",text:{textAlign:"center",fontWeight:"600",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"#00a1e6",size:2,offset:-1},marginTop:18,isMixedMargin:!0},closeButton:{fill:"transparent",fillHover:"00000012",radius:300,paddingTop:2,paddingBottom:2,paddingLeft:6,paddingRight:6,isMixedPadding:!0,color:"#171717",staticText:"Close",text:{textAlign:"center",fontWeight:"400",fontSize:14,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'},focusOutline:{color:"#00a1e6",size:2,offset:-1}},infoMessage:{color:"#171717",text:{fontWeight:"400",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}}}),decisionExplanationSolutionsTitle:{title:"Decision Explanation Solutions Title",type:c.ControlType.Object,controls:{...xt({color:"#171717",staticText:"Solutions",text:{fontWeight:"500",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})}},constraintExplanationSolutionsTitle:{title:"Constraint Explanation Solutions Title",type:c.ControlType.Object,controls:{...xt({color:"#171717",staticText:"Constraint Explanations",text:{fontWeight:"500",fontSize:16,fontFamily:'var(--framer-font-family, "Inter", "Inter Placeholder", sans-serif)'}})}},scrollShadowBorder:{title:"Scroll Shadow Border",type:c.ControlType.Color,defaultValue:"rgba(0, 0, 0, 0.3)"}},sn=w.createContext(null),Ot=()=>w.useContext(sn),Jr=()=>w.useContext(ln)||w.useContext(sn),ze=Jr,Zr=M.button` appearance: none; cursor: pointer; &:hover { background-color: var(--color-button-fill-hover) !important; } &:focus { outline: var(--size-button-focus-outline) solid var(--color-button-focus-outline); outline-offset: var(--size-button-focus-outline-offset); } `;function Vo(e){const{explanation:t,...n}=e,o=ce(),{applySolutionButton:i}=ze();return d.jsx(Zr,{...n,onClick:()=>o.applySolution(t.solution),style:{...jt(i),...Vt(i)},children:i.staticText})}function an(e,t,n){return k.match(e).returnType().with({type:u.AttributeType.Choice},o=>t.get(o.choiceValueId)??o.choiceValueId).with({type:u.AttributeType.Boolean,state:!0},()=>n.attributeValue.booleanDecisionStateTrueLabel).with({type:u.AttributeType.Boolean,state:!1},()=>n.attributeValue.booleanDecisionStateFalseLabel).with({type:u.AttributeType.Component,state:u.ComponentDecisionState.Included},()=>n.attributeValue.componentDecisionStateIncludedLabel).with({type:u.AttributeType.Component,state:u.ComponentDecisionState.Excluded},()=>n.attributeValue.componentDecisionStateExcludedLabel).with({type:u.AttributeType.Numeric},o=>o.state.toString()).exhaustive()}const el=M.div` display: flex; gap: var(--space-xs); align-items: center; min-width: 0; `,tl=M.div` display: grid; place-content: center; border-top-left-radius: 360px; border-bottom-left-radius: 360px; height: 1.5em; width: 1.5em; flex-shrink: 0; `,nl=M.div` white-space: nowrap; overflow: hidden; text-overflow: ellipsis; `;function ol(e){const{decision:t,choiceValuesNames:n}=e,o=t.intention,i=ze(),r=an(t,n,i),l=k.match(o).with("remove",()=>i.attributeValue.remove).with("add",()=>i.attributeValue.add).exhaustive();return d.jsxs(el,{style:{...Ro(i.attributeValue),...he(l),...Do(l),backgroundColor:l.fill},children:[d.jsxs(tl,{style:{backgroundColor:l.iconFill,color:l.iconColor},children:[o==="remove"&&d.jsx(bt.FontAwesomeIcon,{icon:gt.faMinus}),o==="add"&&d.jsx(bt.FontAwesomeIcon,{icon:gt.faPlus})]}),d.jsx(nl,{children:r})]})}function te(e){var t;return{localId:e.attributeId,componentPath:e.componentPath===""?[]:((t=e.componentPath)==null?void 0:t.split(" -> "))??[],sharedConfigurationModelId:e.sharedConfigurationModel===""?null:e.sharedConfigurationModel}}const kt=w.createContext(null);function nt(e){const{attributes:t}=w.useContext(kt),{activeLocale:n}=c.useLocaleInfo(),o=n.code;return w.useMemo(()=>m.pipe(t,m.RA.findFirst(i=>u.globalAttributeIdEq.equals(te(i),e)),m.O.map(i=>i.name),m.RA.fromOption,m.RA.flatten,cn(o),m.O.toUndefined),[t,o,e.localId,e.componentPath,e.sharedConfigurationModelId])}function We(e){const{choiceValues:t}=w.useContext(kt),{activeLocale:n}=c.useLocaleInfo(),o=Y.useChoiceAttribute(e);if(!o)return m.RM.empty;const i=w.useMemo(()=>m.pipe(t,m.RA.filter(s=>u.globalAttributeIdEq.equals(te(s),e))),[t,e.localId,e.componentPath,e.sharedConfigurationModelId]),r=n.code,l=o.attribute.values;return w.useMemo(()=>m.pipe(l,m.RM.mapWithIndex((s,a)=>m.pipe(i,m.RA.findFirst(p=>p.choiceValueId===s),m.O.map(p=>p.name),m.RA.fromOption,m.RA.flatten,cn(r))),m.RM.compact),[l,i,r])}function Oo(e,t){const{choiceValues:n}=w.useContext(kt),{activeLocale:o}=c.useLocaleInfo(),i=o.code;return w.useMemo(()=>m.pipe(n,m.RA.findFirst(r=>u.globalAttributeIdEq.equals(te(r),e)&&r.choiceValueId===t),m.O.map(r=>r.name),m.RA.fromOption,m.RA.flatten,cn(i),m.O.toUndefined),[n,i,e.localId,e.componentPath,e.sharedConfigurationModelId,t])}function cn(e){return m.flow(m.RA.findFirst(t=>t.localeCode.localeCompare(e,void 0,{sensitivity:"accent"})===0),m.O.map(t=>t.translation))}function ko(e,t,n){const o=m.pipe(m.Str.Ord,m.Ord.contramap(i=>an(i,t,n)));return m.pipe(e,m.RA.sort(o))}const il=M.div` display: grid; grid-template-columns: subgrid; grid-column: span 2; align-items: center; `,rl=M.div` grid-area: name; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; `,ll=M.div` grid-area: values; display: flex; flex-wrap: wrap; min-width: 0; gap: var(--space-xxs); `;function sl(e){const{decisions:t}=e,n=t[0].attributeId,o=We(n),i=nt(n),r=ze(),l=ko(t,o,r);return d.jsxs(il,{children:[d.jsx(rl,{style:he(r.attributeName),children:i??n.localId}),d.jsx(ll,{children:l.map((s,a)=>d.jsx(ol,{decision:s,choiceValuesNames:o},a))})]})}function Fo(e){const{attributes:t,...n}=e;return d.jsx("div",{...n,children:t.map(o=>d.jsx(sl,{decisions:o.decisions},o.key))})}function Mo(e){const t=e.sharedConfigurationModelId&&`shared::${e.sharedConfigurationModelId}`,n=(e.componentPath??[]).join("::");return[t,n,e.localId].filter(o=>(o==null?void 0:o.length)>0).join("::")}const al=m.pipe(m.Str.Ord,m.Ord.contramap(e=>e.attributeId.localId));function un(e,t="any"){var l,s;const n=((s=(l=e.solution)==null?void 0:l.decisions)==null?void 0:s.filter(a=>a.state!=null))??[],o=e.causedByDecisions??[],i=[...n.map(a=>({...a,intention:"add"})),...o.map(a=>({...a,intention:"remove"}))],r=k.match(t).with("add",()=>a=>a.intention==="add").with("remove",()=>a=>a.intention==="remove").otherwise(()=>m.constTrue);return m.pipe(i,m.RA.filter(r),m.RNEA.groupBy(a=>Mo(a.attributeId)),m.RR.collect(m.Ord.trivial)((a,p)=>({key:a,attributeId:m.RNEA.head(p).attributeId,decisions:p})),m.RA.sort(al))}const cl=M(Fo)` display: grid; grid-template-columns: [name] minmax(150px, auto) [values] minmax(0px, 1fr); gap: var(--space-sm); `;function ul(e){const{explanation:t}=e,{explanationCard:n}=Ot(),o=un(t);return d.jsxs("div",{style:{...$e(n),...Vt(n)},children:[d.jsx(cl,{attributes:o}),d.jsx(Vo,{explanation:t})]})}const dl=M.div` ul { margin: 0; } line-height: 1.5em; `,fl=M.ul` list-style-type: none; margin-inline-start: 0; padding-inline-start: 0; `,Rn=M.ul` list-style-type: disc; margin-inline-start: 0; padding-inline-start: var(--space-lg); `;function pl(e){const{explanation:t}=e,{explanationCard:n,constraintExplanation:o}=Ot(),i=t.causedByCardinalities,r=m.pipe(t.causedByRules,m.RNEA.groupBy(l=>l.configurationModelId),m.RR.collect(m.Str.Ord)((l,s)=>({configurationModelId:l,rules:m.pipe(s,m.RA.map(a=>a.localId),m.RA.sort(m.Str.Ord))})));return d.jsx(dl,{style:{...$e(n),...Vt(n)},children:d.jsxs(fl,{children:[r.map(l=>d.jsxs("li",{children:[d.jsx("span",{style:he(o.configurationModelId),children:l.configurationModelId}),d.jsx(Rn,{style:he(o.ruleId),children:l.rules.map(s=>d.jsx("li",{children:s}))})]})),i.length>0&&d.jsxs("li",{style:he(o.ruleId),children:[d.jsx("span",{children:"Cardinality"}),d.jsx(Rn,{children:i.map(l=>d.jsx("li",{children:l.localId}))})]})]})})}function No(e){const{variant:t,...n}=e,{explainQuestion:o}=ce(),{infoMessage:i}=ze(),r=k.match(o).returnType().with({question:u.ExplainQuestionType.whyIsStateNotPossible},()=>i.whyIsStateNotPossibleQuestion).with({question:u.ExplainQuestionType.whyIsNotSatisfied,subject:u.ExplainQuestionSubject.configuration},()=>i.whyConfigurationIsNotSatisfiedQuestion).with({question:u.ExplainQuestionType.whyIsNotSatisfied,subject:u.ExplainQuestionSubject.attribute},()=>i.whyAttributeIsNotSatisfiedQuestion).with(k.P.nullish,()=>i.generalConflictQuestion).exhaustive(),l=k.match(t).returnType().with("failedToExplain",()=>d.jsxs(d.Fragment,{children:[mt.render(i.failedToExplainText,{question:r}),d.jsx("br",{}),i.failedToExplainHintText]})).with("noExplanationFound",()=>d.jsx(d.Fragment,{children:mt.render(i.noExplanationFoundText,{question:r})})).with("noSolutionFound",()=>d.jsx(d.Fragment,{children:mt.render(i.noSolutionFoundText,{question:r})})).exhaustive();return d.jsx("div",{...n,style:he(i),children:l})}const Dn=M.div` margin-bottom: var(--space-xs); `,jn=M.div` display: flex; flex-direction: column; gap: var(--space-xs); `,hl=M.div` display: flex; flex-direction: column; gap: var(--space-md); `,Vn=M(No)` width: min-content; min-width: 400px; margin: var(--space-sm-fixed) var(--space-md-fixed) var(--space-sm-fixed) var(--space-sm-fixed); `;function ml(){const{decisionExplanations:e,constraintExplanations:t,hasError:n}=ce(),{decisionExplanationSolutionsTitle:o,constraintExplanationSolutionsTitle:i}=Ot();return n?d.jsx(Vn,{variant:"failedToExplain"}):e.length===0&&t.length===0?d.jsx(Vn,{variant:"noExplanationFound"}):d.jsxs(hl,{children:[e.length>0&&d.jsxs("div",{children:[d.jsx(Dn,{style:Ct(o),children:o.staticText}),d.jsx(jn,{children:e.map(r=>d.jsx(ul,{explanation:r},e.indexOf(r)))})]}),t.length>0&&d.jsxs("div",{children:[d.jsx(Dn,{style:Ct(i),children:i.staticText}),d.jsx(jn,{children:t.map(r=>d.jsx(pl,{explanation:r},t.indexOf(r)))})]})]})}function xe(e){return Bo(e)?(e.nodeName||"").toLowerCase():"#document"}function se(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ce(e){var t;return(t=(Bo(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function Bo(e){return e instanceof Node||e instanceof se(e).Node}function Z(e){return e instanceof Element||e instanceof se(e).Element}function oe(e){return e instanceof HTMLElement||e instanceof se(e).HTMLElement}function Jt(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof se(e).ShadowRoot}function ot(e){const{overflow:t,overflowX:n,overflowY:o,display:i}=ae(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(i)}function yl(e){return["table","td","th"].includes(xe(e))}function dn(e){const t=fn(),n=ae(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Lo(e){let t=Ie(e);for(;oe(t)&&!Fe(t);){if(dn(t))return t;t=Ie(t)}return null}function fn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Fe(e){return["html","body","#document"].includes(xe(e))}function ae(e){return se(e).getComputedStyle(e)}function Ft(e){return Z(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Ie(e){if(xe(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Jt(e)&&e.host||Ce(e);return Jt(t)?t.host:t}function $o(e){const t=Ie(e);return Fe(t)?e.ownerDocument?e.ownerDocument.body:e.body:oe(t)&&ot(t)?t:$o(t)}function ve(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=$o(e),r=i===((o=e.ownerDocument)==null?void 0:o.body),l=se(i);return r?t.concat(l,l.visualViewport||[],ot(i)?i:[],l.frameElement&&n?ve(l.frameElement):[]):t.concat(i,ve(i,[],n))}function je(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function le(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Jt(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function zo(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function Wo(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:o}=t;return n+"/"+o}).join(" "):navigator.userAgent}function gl(e){return e.mozInputSource===0&&e.isTrusted?!0:Zt()&&e.pointerType?e.type==="click"&&e.buttons===1:e.detail===0&&!e.pointerType}function bl(e){return Cl()?!1:!Zt()&&e.width===0&&e.height===0||Zt()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function xl(){return/apple/i.test(navigator.vendor)}function Zt(){const e=/android/i;return e.test(zo())||e.test(Wo())}function Cl(){return Wo().includes("jsdom/")}function On(e,t){const n=["mouse","pen"];return t||n.push("",void 0),n.includes(e)}function vl(e){return"nativeEvent"in e}function Sl(e){return e.matches("html,body")}function be(e){return(e==null?void 0:e.ownerDocument)||document}function Lt(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Ve(e){return"composedPath"in e?e.composedPath()[0]:e.target}const wl="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Ko(e){return oe(e)&&e.matches(wl)}function $t(e){e.preventDefault(),e.stopPropagation()}function Tl(e){return e?e.getAttribute("role")==="combobox"&&Ko(e):!1}const Me=Math.min,Ee=Math.max,wt=Math.round,ct=Math.floor,Se=e=>({x:e,y:e}),El={left:"right",right:"left",bottom:"top",top:"bottom"},Il={start:"end",end:"start"};function en(e,t,n){return Ee(e,Me(t,n))}function it(e,t){return typeof e=="function"?e(t):e}function Ae(e){return e.split("-")[0]}function rt(e){return e.split("-")[1]}function Qo(e){return e==="x"?"y":"x"}function pn(e){return e==="y"?"height":"width"}function Mt(e){return["top","bottom"].includes(Ae(e))?"y":"x"}function hn(e){return Qo(Mt(e))}function Al(e,t,n){n===void 0&&(n=!1);const o=rt(e),i=hn(e),r=pn(i);let l=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(l=Tt(l)),[l,Tt(l)]}function Pl(e){const t=Tt(e);return[tn(e),t,tn(t)]}function tn(e){return e.replace(/start|end/g,t=>Il[t])}function Rl(e,t,n){const o=["left","right"],i=["right","left"],r=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?i:o:t?o:i;case"left":case"right":return t?r:l;default:return[]}}function Dl(e,t,n,o){const i=rt(e);let r=Rl(Ae(e),n==="start",o);return i&&(r=r.map(l=>l+"-"+i),t&&(r=r.concat(r.map(tn)))),r}function Tt(e){return e.replace(/left|right|bottom|top/g,t=>El[t])}function jl(e){return{top:0,right:0,bottom:0,left:0,...e}}function qo(e){return typeof e!="number"?jl(e):{top:e,right:e,bottom:e,left:e}}function Et(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function kn(e,t,n){let{reference:o,floating:i}=e;const r=Mt(t),l=hn(t),s=pn(l),a=Ae(t),p=r==="y",C=o.x+o.width/2-i.width/2,y=o.y+o.height/2-i.height/2,g=o[s]/2-i[s]/2;let f;switch(a){case"top":f={x:C,y:o.y-i.height};break;case"bottom":f={x:C,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y};break;case"left":f={x:o.x-i.width,y};break;default:f={x:o.x,y:o.y}}switch(rt(t)){case"start":f[l]-=g*(n&&p?-1:1);break;case"end":f[l]+=g*(n&&p?-1:1);break}return f}const Vl=async(e,t,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,s=r.filter(Boolean),a=await(l.isRTL==null?void 0:l.isRTL(t));let p=await l.getElementRects({reference:e,floating:t,strategy:i}),{x:C,y}=kn(p,o,a),g=o,f={},x=0;for(let v=0;v<s.length;v++){const{name:h,fn:b}=s[v],{x:S,y:R,data:I,reset:A}=await b({x:C,y,initialPlacement:o,placement:g,strategy:i,middlewareData:f,rects:p,platform:l,elements:{reference:e,floating:t}});C=S??C,y=R??y,f={...f,[h]:{...f[h],...I}},A&&x<=50&&(x++,typeof A=="object"&&(A.placement&&(g=A.placement),A.rects&&(p=A.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:i}):A.rects),{x:C,y}=kn(p,g,a)),v=-1)}return{x:C,y,placement:g,strategy:i,middlewareData:f}};async function _o(e,t){var n;t===void 0&&(t={});const{x:o,y:i,platform:r,rects:l,elements:s,strategy:a}=e,{boundary:p="clippingAncestors",rootBoundary:C="viewport",elementContext:y="floating",altBoundary:g=!1,padding:f=0}=it(t,e),x=qo(f),h=s[g?y==="floating"?"reference":"floating":y],b=Et(await r.getClippingRect({element:(n=await(r.isElement==null?void 0:r.isElement(h)))==null||n?h:h.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(s.floating)),boundary:p,rootBoundary:C,strategy:a})),S=y==="floating"?{...l.floating,x:o,y:i}:l.reference,R=await(r.getOffsetParent==null?void 0:r.getOffsetParent(s.floating)),I=await(r.isElement==null?void 0:r.isElement(R))?await(r.getScale==null?void 0:r.getScale(R))||{x:1,y:1}:{x:1,y:1},A=Et(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:S,offsetParent:R,strategy:a}):S);return{top:(b.top-A.top+x.top)/I.y,bottom:(A.bottom-b.bottom+x.bottom)/I.y,left:(b.left-A.left+x.left)/I.x,right:(A.right-b.right+x.right)/I.x}}const Ol=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:i,rects:r,platform:l,elements:s,middlewareData:a}=t,{element:p,padding:C=0}=it(e,t)||{};if(p==null)return{};const y=qo(C),g={x:n,y:o},f=hn(i),x=pn(f),v=await l.getDimensions(p),h=f==="y",b=h?"top":"left",S=h?"bottom":"right",R=h?"clientHeight":"clientWidth",I=r.reference[x]+r.reference[f]-g[f]-r.floating[x],A=g[f]-r.reference[f],P=await(l.getOffsetParent==null?void 0:l.getOffsetParent(p));let V=P?P[R]:0;(!V||!await(l.isElement==null?void 0:l.isElement(P)))&&(V=s.floating[R]||r.floating[x]);const O=I/2-A/2,B=V/2-v[x]/2-1,D=Me(y[b],B),K=Me(y[S],B),L=D,Q=V-v[x]-K,U=V/2-v[x]/2+O,T=en(L,U,Q),N=!a.arrow&&rt(i)!=null&&U!==T&&r.reference[x]/2-(U<L?D:K)-v[x]/2<0,j=N?U<L?U-L:U-Q:0;return{[f]:g[f]+j,data:{[f]:T,centerOffset:U-T-j,...N&&{alignmentOffset:j}},reset:N}}}),kl=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:i,middlewareData:r,rects:l,initialPlacement:s,platform:a,elements:p}=t,{mainAxis:C=!0,crossAxis:y=!0,fallbackPlacements:g,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0,...h}=it(e,t);if((n=r.arrow)!=null&&n.alignmentOffset)return{};const b=Ae(i),S=Ae(s)===s,R=await(a.isRTL==null?void 0:a.isRTL(p.floating)),I=g||(S||!v?[Tt(s)]:Pl(s));!g&&x!=="none"&&I.push(...Dl(s,v,x,R));const A=[s,...I],P=await _o(t,h),V=[];let O=((o=r.flip)==null?void 0:o.overflows)||[];if(C&&V.push(P[b]),y){const L=Al(i,l,R);V.push(P[L[0]],P[L[1]])}if(O=[...O,{placement:i,overflows:V}],!V.every(L=>L<=0)){var B,D;const L=(((B=r.flip)==null?void 0:B.index)||0)+1,Q=A[L];if(Q)return{data:{index:L,overflows:O},reset:{placement:Q}};let U=(D=O.filter(T=>T.overflows[0]<=0).sort((T,N)=>T.overflows[1]-N.overflows[1])[0])==null?void 0:D.placement;if(!U)switch(f){case"bestFit":{var K;const T=(K=O.map(N=>[N.placement,N.overflows.filter(j=>j>0).reduce((j,F)=>j+F,0)]).sort((N,j)=>N[1]-j[1])[0])==null?void 0:K[0];T&&(U=T);break}case"initialPlacement":U=s;break}if(i!==U)return{reset:{placement:U}}}return{}}}};async function Fl(e,t){const{placement:n,platform:o,elements:i}=e,r=await(o.isRTL==null?void 0:o.isRTL(i.floating)),l=Ae(n),s=rt(n),a=Mt(n)==="y",p=["left","top"].includes(l)?-1:1,C=r&&a?-1:1,y=it(t,e);let{mainAxis:g,crossAxis:f,alignmentAxis:x}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...y};return s&&typeof x=="number"&&(f=s==="end"?x*-1:x),a?{x:f*C,y:g*p}:{x:g*p,y:f*C}}const Ml=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:i,y:r,placement:l,middlewareData:s}=t,a=await Fl(t,e);return l===((n=s.offset)==null?void 0:n.placement)&&(o=s.arrow)!=null&&o.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:l}}}}},Nl=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:i}=t,{mainAxis:r=!0,crossAxis:l=!1,limiter:s={fn:h=>{let{x:b,y:S}=h;return{x:b,y:S}}},...a}=it(e,t),p={x:n,y:o},C=await _o(t,a),y=Mt(Ae(i)),g=Qo(y);let f=p[g],x=p[y];if(r){const h=g==="y"?"top":"left",b=g==="y"?"bottom":"right",S=f+C[h],R=f-C[b];f=en(S,f,R)}if(l){const h=y==="y"?"top":"left",b=y==="y"?"bottom":"right",S=x+C[h],R=x-C[b];x=en(S,x,R)}const v=s.fn({...t,[g]:f,[y]:x});return{...v,data:{x:v.x-n,y:v.y-o}}}}};function Uo(e){const t=ae(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const i=oe(e),r=i?e.offsetWidth:n,l=i?e.offsetHeight:o,s=wt(n)!==r||wt(o)!==l;return s&&(n=r,o=l),{width:n,height:o,$:s}}function mn(e){return Z(e)?e:e.contextElement}function ke(e){const t=mn(e);if(!oe(t))return Se(1);const n=t.getBoundingClientRect(),{width:o,height:i,$:r}=Uo(t);let l=(r?wt(n.width):n.width)/o,s=(r?wt(n.height):n.height)/i;return(!l||!Number.isFinite(l))&&(l=1),(!s||!Number.isFinite(s))&&(s=1),{x:l,y:s}}const Bl=Se(0);function Ho(e){const t=se(e);return!fn()||!t.visualViewport?Bl:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Ll(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==se(e)?!1:t}function Pe(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const i=e.getBoundingClientRect(),r=mn(e);let l=Se(1);t&&(o?Z(o)&&(l=ke(o)):l=ke(e));const s=Ll(r,n,o)?Ho(r):Se(0);let a=(i.left+s.x)/l.x,p=(i.top+s.y)/l.y,C=i.width/l.x,y=i.height/l.y;if(r){const g=se(r),f=o&&Z(o)?se(o):o;let x=g.frameElement;for(;x&&o&&f!==g;){const v=ke(x),h=x.getBoundingClientRect(),b=ae(x),S=h.left+(x.clientLeft+parseFloat(b.paddingLeft))*v.x,R=h.top+(x.clientTop+parseFloat(b.paddingTop))*v.y;a*=v.x,p*=v.y,C*=v.x,y*=v.y,a+=S,p+=R,x=se(x).frameElement}}return Et({width:C,height:y,x:a,y:p})}const $l=[":popover-open",":modal"];function Go(e){let t=!1,n=0,o=0;function i(r){try{t=t||e.matches(r)}catch{}}if($l.forEach(r=>{i(r)}),t){const r=Lo(e);if(r){const l=r.getBoundingClientRect();n=l.x,o=l.y}}return[t,n,o]}function zl(e){let{elements:t,rect:n,offsetParent:o,strategy:i}=e;const r=Ce(o),[l]=t?Go(t.floating):[!1];if(o===r||l)return n;let s={scrollLeft:0,scrollTop:0},a=Se(1);const p=Se(0),C=oe(o);if((C||!C&&i!=="fixed")&&((xe(o)!=="body"||ot(r))&&(s=Ft(o)),oe(o))){const y=Pe(o);a=ke(o),p.x=y.x+o.clientLeft,p.y=y.y+o.clientTop}return{width:n.width*a.x,height:n.height*a.y,x:n.x*a.x-s.scrollLeft*a.x+p.x,y:n.y*a.y-s.scrollTop*a.y+p.y}}function Wl(e){return Array.from(e.getClientRects())}function Xo(e){return Pe(Ce(e)).left+Ft(e).scrollLeft}function Kl(e){const t=Ce(e),n=Ft(e),o=e.ownerDocument.body,i=Ee(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),r=Ee(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+Xo(e);const s=-n.scrollTop;return ae(o).direction==="rtl"&&(l+=Ee(t.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:s}}function Ql(e,t){const n=se(e),o=Ce(e),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,s=0,a=0;if(i){r=i.width,l=i.height;const p=fn();(!p||p&&t==="fixed")&&(s=i.offsetLeft,a=i.offsetTop)}return{width:r,height:l,x:s,y:a}}function ql(e,t){const n=Pe(e,!0,t==="fixed"),o=n.top+e.clientTop,i=n.left+e.clientLeft,r=oe(e)?ke(e):Se(1),l=e.clientWidth*r.x,s=e.clientHeight*r.y,a=i*r.x,p=o*r.y;return{width:l,height:s,x:a,y:p}}function Fn(e,t,n){let o;if(t==="viewport")o=Ql(e,n);else if(t==="document")o=Kl(Ce(e));else if(Z(t))o=ql(t,n);else{const i=Ho(e);o={...t,x:t.x-i.x,y:t.y-i.y}}return Et(o)}function Yo(e,t){const n=Ie(e);return n===t||!Z(n)||Fe(n)?!1:ae(n).position==="fixed"||Yo(n,t)}function _l(e,t){const n=t.get(e);if(n)return n;let o=ve(e,[],!1).filter(s=>Z(s)&&xe(s)!=="body"),i=null;const r=ae(e).position==="fixed";let l=r?Ie(e):e;for(;Z(l)&&!Fe(l);){const s=ae(l),a=dn(l);!a&&s.position==="fixed"&&(i=null),(r?!a&&!i:!a&&s.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||ot(l)&&!a&&Yo(e,l))?o=o.filter(C=>C!==l):i=s,l=Ie(l)}return t.set(e,o),o}function Ul(e){let{element:t,boundary:n,rootBoundary:o,strategy:i}=e;const l=[...n==="clippingAncestors"?_l(t,this._c):[].concat(n),o],s=l[0],a=l.reduce((p,C)=>{const y=Fn(t,C,i);return p.top=Ee(y.top,p.top),p.right=Me(y.right,p.right),p.bottom=Me(y.bottom,p.bottom),p.left=Ee(y.left,p.left),p},Fn(t,s,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Hl(e){const{width:t,height:n}=Uo(e);return{width:t,height:n}}function Gl(e,t,n,o){const i=oe(t),r=Ce(t),l=n==="fixed",s=Pe(e,!0,l,t);let a={scrollLeft:0,scrollTop:0};const p=Se(0);if(i||!i&&!l)if((xe(t)!=="body"||ot(r))&&(a=Ft(t)),i){const v=Pe(t,!0,l,t);p.x=v.x+t.clientLeft,p.y=v.y+t.clientTop}else r&&(p.x=Xo(r));let C=s.left+a.scrollLeft-p.x,y=s.top+a.scrollTop-p.y;const[g,f,x]=Go(o);return g&&(C+=f,y+=x,i&&(C+=t.clientLeft,y+=t.clientTop)),{x:C,y,width:s.width,height:s.height}}function Mn(e,t){return!oe(e)||ae(e).position==="fixed"?null:t?t(e):e.offsetParent}function Jo(e,t){const n=se(e);if(!oe(e))return n;let o=Mn(e,t);for(;o&&yl(o)&&ae(o).position==="static";)o=Mn(o,t);return o&&(xe(o)==="html"||xe(o)==="body"&&ae(o).position==="static"&&!dn(o))?n:o||Lo(e)||n}const Xl=async function(e){const t=this.getOffsetParent||Jo,n=this.getDimensions;return{reference:Gl(e.reference,await t(e.floating),e.strategy,e.floating),floating:{x:0,y:0,...await n(e.floating)}}};function Yl(e){return ae(e).direction==="rtl"}const Zo={convertOffsetParentRelativeRectToViewportRelativeRect:zl,getDocumentElement:Ce,getClippingRect:Ul,getOffsetParent:Jo,getElementRects:Xl,getClientRects:Wl,getDimensions:Hl,getScale:ke,isElement:Z,isRTL:Yl};function Jl(e,t){let n=null,o;const i=Ce(e);function r(){var s;clearTimeout(o),(s=n)==null||s.disconnect(),n=null}function l(s,a){s===void 0&&(s=!1),a===void 0&&(a=1),r();const{left:p,top:C,width:y,height:g}=e.getBoundingClientRect();if(s||t(),!y||!g)return;const f=ct(C),x=ct(i.clientWidth-(p+y)),v=ct(i.clientHeight-(C+g)),h=ct(p),S={rootMargin:-f+"px "+-x+"px "+-v+"px "+-h+"px",threshold:Ee(0,Me(1,a))||1};let R=!0;function I(A){const P=A[0].intersectionRatio;if(P!==a){if(!R)return l();P?l(!1,P):o=setTimeout(()=>{l(!1,1e-7)},100)}R=!1}try{n=new IntersectionObserver(I,{...S,root:i.ownerDocument})}catch{n=new IntersectionObserver(I,S)}n.observe(e)}return l(!0),r}function Zl(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:a=!1}=o,p=mn(e),C=i||r?[...p?ve(p):[],...ve(t)]:[];C.forEach(b=>{i&&b.addEventListener("scroll",n,{passive:!0}),r&&b.addEventListener("resize",n)});const y=p&&s?Jl(p,n):null;let g=-1,f=null;l&&(f=new ResizeObserver(b=>{let[S]=b;S&&S.target===p&&f&&(f.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var R;(R=f)==null||R.observe(t)})),n()}),p&&!a&&f.observe(p),f.observe(t));let x,v=a?Pe(e):null;a&&h();function h(){const b=Pe(e);v&&(b.x!==v.x||b.y!==v.y||b.width!==v.width||b.height!==v.height)&&n(),v=b,x=requestAnimationFrame(h)}return n(),()=>{var b;C.forEach(S=>{i&&S.removeEventListener("scroll",n),r&&S.removeEventListener("resize",n)}),y==null||y(),(b=f)==null||b.disconnect(),f=null,a&&cancelAnimationFrame(x)}}const es=Nl,ts=kl,Nn=Ol,ns=(e,t,n)=>{const o=new Map,i={platform:Zo,...n},r={...i.platform,_c:o};return Vl(e,t,{...i,platform:r})},os=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){