import{h}from"./index-38ad4957.js";import{i as intl}from"./global-96c14d63.js";import{k as useState,y}from"./dom-context-hooks.module-50442785.js";import{_}from"./index.module-b23fdad8.js";import{c as createStyleSheet}from"./JSS-67b5cff8.js";var style={IconStyle:{display:"block",position:"absolute",top:"23px"},DivStyle:{marginLeft:"28px"},Details:{marginLeft:"28px"},Heading:{display:"inline-block"},Children:{display:"none"}};var sheet=createStyleSheet(style);var styleString=sheet.toString();function RequiredPropsError(e,t){var s=e.missingProps,a=e.heading,r=a===void 0?"There was a problem loading this section":a,i=e.subheading,l=i===void 0?"There was a technical problem that prevented this section from loading. Please contact us with the link to this page.":i,o=e.description,n=o===void 0?"Error occured while loading <{tagName}>. Values for the following attributes are missing:":o;if(!s)return false;var d=_();var c=useState(false),m=c[0],u=c[1];return h("sl-alert",{type:"danger",open:true},h("style",{type:"text/css"},styleString),h("div",{slot:"icon",class:sheet.classes.IconStyle},h("sl-icon",{name:"exclamation-octagon"})),h("div",{class:sheet.classes.DivStyle},h("h2",{class:sheet.classes.Heading},intl.formatMessage({id:"error-heading",defaultMessage:r})),h("p",null,intl.formatMessage({id:"error-subheading",defaultMessage:l}))),h("details",{class:sheet.classes.Details},h("summary",{onClick:function(){return u(!m)}},m?"Less":"More"," details"),h("p",null,intl.formatMessage({id:"error-description",defaultMessage:n},{tagName:d.tagName.toLowerCase()})),h("ul",null,s.map((function(e){return h("li",null,h("strong",null,e.attribute))})))),h("div",{class:sheet.classes.Children},t))}var LEAD_FORM_STATE_CONTEXT="sq:lead-form-state";var LEAD_FORM_STATE_CONTEXT_INTERNAL="sq:lead-form-state-internal";function useLeadFormState(e){var t=_();var s=y(t,LEAD_FORM_STATE_CONTEXT,e),a=s[0],r=s[1];y(t,LEAD_FORM_STATE_CONTEXT_INTERNAL,[a,r]);return{leadFormState:a,setLeadFormState:r}}export{LEAD_FORM_STATE_CONTEXT as L,RequiredPropsError as R,useLeadFormState as u};