freemium-survey-components 0.10.54 → 0.11.0

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/lib/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("react"),t=e(n),r=require("react-transition-group"),o=e(require("react-dom"));function s(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}s(".freemium-survey-components .nps-container {\n margin: 0 auto;\n width: 100%;\n display: flex;\n flex-direction: column;\n grid-gap: 28px;\n gap: 28px;\n}\n.freemium-survey-components .nps-container .footer {\n border-top: 1px solid #ebeff3;\n padding-top: 20px;\n display: flex;\n justify-content: center;\n font-size: 0.875rem;\n line-height: 1.5;\n color: #666;\n}\n.freemium-survey-components .nps-container .footer:empty {\n display: none;\n}\n.freemium-survey-components .nps-container .nps-scale {\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale .button-container {\n flex-direction: column;\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n}\n.freemium-survey-components .nps-container .nps-scale .help-text-container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.freemium-survey-components .nps-container .nps-scale .positive-text {\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n right: 0px;\n text-align: right;\n}\n.freemium-survey-components .nps-container .nps-scale .negative-text {\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n left: 0;\n text-align: left;\n}\n.freemium-survey-components .nps-container .nps-scale span {\n color: #aaa;\n font-size: 0.75rem;\n}\n.freemium-survey-components .nps-container .nps-scale button {\n display: inline-block;\n font-size: 1rem;\n white-space: nowrap;\n vertical-align: middle;\n background: none;\n border: none;\n box-shadow: none;\n cursor: pointer;\n text-align: center;\n font-weight: 400;\n border-radius: 4px;\n margin: 0;\n outline: none;\n margin-left: -1px;\n width: 40px;\n height: 40px;\n transform: scale(1);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover {\n transition: background 0.2s ease-in, border-color 0.2s ease-in, transform 0.2s cubic-bezier(0.5, 2, 0.5, 0.75);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover, .freemium-survey-components .nps-container .nps-scale button:focus {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale button.active {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale.rounded button {\n border-radius: 50%;\n}\n.freemium-survey-components .nps-container .nps-scale.square button {\n border-radius: 0;\n}\n.freemium-survey-components .nps-container .nps-scale.curved button {\n border-radius: 3px;\n}\n.freemium-survey-components .nps-container .nps-scale.highlighted button:hover, .freemium-survey-components .nps-container .nps-scale.highlighted button:focus, .freemium-survey-components .nps-container .nps-scale.highlighted button.active {\n background: var(--default-brand-color) !important;\n background: var(--brand-color, var(--default-brand-color)) !important;\n}\n.freemium-survey-components .nps-container .nps-scale .choices {\n width: 100%;\n display: flex;\n justify-content: space-between;\n font-weight: 500;\n background-color: #ebeff3;\n border-radius: 4px;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choices {\n background-color: transparent;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice {\n background: #ebeff3;\n color: #000;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice.active, .freemium-survey-components .nps-container .nps-scale.standard .choice:hover {\n background: #e43e3d;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1):focus, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1).active, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1):hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2):focus, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2).active, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2):hover {\n background: #00af50;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(3):hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(4):hover {\n background: #f8c43e;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice.active {\n color: #fff;\n transform: scale(1.2);\n}\n\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .choices {\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .nps-container .nps-scale .choices,\n.card-survey-style .nps-container .nps-scale .choices {\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale .choices,\n.card-survey-style .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale button,\n.card-survey-style .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n }\n}\n.widget-survey-components .nps-container .nps-scale .choices {\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}");const i=e=>{const{type_info:{linear_scale:{button_style:r="highlighted",button_shape:o="rounded"}={},rating_presets:{start:s="Very unlikely",end:i="Very likely"}={},validation:{min:a},footer_text:u}}=e,c=e=>{switch(e){case e<=6:return"detractor";case e<=8:return"passive";default:return"promoter"}},l=n.useRef(Array.from({length:10+(0===a?1:0)},((e,n)=>n+a)));return t.createElement("div",{className:"nps-container","data-test-input":"nps"},t.createElement("div",{className:`nps-scale ${o} ${r}`},t.createElement("div",{className:"button-container"},t.createElement("div",{className:"choices",role:"radiogroup","aria-required":!0},l.current.map((n=>t.createElement("button",{role:"radio","aria-checked":e.npsValue===n,key:n,"data-test-nps-choice":n,onClick:t=>{e.onChangeHandler(n)},className:`choice ${c(n)} ${e.npsValue===n&&"active"}`},n)))),t.createElement("div",{className:"help-text-container"},t.createElement("span",{className:"negative-text",role:"note"},`${a} - ${s}`),t.createElement("span",{className:"positive-text",role:"note"},`${l.current[l.current.length-1]} - ${i}`)))),t.createElement("div",{className:"footer",role:"note"},u))},a=(e,n)=>(e.defaultProps=n,e);s('.freemium-survey-components .input-container,\n.freemium-survey-components .textarea-container {\n display: flex;\n flex-direction: column;\n width: 100%;\n border-radius: 4px;\n position: relative;\n}\n.freemium-survey-components label.input-label {\n display: inline-block;\n padding-bottom: 8px;\n padding-left: 2px;\n font-size: 0.75rem;\n font-weight: 400;\n}\n.freemium-survey-components label.required::after {\n content: "*";\n position: relative;\n top: 2px;\n font-weight: 500;\n font-size: 0.85rem;\n padding-left: 3px;\n color: #d72d30;\n}\n.freemium-survey-components .input-basic {\n width: 100%;\n display: flex;\n align-items: center;\n border-radius: 4px;\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n transition: border-color 0.2s linear;\n background: #fff;\n}\n.freemium-survey-components .textarea-container .input-basic {\n flex-direction: column;\n align-items: unset;\n}\n.freemium-survey-components .input-basic.error {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error:hover {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error[focus-within] {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic.error:focus-within {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: 0.2s linear;\n}\n.freemium-survey-components .input-basic[focus-within] {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .input-basic:focus-within {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .input-basic[focus-within] .end-max-length {\n opacity: 1;\n}\n.freemium-survey-components .input-basic:focus-within .end-max-length {\n opacity: 1;\n}\n.freemium-survey-components .end-max-length {\n transition: opacity ease 0.2s;\n opacity: 0;\n padding: 0 8px;\n font-size: 0.75rem;\n color: #264966;\n}\n.freemium-survey-components .textarea-container .end-max-length {\n padding: 8px;\n align-self: flex-end;\n}\n.freemium-survey-components span.input-error {\n display: block;\n padding-left: 2px;\n padding-top: 4px;\n font-size: 0.9rem;\n color: #d72d30;\n}\n.freemium-survey-components input[type=text] {\n padding: 6px 12px;\n flex: 1;\n border: unset;\n height: 32px;\n font-size: 1rem;\n min-width: 0;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components input[type=text],\n.freemium-survey-components textarea {\n outline: none;\n border: none;\n}\n.freemium-survey-components input[type=text]::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea {\n min-height: 116px;\n padding: 12px;\n flex: 1;\n border: unset;\n resize: none;\n font-size: 1rem;\n min-width: 0;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components textarea::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}');const u=["RANGE","NPS","RADIO","DROPDOWN"],c={default:500,compact:500,cozy:400},l={isRequired:!1,showCount:!0,isErrored:!1,inline:!1,spellCheck:!1,autoFocusInput:!0},m=n.forwardRef(((e,r)=>{const o=n.useRef(null);n.useEffect((()=>{e.autoFocusInput&&setTimeout((()=>{o.current?.focus()}),300+e.autoFocusDelay)}),[e.autoFocusInput]);const{inputStyle:s,style:i,className:a,showCount:u,isErrored:c,startLabel:l,isRequired:m,errorText:d,endLabel:p,maxLength:f=256,onChange:y,autoFocusInput:v,...h}=e;return t.createElement("div",{className:"input-container",style:i},e.label&&t.createElement("label",{className:"input-label "+(m?"required":"")},e.label),t.createElement(t.Fragment,null,l&&t.createElement("div",{className:"start-label"},l),t.createElement("div",{className:`input-basic ${c?"error":""}${a||""}`},t.createElement("input",Object.assign({},h,{type:"text",autoComplete:"off",ref:o,style:s,onChange:e=>{e.target.value?.length>f||y?.(e)}})),u&&f>0&&t.createElement("div",{className:"end-max-length"},`${e.value&&e.value.length||0}/${f}`)),p&&t.createElement("div",{className:"end-label"},p)),c&&d&&t.createElement("span",{className:"input-error"},e.errorText))})),d=n.forwardRef(((e,r)=>{const o=n.useRef(null);n.useEffect((()=>{e.autoFocusInput&&setTimeout((()=>{o.current?.focus()}),300+e.autoFocusDelay)}),[e.autoFocusInput]);const{inputStyle:s,style:i,className:a,showCount:u,maxLength:c=1500,startLabel:l,isRequired:m,autoFocusInput:d,onChange:p,...f}=e;return t.createElement(t.Fragment,null,t.createElement("div",{className:"textarea-container",style:i},e.label&&t.createElement("label",{className:"input-label "+(m?"required":"")},e.label),l&&t.createElement("div",{className:"start-label"},l),t.createElement("div",{className:`input-basic ${a||""}`},t.createElement("textarea",Object.assign({},f,{autoComplete:"off",ref:o,style:s,onChange:e=>{e.target.value?.length>c||p?.(e)}})),u&&c&&c>0&&t.createElement("div",{className:"end-max-length"},`${e.value&&e.value.length||0}/${c}`)),e.endLabel&&t.createElement("div",{className:"end-label"},e.endLabel)))})),p=a(m,l),f=a(d,l);s('.freemium-survey-components .checkbox-group {\n width: 100%;\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n flex-direction: column;\n white-space: nowrap;\n flex-wrap: wrap;\n}\n.freemium-survey-components .icon-container {\n display: inline-block;\n flex: 0 0 12px;\n width: 12px;\n height: 12px;\n min-width: 12px;\n min-height: 12px;\n color: inherit;\n position: absolute;\n left: 1px;\n top: 2px;\n}\n.freemium-survey-components .tick-icon {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: 100%;\n width: 100%;\n color: inherit;\n fill: currentColor;\n}\n.freemium-survey-components input[type=checkbox] {\n position: absolute;\n clip: rect(0px 0px 0px 0px);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=checkbox]:focus ~ .checkbox {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 2px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 2px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 2px;\n border-color: transparent;\n}\n.freemium-survey-components .checkbox-label {\n display: flex;\n align-items: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n opacity: 1;\n line-height: 1.2;\n cursor: pointer;\n font-size: 1rem;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n border-radius: 4px;\n white-space: pre-wrap;\n}\n.freemium-survey-components .checkbox-label:hover {\n border-color: #92a2b1;\n}\n.freemium-survey-components .checkbox-label.disabled {\n opacity: 0.5;\n cursor: "not-allowed";\n}\n.freemium-survey-components .checkbox {\n transition: background-color ease-in 0.2s;\n min-width: 14px;\n min-height: 14px;\n min-height: 14px;\n max-height: 14px;\n border-radius: 2px;\n position: relative;\n margin-right: 16px;\n background-color: #fff;\n border: 1px solid;\n text-align: left;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n box-shadow: var(--default-background-color) 0px 0px 0px 5px;\n box-shadow: var(--background-color, var(--default-background-color)) 0px 0px 0px 5px;\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:disabled ~ .checkbox:hover {\n box-shadow: unset;\n border-color: unset;\n}');const y=()=>t.createElement("svg",{id:"tick",className:"tick-icon",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"title",viewBox:"0 0 10 10"},t.createElement("path",{d:"M3 5.87c-.18666814.00267463-.36667109-.06932655-.5-.2L.21 3.41c-.1786328-.17863279-.24839684-.43899577-.1830127-.6830127.06538414-.24401694.25598306-.43461586.5-.5C.77100423 2.16160316 1.0313672 2.23136721 1.21 2.41L3 4.18 6.8.33c.27679776-.27455556.72320224-.27455556 1 0 .13696438.13025306.21450026.31098915.21450026.5S7.93696438 1.19974694 7.8 1.33L3.45 5.67c-.12082534.11896945-.28072735.19003701-.45.2Z",fill:"#fff",fillRule:"evenodd"})),v=({values:e=[],othersValue:r="",options:o,name:s,autoFocusGroup:i,autoFocusDelay:a,onChangeHandler:u,saveOthersValue:c})=>{const l=e.includes("__others__"),m=n.useRef(null);return n.useEffect((()=>{i&&setTimeout((()=>{m.current?.focus()}),300+a)}),[i]),t.createElement("div",{className:"checkbox-group"},t.createElement("button",{ref:m,className:"autofocus-button","aria-hidden":!0}),o?.filter((e=>"__others__"!==e.value)).map(((n,r)=>t.createElement(h,{key:n.id,checked:e?.includes(n.value),name:n.value,id:n.id,onChange:(t,r)=>{if(r)u([...e||[],n.value]);else{const t=e.indexOf(n.value);t>-1&&e.splice(t,1),u([...e])}}},n.value))),o?.find((e=>"__others__"===e.value))&&t.createElement(h,{key:"others",checked:l,name:"__others__",id:"__others__",onChange:(n,t)=>{if(t)u([...e,"__others__"]);else{const n=e.findIndex((e=>"__others__"===e));e.splice(n,1),u(e)}}},"Others"),l&&t.createElement(t.Fragment,null,t.createElement(p,{placeholder:"Enter your comment",value:r,onChange:e=>{c(s,e.target.value)},autoFocusDelay:10,label:""})))},h=a((e=>{const r=n.useRef(null);return n.useEffect((()=>{e.autoFocus&&setTimeout((()=>{r.current?.focus()}),320)}),[]),t.createElement("label",{className:`checkbox-label ${e.disabled&&"disabled"}`},t.createElement("input",{ref:r,id:e.id,type:"checkbox",name:e.name,readOnly:e.readOnly,disabled:e.disabled,"aria-disabled":e.disabled,checked:e.checked,onChange:e.readOnly?()=>{}:n=>e.onChange(n,n.target.checked)}),t.createElement("div",{className:"checkbox"},e.checked&&t.createElement("div",{className:"icon-container"},t.createElement(y,null)," ")),t.createElement("div",null,e.children))}),{checked:!1});s('.freemium-survey-components .radio-group {\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n white-space: nowrap;\n flex-direction: column;\n width: 100%;\n}\n.freemium-survey-components .radio {\n background-color: #fff;\n border: 1px solid;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: background-color ease-in 0.2s;\n min-width: 18px;\n max-width: 18px;\n min-height: 18px;\n max-height: 18px;\n border-radius: 50%;\n position: relative;\n margin-right: 16px;\n text-align: left;\n}\n.freemium-survey-components .radio:before {\n left: 3px;\n top: 3px;\n content: "";\n position: absolute;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n transition: all ease-in 0.2s;\n background-color: #fff;\n}\n.freemium-survey-components .radio-label {\n display: flex;\n align-items: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n cursor: pointer;\n line-height: 1.2;\n font-size: 1rem;\n font-weight: 400;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n border-radius: 4px;\n white-space: pre-wrap;\n color: #3a4b67;\n}\n.freemium-survey-components input[type=radio] {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=radio]:focus ~ .radio {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 3px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 3px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 3px;\n border-color: transparent;\n}\n.freemium-survey-components input[type=radio]:checked ~ .radio:before {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .radio-label:hover {\n border-color: #92a2b1;\n}');const x=({name:e,options:r,value:o,autoFocusGroup:s,autoFocusDelay:i,onChangeHandler:a,saveOthersValue:u,othersOption:c,othersRequired:l,othersValue:m,isFinalQn:d})=>{const f=n.useRef(null);return n.useEffect((()=>{s&&setTimeout((()=>{f.current?.focus()}),300+i)}),[s]),t.createElement("div",{className:"radio-group",role:"radiogroup"},t.createElement("button",{ref:f,className:"autofocus-button","aria-hidden":!0,tabIndex:-1}),r?.sort(((e,n)=>"__others__"===e.value?1:"__others__"===n.value?-1:0))?.map(((n,r)=>t.createElement(g,{key:n.value,value:n.value,name:e,onChange:n=>{"__others__"!==n.currentTarget.value&&u(e,null),a(n.currentTarget.value)},checked:o===n.value},"__others__"===n.value?"Others":n.value))),"__others__"===o&&t.createElement(t.Fragment,null,t.createElement(p,{value:m??"",onChange:n=>{"__others__"!==o&&d&&a("__others__"),u(e,n.target.value)},placeholder:"Enter your comment",label:"",autoFocusDelay:10})))},g=a((e=>{const r=n.useRef(null);return n.useEffect((()=>{e.autoFocus&&setTimeout((()=>{r.current?.focus()}),320)}),[]),t.createElement("label",{className:"radio-label"},t.createElement("input",{ref:r,type:"radio",name:e.name,value:e.value,checked:e.checked,onChange:e.onChange}),t.createElement("div",{className:"radio"}),t.createElement("div",null,e.children))}),{checked:!1,autoFocus:!1});s(".progressbar-container {\n width: 100%;\n height: 4px;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1;\n text-align: left;\n overflow: hidden;\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n}\n\n.progressbar-container.widget {\n position: absolute;\n top: 0;\n height: 2px;\n}\n\n.progressbar {\n transition: transform 0.2s linear 200ms;\n transform-origin: left;\n height: 100%;\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}");const b=e=>{const{totalSteps:n,completedSteps:r,widget:o}=e;return t.createElement("div",{className:"progressbar-container "+(o?"widget":"")},t.createElement("div",{className:"progressbar",style:{width:(r>0?100/n:0)+"%",transform:`scaleX(${r})`}}))};s(".freemium-survey-components .action-button {\n width: auto;\n display: block;\n padding: 8px 16px;\n cursor: pointer;\n line-height: 1.5;\n text-align: center;\n font-weight: 600;\n letter-spacing: 0.3px;\n border-radius: 4px;\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n color: --default-button-text-color;\n color: var(--button-text-color, --default-button-text-color);\n background: var(--default-brand-color);\n background: var(--brand-color, var(--default-brand-color));\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n border-radius: 4px;\n min-width: 200px;\n max-width: -webkit-fit-content;\n max-width: -moz-fit-content;\n max-width: fit-content;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components .action-button:not([disabled]):hover {\n transform: translateY(-4px);\n}\n.freemium-survey-components .action-button[disabled] {\n cursor: not-allowed;\n opacity: 0.6;\n}\n.freemium-survey-components button:focus:not(:active) {\n /* box-shadow: 0 0 0 2px ${pseudo.focus}; */\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .action-button {\n min-width: 120px;\n }\n}\n.widget-survey-components .action-button {\n min-width: 120px;\n}\n\n.freemium-survey-components.mobile-preview .action-button {\n min-width: 120px;\n}");const w=()=>t.createElement(t.Fragment,null,"..."),k=e=>{const{inline:n=!1,children:r,disabled:o,className:s="",htmlType:i,type:a="primary",onClick:u,size:c,overrideStyleClassName:l="",loading:m=!1,...d}=e;return t.createElement("button",Object.assign({style:n?{display:"inline-block"}:{},disabled:o,className:`action-button ${s} ${l}`,type:i,onClick:u},d),m?t.createElement(w,null):r)},_=()=>t.createElement("svg",{width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M7.82585 6.15754C7.98999 6.32147 8.08232 6.54389 8.08252 6.77587L8.08252 7.2192C8.07983 7.45069 7.98788 7.6722 7.82585 7.83754L1.82919 13.8225C1.77496 13.8772 1.71044 13.9206 1.63936 13.9502C1.56827 13.9798 1.49203 13.9951 1.41502 13.9951C1.33801 13.9951 1.26177 13.9798 1.19068 13.9502C1.1196 13.9206 1.05508 13.8772 1.00085 13.8225L0.172521 12.9942C0.118197 12.941 0.0750381 12.8774 0.0455752 12.8073C0.0161124 12.7372 0.000937578 12.6619 0.000937585 12.5859C0.000937592 12.5098 0.0161125 12.4345 0.0455753 12.3644C0.0750381 12.2943 0.118197 12.2308 0.172521 12.1775L5.36419 6.99754L0.172522 1.81754C0.117847 1.76331 0.0744506 1.69879 0.0448352 1.62771C0.0152208 1.55662 -2.75162e-05 1.48038 -2.75094e-05 1.40337C-2.75027e-05 1.32636 0.0152208 1.25012 0.0448353 1.17904C0.0744507 1.10795 0.117847 1.04343 0.172522 0.989205L1.00086 0.172537C1.05508 0.117862 1.1196 0.0744661 1.19069 0.0448507C1.26177 0.0152353 1.33801 -1.20337e-05 1.41502 -1.2027e-05C1.49203 -1.20203e-05 1.56827 0.0152353 1.63936 0.0448507C1.71044 0.0744661 1.77496 0.117862 1.82919 0.172537L7.82585 6.15754Z",fill:"#6B6B6B"})),q=()=>t.createElement("svg",{width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0.256667 7.83755C0.0925257 7.67361 0.000204227 7.4512 0 7.21921V6.77588C0.00268801 6.5444 0.0946357 6.32289 0.256667 6.15755L6.25333 0.172549C6.30756 0.117874 6.37208 0.0744776 6.44316 0.0448625C6.51425 0.0152474 6.59049 0 6.6675 0C6.74451 0 6.82075 0.0152474 6.89184 0.0448625C6.96292 0.0744776 7.02744 0.117874 7.08167 0.172549L7.91 1.00088C7.96432 1.05411 8.00748 1.11764 8.03694 1.18776C8.06641 1.25787 8.08158 1.33316 8.08158 1.40922C8.08158 1.48527 8.06641 1.56056 8.03694 1.63067C8.00748 1.70079 7.96432 1.76432 7.91 1.81755L2.71833 6.99755L7.91 12.1775C7.96467 12.2318 8.00807 12.2963 8.03769 12.3674C8.0673 12.4385 8.08255 12.5147 8.08255 12.5917C8.08255 12.6687 8.0673 12.745 8.03769 12.8161C8.00807 12.8871 7.96467 12.9517 7.91 13.0059L7.08167 13.8225C7.02744 13.8772 6.96292 13.9206 6.89184 13.9502C6.82075 13.9799 6.74451 13.9951 6.6675 13.9951C6.59049 13.9951 6.51425 13.9799 6.44316 13.9502C6.37208 13.9206 6.30756 13.8772 6.25333 13.8225L0.256667 7.83755Z",fill:"#6B6B6B"})),E=({question:e,formValues:n,othersMeta:r,onChangeHandler:o,saveOthersValue:s,autoFocus:a,autoFocusDelay:u,isFinalQn:c})=>{switch(e.type_info.question_type){case"RANGE":return t.createElement(i,{type_info:e.type_info,onChangeHandler:o,npsValue:n[e.name]});case"CHECKBOX":case"MULTI_SELECT":return t.createElement(v,{name:e.name,autoFocusGroup:a,values:n[e.name],othersValue:r[e.name],options:e.type_info.choices,onChangeHandler:o,saveOthersValue:s,othersOption:e.type_info.meta?.othersOption,othersRequired:e.type_info.meta?.othersRequired,autoFocusDelay:u});case"RADIO":case"DROPDOWN":return t.createElement(x,{autoFocusGroup:a,autoFocusDelay:u,name:e.name,onChangeHandler:o,saveOthersValue:s,options:e.type_info.choices,value:n[e.name],othersValue:r[e.name],othersOption:e.type_info.meta?.othersOption,othersRequired:e.type_info.meta?.othersRequired,isFinalQn:c});case"INPUT":case"TEXT":return e.type_info?.meta?.readOnly?t.createElement("div",{className:"message-container"},e.type_info?.meta?.value):t.createElement("div",{className:"responsive-text-field"},t.createElement(p,{autoFocusInput:a,autoFocusDelay:u,label:"",isRequired:e.is_required,value:n[e.name]||"",placeholder:e.type_info?.meta?.placeholder??"",onChange:e=>o(e.target.value)}),t.createElement(f,{autoFocusInput:a,autoFocusDelay:u,label:"",maxLength:256,isRequired:e.is_required,placeholder:e.type_info?.meta?.placeholder??"",value:n[e.name]||"",onChange:e=>o(e.target.value)}));case"PARAGRAPH":return t.createElement(f,{autoFocusInput:a,autoFocusDelay:u,label:"",isRequired:e.is_required,placeholder:e.type_info?.meta?.placeholder??"",value:n[e.name]||"",onChange:e=>o(e.target.value)});default:return console.error(`Question type ${e.type_info.question_type} not found`),null}},C=(e,n,t)=>{if(e){let r={"{{nps.rating}}":t};n&&(r={...r,...n});const o=new RegExp(Object.keys(r).join("|"),"gi");e=e.replace(o,(function(e){return r[e.toLowerCase()]}))}return e},N=e=>n.useMemo((()=>{const n=JSON.parse(JSON.stringify(e)),t=[];return(n.question_details?.questions||[]).forEach((e=>{const n=e.type_info?.meta?.block;n&&(n.question_names||(n.question_names=[e.name]),t.push(n))})),{...n,meta:{...n.meta,blocks:t}}}),[e]);s(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #3a4b67;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 560px;\n --default-widget-max-height: 400px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-components.card-survey-style {\n padding: 20px 0;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation {\n white-space: nowrap;\n border-radius: 3px;\n border: 1px solid #efefef;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button svg {\n transform: rotate(90deg);\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #efefef;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n.freemium-survey-components.card-survey-style .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 200ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n transition: opacity 50ms ease-out;\n overflow: auto;\n}\n.freemium-survey-components.card-survey-style .hide-question-container {\n opacity: 0;\n}\n.freemium-survey-components.card-survey-style .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components.card-survey-style .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components.card-survey-style .fade-enter .question-container {\n opacity: 0;\n transform: translateY(15px);\n}\n.freemium-survey-components.card-survey-style .fade-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-exit-active .question-container {\n opacity: 0.05;\n transform: translateY(-15px);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-enter .question-container {\n opacity: 0;\n transform: translateY(-15px);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-exit-active .question-container {\n opacity: 0.05;\n transform: translateY(15px);\n}\n.freemium-survey-components.card-survey-style .fade-enter-active .question-container,\n.freemium-survey-components.card-survey-style .fade-exit-active .question-container,\n.freemium-survey-components.card-survey-style .fade-reverse-enter-active .question-container,\n.freemium-survey-components.card-survey-style .fade-reverse-exit-active .question-container {\n transition: opacity 200ms, transform 200ms;\n}\n.freemium-survey-components.card-survey-style .question-footer {\n display: flex;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components.card-survey-style .question-footer:empty {\n display: none;\n}\n.freemium-survey-components.card-survey-style .question-footer:only-child {\n margin-left: auto;\n}\n.freemium-survey-components.card-survey-style .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n width: 100%;\n}\n.freemium-survey-components.card-survey-style .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components.card-survey-style .skip-button {\n font-weight: 500;\n color: #3a4b67;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components.card-survey-style .skip-button:hover {\n background-color: #f3f3f3;\n transform: translateY(-4px);\n}\n.freemium-survey-components.card-survey-style .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.card-survey-style .submit {\n max-width: 700px;\n text-align: left;\n background: transparent;\n box-shadow: none;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.card-survey-style .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components.card-survey-style .thankyou .heading {\n font-weight: 500;\n font-size: 22px;\n}\n.freemium-survey-components.card-survey-style .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #475867;\n width: 75%;\n}\n.freemium-survey-components.card-survey-style .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components.card-survey-style .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components.card-survey-style .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components.card-survey-style .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components.card-survey-style .message-container:empty {\n display: none;\n}\n\n@media (max-width: 550px) {\n div.freemium-survey-components.card-survey-style .responsive-text-field .input-container {\n display: none;\n }\n div.freemium-survey-components.card-survey-style .responsive-text-field .textarea-container {\n display: flex;\n }\n div.freemium-survey-components.card-survey-style .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n }\n div.freemium-survey-components.card-survey-style .question-footer {\n flex-direction: column-reverse;\n grid-gap: 20px;\n gap: 20px;\n }\n div.freemium-survey-components.card-survey-style .freemium-survey-step-navigation {\n width: 100%;\n }\n div.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button {\n width: 50%;\n }\n div.freemium-survey-components.card-survey-style .action-buttons {\n flex-direction: column;\n width: 100%;\n }\n div.freemium-survey-components.card-survey-style .action-buttons button {\n max-width: unset;\n }\n div.freemium-survey-components.card-survey-style .action-button {\n max-width: unset;\n width: 100%;\n }\n div.freemium-survey-components.card-survey-style .thankyou .text {\n width: auto;\n }\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .responsive-text-field .input-container {\n display: none;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .responsive-text-field .textarea-container {\n display: flex;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .question-footer {\n flex-direction: column-reverse;\n grid-gap: 20px;\n gap: 20px;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .freemium-survey-step-navigation {\n width: 100%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .freemium-survey-step-navigation .navigation-button {\n width: 50%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .action-buttons {\n flex-direction: column;\n width: 100%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .action-buttons button {\n max-width: unset;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .action-button {\n max-width: unset;\n width: 100%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .thankyou .text {\n width: auto;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const S=({thankYouQuestion:e,preview:r,placeholders:o,npsValue:s})=>(n.useEffect((()=>{r||e.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=e.type_info.meta?.redirectUrl}),1e3*e.type_info.meta?.redirectDelay??1e4)}),[]),t.createElement("div",{className:"question-container thankyou"},t.createElement("div",{className:"heading"},"Thank you!"),t.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:C(e.text,o,s)}}),e.type_info.meta?.redirectUrl&&t.createElement("div",{style:{width:"100%"}},t.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",e.type_info.meta?.redirectDelay," seconds.",t.createElement("br",null)),t.createElement("a",{className:"link",href:e.type_info.meta?.redirectUrl},e?.type_info.meta?.redirectUrl)))),B=({currentBlockIndex:e,currentBlockIndexOfBlocksWithQns:n,setCurrentBlockIndexOfBlocksWithQnsDirty:r,blocksWithQns:o,blocks:s,setHorizontalScrollUnits:i,preventQuestionAnimation:a,tempCurrentBlockIndexOfBlocksWithQns:u,setReverse:c,reverse:l})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:0==n.current,className:"navigation-button",onClick:()=>{l?(n.current=Math.max(n.current-1,0),e.current=s.findIndex((e=>e.name===o[n.current].name))):(u.current=Math.max(n.current-1,0),e.current=s.findIndex((e=>e.name===o[u.current].name))),a.current=!1,r.current=!0,c(!0),i({})}},t.createElement(q,null)),t.createElement("button",{className:"navigation-button",disabled:n.current>=o.length-1,onClick:()=>{a.current=!1,l?(u.current=Math.min(n.current+1,o.length-1),e.current=s.findIndex((e=>e.name===o[u.current].name))):(n.current=Math.min(n.current+1,o.length-1),e.current=s.findIndex((e=>e.name===o[n.current].name))),r.current=!0,c(!1),i({})}},t.createElement(_,null))),I=({widget:e,surveyStyle:n,formValues:r,blocksWithQns:o,blocks:s,thankYouQuestion:i,currentBlockIndexOfBlocksWithQns:a,currentBlockIndexOfBlocks:c,currentEditingBlock:l,isSubmitting:m,isValuesCommitted:d,isCurrentBlockFinal:p,setHorizontalScrollUnits:f,handleFormValues:y,skipBlock:v,setIsSubmitting:h,onSubmit:x,setIsSurveyCompleted:g,preventQuestionAnimation:b,preview:w,closePreview:_,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,question:C,block:N,reverse:S,othersMeta:I,setCurrentBlockIndexOfBlocksWithQnsDirty:O,...R})=>{const z=R.blockIndex??a.current,Q=()=>(!u.includes(C.type_info.question_type)||"DROPDOWN"===C.type_info.question_type&&"__others__"===r[C.name])&&!p(),T=()=>"RANGE"!==C.type_info.question_type&&!N.required&&!p(),D=()=>("DROPDOWN"===C.type_info.question_type&&!N.required&&r[C.name],!1),F=()=>p()&&(e||"standard"!==n),W=("MULTI_SELECT"===l.current.question.type_info.question_type&&r[l.current.question.name]?.includes("__others__")||"DROPDOWN"===l.current.question.type_info.question_type&&"__others__"===r[l.current.question.name])&&(!I[l.current.question.name]||""===I[l.current.question.name].trim());return t.createElement("div",{className:"question-footer"},!(!e&&"standard"===n||0===z&&void 0===r[C.name]||0===a.current&&!S)&&t.createElement(B,{currentBlockIndex:c,currentBlockIndexOfBlocksWithQns:a,blocksWithQns:o,blocks:s,setHorizontalScrollUnits:f,preventQuestionAnimation:b,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,reverse:S,setCurrentBlockIndexOfBlocksWithQnsDirty:O}),(Q()||D()||T()||F())&&t.createElement("div",{className:"action-buttons"},Q()&&t.createElement(k,{onClick:()=>{O.current=!1,q(!1),y(o[z],null,!0)},disabled:l.current.required&&(!r[l.current.question.name]||Array.isArray(r[l.current.question.name])&&0===r[l.current.question.name].length)||l.current.question.type_info.meta?.othersRequired&&W,className:"next-button"},"Next"),T()&&t.createElement("button",{className:"skip-button",onClick:()=>{O.current=!1,q(!1),v(C)}},"Skip"),F()&&t.createElement("div",{className:"submit"},t.createElement(k,{disabled:(l.current.required||l.current.question.type_info.pivot_question)&&(null==r[l.current.question.name]||0===r[l.current.question.name]?.length)||l.current.question.type_info.meta?.othersRequired&&W||m,onClick:()=>{h(!0),x()}},m?"Submitting":"Submit survey")),D()&&t.createElement("button",{className:"skip-button",onClick:()=>{q(!1),l.current=o[z],c.current=s.findIndex((e=>e.name===o[z].name)),v(C)}},"Clear selection")))},O=({survey:e,surveyStyle:o="standard",placeholders:s,onSubmit:i,widget:a,npsValue:c,preview:l,mobilePreview:m,closePreview:d})=>{const p=e.question_details?.questions||[],f=e.meta?.blocks||[],[y,v]=n.useState(null),[h,x]=n.useState({}),[g,w]=n.useState(!1),[k,_]=n.useState([]),[q,N]=n.useState({}),[B,O]=n.useState(!1),[R,z]=n.useState(null),[Q,T]=n.useState({}),D=n.useRef(null),F=n.useRef(null),W=n.useRef(-1),L=n.useRef(null),V=n.useRef(0),P=n.useRef(0),Y=n.useRef(!1),M=n.useRef(!1),A=n.useRef([]),H=t.useRef(null!=c&&"card"===o),$=n.useRef(null),U=n.useRef(0),[j,G]=n.useState(!1),X=n.useRef();n.useEffect((()=>{f&&($.current=f.find((e=>"TY"===e.name)),v(f.filter((e=>"TY"!==e.name))))}),[f]),n.useEffect((()=>{Y.current&&(P.current=U.current,N({}))}),[j]),n.useEffect((()=>{if(y)if(F.current=p.find((e=>e.type_info?.pivot_question))??p.find((e=>"RANGE"===e.type_info?.question_type))??p[0],null!=c){W.current=Math.min(F.current.type_info.validation.max,Math.max(F.current.type_info.validation.min,c));const e=p.find((e=>e.name===y[0].question_names[0]));D.current={...y[0],question:e},A.current=[...A.current,{...y[0],question:e}],_(A.current),x({Q_1:W.current})}else if(!D.current&&y.length>0)return D.current=y[0],void J(y[0])}),[y,c]),t.useEffect((()=>{k.length&&(A.current=k,P.current=k.length-1),N({})}),[k]),n.useEffect((()=>{Object.keys(h).length>0&&D.current.question&&(u.includes(D.current.question.type_info.question_type)&&("DROPDOWN"!==D.current.question.type_info.question_type||"__others__"!==h[D.current.question.name])||M.current)&&!K()&&(null!=c&&1==k.length?X.current?(clearTimeout(X.current),X.current=null,ee()):X.current=setTimeout((()=>{ee()}),1500):ee())}),[h]),n.useEffect((()=>{if(null!=h?.[F.current?.name])if($.current?.is_based_on_rating){const e=F.current?.type_info?.choices[h?.[F.current?.name]-F.current?.type_info?.validation?.min??0]?.dependent_question_names,n=$.current?.question_names.find((n=>e?.includes(n))),t=p.find((e=>e.name===n));z(t)}else{const e=p.find((e=>e.name==$.current?.question_names[0]));z(e)}}),[h?.[F.current?.name]]);const Z=()=>{i({...h,others_meta:Q},(()=>{R?.type_info.meta?.skipThankYouPage?l?setTimeout((()=>{d?.()}),300):window.location.href=R?.type_info.meta?.redirectUrl:w(!0)}))},K=()=>(V.current===y.length-1||"end"===D.current.branchOption)&&P.current===k.length-1,J=e=>{let n={};if(e.is_based_on_rating){const t=F.current?.type_info?.choices[h?.[F.current?.name]-F.current?.type_info?.validation?.min??0]?.dependent_question_names,r=e.question_names.find((e=>t?.includes(e)));n=p.find((e=>e.name===r))}else n=p.find((n=>n.name===e.question_names[0]));D.current.question=n;A.current.find((e=>e.question.name===n.name))?(P.current+=1,N({})):_([...A.current,{...e,question:n}])},ee=()=>{if(K())w(!0);else{if(D.current.nextBlock)V.current=y.findIndex((e=>e.name===D.current.nextBlock));else if(D.current.question.type_info?.meta?.branches){const e=D.current.question.type_info?.meta?.branches,n=h[D.current.question.name];let t;if(t="RANGE"===D.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return Z(),void w(!0);V.current=y.findIndex((e=>e.name===t.nextBlock))}else V.current+=1}else V.current+=1;D.current=y[V.current],J(y[V.current])}},ne=(e,n,t)=>{if(H.current=!1,t){if(M.current=!0,null!=h[e.question.name]&&e.name!==k[k.length-1].name){const[t,r]=(e=>{const n=k.findIndex((n=>n.name===e.name)),t=k.slice(0,n+1),r=t.reduce(((e,n)=>(e[n.question.name]=h[n.question.name],e)),{});return V.current=y.findIndex((n=>n.name===e.name)),[t,r]})(e);x({...r,...null!=n&&{[e.question.name]:n}}),A.current=t}else x({...h,...null!=n&&{[e.question.name]:n}});F?.current?.name==e?.question?.name&&(W.current=n)}else x({...h,...null!=n&&{[e.question.name]:n}})};if(!D.current||!D.current.question)return null;const te=k[Math.min(P.current??k.length-1,k.length-1)];return t.createElement("div",{className:`freemium-survey-components ${m?"mobile-preview":""} ${o}-survey-style`,id:"freemium-survey"},g?null:t.createElement(b,{totalSteps:y.length,completedSteps:V.current+(g?1:0)}),t.createElement(r.SwitchTransition,{mode:"out-in"},t.createElement(r.CSSTransition,{key:P.current+String(g),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:j?"fade-reverse":"fade"},t.createElement("div",{className:"questions"},g?t.createElement(S,{thankYouQuestion:R,preview:l,placeholders:s,npsValue:W.current}):t.createElement("div",{ref:L,id:`${te.question.name}`,className:`question-container ${a||"card"===o}`,"data-test-question-name":te.question.name},t.createElement("div",{className:"question-text",dangerouslySetInnerHTML:{__html:C(te.question.text,s,W.current)},title:`question-${P.current}`,role:"heading","aria-level":1}),t.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:{width:"100%"}},t.createElement(E,{question:te.question,isFinalQn:K(),formValues:h,othersMeta:Q,autoFocus:!0,autoFocusDelay:"standard"===o?350:0,saveOthersValue:(e,n)=>{if(null===n){const n={...Q};delete n[e],T({...n})}else T({...Q,[e]:n})},onChangeHandler:e=>{M.current=!1,V.current=y.findIndex((e=>e.name===te.name)),D.current=te,Y.current=!1,G(!1),ne(te,e,!("DROPDOWN"===te.question.type_info.question_type&&"__others__"===e)&&u.includes(te.question.type_info.question_type)&&!K())}})),t.createElement(I,{question:te.question,block:te,widget:a,surveyStyle:o,formValues:h,othersMeta:Q,blocksWithQns:k,blocks:y,thankYouQuestion:R,currentBlockIndexOfBlocksWithQns:P,reverse:j,setReverse:G,currentBlockIndexOfBlocks:V,currentEditingBlock:D,isSubmitting:B,isValuesCommitted:M,isCurrentBlockFinal:K,setHorizontalScrollUnits:N,handleFormValues:ne,skipBlock:e=>{M.current=!0,delete h[e.name],x({...h})},setIsSubmitting:O,onSubmit:Z,setIsSurveyCompleted:w,preventQuestionAnimation:H,preview:l,closePreview:d,tempCurrentBlockIndexOfBlocksWithQns:U,setCurrentBlockIndexOfBlocksWithQnsDirty:Y}))))))};s(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #3a4b67;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n}\n\n.freemium-survey-components.widget-survey-components {\n overflow: hidden;\n}\n.freemium-survey-components.widget-survey-components * {\n scrollbar-color: rgba(216, 216, 216, 0.5) transparent !important;\n}\n.freemium-survey-components.widget-survey-components * ::-webkit-scrollbar {\n height: auto;\n height: initial;\n width: 6px;\n}\n.freemium-survey-components.widget-survey-components * ::-webkit-scrollbar-track {\n background: transparent !important;\n}\n.freemium-survey-components.widget-survey-components * ::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: rgba(216, 216, 216, 0.5) !important;\n}\n.freemium-survey-components.widget-survey-components p {\n margin: 0;\n}\n.freemium-survey-components.widget-survey-components .questions {\n min-width: 100%;\n max-width: 100%;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n position: relative;\n display: flex;\n justify-content: row;\n align-items: flex-end;\n height: 100%;\n transition: height 200ms ease;\n}\n.freemium-survey-components.widget-survey-components .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n text-align: center;\n max-height: 100%;\n min-width: 100%;\n max-width: 700px;\n margin: 0 auto;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n padding: 28px 0;\n padding-top: 0;\n grid-gap: 28px;\n gap: 28px;\n position: absolute;\n overflow: auto;\n}\n.freemium-survey-components.widget-survey-components .question-wrapper {\n width: 100%;\n flex-grow: 1;\n padding: 4px 28px;\n overflow: auto;\n}\n.freemium-survey-components.widget-survey-components .hide-question-container {\n opacity: 0;\n}\n.freemium-survey-components.widget-survey-components .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n padding: 0 28px;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components.widget-survey-components .question-text p {\n all: inherit;\n padding: 0;\n}\n.freemium-survey-components.widget-survey-components .nps-container .footer {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components.widget-survey-components .fade-enter {\n opacity: 1;\n transform: translateX(80px);\n position: absolute;\n}\n.freemium-survey-components.widget-survey-components .fade-enter-active {\n position: absolute;\n opacity: 1;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-enter-done {\n position: absolute;\n}\n.freemium-survey-components.widget-survey-components .fade-exit {\n opacity: 0.05;\n pointer-events: none;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-exit-active {\n pointer-events: none;\n opacity: 0;\n transform: translateX(-80px);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-enter {\n opacity: 0;\n position: absolute;\n transform: translateX(-80px);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-enter-active {\n opacity: 1;\n position: absolute;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-exit {\n opacity: 0.05;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-exit-active {\n opacity: 0;\n transform: translateX(80px);\n}\n.freemium-survey-components.widget-survey-components .fade-enter-active,\n.freemium-survey-components.widget-survey-components .fade-reverse-enter-active,\n.freemium-survey-components.widget-survey-components .fade-reverse-exit-active,\n.freemium-survey-components.widget-survey-components .fade-exit-active {\n transition: opacity 200ms, transform 200ms;\n}\n.freemium-survey-components.widget-survey-components .question-footer {\n margin: 0px auto;\n display: flex;\n justify-content: space-between;\n align-items: center;\n position: -webkit-sticky;\n position: sticky;\n padding: 0 28px;\n bottom: -28px;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n}\n.freemium-survey-components.widget-survey-components .question-footer:empty {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .question-footer:only-child {\n margin-left: auto;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation {\n white-space: nowrap;\n border-radius: 3px;\n border: 1px solid #efefef;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 40px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #efefef;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n.freemium-survey-components.widget-survey-components .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n width: 100%;\n}\n.freemium-survey-components.widget-survey-components .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .skip-button {\n font-weight: 500;\n cursor: pointer;\n color: #3a4b67;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components.widget-survey-components .skip-button:hover {\n background-color: #f3f3f3;\n transform: translateY(-4px);\n}\n.freemium-survey-components.widget-survey-components .next-button,\n.freemium-survey-components.widget-survey-components .submit {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.widget-survey-components .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components.widget-survey-components .thankyou .heading {\n font-weight: 500;\n font-size: 22px;\n}\n.freemium-survey-components.widget-survey-components .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #475867;\n width: 75%;\n}\n.freemium-survey-components.widget-survey-components .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components.widget-survey-components .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components.widget-survey-components .responsive-text-field .input-container {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .responsive-text-field .textarea-container {\n display: flex;\n}\n.freemium-survey-components.widget-survey-components .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n}\n.freemium-survey-components.widget-survey-components .message-container:empty {\n display: none;\n}\n\n.freemium-survey-components.widget-survey-components.compact-style .nps-question-text {\n text-align: center;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-container {\n grid-gap: 20px;\n gap: 20px;\n max-width: 100%;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer {\n flex-direction: column-reverse;\n grid-gap: 20px;\n gap: 20px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .compact-footer-layout {\n display: flex;\n justify-content: space-between;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .compact-footer-layout:empty {\n display: none;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .action-buttons {\n grid-gap: 32px;\n gap: 32px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .submit,\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .action-button {\n max-width: unset;\n width: 100%;\n}\n.freemium-survey-components.widget-survey-components.compact-style .nps-container .footer {\n padding-top: 12px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .nps-container .choices {\n grid-gap: 10px;\n gap: 10px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .thankyou .text {\n width: 95%;\n}\n\n.freemium-survey-components.widget-survey-components.default-style .question-footer {\n justify-content: space-between;\n}\n.freemium-survey-components.widget-survey-components.default-style .nps-container .footer {\n padding-top: 12px;\n}\n.freemium-survey-components.widget-survey-components.default-style .nps-container .choices {\n flex-wrap: unset;\n grid-gap: 12px;\n gap: 12px;\n}\n.freemium-survey-components.widget-survey-components.default-style .radio-group {\n flex-direction: column;\n flex-wrap: nowrap;\n}\n.freemium-survey-components.widget-survey-components.default-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n color: #3a4b67;\n}\n.freemium-survey-components.widget-survey-components.default-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.freemium-survey-components.widget-survey-components.default-style textarea {\n min-height: 84px;\n}\n.freemium-survey-components.widget-survey-components.default-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.widget-survey-components.cozy-style {\n max-width: 1000px;\n min-width: 600px;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .question-text {\n font-size: 1rem;\n text-align: left;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-question-text {\n text-align: center;\n width: 70%;\n margin: 0 auto;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .question-footer {\n justify-content: space-between;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .widget {\n display: flex;\n justify-content: center;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .button-container {\n width: 60%;\n min-width: 600px;\n margin: 0 auto;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .button-container .choices {\n justify-content: space-around;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .footer {\n padding-top: 8px;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .action-button {\n line-height: 1.2;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n color: #3a4b67;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.freemium-survey-components.widget-survey-components.cozy-style textarea {\n min-height: 60px;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const R=({thankYouQuestion:e,preview:n,placeholders:r,npsValue:o},s)=>t.createElement(t.Fragment,null,t.createElement("div",{className:"heading"},"Thank you!"),t.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:C(e.text,r,o)}})),z=({currentBlockIndexOfBlocks:e,currentBlockIndexOfBlocksWithQns:n,blocksWithQns:r,blocks:o,setHorizontalScrollUnits:s,preventQuestionAnimation:i,tempCurrentBlockIndexOfBlocksWithQns:a,setCurrentBlockIndexOfBlocksWithQnsDirty:u,setReverse:c,reverse:l})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:0==n.current,className:"navigation-button",onClick:()=>{l?(n.current=Math.max(n.current-1,0),e.current=o.findIndex((e=>e.name===r[n.current].name))):(a.current=Math.max(n.current-1,0),e.current=o.findIndex((e=>e.name===r[a.current].name))),i.current=!1,u.current=!0,c(!0),s({})}},t.createElement(q,null)),t.createElement("button",{className:"navigation-button",disabled:n.current>=r.length-1,onClick:()=>{i.current=!1,l?(a.current=Math.min(n.current+1,r.length-1),e.current=o.findIndex((e=>e.name===r[a.current].name))):(n.current=Math.min(n.current+1,r.length-1),e.current=o.findIndex((e=>e.name===r[n.current].name))),u.current=!0,c(!1),s({})}},t.createElement(_,null))),Q=({widget:e,widgetStyle:n,surveyStyle:r,formValues:o,blocksWithQns:s,blocks:i,thankYouQuestion:a,currentBlockIndexOfBlocksWithQns:c,currentBlockIndexOfBlocks:l,currentEditingBlock:m,isSubmitting:d,isValuesCommitted:p,isCurrentBlockFinal:f,setHorizontalScrollUnits:y,handleFormValues:v,skipBlock:h,setIsSubmitting:x,onSubmit:g,setIsSurveyCompleted:b,preventQuestionAnimation:w,preview:_,closePreview:q,setReverse:E,tempCurrentBlockIndexOfBlocksWithQns:C,question:N,block:S,reverse:B,othersMeta:I,setCurrentBlockIndexOfBlocksWithQnsDirty:O,...R})=>{const Q=R.blockIndex??c.current,T=()=>!(!e&&"standard"===r||0===Q&&void 0===o[N.name]||0===c.current&&!B),D=()=>(!u.includes(N.type_info.question_type)||"DROPDOWN"===N.type_info.question_type&&"__others__"===o[N.name])&&!f(),F=()=>"RANGE"!==N.type_info.question_type&&!S.required&&!f(),W=()=>("DROPDOWN"===N.type_info.question_type&&!S.required&&o[N.name],!1),L=()=>f()&&(e||"standard"!==r),V=("MULTI_SELECT"===m.current.question.type_info.question_type&&o[m.current.question.name]?.includes("__others__")||"DROPDOWN"===m.current.question.type_info.question_type&&"__others__"===o[m.current.question.name])&&(!I[m.current.question.name]||""===I[m.current.question.name].trim()),P="compact"===n&&F()&&T(),Y=!P&&T();return t.createElement("div",{className:"question-footer"},P?t.createElement("div",{className:"compact-footer-layout"},T()&&t.createElement(z,{currentBlockIndexOfBlocks:l,currentBlockIndexOfBlocksWithQns:c,blocksWithQns:s,blocks:i,setHorizontalScrollUnits:y,preventQuestionAnimation:w,setReverse:E,tempCurrentBlockIndexOfBlocksWithQns:C,setCurrentBlockIndexOfBlocksWithQnsDirty:O,reverse:B}),F()&&t.createElement("button",{className:"skip-button",onClick:()=>{E(!1),h(N)}},"Skip")):null,(D()||W()||"compact"!==n&&F()||Y||L())&&t.createElement("div",{className:"action-buttons"},Y&&t.createElement("div",{style:{marginRight:"auto"}},t.createElement(z,{currentBlockIndexOfBlocks:l,currentBlockIndexOfBlocksWithQns:c,blocksWithQns:s,blocks:i,setHorizontalScrollUnits:y,preventQuestionAnimation:w,setReverse:E,tempCurrentBlockIndexOfBlocksWithQns:C,setCurrentBlockIndexOfBlocksWithQnsDirty:O,reverse:B})),D()&&t.createElement(k,{onClick:()=>{O.current=!1,E(!1),v(s[Q],null,!0)},disabled:m.current.required&&(!o[m.current.question.name]||Array.isArray(o[m.current.question.name])&&0===o[m.current.question.name].length)||m.current.question.type_info.meta?.othersRequired&&V,className:"next-button"},"Next"),L()&&t.createElement(k,{className:"submit",disabled:(m.current.required||m.current.question.type_info.pivot_question)&&(null==o[m.current.question.name]||0===o[m.current.question.name]?.length)||m.current.question.type_info.meta?.othersRequired&&V||d,onClick:()=>{g(),x(!0)}},d?"Submitting":"Submit survey"),W()&&t.createElement("button",{className:"skip-button",onClick:()=>{E(!1),m.current=s[Q],l.current=i.findIndex((e=>e.name===s[Q].name)),h(N)}},"Clear selection")))},T=({survey:e,surveyStyle:s="standard",placeholders:i,onSubmit:a,widget:l,npsValue:m,widgetStyle:d,widgetHeaderQuerySelector:p,preview:f,mobilePreview:y,closePreview:v})=>{const h=e.question_details?.questions||[],x=e.meta?.blocks||[],[g,w]=n.useState(null),[k,_]=n.useState({}),[q,N]=n.useState(!1),[S,B]=n.useState([]),[I,O]=n.useState({}),[z,T]=n.useState(!1),[D,F]=n.useState(null),[W,L]=n.useState({}),V=n.useRef(null),P=n.useRef(null),Y=n.useRef(-1),[M,A]=n.useState(null),H=n.useRef(0),$=n.useRef(0),U=n.useRef(!1),j=n.useRef([]),G=n.useRef(!!m&&"card"===s),X=n.useRef(null),Z=n.useRef(0),[K,J]=n.useState(!1),ee=n.useRef(0),ne=n.useRef(!1);n.useEffect((()=>{x&&(X.current=x.find((e=>"TY"===e.name)),w(x.filter((e=>"TY"!==e.name))))}),[x]),n.useEffect((()=>{ne.current&&($.current=Z.current,O({}))}),[K]),n.useEffect((()=>{if(g)if(P.current=h.find((e=>e.type_info?.pivot_question))??h.find((e=>"RANGE"===e.type_info?.question_type))??h[0],null!=m){Y.current=m;const e=h.find((e=>e.name===g[0].question_names[0]));V.current={...g[0],question:e},j.current=[...j.current,{...g[0],question:e}],B(j.current),_({Q_1:m})}else if(!V.current&&g.length>0)return V.current=g[0],void oe(g[0])}),[g,m]),n.useEffect((()=>{S.length&&(j.current=S,$.current=S.length-1,O({}))}),[S]),n.useEffect((()=>{Object.keys(k).length>0&&V.current.question&&(u.includes(V.current.question.type_info.question_type)&&("DROPDOWN"!==V.current.question.type_info.question_type||"__others__"!==k[V.current.question.name])||U.current)&&!re()&&(m&&1==S.length?setTimeout((()=>{se()}),1500):se())}),[k]),n.useEffect((()=>{if(null!=k?.[P.current?.name])if(X.current?.is_based_on_rating){const e=P.current?.type_info?.choices[k?.[P.current?.name]-P.current?.type_info?.validation?.min??0]?.dependent_question_names,n=X.current?.question_names.find((n=>e?.includes(n))),t=h.find((e=>e.name===n));F(t)}else{const e=h.find((e=>e.name==X.current?.question_names[0]));F(e)}}),[k?.[P.current?.name]]);n.useMemo((()=>{(()=>{if(M){M.style.minHeight="unset",M.style.maxHeight="unset",M.style.height="min-content";const e=Math.min(M?.scrollHeight+2,c[d]);M.style.height=e+"px",M.style.minHeight=e+"px",ee.current=e}})()}),[M]);const te=()=>{a({...k,others_meta:W},(()=>{D?.type_info.meta?.skipThankYouPage?f?setTimeout((()=>{v?.()}),300):window.location.href=D?.type_info.meta?.redirectUrl:N(!0)}))},re=()=>(H.current===g.length-1||"end"===V.current.branchOption)&&$.current===S.length-1,oe=e=>{let n={};if(e.is_based_on_rating){const t=P.current?.type_info?.choices[k?.[P.current?.name]-P.current?.type_info?.validation?.min??0]?.dependent_question_names,r=e.question_names.find((e=>t?.includes(e)));n=h.find((e=>e.name===r))}else n=h.find((n=>n.name===e.question_names[0]));V.current.question=n;j.current.find((e=>e.question.name===n.name))?(O({}),$.current+=1):B([...j.current,{...e,question:n}])},se=()=>{if(re())N(!0);else{if(V.current.nextBlock)H.current=g.findIndex((e=>e.name===V.current.nextBlock));else if(V.current.question.type_info?.meta?.branches){const e=V.current.question.type_info?.meta?.branches,n=k[V.current.question.name];let t;if(t="RANGE"===V.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return te(),void N(!0);H.current=g.findIndex((e=>e.name===t.nextBlock))}else H.current+=1}else H.current+=1;V.current=g[H.current],oe(g[H.current])}},ie=(e,n,t)=>{if(G.current=!1,t){if(U.current=!0,null!=k[e.question.name]&&e.name!==S[S.length-1].name){const[t,r]=(e=>{const n=S.findIndex((n=>n.name===e.name)),t=S.slice(0,n+1),r=t.reduce(((e,n)=>(e[n.question.name]=k[n.question.name],e)),{});return H.current=g.findIndex((n=>n.name===e.name)),[t,r]})(e);_({...r,...null!=n&&{[e.question.name]:n}}),j.current=t}else _({...k,...null!=n&&{[e.question.name]:n}});P?.current?.name==e?.question?.name&&(Y.current=n)}else _({...k,...null!=n&&{[e.question.name]:n}})};if(!V.current||!V.current.question)return null;const ae=S[Math.min($.current??S.length-1,S.length-1)];return t.createElement("div",{className:`freemium-survey-components ${l?"widget-survey-components":""} ${d}-style ${y?"mobile-preview":""}`,id:"freemium-survey"},p&&!q&&document.querySelector(p)?o.createPortal(t.createElement(b,{totalSteps:g.length,completedSteps:H.current+(q?1:0),widget:!0}),document.querySelector(p)):null,t.createElement("div",{className:"questions",style:{height:ee.current,...1===S.length?{transition:"none"}:{}}},t.createElement(r.TransitionGroup,{component:null},t.createElement(r.CSSTransition,{key:ae.question.name+String(q),unmountOnExit:!0,addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:K?"fade-reverse":"fade"},t.createElement("div",{ref:e=>e?A(e):null,id:`${ae.question.name}`,className:"question-container "+(q?"thankyou":""),"data-test-question-name":ae.question.name},q?t.createElement(R,{thankYouQuestion:D,preview:f,placeholders:i,npsValue:Y.current,setBlockElementRef:A}):t.createElement(t.Fragment,null,t.createElement("div",{className:"question-text "+("RANGE"===ae.question.type_info.question_type?"nps-question-text":""),dangerouslySetInnerHTML:{__html:C(ae.question.text,i,Y.current)},title:`question-${$.current}`,role:"heading","aria-level":1}),t.createElement("div",{className:"question-wrapper",onTransitionEndCapture:e=>e.stopPropagation()},t.createElement(E,{question:ae.question,isFinalQn:re(),formValues:k,othersMeta:W,autoFocus:!0,autoFocusDelay:"standard"===s?300:0,saveOthersValue:(e,n)=>{if(null===n){const n={...W};delete n[e],L({...n})}else L({...W,[e]:n})},onChangeHandler:e=>{U.current=!1,H.current=g.findIndex((e=>e.name===ae.name)),V.current=ae,ne.current=!1,J(!1),ie(ae,e,!("DROPDOWN"===ae.question.type_info.question_type&&"__others__"===e)&&u.includes(ae.question.type_info.question_type)&&!re())}})),t.createElement(Q,{question:ae.question,block:ae,widget:l,widgetStyle:d,surveyStyle:s,formValues:k,othersMeta:W,blocksWithQns:S,blocks:g,thankYouQuestion:D,currentBlockIndexOfBlocksWithQns:$,reverse:K,setReverse:J,currentBlockIndexOfBlocks:H,currentEditingBlock:V,isSubmitting:z,isValuesCommitted:U,isCurrentBlockFinal:re,setHorizontalScrollUnits:O,handleFormValues:ie,skipBlock:e=>{U.current=!0,delete k[e.name],_({...k})},setIsSubmitting:T,onSubmit:te,setIsSurveyCompleted:N,preventQuestionAnimation:G,preview:f,closePreview:v,tempCurrentBlockIndexOfBlocksWithQns:Z,setCurrentBlockIndexOfBlocksWithQnsDirty:ne})))))))};s(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #3a4b67;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 480px;\n --default-widget-max-height: 460px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-step-navigation {\n border-radius: 3px;\n border: 1px solid #efefef;\n white-space: nowrap;\n}\n.freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #efefef;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n\n.freemium-survey-components.standard-survey-style .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 800ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n margin-bottom: 28px;\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: auto;\n opacity: 1;\n}\n.freemium-survey-components.standard-survey-style .hide-question-container {\n pointer-events: none;\n opacity: 0;\n}\n.freemium-survey-components.standard-survey-style .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components.standard-survey-style .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components.standard-survey-style .question-footer {\n display: flex;\n justify-content: flex-start;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components.standard-survey-style .question-footer:empty {\n display: none;\n}\n.freemium-survey-components.standard-survey-style .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n}\n.freemium-survey-components.standard-survey-style .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components.standard-survey-style .skip-button {\n font-weight: 500;\n color: #3a4b67;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components.standard-survey-style .skip-button:hover {\n background-color: #f3f3f3;\n transform: translateY(-4px);\n}\n.freemium-survey-components.standard-survey-style .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.standard-survey-style .submit {\n max-width: 700px;\n margin: 0 auto;\n text-align: left;\n background: transparent;\n box-shadow: none;\n padding-bottom: 40px;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.standard-survey-style .fade-enter {\n transition: all ease 400ms;\n opacity: 0;\n transform: translateY(40px);\n}\n.freemium-survey-components.standard-survey-style .fade-enter-active {\n transition: all ease 400ms;\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.standard-survey-style .fade-exit {\n transition: all ease 400ms;\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.standard-survey-style .fade-exit-active {\n transition: all ease 400ms;\n opacity: 0;\n transform: translateY(-40px);\n}\n.freemium-survey-components.standard-survey-style .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components.standard-survey-style .thankyou .heading {\n font-weight: 500;\n font-size: 22px;\n}\n.freemium-survey-components.standard-survey-style .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #475867;\n width: 75%;\n}\n.freemium-survey-components.standard-survey-style .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components.standard-survey-style .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components.standard-survey-style .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components.standard-survey-style .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components.standard-survey-style .message-container:empty {\n display: none;\n}\n@media (max-width: 550px) {\n .freemium-survey-components.standard-survey-style .action-buttons {\n flex-direction: column;\n width: 100%;\n }\n .freemium-survey-components.standard-survey-style .action-buttons button {\n max-width: unset;\n }\n .freemium-survey-components.standard-survey-style .action-button {\n max-width: unset;\n width: 100%;\n }\n .freemium-survey-components.standard-survey-style .thankyou .text {\n width: auto;\n }\n}\n\n@media (max-width: 550px) {\n .freemium-survey-component .responsive-text-field .input-container {\n display: none;\n }\n .freemium-survey-component .responsive-text-field .textarea-container {\n display: flex;\n }\n .freemium-survey-component .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n }\n}\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const D=({thankYouQuestion:e,preview:r,placeholders:o,npsValue:s})=>(n.useEffect((()=>{r||e.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=e.type_info.meta?.redirectUrl}),1e3*(1e3*e.type_info.meta?.redirectDelay??1e4))}),[]),t.createElement("div",{className:"question-container thankyou"},t.createElement("div",{className:"heading"},"Thank you!"),t.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:C(e.text,o,s)}}),e.type_info.meta?.redirectUrl&&t.createElement("div",{style:{width:"100%"}},t.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",e.type_info.meta?.redirectDelay," seconds.",t.createElement("br",null)),t.createElement("a",{className:"link",href:e.type_info.meta?.redirectUrl},e?.type_info.meta?.redirectUrl)))),F=({currentBlockIndex:e,currentBlockIndexOfBlocksWithQns:n,blocksWithQns:r,blocks:o,setHorizontalScrollUnits:s,preventQuestionAnimation:i})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:0==n.current,className:"navigation-button",onClick:()=>{n.current=Math.max(n.current-1,0),e.current=o.findIndex((e=>e.name===r[n.current].name)),i.current=!1,s(n.current)}},t.createElement(q,null)),t.createElement("button",{className:"navigation-button",disabled:n.current>=r.length-1,onClick:()=>{i.current=!1,n.current=Math.min(n.current+1,r.length-1),e.current=o.findIndex((e=>e.name===r[n.current].name)),s(n.current)}},t.createElement(_,null))),W=({widget:e,block:n,surveyStyle:r,formValues:o,othersMeta:s,blocksWithQns:i,blocks:a,thankYouQuestion:c,currentBlockIndexOfBlocksWithQns:l,currentBlockIndexOfBlocks:m,currentEditingBlock:d,isSubmitting:p,isValuesCommitted:f,isCurrentBlockFinal:y,setHorizontalScrollUnits:v,handleFormValues:h,skipBlock:x,setIsSubmitting:g,onSubmit:b,setIsSurveyCompleted:w,preventQuestionAnimation:_,preview:q,closePreview:E,...C})=>{const N=C.blockIndex??l.current,S=C.question??i[N].question,B=()=>S.name===d.current.question.name&&(!u.includes(S.type_info.question_type)||"DROPDOWN"===S.type_info.question_type&&"__others__"===o[S.name])&&!y(),I=()=>"RANGE"!==S.type_info.question_type&&!n.required&&S.name===d.current.question.name&&!y(),O=()=>("DROPDOWN"===S.type_info.question_type&&S.name!==d.current.question.name&&!n.required&&o[S.name],!1),R=()=>y()&&(e||"standard"!==r)&&S.name===d.current.question.name,z=("MULTI_SELECT"===d.current.question.type_info.question_type&&o[d.current.question.name]?.includes("__others__")||"DROPDOWN"===d.current.question.type_info.question_type&&"__others__"===o[d.current.question.name])&&(!s[d.current.question.name]||""===s[d.current.question.name].trim());return t.createElement("div",{className:"question-footer"},!(!e&&"standard"===r||0===N&&!o[S.name])&&t.createElement(F,{currentBlockIndex:m,currentBlockIndexOfBlocksWithQns:l,blocksWithQns:i,blocks:a,setHorizontalScrollUnits:v,preventQuestionAnimation:_}),(B()||O()||I()||R())&&t.createElement("div",{className:"action-buttons"},B()&&t.createElement(k,{onClick:()=>{h(i[N],null,!0)},disabled:d.current.required&&(!o[d.current.question.name]||Array.isArray(o[d.current.question.name])&&0===o[d.current.question.name].length)||d.current.question.type_info.meta?.othersRequired&&z,className:"next-button"},"Next"),I()&&t.createElement("button",{className:"skip-button",onClick:()=>x(S)},"Skip"),O()&&t.createElement("button",{className:"skip-button",onClick:()=>{d.current=i[N],m.current=a.findIndex((e=>e.name===i[N].name)),x(S)}},"Clear selection"),R()&&t.createElement("div",{className:"submit"},t.createElement(k,{disabled:(d.current.required||d.current.question.type_info.pivot_question)&&(null==o[d.current.question.name]||0===o[d.current.question.name]?.length)||d.current.question.type_info.meta?.othersRequired&&z||p,onClick:()=>{g(!0),b()}},p?"Submitting":"Submit survey"))))},L=({survey:e,surveyStyle:o="standard",placeholders:s,onSubmit:i,widget:a,npsValue:c,preview:l,mobilePreview:m,closePreview:d})=>{const p=e.question_details?.questions||[],f=e.meta?.blocks||[],[y,v]=n.useState(null),[h,x]=n.useState({}),[g,w]=n.useState(!1),[_,q]=n.useState([]),[N,S]=n.useState(0),[B,I]=n.useState(!1),[O,R]=n.useState(null),[z,Q]=n.useState({}),T=n.useRef(null),F=n.useRef(null),L=n.useRef(-1),V=n.useRef(null),P=n.useRef(0),Y=n.useRef(0),M=n.useRef(!1),A=n.useRef([]),H=n.useRef(null!=c&&"card"===o),$=n.useRef(null),U=n.useRef([]);n.useEffect((()=>{f&&($.current=f.find((e=>"TY"===e.name)),v(f.filter((e=>"TY"!==e.name))))}),[f]),n.useEffect((()=>{if(y)if(F.current=p.find((e=>e.type_info?.pivot_question))??p.find((e=>"RANGE"===e.type_info?.question_type))??p[0],null!=c){L.current=Math.min(F.current.type_info.validation.max,Math.max(F.current.type_info.validation.min,c));const e=p.find((e=>e.name===y[0].question_names[0]));T.current={...y[0],question:e},A.current=[...A.current,{...y[0],question:e}],q(A.current),x({Q_1:L.current})}else if(!T.current&&y.length>0)return T.current=y[0],void X(y[0])}),[y,c]),n.useEffect((()=>{_.length&&(A.current=_,Y.current=_.length-1),a||"standard"!==o?(V.current&&(V.current.style.maxHeight="unset"),U.current[P.current]=V.current?.scrollHeight||U.current[P.current]||0,V.current&&(V.current.style.maxHeight="100%")):V.current?.scrollIntoView({block:"start",behavior:"smooth"}),S(_.length-1)}),[_]),n.useEffect((()=>{Object.keys(h).length>0&&T.current.question&&(u.includes(T.current.question.type_info.question_type)&&("DROPDOWN"!==T.current.question.type_info.question_type||"__others__"!==h[T.current.question.name])||M.current)&&!G()&&Z()}),[h]),n.useEffect((()=>{if(null!=h?.[F.current?.name])if($.current?.is_based_on_rating){const e=F.current?.type_info?.choices[h?.[F.current?.name]-F.current?.type_info?.validation?.min??0]?.dependent_question_names,n=$.current?.question_names.find((n=>e?.includes(n))),t=p.find((e=>e.name===n));R(t)}else{const e=p.find((e=>e.name==$.current?.question_names[0]));R(e)}}),[h?.[F.current?.name]]);const j=()=>{i({...h,others_meta:z},(()=>{O?.type_info.meta?.skipThankYouPage?l?setTimeout((()=>{d?.()}),300):window.location.href=O?.type_info.meta?.redirectUrl:w(!0)}))},G=()=>P.current===y.length-1||"end"===T.current.branchOption,X=e=>{let n={};if(e.is_based_on_rating){const t=F.current?.type_info?.choices[h?.[F.current?.name]-F.current?.type_info?.validation?.min??0]?.dependent_question_names,r=e.question_names.find((e=>t?.includes(e)));n=p.find((e=>e.name===r))}else n=p.find((n=>n.name===e.question_names[0]));T.current.question=n;A.current.find((e=>e.question.name===n.name))?(S(N+1),Y.current+=1):q([...A.current,{...e,question:n}])},Z=()=>{if(G())w(!0);else{if(T.current.nextBlock)P.current=y.findIndex((e=>e.name===T.current.nextBlock));else if(T.current.question.type_info?.meta?.branches){const e=T.current.question.type_info?.meta?.branches,n=h[T.current.question.name];let t;if(t="RANGE"===T.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return j(),void w(!0);P.current=y.findIndex((e=>e.name===t.nextBlock))}else P.current+=1}else P.current+=1;T.current=y[P.current],X(y[P.current])}},K=e=>{M.current=!0,delete h[e.name],x({...h})},J=(e,n,t)=>{if(H.current=!1,t){if(M.current=!0,null!=h[e.question.name]&&e.name!==_[_.length-1].name){const[t,r]=(e=>{const n=_.findIndex((n=>n.name===e.name)),t=_.slice(0,n+1),r=t.reduce(((e,n)=>(e[n.question.name]=h[n.question.name],e)),{});return P.current=y.findIndex((n=>n.name===e.name)),[t,r]})(e);x({...r,...null!=n&&{[e.question.name]:n}}),A.current=t}else x({...h,...null!=n&&{[e.question.name]:n}});F?.current?.name==e?.question?.name&&(L.current=n)}else x({...h,...null!=n&&{[e.question.name]:n}})},ee=(e,n)=>{const t=_.find((n=>n.question.name===e));if(P.current=y.findIndex((e=>e.name===t.name)),T.current=t,null===n){const n={...z};delete n[e],Q({...n})}else Q({...z,[e]:n})};if(!T.current||!T.current.question)return null;const ne=("MULTI_SELECT"===T.current.question.type_info.question_type&&h[T.current.question.name]?.includes("__others__")||"DROPDOWN"===T.current.question.type_info.question_type&&"__others__"===h[T.current.question.name])&&(!z[T.current.question.name]||""===z[T.current.question.name]);return t.createElement("div",{className:`freemium-survey-components ${a?"widget-survey-components":""} ${m?"mobile-preview":""} ${o}-survey-style`,id:"freemium-survey"},g?null:t.createElement(b,{totalSteps:y.length,completedSteps:P.current}),t.createElement(r.SwitchTransition,{mode:"out-in"},t.createElement(r.CSSTransition,{key:String(g),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:a?"":"fade"},t.createElement("div",null,g?t.createElement(D,{thankYouQuestion:O,preview:l,placeholders:s,npsValue:L.current}):t.createElement(t.Fragment,null,t.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:a||"card"===o?{transform:`translateX(calc(-${N} * 100%))`,height:`${U.current[P.current]}px`,transition:H.current||_?.length<=1?"none":"all 300ms ease-out 0ms"}:{},className:"questions"},_.map(((e,n)=>t.createElement("div",{key:e.question.name,ref:V,className:"question-container "+(!a&&"card"!==o||Y.current===n?"":"hide-question-container")},t.createElement("div",{className:"question-text "+(0===n?"nps":""),dangerouslySetInnerHTML:{__html:C(e.question.text,s,L.current)},title:`question-${n}`,role:"heading","aria-level":1}),t.createElement("button",{disabled:!a&&"standard"===o,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),t.createElement(E,{question:e.question,isFinalQn:G(),formValues:h,othersMeta:z,autoFocus:Y.current===n,autoFocusDelay:"standard"===o?350:20,saveOthersValue:ee,onChangeHandler:n=>{M.current=!1,P.current=y.findIndex((n=>n.name===e.name)),T.current=e,J(e,n,!("DROPDOWN"===e.question.type_info.question_type&&"__others__"===n)&&u.includes(e.question.type_info.question_type)&&!G())}}),t.createElement("button",{disabled:!a&&"standard"===o,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),t.createElement(W,{question:e.question,block:e,blockIndex:n,widget:a,surveyStyle:o,formValues:h,othersMeta:z,blocksWithQns:_,blocks:y,thankYouQuestion:O,currentBlockIndexOfBlocksWithQns:Y,currentBlockIndexOfBlocks:P,currentEditingBlock:T,isSubmitting:B,isValuesCommitted:M,isCurrentBlockFinal:G,setHorizontalScrollUnits:S,handleFormValues:J,skipBlock:K,setIsSubmitting:I,onSubmit:j,setIsSurveyCompleted:w,preventQuestionAnimation:H,preview:l,closePreview:d})))),!a&&"card"!==o&&G()&&t.createElement("div",{className:"submit"},t.createElement(k,{disabled:(T.current.required||T.current.question.type_info.pivot_question)&&(null==h[T.current.question.name]||0===h[T.current.question.name]?.length)||T.current.question.type_info.meta?.othersRequired&&ne||B,onClick:()=>{I(!0),i({...h,others_meta:z},(()=>{O?.type_info.meta?.skipThankYouPage?l?setTimeout((()=>{d?.()}),300):window.location.href=O?.type_info.meta?.redirectUrl:w(!0)}))}},B?"Submitting":"Submit survey"))))))))};exports.BUTTON_SIZE_VARIANTS={LARGE:"large",MINI:"mini",NORMAL:"normal"},exports.Button=k,exports.CheckboxGroup=v,exports.Input=p,exports.NPS=i,exports.ProgressBar=b,exports.Radio=g,exports.RadioGroup=x,exports.Survey=e=>{const n=N(e.survey);return t.createElement(t.Fragment,null,"standard"===e.surveyStyle?t.createElement(L,Object.assign({},e,{survey:n})):t.createElement(O,Object.assign({},e,{survey:n})))},exports.TextArea=f,exports.WebInAppSurvey=e=>{const n=N(e.survey);return t.createElement(T,Object.assign({},e,{survey:n}))};
1
+ "use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var n=require("react"),t=e(n),r=require("react-transition-group"),o=e(require("react-dom"));function s(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}s(".freemium-survey-components .nps-container {\n margin: 0 auto;\n width: 100%;\n display: flex;\n flex-direction: column;\n grid-gap: 28px;\n gap: 28px;\n}\n.freemium-survey-components .nps-container .footer {\n border-top: 1px solid #ebeff3;\n padding-top: 20px;\n display: flex;\n justify-content: center;\n font-size: 0.875rem;\n line-height: 1.5;\n color: #666;\n}\n.freemium-survey-components .nps-container .footer:empty {\n display: none;\n}\n.freemium-survey-components .nps-container .nps-scale {\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale .button-container {\n flex-direction: column;\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n}\n.freemium-survey-components .nps-container .nps-scale .help-text-container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.freemium-survey-components .nps-container .nps-scale .positive-text {\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n right: 0px;\n text-align: right;\n}\n.freemium-survey-components .nps-container .nps-scale .negative-text {\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n left: 0;\n text-align: left;\n}\n.freemium-survey-components .nps-container .nps-scale span {\n color: #aaa;\n font-size: 0.75rem;\n}\n.freemium-survey-components .nps-container .nps-scale button {\n display: inline-block;\n font-size: 1rem;\n white-space: nowrap;\n vertical-align: middle;\n background: none;\n border: none;\n box-shadow: none;\n cursor: pointer;\n text-align: center;\n font-weight: 400;\n border-radius: 4px;\n margin: 0;\n outline: none;\n margin-left: -1px;\n width: 40px;\n height: 40px;\n transform: scale(1);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover {\n transition: background 0.2s ease-in, border-color 0.2s ease-in, transform 0.2s cubic-bezier(0.5, 2, 0.5, 0.75);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover, .freemium-survey-components .nps-container .nps-scale button:focus {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale button.active {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale.rounded button {\n border-radius: 50%;\n}\n.freemium-survey-components .nps-container .nps-scale.square button {\n border-radius: 0;\n}\n.freemium-survey-components .nps-container .nps-scale.curved button {\n border-radius: 3px;\n}\n.freemium-survey-components .nps-container .nps-scale.highlighted button:hover, .freemium-survey-components .nps-container .nps-scale.highlighted button:focus, .freemium-survey-components .nps-container .nps-scale.highlighted button.active {\n background: var(--default-brand-color) !important;\n background: var(--brand-color, var(--default-brand-color)) !important;\n}\n.freemium-survey-components .nps-container .nps-scale .choices {\n width: 100%;\n display: flex;\n justify-content: space-between;\n font-weight: 500;\n background-color: #ebeff3;\n border-radius: 4px;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choices {\n background-color: transparent;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice {\n background: #ebeff3;\n color: #000;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice.active, .freemium-survey-components .nps-container .nps-scale.standard .choice:hover {\n background: #e43e3d;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1):focus, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1).active, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1):hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2):focus, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2).active, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2):hover {\n background: #00af50;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(3):hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(4):hover {\n background: #f8c43e;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice.active {\n color: #fff;\n transform: scale(1.2);\n}\n\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .choices {\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .nps-container .nps-scale .choices,\n.card-survey-style .nps-container .nps-scale .choices {\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale .choices,\n.card-survey-style .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale button,\n.card-survey-style .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n }\n}\n.widget-survey-components .nps-container .nps-scale .choices {\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}");const i=e=>{const{type_info:{linear_scale:{button_style:r="highlighted",button_shape:o="rounded"}={},rating_presets:{start:s="Very unlikely",end:i="Very likely"}={},validation:{min:a},footer_text:c}}=e,u=e=>{switch(e){case e<=6:return"detractor";case e<=8:return"passive";default:return"promoter"}},l=n.useRef(Array.from({length:10+(0===a?1:0)},((e,n)=>n+a)));return t.createElement("div",{className:"nps-container","data-test-input":"nps"},t.createElement("div",{className:`nps-scale ${o} ${r}`},t.createElement("div",{className:"button-container"},t.createElement("div",{className:"choices",role:"radiogroup","aria-required":!0},l.current.map((n=>t.createElement("button",{role:"radio","aria-checked":e.npsValue===n,key:n,"data-test-nps-choice":n,onClick:t=>{e.onChangeHandler(n)},className:`choice ${u(n)} ${e.npsValue===n&&"active"}`},n)))),t.createElement("div",{className:"help-text-container"},t.createElement("span",{className:"negative-text",role:"note"},`${a} - ${s}`),t.createElement("span",{className:"positive-text",role:"note"},`${l.current[l.current.length-1]} - ${i}`)))),t.createElement("div",{className:"footer",role:"note"},c))},a=(e,n)=>(e.defaultProps=n,e);s('.freemium-survey-components .input-container,\n.freemium-survey-components .textarea-container {\n display: flex;\n flex-direction: column;\n width: 100%;\n border-radius: 4px;\n position: relative;\n}\n.freemium-survey-components label.input-label {\n display: inline-block;\n padding-bottom: 8px;\n padding-left: 2px;\n font-size: 0.75rem;\n font-weight: 400;\n}\n.freemium-survey-components label.required::after {\n content: "*";\n position: relative;\n top: 2px;\n font-weight: 500;\n font-size: 0.85rem;\n padding-left: 3px;\n color: #d72d30;\n}\n.freemium-survey-components .input-basic {\n width: 100%;\n display: flex;\n align-items: center;\n border-radius: 4px;\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n transition: border-color 0.2s linear;\n background: #fff;\n}\n.freemium-survey-components .textarea-container .input-basic {\n flex-direction: column;\n align-items: unset;\n}\n.freemium-survey-components .input-basic.error {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error:hover {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error[focus-within] {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic.error:focus-within {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: 0.2s linear;\n}\n.freemium-survey-components .input-basic[focus-within] {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .input-basic:focus-within {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .input-basic[focus-within] .end-max-length {\n opacity: 1;\n}\n.freemium-survey-components .input-basic:focus-within .end-max-length {\n opacity: 1;\n}\n.freemium-survey-components .end-max-length {\n transition: opacity ease 0.2s;\n opacity: 0;\n padding: 0 8px;\n font-size: 0.75rem;\n color: #264966;\n}\n.freemium-survey-components .textarea-container .end-max-length {\n padding: 8px;\n align-self: flex-end;\n}\n.freemium-survey-components span.input-error {\n display: block;\n padding-left: 2px;\n padding-top: 4px;\n font-size: 0.9rem;\n color: #d72d30;\n}\n.freemium-survey-components input[type=text] {\n padding: 6px 12px;\n flex: 1;\n border: unset;\n height: 32px;\n font-size: 1rem;\n min-width: 0;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components input[type=text],\n.freemium-survey-components textarea {\n outline: none;\n border: none;\n}\n.freemium-survey-components input[type=text]::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea {\n min-height: 116px;\n padding: 12px;\n flex: 1;\n border: unset;\n resize: none;\n font-size: 1rem;\n min-width: 0;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components textarea::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}');const c=["RANGE","NPS","RADIO","DROPDOWN"],u={default:500,compact:500,cozy:400},l={default:"600px",compact:"350px",cozy:"96%"},m={isRequired:!1,showCount:!0,isErrored:!1,inline:!1,spellCheck:!1,autoFocusInput:!0},d=n.forwardRef(((e,r)=>{const o=n.useRef(null);n.useEffect((()=>{e.autoFocusInput&&setTimeout((()=>{o.current?.focus()}),300+e.autoFocusDelay)}),[e.autoFocusInput]);const{inputStyle:s,style:i,className:a,showCount:c,isErrored:u,startLabel:l,isRequired:m,errorText:d,endLabel:p,maxLength:f=256,onChange:y,autoFocusInput:v,...h}=e;return t.createElement("div",{className:"input-container",style:i},e.label&&t.createElement("label",{className:"input-label "+(m?"required":"")},e.label),t.createElement(t.Fragment,null,l&&t.createElement("div",{className:"start-label"},l),t.createElement("div",{className:`input-basic ${u?"error":""}${a||""}`},t.createElement("input",Object.assign({},h,{type:"text",autoComplete:"off",ref:o,style:s,onChange:e=>{e.target.value?.length>f||y?.(e)}})),c&&f>0&&t.createElement("div",{className:"end-max-length"},`${e.value&&e.value.length||0}/${f}`)),p&&t.createElement("div",{className:"end-label"},p)),u&&d&&t.createElement("span",{className:"input-error"},e.errorText))})),p=n.forwardRef(((e,r)=>{const o=n.useRef(null);n.useEffect((()=>{e.autoFocusInput&&setTimeout((()=>{o.current?.focus()}),300+e.autoFocusDelay)}),[e.autoFocusInput]);const{inputStyle:s,style:i,className:a,showCount:c,maxLength:u=1500,startLabel:l,isRequired:m,autoFocusInput:d,onChange:p,...f}=e;return t.createElement(t.Fragment,null,t.createElement("div",{className:"textarea-container",style:i},e.label&&t.createElement("label",{className:"input-label "+(m?"required":"")},e.label),l&&t.createElement("div",{className:"start-label"},l),t.createElement("div",{className:`input-basic ${a||""}`},t.createElement("textarea",Object.assign({},f,{autoComplete:"off",ref:o,style:s,onChange:e=>{e.target.value?.length>u||p?.(e)}})),c&&u&&u>0&&t.createElement("div",{className:"end-max-length"},`${e.value&&e.value.length||0}/${u}`)),e.endLabel&&t.createElement("div",{className:"end-label"},e.endLabel)))})),f=a(d,m),y=a(p,m);s('.freemium-survey-components .checkbox-group {\n width: 100%;\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n flex-direction: column;\n white-space: nowrap;\n flex-wrap: wrap;\n}\n.freemium-survey-components .icon-container {\n display: inline-block;\n flex: 0 0 12px;\n width: 12px;\n height: 12px;\n min-width: 12px;\n min-height: 12px;\n color: inherit;\n position: absolute;\n left: 1px;\n top: 2px;\n}\n.freemium-survey-components .tick-icon {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: 100%;\n width: 100%;\n color: inherit;\n fill: currentColor;\n}\n.freemium-survey-components input[type=checkbox] {\n position: absolute;\n clip: rect(0px 0px 0px 0px);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=checkbox]:focus ~ .checkbox {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 2px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 2px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 2px;\n border-color: transparent;\n}\n.freemium-survey-components .checkbox-label {\n display: flex;\n align-items: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n opacity: 1;\n line-height: 1.2;\n cursor: pointer;\n font-size: 1rem;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n border-radius: 4px;\n white-space: pre-wrap;\n}\n.freemium-survey-components .checkbox-label:hover {\n border-color: #92a2b1;\n}\n.freemium-survey-components .checkbox-label.disabled {\n opacity: 0.5;\n cursor: "not-allowed";\n}\n.freemium-survey-components .checkbox {\n transition: background-color ease-in 0.2s;\n min-width: 14px;\n min-height: 14px;\n min-height: 14px;\n max-height: 14px;\n border-radius: 2px;\n position: relative;\n margin-right: 16px;\n background-color: #fff;\n border: 1px solid;\n text-align: left;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n box-shadow: var(--default-background-color) 0px 0px 0px 5px;\n box-shadow: var(--background-color, var(--default-background-color)) 0px 0px 0px 5px;\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:disabled ~ .checkbox:hover {\n box-shadow: unset;\n border-color: unset;\n}');const v=()=>t.createElement("svg",{id:"tick",className:"tick-icon",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"title",viewBox:"0 0 10 10"},t.createElement("path",{d:"M3 5.87c-.18666814.00267463-.36667109-.06932655-.5-.2L.21 3.41c-.1786328-.17863279-.24839684-.43899577-.1830127-.6830127.06538414-.24401694.25598306-.43461586.5-.5C.77100423 2.16160316 1.0313672 2.23136721 1.21 2.41L3 4.18 6.8.33c.27679776-.27455556.72320224-.27455556 1 0 .13696438.13025306.21450026.31098915.21450026.5S7.93696438 1.19974694 7.8 1.33L3.45 5.67c-.12082534.11896945-.28072735.19003701-.45.2Z",fill:"#fff",fillRule:"evenodd"})),h=({values:e=[],othersValue:r="",options:o,name:s,autoFocusGroup:i,autoFocusDelay:a,onChangeHandler:c,saveOthersValue:u})=>{const l=e.includes("__others__"),m=n.useRef(null);return n.useEffect((()=>{i&&setTimeout((()=>{m.current?.focus()}),300+a)}),[i]),t.createElement("div",{className:"checkbox-group"},t.createElement("button",{ref:m,className:"autofocus-button","aria-hidden":!0}),o?.filter((e=>"__others__"!==e.value)).map(((n,r)=>t.createElement(g,{key:n.id,checked:e?.includes(n.value),name:n.value,id:n.id,onChange:(t,r)=>{if(r)c([...e||[],n.value]);else{const t=e.indexOf(n.value);t>-1&&e.splice(t,1),c([...e])}}},n.value))),o?.find((e=>"__others__"===e.value))&&t.createElement(g,{key:"others",checked:l,name:"__others__",id:"__others__",onChange:(n,t)=>{if(t)c([...e,"__others__"]);else{const n=e.findIndex((e=>"__others__"===e));e.splice(n,1),c(e)}}},"Others"),l&&t.createElement(t.Fragment,null,t.createElement(f,{placeholder:"Enter your comment",value:r,onChange:e=>{u(s,e.target.value)},autoFocusDelay:10,label:""})))},g=a((e=>{const r=n.useRef(null);return n.useEffect((()=>{e.autoFocus&&setTimeout((()=>{r.current?.focus()}),320)}),[]),t.createElement("label",{className:`checkbox-label ${e.disabled&&"disabled"}`},t.createElement("input",{ref:r,id:e.id,type:"checkbox",name:e.name,readOnly:e.readOnly,disabled:e.disabled,"aria-disabled":e.disabled,checked:e.checked,onChange:e.readOnly?()=>{}:n=>e.onChange(n,n.target.checked)}),t.createElement("div",{className:"checkbox"},e.checked&&t.createElement("div",{className:"icon-container"},t.createElement(v,null)," ")),t.createElement("div",null,e.children))}),{checked:!1});s('.freemium-survey-components .radio-group {\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n white-space: nowrap;\n flex-direction: column;\n width: 100%;\n}\n.freemium-survey-components .radio {\n background-color: #fff;\n border: 1px solid;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: background-color ease-in 0.2s;\n min-width: 18px;\n max-width: 18px;\n min-height: 18px;\n max-height: 18px;\n border-radius: 50%;\n position: relative;\n margin-right: 16px;\n text-align: left;\n}\n.freemium-survey-components .radio:before {\n left: 3px;\n top: 3px;\n content: "";\n position: absolute;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n transition: all ease-in 0.2s;\n background-color: #fff;\n}\n.freemium-survey-components .radio-label {\n display: flex;\n align-items: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n cursor: pointer;\n line-height: 1.2;\n font-size: 1rem;\n font-weight: 400;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n border-radius: 4px;\n white-space: pre-wrap;\n color: #3a4b67;\n}\n.freemium-survey-components input[type=radio] {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=radio]:focus ~ .radio {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 3px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 3px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 3px;\n border-color: transparent;\n}\n.freemium-survey-components input[type=radio]:checked ~ .radio:before {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .radio-label:hover {\n border-color: #92a2b1;\n}');const x=({name:e,options:r,value:o,autoFocusGroup:s,autoFocusDelay:i,onChangeHandler:a,saveOthersValue:c,othersOption:u,othersRequired:l,othersValue:m,isFinalQn:d})=>{const p=n.useRef(null);return n.useEffect((()=>{s&&setTimeout((()=>{p.current?.focus()}),300+i)}),[s]),t.createElement("div",{className:"radio-group",role:"radiogroup"},t.createElement("button",{ref:p,className:"autofocus-button","aria-hidden":!0,tabIndex:-1}),r?.sort(((e,n)=>"__others__"===e.value?1:"__others__"===n.value?-1:0))?.map(((n,r)=>t.createElement(b,{key:n.value,value:n.value,name:e,onChange:n=>{"__others__"!==n.currentTarget.value&&c(e,null),a(n.currentTarget.value)},checked:o===n.value},"__others__"===n.value?"Others":n.value))),"__others__"===o&&t.createElement(t.Fragment,null,t.createElement(f,{value:m??"",onChange:n=>{"__others__"!==o&&d&&a("__others__"),c(e,n.target.value)},placeholder:"Enter your comment",label:"",autoFocusDelay:10})))},b=a((e=>{const r=n.useRef(null);return n.useEffect((()=>{e.autoFocus&&setTimeout((()=>{r.current?.focus()}),320)}),[]),t.createElement("label",{className:"radio-label"},t.createElement("input",{ref:r,type:"radio",name:e.name,value:e.value,checked:e.checked,onChange:e.onChange}),t.createElement("div",{className:"radio"}),t.createElement("div",null,e.children))}),{checked:!1,autoFocus:!1});s(".progressbar-container {\n width: 100%;\n height: 4px;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1;\n text-align: left;\n overflow: hidden;\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n}\n\n.progressbar-container.widget {\n position: absolute;\n top: 0;\n height: 2px;\n}\n\n.progressbar {\n transition: transform 0.2s linear 200ms;\n transform-origin: left;\n height: 100%;\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}");const w=e=>{const{totalSteps:n,completedSteps:r,widget:o}=e;return t.createElement("div",{className:"progressbar-container "+(o?"widget":"")},t.createElement("div",{className:"progressbar",style:{width:(r>0?100/n:0)+"%",transform:`scaleX(${r})`}}))};s(".freemium-survey-components .action-button {\n width: auto;\n display: block;\n padding: 8px 16px;\n cursor: pointer;\n line-height: 1.5;\n text-align: center;\n font-weight: 600;\n letter-spacing: 0.3px;\n border-radius: 4px;\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n color: --default-button-text-color;\n color: var(--button-text-color, --default-button-text-color);\n background: var(--default-brand-color);\n background: var(--brand-color, var(--default-brand-color));\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n border-radius: 4px;\n min-width: 200px;\n max-width: -webkit-fit-content;\n max-width: -moz-fit-content;\n max-width: fit-content;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components .action-button:not([disabled]):hover {\n transform: translateY(-4px);\n}\n.freemium-survey-components .action-button[disabled] {\n cursor: not-allowed;\n opacity: 0.6;\n}\n.freemium-survey-components button:focus:not(:active) {\n /* box-shadow: 0 0 0 2px ${pseudo.focus}; */\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .action-button {\n min-width: 120px;\n }\n}\n.widget-survey-components .action-button {\n min-width: 120px;\n}\n\n.freemium-survey-components.mobile-preview .action-button {\n min-width: 120px;\n}");const k=()=>t.createElement(t.Fragment,null,"..."),_=e=>{const{inline:n=!1,children:r,disabled:o,className:s="",htmlType:i,type:a="primary",onClick:c,size:u,overrideStyleClassName:l="",loading:m=!1,...d}=e;return t.createElement("button",Object.assign({style:n?{display:"inline-block"}:{},disabled:o,className:`action-button ${s} ${l}`,type:i,onClick:c},d),m?t.createElement(k,null):r)},q=()=>t.createElement("svg",{width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M7.82585 6.15754C7.98999 6.32147 8.08232 6.54389 8.08252 6.77587L8.08252 7.2192C8.07983 7.45069 7.98788 7.6722 7.82585 7.83754L1.82919 13.8225C1.77496 13.8772 1.71044 13.9206 1.63936 13.9502C1.56827 13.9798 1.49203 13.9951 1.41502 13.9951C1.33801 13.9951 1.26177 13.9798 1.19068 13.9502C1.1196 13.9206 1.05508 13.8772 1.00085 13.8225L0.172521 12.9942C0.118197 12.941 0.0750381 12.8774 0.0455752 12.8073C0.0161124 12.7372 0.000937578 12.6619 0.000937585 12.5859C0.000937592 12.5098 0.0161125 12.4345 0.0455753 12.3644C0.0750381 12.2943 0.118197 12.2308 0.172521 12.1775L5.36419 6.99754L0.172522 1.81754C0.117847 1.76331 0.0744506 1.69879 0.0448352 1.62771C0.0152208 1.55662 -2.75162e-05 1.48038 -2.75094e-05 1.40337C-2.75027e-05 1.32636 0.0152208 1.25012 0.0448353 1.17904C0.0744507 1.10795 0.117847 1.04343 0.172522 0.989205L1.00086 0.172537C1.05508 0.117862 1.1196 0.0744661 1.19069 0.0448507C1.26177 0.0152353 1.33801 -1.20337e-05 1.41502 -1.2027e-05C1.49203 -1.20203e-05 1.56827 0.0152353 1.63936 0.0448507C1.71044 0.0744661 1.77496 0.117862 1.82919 0.172537L7.82585 6.15754Z",fill:"#6B6B6B"})),E=()=>t.createElement("svg",{width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M0.256667 7.83755C0.0925257 7.67361 0.000204227 7.4512 0 7.21921V6.77588C0.00268801 6.5444 0.0946357 6.32289 0.256667 6.15755L6.25333 0.172549C6.30756 0.117874 6.37208 0.0744776 6.44316 0.0448625C6.51425 0.0152474 6.59049 0 6.6675 0C6.74451 0 6.82075 0.0152474 6.89184 0.0448625C6.96292 0.0744776 7.02744 0.117874 7.08167 0.172549L7.91 1.00088C7.96432 1.05411 8.00748 1.11764 8.03694 1.18776C8.06641 1.25787 8.08158 1.33316 8.08158 1.40922C8.08158 1.48527 8.06641 1.56056 8.03694 1.63067C8.00748 1.70079 7.96432 1.76432 7.91 1.81755L2.71833 6.99755L7.91 12.1775C7.96467 12.2318 8.00807 12.2963 8.03769 12.3674C8.0673 12.4385 8.08255 12.5147 8.08255 12.5917C8.08255 12.6687 8.0673 12.745 8.03769 12.8161C8.00807 12.8871 7.96467 12.9517 7.91 13.0059L7.08167 13.8225C7.02744 13.8772 6.96292 13.9206 6.89184 13.9502C6.82075 13.9799 6.74451 13.9951 6.6675 13.9951C6.59049 13.9951 6.51425 13.9799 6.44316 13.9502C6.37208 13.9206 6.30756 13.8772 6.25333 13.8225L0.256667 7.83755Z",fill:"#6B6B6B"})),C=()=>t.createElement("svg",{width:"11",height:"10",viewBox:"0 0 11 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("rect",{opacity:"0.01",x:"0.16748",width:"10",height:"10",fill:"white","fill-opacity":"0.01"}),t.createElement("path",{d:"M1.85129 1.68479L8.48395 8.31744",stroke:"#264966",strokeWidth:"1.5",strokeLinecap:"round"}),t.createElement("path",{d:"M8.48395 1.68479L1.85129 8.31744",stroke:"#264966",strokeWidth:"1.5",strokeLinecap:"round"})),N=()=>t.createElement("svg",{width:"8",height:"8",viewBox:"0 0 7 2",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t.createElement("path",{d:"M6.08333 1.32682H0.583333C0.261167 1.32682 0 1.06565 0 0.743489C0 0.421323 0.261167 0.160156 0.583333 0.160156H6.08333C6.4055 0.160156 6.66667 0.421323 6.66667 0.743489C6.66667 1.06565 6.4055 1.32682 6.08333 1.32682Z",fill:"#264966"})),S=()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 11 11",fill:"none"},t.createElement("mask",{id:"a",maskUnits:"userSpaceOnUse",x:"-.400146",y:"-.400024",width:"11",height:"11",fill:"#000"},t.createElement("path",{fill:"#fff",d:"M-.400146-.400024h11v11h-11z"}),t.createElement("path",{d:"m4.70226 6.76428-2.6856 2.6856 2.60775-.00293c.02738-.00011.05452.0052.07983.01562.02532.01043.04833.02577.06769.04513.01936.01936.0347.04237.04512.06769.01043.02531.01574.05245.01563.07983l-.00293.41358c.00011.0274-.0052.0545-.01563.0799-.01043.0253-.02576.0483-.04512.0676-.01937.0194-.04237.0347-.06769.0452-.02532.0104-.05245.0157-.07983.0156l-3.59922.0029c-.082493.0001-.161625-.0326-.220005-.0909l-.111467-.1115c-.057526-.0589-.090102-.13767-.090934-.21998L.602787 6.2584c-.000112-.02738.005198-.05452.015625-.07984.010427-.02532.025763-.04832.045125-.06768.019362-.01936.042366-.0347.067685-.04513.025319-.01042.052451-.01573.079833-.01562h.416535c.02704-.00028.05387.00485.0789.01507.02504.01022.04779.02533.06691.04445.01912.01913.03424.04187.04446.06691s.01534.05186.01507.0789l-.00294 2.60775 4.74323-4.74323.0044-.00427 2.6856-2.6856-2.60775.00294c-.02738.00011-.05452-.0052-.07983-.01563-.02532-.01042-.04833-.02576-.06769-.04512-.01936-.01936-.0347-.04237-.04512-.06769-.01043-.02532-.01574-.05245-.01563-.07983l.00293-.413603c-.00011-.027382.0052-.054514.01563-.079833.01043-.025319.02576-.048323.04512-.067685.01937-.019362.04237-.034698.06769-.045125.02532-.010427.05245-.015737.07983-.015625L9.85762.599976c.08249-.000052.16158.032657.21998.090934l.1115.111467c.0575.058878.0901.13769.0909.220003l-.0029 3.59922c.0001.02738-.0052.05452-.0156.07983-.0105.02532-.0258.04833-.0452.06769-.0193.01936-.0423.0347-.0676.04512-.0254.01043-.0525.01574-.0799.01563h-.41651c-.02704.00027-.05387-.00485-.0789-.01507-.02504-.01022-.04779-.02533-.06691-.04446-.01912-.01912-.03424-.04187-.04446-.0669-.01022-.02504-.01534-.05186-.01506-.07891l.00293-2.60775-4.74323 4.74323-.0044.00427Z"})),t.createElement("path",{d:"m4.70226 6.76428-2.6856 2.6856 2.60775-.00293c.02738-.00011.05452.0052.07983.01562.02532.01043.04833.02577.06769.04513.01936.01936.0347.04237.04512.06769.01043.02531.01574.05245.01563.07983l-.00293.41358c.00011.0274-.0052.0545-.01563.0799-.01043.0253-.02576.0483-.04512.0676-.01937.0194-.04237.0347-.06769.0452-.02532.0104-.05245.0157-.07983.0156l-3.59922.0029c-.082493.0001-.161625-.0326-.220005-.0909l-.111467-.1115c-.057526-.0589-.090102-.13767-.090934-.21998L.602787 6.2584c-.000112-.02738.005198-.05452.015625-.07984.010427-.02532.025763-.04832.045125-.06768.019362-.01936.042366-.0347.067685-.04513.025319-.01042.052451-.01573.079833-.01562h.416535c.02704-.00028.05387.00485.0789.01507.02504.01022.04779.02533.06691.04445.01912.01913.03424.04187.04446.06691s.01534.05186.01507.0789l-.00294 2.60775 4.74323-4.74323.0044-.00427 2.6856-2.6856-2.60775.00294c-.02738.00011-.05452-.0052-.07983-.01563-.02532-.01042-.04833-.02576-.06769-.04512-.01936-.01936-.0347-.04237-.04512-.06769-.01043-.02532-.01574-.05245-.01563-.07983l.00293-.413603c-.00011-.027382.0052-.054514.01563-.079833.01043-.025319.02576-.048323.04512-.067685.01937-.019362.04237-.034698.06769-.045125.02532-.010427.05245-.015737.07983-.015625L9.85762.599976c.08249-.000052.16158.032657.21998.090934l.1115.111467c.0575.058878.0901.13769.0909.220003l-.0029 3.59922c.0001.02738-.0052.05452-.0156.07983-.0105.02532-.0258.04833-.0452.06769-.0193.01936-.0423.0347-.0676.04512-.0254.01043-.0525.01574-.0799.01563h-.41651c-.02704.00027-.05387-.00485-.0789-.01507-.02504-.01022-.04779-.02533-.06691-.04446-.01912-.01912-.03424-.04187-.04446-.0669-.01022-.02504-.01534-.05186-.01506-.07891l.00293-2.60775-4.74323 4.74323-.0044.00427Z",fill:"#264966"}),t.createElement("path",{d:"m4.70226 6.76428-.19158-.19732-.00287.00287.19445.19445Zm-2.6856 2.6856-.19445-.19445-.4702.4702.66496-.00075-.00031-.275Zm2.60775-.00293.00031.275h.00082l-.00113-.275Zm.14752.06075.19446-.19445-.00001-.00001-.19445.19446Zm.06075.14752.27499.00195.00001-.00082-.275-.00113Zm-.00293.41358-.27501-.0019.00001.003.275-.0011Zm-.06075.1475.19445.1945-.19445-.1945Zm-.06769.0452-.10471-.2543.10471.2543Zm-.07983.0156.00113-.275h-.00136l.00023.275Zm-3.59922.0029.00017.275h.00005l-.00022-.275Zm-.220005-.0909-.194454.1944.00017.0002.194284-.1946Zm-.111467-.1115-.196712.1922.002257.0023.194455-.1945Zm-.090934-.21998L.324837 9.8574l.000031.003.274986-.00278ZM.602787 6.2584l.275003.00022-.000005-.00135-.274998.00113Zm.015625-.07984L.36413 6.07385H.364129l.254283.10471Zm.045125-.06768.194453.19445h.000003l-.194456-.19445Zm.067685-.04513.104714.25429.000005-.00001-.104719-.25428Zm.079833-.01562-.001128.275h.001127l.000001-.275Zm.416535 0v.27501l.00281-.00002-.00281-.27499Zm.0789.01507-.10394.2546h.00001l.10393-.2546Zm.06691.04445.19445-.19445-.19445.19445Zm.04446.06691.2546-.10394-.2546.10394Zm.01507.0789-.275-.0028v.00249l.275.00031Zm-.00294 2.60775-.275-.00031-.00075.66497.47021-.4702-.19446-.19446Zm4.74323-4.74323-.19158-.19732-.00287.00287.19445.19445Zm.0044-.00427.19158.19733.00287-.00287-.19445-.19446Zm2.6856-2.6856.19445.19446.4702-.4702-.66496.00074.00031.275Zm-2.60775.00294-.00031-.275h-.00082l.00113.275Zm-.07983-.01563-.10472.25429.10472-.25429Zm-.06769-.04512.19446-.19446H6.3024l-.19445.19446Zm-.04512-.06769.25428-.10471v-.00001l-.25428.10472Zm-.01563-.07983-.27499-.00195-.00001.00082.275.00113Zm.00293-.413603.27502.001951L6.32513.81005l-.275.001127Zm.01563-.079833L5.81148.626625v.000004l.25428.104715Zm.04512-.067685L5.91643.469203v.000003l.19445.194453Zm.06769-.045125L6.07385.364252l.10472.254282ZM6.2584.602909 6.25728.87791l.00135-.000001-.00023-.275ZM9.85762.599976l-.00017-.275H9.8574l.00022.275Zm.21998.090934.1945-.194455-.0002-.000172-.1943.194627Zm.1115.111467.1967-.192197-.0023-.002257-.1944.194454Zm.0909.220003.275.00022v-.003l-.275.00278Zm-.0029 3.59922-.275-.00022v.00135l.275-.00113Zm-.0156.07983-.2543-.10472v.00001l.2543.10471Zm-.0452.06769-.1944-.19446.1944.19446Zm-.1475.06075.0012-.275h-.0012v.275Zm-.41651 0v-.27502l-.00281.00003.00281.27499Zm-.0789-.01507.10394-.2546-.10394.2546Zm-.06691-.04446.19446-.19445-.00001-.00001-.19445.19446Zm-.04446-.0669.25461-.10394-.00001-.00001-.2546.10395Zm-.01506-.07891.27499.00282.00001-.00251-.275-.00031Zm.00293-2.60775.275.00031.00075-.66496-.47021.4702.19446.19445ZM4.70666 6.76001l.19159.19733.00286-.00287-.19445-.19446Zm-.19885-.19018-2.6856 2.6856.38891.38891 2.6856-2.6856-.38891-.38891ZM2.01697 9.72488l2.60775-.00293-.00062-.55-2.60775.00293.00062.55Zm2.60857-.00293c-.00893.00003-.01777-.0017-.02601-.00509l.20943-.50857c-.05888-.02425-.12198-.0366-.18568-.03634l.00226.55Zm-.02601-.00509c-.00825-.0034-.01575-.0084-.02205-.0147l.3889-.38892c-.04503-.04503-.09853-.0807-.15742-.10495l-.20943.50857Zm-.02206-.01471c-.00631-.00631-.0113-.0138-.0147-.02205l.50857-.20943c-.02425-.05889-.05992-.11239-.10495-.15742l-.38892.3889Zm-.0147-.02205c-.0034-.00825-.00512-.01709-.00509-.02601l.55.00226c.00026-.06369-.01209-.12679-.03634-.18568l-.50857.20943Zm-.00508-.02683-.00294.41363.54999.0039.00293-.41363-.54998-.0039Zm-.00294.41663c-.00004-.0089.00169-.0177.00509-.026l.50856.2095c.02425-.0589.0366-.122.03634-.1857l-.54999.0022Zm.00509-.026c.0034-.0082.00839-.0157.0147-.022l.38891.3889c.04503-.045.0807-.0985.10495-.1574l-.50856-.2095Zm.01471-.022c.0063-.0063.01379-.0113.02205-.0147l.20943.5085c.05889-.0242.11239-.0599.15742-.1049l-.3889-.3889Zm.02205-.0147c.00824-.0034.01708-.0051.02601-.0051l-.00226.55c.06369.0002.1268-.0121.18568-.0364l-.20943-.5085Zm.02465-.0051-3.59922.0029.00045.55 3.59922-.0029-.00045-.55Zm-3.59917.0029c-.00957 0-.01876-.0038-.025541-.01054l-.388568.38924c.109981.1098.259058.1714.414459.1713l-.00035-.55Zm-.025371-.01037-.111467-.11146-.388909.38893.111468.1114.388908-.38887Zm-.109222-.10919c-.008001-.00819-.012532-.01915-.012648-.0306l-.549971.00556c.001548.1532.062169.2998.169221.4094l.393398-.38436Zm-.012634-.0276.002934-3.59922-.55-.00045L.324854 9.8574l.549999.00044Zm.002932-3.60057a.0675974.0675974 0 0 1-.005091.02601l-.508565-.20943c-.024249.05888-.036601.12199-.03634.18567l.549996-.00225Zm-.005092.02601c-.003395.00825-.008392.01574-.014703.02205l-.388906-.38891c-.045036.04504-.080705.09854-.104954.15743l.508563.20943Zm-.0147.02205c-.006311.00631-.013807.01131-.022057.01471l-.209429-.50857c-.058887.02425-.112392.05992-.157426.10496l.388912.3889Zm-.022052.0147c-.008251.0034-.017093.00513-.026013.0051l.002254-.55c-.063684-.00026-.12679.01209-.185679.03634l.209438.50856Zm-.024887.0051h.416536v-.55H.811055l-.000001.55Zm.419346-.00001c-.00954.00009-.01901-.00171-.02785-.00532l.20788-.5092c-.05891-.02405-.12202-.03611-.18564-.03546l.00561.54998Zm-.02784-.00532c-.00884-.00361-.01687-.00894-.02361-.01569l.3889-.38891c-.04499-.04499-.09851-.08055-.15742-.1046l-.20787.5092Zm-.02362-.01569c-.00674-.00675-.01208-.01477-.01568-.02361l.5092-.20788c-.02405-.05891-.05962-.11243-.10461-.15742l-.38891.38891Zm-.01568-.02361c-.00361-.00884-.00542-.0183-.00532-.02784l.54997.00561c.00065-.06362-.0114-.12674-.03545-.18565l-.5092.20788Zm-.00533-.02535L1.15499 8.8629l.55.00062.00294-2.60775-.55-.00062Zm.46652 2.80252 4.74323-4.74323-.38891-.38891-4.74323 4.74323.38891.38891Zm4.74033-4.74038.0044-.00427-.38312-.39461-.0044.00427.38312.39461Zm.00729-.00712 2.6856-2.6856-.38891-.38891-2.6856 2.6856.38891.38891Zm2.49084-3.15506-2.60775.00294.00062.55 2.60775-.00294-.00062-.55Zm-2.60857.00294c.00892-.00004.01776.00169.02601.00509l-.20943.50857c.05889.02424.12199.0366.18568.03634l-.00226-.55Zm.02601.00509c.00825.0034.01575.00839.02206.0147l-.38891.38891c.04503.04503.09853.0807.15742.10496l.20943-.50857Zm.02205.0147c.00631.00631.01131.01381.01471.02206l-.50857.20943c.02425.05888.05992.11239.10496.15742l.3889-.38891Zm.01471.02205c.0034.00826.00513.0171.00509.02602l-.55-.00226c-.00026.06369.01209.12679.03635.18568l.50856-.20944Zm.00508.02684.00294-.413602-.54999-.003901-.00293.413603.54998.0039Zm.00294-.41668c.00004.00892-.00169.01776-.00509.026009l-.50856-.20943c-.02425.058887-.0366.121992-.03634.185675L6.32513.81005Zm-.00509.026013c-.0034.008247-.00839.015741-.0147.022049L5.91643.469206c-.04503.045032-.0807.098534-.10495.157419l.50856.209438Zm-.0147.022052c-.00631.006307-.0138.011304-.02205.014701L6.07385.364252c-.05889.024251-.11239.059921-.15742.104951l.38891.388912Zm-.02205.014701a.0675974.0675974 0 0 1-.02601.005091l.00225-.549996c-.06369-.000261-.12679.012091-.18568.036341l.20944.508564Zm-.02466.005093L9.85785.874976l-.00045-.55-3.59922.002933.00045.55ZM9.8578.874976c.00957-.000006.01876.003791.02554.01056l.38856-.389253c-.11-.109784-.259-.171404-.41445-.171307l.00035.55Zm.02537.010388.11147.111467.38886-.388908-.1114-.111467-.38893.388908Zm.10922.109197c.00801.008189.01251.019149.01261.030599l.55-.00556c-.0015-.153176-.0622-.29984-.1692-.409407l-.39341.384368Zm.01261.027589-.0029 3.59923.55.00044.0029-3.59922-.55-.00045Zm-.0029 3.60058c0-.00892.0017-.01777.0051-.02602l.5085.20945c.0243-.05889.0367-.122.0364-.18569l-.55.00226Zm.0051-.02601c.0034-.00825.0084-.01574.0147-.02206l.3889.38892c.045-.04504.0807-.09855.105-.15743l-.5086-.20943Zm.0147-.02206c.0063-.00631.0138-.0113.022-.0147l.2095.50857c.0589-.02425.1124-.05992.1574-.10496l-.3889-.38891Zm.022-.0147c.0083-.0034.0171-.00513.0261-.00509l-.0023.55c.0637.00026.1268-.01209.1857-.03634l-.2095-.50857Zm.0249-.00509h-.41651v.55h.41651v-.55Zm-.41932.00001c.00954-.00009.01901.00171.02785.00532l-.20789.5092c.05892.02405.12203.0361.18566.03545l-.00562-.54997Zm.02785.00532c.00883.00361.01686.00894.02361.01569l-.38892.3889c.045.045.09852.08056.15743.10461l.20788-.5092Zm.0236.01568c.00675.00675.01209.01478.0157.02362l-.50921.20787c.02405.05892.05961.11244.10461.15743l.3889-.38892Zm.01569.02361c.00361.00884.00542.01831.00532.02786l-.54997-.00563c-.00065.06363.0114.12675.03546.18566l.50919-.20789Zm.00534.02535.00293-2.60775-.55-.00061-.00293 2.60774.55.00062Zm-.46653-2.80251L4.51221 6.56556l.3889.38891 4.74323-4.74323-.38891-.38891ZM4.51509 6.56271l-.00439.00427.38313.3946.0044-.00427-.38314-.3946Z",fill:"#264966",mask:"url(#a)"})),B=()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"76",height:"16",viewBox:"0 0 200 40"},t.createElement("g",{fill:"none","fill-rule":"nonzero"},t.createElement("path",{fill:"#4D4D4D",d:"M48.6 1c-5 0-6.8 3.5-6.8 6.8v2h-1c-.8 0-1.4.6-1.4 1.4 0 .8.6 1.4 1.4 1.4h1v13.8c0 .8.6 1.5 1.5 1.5s1.5-.6 1.5-1.5V12.5H48c.8 0 1.4-.6 1.4-1.4 0-.8-.6-1.4-1.4-1.4h-3.2v-2c0-1.8.7-4 3.9-4 .8 0 1.4-.6 1.4-1.3-.1-.8-.7-1.4-1.5-1.4zM60 9.3c-2-.1-3.8.8-5 2.4v-.8c0-.8-.6-1.5-1.5-1.5s-1.5.7-1.5 1.5v15.4c0 .8.6 1.5 1.5 1.5s1.5-.6 1.5-1.5v-8.5c0-3.6 1.9-5.7 5-5.7.8 0 1.4-.6 1.4-1.4 0-.8-.7-1.4-1.4-1.4zM77.7 16.9c0-1.7-.5-3.4-1.4-4.8-1.4-1.9-3.7-3-6.1-2.8-5.1 0-8 3.4-8 9.3 0 6.1 2.9 9.4 8.4 9.4 2.2.1 4.4-.7 6.1-2.2.3-.2.5-.6.5-1 0-.7-.6-1.3-1.3-1.3-.3 0-.6.1-.8.3-1.2 1-2.8 1.6-4.4 1.6-3.3 0-5.4-2.2-5.5-5.7H76c1.7-.2 1.7-1.8 1.7-2.8zm-7.4-5c3 0 4.5 1.7 4.6 5h-9.7c.3-3.2 2.1-5 5.1-5zM87.5 17.1c-2.2-.8-4-1.4-4-3 0-1.8 2-2 3.1-2 1.5-.1 3 .5 4 1.5.5.5 1.4.5 1.9 0 .3-.3.4-.6.4-1 0-.3-.1-.6-.3-.9-1.5-1.7-3.7-2.7-5.9-2.5-3.7 0-6 1.9-6 4.8 0 3.6 3.2 4.7 6 5.7 2.1.7 4 1.3 4 2.9 0 2.1-2.4 2.5-3.8 2.5-1.7.1-3.4-.6-4.6-1.8-.3-.3-.6-.4-1-.5-.7 0-1.3.6-1.3 1.3 0 .3.1.6.3.9 1.7 2 4.1 3 6.6 3 4.2 0 6.7-2 6.7-5.2-.2-3.7-3.3-4.7-6.1-5.7zM104.8 9.2c-1.8-.1-3.6.7-4.8 2.1V1.5c0-.8-.6-1.5-1.5-1.5-.8 0-1.4.6-1.4 1.5v24.8c0 .8.6 1.5 1.4 1.5.8 0 1.5-.6 1.5-1.5V17c0-3.4 1.6-5.1 4.8-5.1 3.2 0 4.3 1.4 4.3 4.8v9.6c0 .8.6 1.5 1.5 1.5.8 0 1.4-.6 1.4-1.5V16.2c0-4.6-2.4-7-7.2-7zM136.2 9.5c-.6 0-1.2.4-1.4 1l-4.2 11.8-3.4-11.8c-.3-.8-1.1-1.1-1.9-.9-.4.1-.7.5-.9.9L121 22.3l-4-11.9c-.2-.6-.7-1-1.4-.9-.8 0-1.4.6-1.4 1.4 0 .2 0 .4.1.6l5.6 15.3c.2.6.7 1 1.4 1 .6 0 1.2-.4 1.4-1l3.3-11.2 3.3 11.2c.2.6.8 1 1.4 1 .6 0 1.2-.4 1.4-1l5.6-15.3c.1-.2.1-.4.1-.6-.2-.8-.8-1.4-1.6-1.4zM146.8 9.2c-5.3 0-8.2 3.3-8.2 9.3 0 6 2.9 9.4 8.2 9.4 5.3 0 8.2-3.3 8.2-9.4 0-6.1-2.9-9.3-8.2-9.3zm0 16c-3.5 0-5.3-2.2-5.3-6.7s1.8-6.7 5.3-6.7 5.2 2.3 5.2 6.7-1.7 6.8-5.2 6.7zM166.2 9.3c-2-.1-3.8.8-5 2.4v-.8c0-.8-.6-1.5-1.4-1.5-.8 0-1.5.6-1.5 1.4v15.4c0 .8.6 1.5 1.4 1.5.8 0 1.5-.6 1.5-1.4v-8.5c0-3.6 1.9-5.7 5-5.7.8 0 1.4-.6 1.4-1.4 0-.8-.6-1.4-1.4-1.4zM177.3 16.9l6-4.8c.4-.3.6-.7.6-1.2 0-.8-.6-1.4-1.4-1.4-.4 0-.7.1-1 .4l-8.6 7V1.5c0-.8-.6-1.5-1.4-1.5-.8 0-1.5.6-1.5 1.4v24.8c0 .8.6 1.5 1.4 1.5.8 0 1.5-.6 1.5-1.4v-6l2-1.6 6.6 8.4c.3.4.8.7 1.2.7.8 0 1.4-.6 1.4-1.4 0-.3-.1-.7-.3-.9l-6.5-8.6zM193.7 17.1c-2.2-.8-4-1.4-4-3 0-1.8 2-2 3.1-2 1.5-.1 3 .5 4 1.5.3.3.6.4 1 .4.7-.1 1.2-.7 1.2-1.4 0-.3-.1-.6-.3-.9-1.5-1.7-3.7-2.7-5.9-2.5-3.7 0-6 1.9-6 4.8 0 3.6 3.2 4.7 6 5.7 2.1.7 4 1.3 4 2.9 0 2.1-2.4 2.5-3.8 2.5-1.7.1-3.4-.6-4.6-1.8-.3-.3-.6-.4-1-.5-.7 0-1.3.6-1.3 1.3 0 .3.1.6.3.9 1.7 1.9 4.1 2.9 6.7 2.8 4.2 0 6.7-2 6.7-5.2-.2-3.5-3.3-4.5-6.1-5.5z"}),t.createElement("path",{fill:"#9B65C3",d:"M.2 25.5C.7 29.1 2.4 32.4 5 35l5.8-5.8c0-6.1 3.2-11.7 8.5-14.8L.2 25.5z"}),t.createElement("path",{fill:"#9B65C3",d:"M10.8 29.2c-3 0-5.9-.8-8.5-2.3-.7-.4-1.4-.9-2.1-1.4.5 3.6 2.2 6.9 4.8 9.5l5.8-5.8z"}),t.createElement("path",{fill:"#BE63C5",d:"M10.8 29.2L5 35c2.6 2.6 5.9 4.3 9.5 4.8l11-19.1c-3 5.2-8.6 8.5-14.7 8.5z"}),t.createElement("path",{fill:"#BF63C6",d:"M13.1 37.7c-1.5-2.6-2.3-5.5-2.3-8.5L5 35c2.6 2.6 5.9 4.3 9.5 4.8-.5-.7-1-1.4-1.4-2.1z"}),t.createElement("path",{fill:"#3278B1",d:"M32.5 6.8l-13.2 7.6c-5.3 3-11.7 3-17 0C.8 17 0 20 0 23c0 .8.1 1.7.2 2.5.7.5 1.4 1 2.1 1.4 2.6 1.5 5.5 2.3 8.5 2.3l22-22c-.1-.1-.2-.2-.3-.4z"}),t.createElement("path",{fill:"#3278B2",d:"M2.3 26.9c2.6 1.5 5.5 2.3 8.5 2.3 0-6.1 3.2-11.7 8.5-14.8L.2 25.4c.7.6 1.4 1.1 2.1 1.5z"}),t.createElement("path",{fill:"#45A4EC",d:"M2.3 14.4C.8 17 0 20 0 23c0 .8.1 1.7.2 2.5l19.1-11.1c-5.2 3.1-11.7 3.1-17 0z"}),t.createElement("path",{fill:"#19BB7D",d:"M32.8 7.2c-.3-.3-.5-.5-.8-.7-.6-.4-1.4-.6-2.1-.6H17c-6.1 0-11.7 3.3-14.7 8.5 5.3 3 11.7 3 17 0-5.3 3-8.5 8.7-8.5 14.8 6.1 0 11.7-3.2 14.8-8.5l7.6-13.2c-.2-.1-.3-.2-.4-.3z"}),t.createElement("path",{fill:"#08C7FB",d:"M19.3 14.4l13.2-7.6c-.2-.1-.3-.3-.5-.4l-29.7 8c5.3 3.1 11.8 3.1 17 0z"}),t.createElement("path",{fill:"#59F2F6",d:"M29.8 5.9H17c-6.1 0-11.7 3.3-14.7 8.5l29.7-8c-.7-.3-1.4-.5-2.2-.5z"}),t.createElement("path",{fill:"#DA3757",d:"M25.6 20.7l7.6-13.2c-.1-.1-.2-.2-.3-.4l-22 22c0 3 .8 5.9 2.3 8.5.4.7.9 1.4 1.4 2.1.8.1 1.6.2 2.4.2 3 0 5.9-.8 8.5-2.3-3-5.2-3-11.7.1-16.9z"}),t.createElement("path",{fill:"#D33C4E",d:"M10.8 29.2c0 3 .8 5.9 2.3 8.5.4.7.9 1.4 1.4 2.1l11-19.1c-3 5.2-8.6 8.5-14.7 8.5z"}),t.createElement("path",{fill:"#EE5A24",d:"M25.6 20.7l-11 19.1c.8.1 1.6.2 2.5.2 3 0 5.9-.8 8.5-2.3-3.1-5.3-3.1-11.8 0-17z"}),t.createElement("path",{fill:"#8BDF55",d:"M33.5 8c-.3-.5-.6-.9-1-1.2l-13.2 7.6c-5.3 3-8.5 8.7-8.5 14.8 6.1 0 11.7-3.2 14.8-8.5-3 5.3-3 11.7 0 17 5.2-3 8.5-8.6 8.5-14.6V10.2c0-.8-.2-1.5-.6-2.2z"}),t.createElement("path",{fill:"#25C16F",d:"M32.5 6.8l-13.2 7.6c-5.3 3-8.5 8.7-8.5 14.8l22-22c-.1-.1-.2-.3-.3-.4z"}),t.createElement("path",{fill:"#8BDF55",d:"M10.8 29.2c6.1 0 11.7-3.2 14.8-8.5l7.6-13.2c-.1-.1-.2-.2-.3-.4L10.8 29.2z"}),t.createElement("path",{fill:"#FB0",d:"M33.2 7.5l-7.6 13.2c-3 5.3-3 11.7 0 17l8-29.7c-.2-.2-.3-.3-.4-.5z"}),t.createElement("path",{fill:"#FFA800",d:"M25.6 37.7c5.3-3 8.5-8.6 8.5-14.7V10.2c0-.8-.2-1.5-.6-2.2l-7.9 29.7z"}))),z=({question:e,formValues:n,othersMeta:r,onChangeHandler:o,saveOthersValue:s,autoFocus:a,autoFocusDelay:c,isFinalQn:u})=>{switch(e.type_info.question_type){case"RANGE":return t.createElement(i,{type_info:e.type_info,onChangeHandler:o,npsValue:n[e.name]});case"CHECKBOX":case"MULTI_SELECT":return t.createElement(h,{name:e.name,autoFocusGroup:a,values:n[e.name],othersValue:r[e.name],options:e.type_info.choices,onChangeHandler:o,saveOthersValue:s,othersOption:e.type_info.meta?.othersOption,othersRequired:e.type_info.meta?.othersRequired,autoFocusDelay:c});case"RADIO":case"DROPDOWN":return t.createElement(x,{autoFocusGroup:a,autoFocusDelay:c,name:e.name,onChangeHandler:o,saveOthersValue:s,options:e.type_info.choices,value:n[e.name],othersValue:r[e.name],othersOption:e.type_info.meta?.othersOption,othersRequired:e.type_info.meta?.othersRequired,isFinalQn:u});case"INPUT":case"TEXT":return e.type_info?.meta?.readOnly?t.createElement("div",{className:"message-container"},e.type_info?.meta?.value):t.createElement("div",{className:"responsive-text-field"},t.createElement(f,{autoFocusInput:a,autoFocusDelay:c,label:"",isRequired:e.is_required,value:n[e.name]||"",placeholder:e.type_info?.meta?.placeholder??"",onChange:e=>o(e.target.value)}),t.createElement(y,{autoFocusInput:a,autoFocusDelay:c,label:"",maxLength:256,isRequired:e.is_required,placeholder:e.type_info?.meta?.placeholder??"",value:n[e.name]||"",onChange:e=>o(e.target.value)}));case"PARAGRAPH":return t.createElement(y,{autoFocusInput:a,autoFocusDelay:c,label:"",isRequired:e.is_required,placeholder:e.type_info?.meta?.placeholder??"",value:n[e.name]||"",onChange:e=>o(e.target.value)});default:return console.error(`Question type ${e.type_info.question_type} not found`),null}},I=(e,n,t)=>{if(e){let r={};t&&(r={"{{nps.rating}}":t}),n&&(r={...r,...n});const o=new RegExp(Object.keys(r).join("|"),"gi");e=e.replace(o,(function(e){return r[e.toLowerCase()]}))}return e},R=e=>({...e.brand_color&&{"--brand-color":e.brand_color},...e.body_background_color&&{"--background-color":e.body_background_color},...e.secondary_button_color&&{"--secondary-button-color":e.secondary_button_color},...e.question_background_color&&{"--question-background-color":e.question_background_color},...e.primary_button_text_color&&{"--button-text-color":e.primary_button_text_color},...e.secondary_button_text_color&&{"--secondary-button-text-color":e.secondary_button_text_color},...e.question_text_color&&{"--question-text-color":e.question_text_color}}),O=e=>n.useMemo((()=>{const n=JSON.parse(JSON.stringify(e)),t=[];return(n.question_details?.questions||[]).forEach((e=>{const n=e.type_info?.meta?.block;n&&(n.question_names||(n.question_names=[e.name]),t.push(n))})),{...n,meta:{...n.meta,blocks:t}}}),[e]);s(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #3a4b67;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 560px;\n --default-widget-max-height: 400px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-components.card-survey-style {\n padding: 20px 0;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation {\n white-space: nowrap;\n border-radius: 3px;\n border: 1px solid #efefef;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button svg {\n transform: rotate(90deg);\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #efefef;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n.freemium-survey-components.card-survey-style .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 200ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n transition: opacity 50ms ease-out;\n overflow: auto;\n}\n.freemium-survey-components.card-survey-style .hide-question-container {\n opacity: 0;\n}\n.freemium-survey-components.card-survey-style .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components.card-survey-style .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components.card-survey-style .fade-enter .question-container {\n opacity: 0;\n transform: translateY(15px);\n}\n.freemium-survey-components.card-survey-style .fade-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-exit-active .question-container {\n opacity: 0.05;\n transform: translateY(-15px);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-enter .question-container {\n opacity: 0;\n transform: translateY(-15px);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-exit-active .question-container {\n opacity: 0.05;\n transform: translateY(15px);\n}\n.freemium-survey-components.card-survey-style .fade-enter-active .question-container,\n.freemium-survey-components.card-survey-style .fade-exit-active .question-container,\n.freemium-survey-components.card-survey-style .fade-reverse-enter-active .question-container,\n.freemium-survey-components.card-survey-style .fade-reverse-exit-active .question-container {\n transition: opacity 200ms, transform 200ms;\n}\n.freemium-survey-components.card-survey-style .question-footer {\n display: flex;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components.card-survey-style .question-footer:empty {\n display: none;\n}\n.freemium-survey-components.card-survey-style .question-footer:only-child {\n margin-left: auto;\n}\n.freemium-survey-components.card-survey-style .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n width: 100%;\n}\n.freemium-survey-components.card-survey-style .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components.card-survey-style .skip-button {\n font-weight: 500;\n color: #3a4b67;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components.card-survey-style .skip-button:hover {\n background-color: #f3f3f3;\n transform: translateY(-4px);\n}\n.freemium-survey-components.card-survey-style .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.card-survey-style .submit {\n max-width: 700px;\n text-align: left;\n background: transparent;\n box-shadow: none;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.card-survey-style .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components.card-survey-style .thankyou .heading {\n font-weight: 500;\n font-size: 22px;\n}\n.freemium-survey-components.card-survey-style .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #475867;\n width: 75%;\n}\n.freemium-survey-components.card-survey-style .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components.card-survey-style .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components.card-survey-style .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components.card-survey-style .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components.card-survey-style .message-container:empty {\n display: none;\n}\n\n@media (max-width: 550px) {\n div.freemium-survey-components.card-survey-style .responsive-text-field .input-container {\n display: none;\n }\n div.freemium-survey-components.card-survey-style .responsive-text-field .textarea-container {\n display: flex;\n }\n div.freemium-survey-components.card-survey-style .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n }\n div.freemium-survey-components.card-survey-style .question-footer {\n flex-direction: column-reverse;\n }\n div.freemium-survey-components.card-survey-style .question-footer > *:first-child {\n margin-bottom: 0px;\n }\n div.freemium-survey-components.card-survey-style .question-footer > * {\n margin-bottom: 20px;\n }\n div.freemium-survey-components.card-survey-style .freemium-survey-step-navigation {\n width: 100%;\n }\n div.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button {\n width: 50%;\n }\n div.freemium-survey-components.card-survey-style .action-buttons {\n flex-direction: column;\n width: 100%;\n }\n div.freemium-survey-components.card-survey-style .action-buttons button {\n max-width: unset;\n }\n div.freemium-survey-components.card-survey-style .action-button {\n max-width: unset;\n width: 100%;\n }\n div.freemium-survey-components.card-survey-style .thankyou .text {\n width: auto;\n }\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .responsive-text-field .input-container {\n display: none;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .responsive-text-field .textarea-container {\n display: flex;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .question-footer {\n flex-direction: column-reverse;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .question-footer > *:first-child {\n margin-bottom: 0px;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .question-footer > * {\n margin-bottom: 20px;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .freemium-survey-step-navigation {\n width: 100%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .freemium-survey-step-navigation .navigation-button {\n width: 50%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .action-buttons {\n flex-direction: column;\n width: 100%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .action-buttons button {\n max-width: unset;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .action-button {\n max-width: unset;\n width: 100%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .thankyou .text {\n width: auto;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const Z=({thankYouQuestion:e,preview:r,placeholders:o,npsValue:s})=>(n.useEffect((()=>{r||e.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=e.type_info.meta?.redirectUrl}),1e3*e.type_info.meta?.redirectDelay??1e4)}),[]),t.createElement("div",{className:"question-container thankyou"},t.createElement("div",{className:"heading"},"Thank you!"),t.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:I(e.text,o,s)}}),e.type_info.meta?.redirectUrl&&t.createElement("div",{style:{width:"100%"}},t.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",e.type_info.meta?.redirectDelay," seconds.",t.createElement("br",null)),t.createElement("a",{className:"link",href:e.type_info.meta?.redirectUrl},e?.type_info.meta?.redirectUrl)))),M=({currentBlockIndex:e,currentBlockIndexOfBlocksWithQns:n,setCurrentBlockIndexOfBlocksWithQnsDirty:r,blocksWithQns:o,blocks:s,setHorizontalScrollUnits:i,preventQuestionAnimation:a,tempCurrentBlockIndexOfBlocksWithQns:c,setReverse:u,reverse:l})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:0==n.current,className:"navigation-button",onClick:()=>{l?(n.current=Math.max(n.current-1,0),e.current=s.findIndex((e=>e.name===o[n.current].name))):(c.current=Math.max(n.current-1,0),e.current=s.findIndex((e=>e.name===o[c.current].name))),a.current=!1,r.current=!0,u(!0),i({})}},t.createElement(E,null)),t.createElement("button",{className:"navigation-button",disabled:n.current>=o.length-1,onClick:()=>{a.current=!1,l?(c.current=Math.min(n.current+1,o.length-1),e.current=s.findIndex((e=>e.name===o[c.current].name))):(n.current=Math.min(n.current+1,o.length-1),e.current=s.findIndex((e=>e.name===o[n.current].name))),r.current=!0,u(!1),i({})}},t.createElement(q,null))),L=({widget:e,surveyStyle:n,formValues:r,blocksWithQns:o,blocks:s,thankYouQuestion:i,currentBlockIndexOfBlocksWithQns:a,currentBlockIndexOfBlocks:u,currentEditingBlock:l,isSubmitting:m,isValuesCommitted:d,isCurrentBlockFinal:p,setHorizontalScrollUnits:f,handleFormValues:y,skipBlock:v,setIsSubmitting:h,onSubmit:g,setIsSurveyCompleted:x,preventQuestionAnimation:b,preview:w,closePreview:k,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,question:C,block:N,reverse:S,othersMeta:B,setCurrentBlockIndexOfBlocksWithQnsDirty:z,...I})=>{const R=I.blockIndex??a.current,O=()=>(!c.includes(C.type_info.question_type)||"DROPDOWN"===C.type_info.question_type&&"__others__"===r[C.name])&&!p(),Z=()=>"RANGE"!==C.type_info.question_type&&!N.required&&!p(),L=()=>("DROPDOWN"===C.type_info.question_type&&!N.required&&r[C.name],!1),D=()=>p()&&(e||"standard"!==n),F=("MULTI_SELECT"===l.current.question.type_info.question_type&&r[l.current.question.name]?.includes("__others__")||"DROPDOWN"===l.current.question.type_info.question_type&&"__others__"===r[l.current.question.name])&&(!B[l.current.question.name]||""===B[l.current.question.name].trim());return t.createElement("div",{className:"question-footer"},!(!e&&"standard"===n||0===R&&void 0===r[C.name]||0===a.current&&!S)&&t.createElement(M,{currentBlockIndex:u,currentBlockIndexOfBlocksWithQns:a,blocksWithQns:o,blocks:s,setHorizontalScrollUnits:f,preventQuestionAnimation:b,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,reverse:S,setCurrentBlockIndexOfBlocksWithQnsDirty:z}),(O()||L()||Z()||D())&&t.createElement("div",{className:"action-buttons"},O()&&t.createElement(_,{onClick:()=>{z.current=!1,q(!1),y(o[R],null,!0)},disabled:l.current.required&&(!r[l.current.question.name]||Array.isArray(r[l.current.question.name])&&0===r[l.current.question.name].length)||l.current.question.type_info.meta?.othersRequired&&F,className:"next-button"},"Next"),Z()&&t.createElement("button",{className:"skip-button",onClick:()=>{z.current=!1,q(!1),v(C)}},"Skip"),D()&&t.createElement("div",{className:"submit"},t.createElement(_,{disabled:(l.current.required||l.current.question.type_info.pivot_question)&&(null==r[l.current.question.name]||0===r[l.current.question.name]?.length)||l.current.question.type_info.meta?.othersRequired&&F||m,onClick:()=>{h(!0),g()}},m?"Submitting":"Submit survey")),L()&&t.createElement("button",{className:"skip-button",onClick:()=>{q(!1),l.current=o[R],u.current=s.findIndex((e=>e.name===o[R].name)),v(C)}},"Clear selection")))},D=({survey:e,surveyStyle:o="standard",placeholders:s,onSubmit:i,widget:a,npsValue:u,preview:l,mobilePreview:m,closePreview:d})=>{const p=e.question_details?.questions||[],f=e.meta?.blocks||[],[y,v]=n.useState(null),[h,g]=n.useState({}),[x,b]=n.useState(!1),[k,_]=n.useState([]),[q,E]=n.useState({}),[C,N]=n.useState(!1),[S,B]=n.useState(null),[R,O]=n.useState({}),M=n.useRef(null),D=n.useRef(null),F=n.useRef(-1),Q=n.useRef(null),T=n.useRef(0),W=n.useRef(0),V=n.useRef(!1),H=n.useRef(!1),P=n.useRef([]),Y=t.useRef(null!=u&&"card"===o),A=n.useRef(null),$=n.useRef(0),[U,j]=n.useState(!1),G=n.useRef();n.useEffect((()=>{f&&(A.current=f.find((e=>"TY"===e.name)),v(f.filter((e=>"TY"!==e.name))))}),[f]),n.useEffect((()=>{V.current&&(W.current=$.current,E({}))}),[U]),n.useEffect((()=>{if(y)if(D.current=p.find((e=>e.type_info?.pivot_question))??p.find((e=>"RANGE"===e.type_info?.question_type))??p[0],null!=u){F.current=Math.min(D.current.type_info.validation.max,Math.max(D.current.type_info.validation.min,u));const e=p.find((e=>e.name===y[0].question_names[0]));M.current={...y[0],question:e},P.current=[...P.current,{...y[0],question:e}],_(P.current),g({Q_1:F.current})}else if(!M.current&&y.length>0)return M.current=y[0],void J(y[0])}),[y,u]),t.useEffect((()=>{k.length&&(P.current=k,W.current=k.length-1),E({})}),[k]),n.useEffect((()=>{Object.keys(h).length>0&&M.current.question&&(c.includes(M.current.question.type_info.question_type)&&("DROPDOWN"!==M.current.question.type_info.question_type||"__others__"!==h[M.current.question.name])||H.current)&&!K()&&(null!=u&&1==k.length?G.current?(clearTimeout(G.current),G.current=null,ee()):G.current=setTimeout((()=>{ee()}),1500):ee())}),[h]),n.useEffect((()=>{if(null!=h?.[D.current?.name])if(A.current?.is_based_on_rating){const e=D.current?.type_info?.choices[h?.[D.current?.name]-D.current?.type_info?.validation?.min??0]?.dependent_question_names,n=A.current?.question_names.find((n=>e?.includes(n))),t=p.find((e=>e.name===n));B(t)}else{const e=p.find((e=>e.name==A.current?.question_names[0]));B(e)}}),[h?.[D.current?.name]]);const X=()=>{i({...h,others_meta:R},(()=>{S?.type_info.meta?.skipThankYouPage?l?setTimeout((()=>{d?.()}),300):window.location.href=S?.type_info.meta?.redirectUrl:b(!0)}))},K=()=>(T.current===y.length-1||"end"===M.current.branchOption)&&W.current===k.length-1,J=e=>{let n={};if(e.is_based_on_rating){const t=D.current?.type_info?.choices[h?.[D.current?.name]-D.current?.type_info?.validation?.min??0]?.dependent_question_names,r=e.question_names.find((e=>t?.includes(e)));n=p.find((e=>e.name===r))}else n=p.find((n=>n.name===e.question_names[0]));M.current.question=n;P.current.find((e=>e.question.name===n.name))?(W.current+=1,E({})):_([...P.current,{...e,question:n}])},ee=()=>{if(K())b(!0);else{if(M.current.nextBlock)T.current=y.findIndex((e=>e.name===M.current.nextBlock));else if(M.current.question.type_info?.meta?.branches){const e=M.current.question.type_info?.meta?.branches,n=h[M.current.question.name];let t;if(t="RANGE"===M.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return X(),void b(!0);T.current=y.findIndex((e=>e.name===t.nextBlock))}else T.current+=1}else T.current+=1;M.current=y[T.current],J(y[T.current])}},ne=(e,n,t)=>{if(Y.current=!1,t){if(H.current=!0,null!=h[e.question.name]&&e.name!==k[k.length-1].name){const[t,r]=(e=>{const n=k.findIndex((n=>n.name===e.name)),t=k.slice(0,n+1),r=t.reduce(((e,n)=>(e[n.question.name]=h[n.question.name],e)),{});return T.current=y.findIndex((n=>n.name===e.name)),[t,r]})(e);g({...r,...null!=n&&{[e.question.name]:n}}),P.current=t}else g({...h,...null!=n&&{[e.question.name]:n}});D?.current?.name==e?.question?.name&&(F.current=n)}else g({...h,...null!=n&&{[e.question.name]:n}})};if(!M.current||!M.current.question)return null;const te=k[Math.min(W.current??k.length-1,k.length-1)];return t.createElement("div",{className:`freemium-survey-components ${m?"mobile-preview":""} ${o}-survey-style`,id:"freemium-survey"},x?null:t.createElement(w,{totalSteps:y.length,completedSteps:T.current+(x?1:0)}),t.createElement(r.SwitchTransition,{mode:"out-in"},t.createElement(r.CSSTransition,{key:W.current+String(x),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:U?"fade-reverse":"fade"},t.createElement("div",{className:"questions"},x?t.createElement(Z,{thankYouQuestion:S,preview:l,placeholders:s,npsValue:F.current}):t.createElement("div",{ref:Q,id:`${te.question.name}`,className:`question-container ${a||"card"===o}`,"data-test-question-name":te.question.name},t.createElement("div",{className:"question-text",dangerouslySetInnerHTML:{__html:I(te.question.text,s,F.current)},"aria-label":`question-${W.current}`,role:"heading","aria-level":1}),t.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:{width:"100%"}},t.createElement(z,{question:te.question,isFinalQn:K(),formValues:h,othersMeta:R,autoFocus:!0,autoFocusDelay:"standard"===o?350:0,saveOthersValue:(e,n)=>{if(null===n){const n={...R};delete n[e],O({...n})}else O({...R,[e]:n})},onChangeHandler:e=>{H.current=!1,T.current=y.findIndex((e=>e.name===te.name)),M.current=te,V.current=!1,j(!1),ne(te,e,!("DROPDOWN"===te.question.type_info.question_type&&"__others__"===e)&&c.includes(te.question.type_info.question_type)&&!K())}})),t.createElement(L,{question:te.question,block:te,widget:a,surveyStyle:o,formValues:h,othersMeta:R,blocksWithQns:k,blocks:y,thankYouQuestion:S,currentBlockIndexOfBlocksWithQns:W,reverse:U,setReverse:j,currentBlockIndexOfBlocks:T,currentEditingBlock:M,isSubmitting:C,isValuesCommitted:H,isCurrentBlockFinal:K,setHorizontalScrollUnits:E,handleFormValues:ne,skipBlock:e=>{H.current=!0,delete h[e.name],g({...h})},setIsSubmitting:N,onSubmit:X,setIsSurveyCompleted:b,preventQuestionAnimation:Y,preview:l,closePreview:d,tempCurrentBlockIndexOfBlocksWithQns:$,setCurrentBlockIndexOfBlocksWithQnsDirty:V}))))))};s(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #3a4b67;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n}\n\n.freemium-survey-components.widget-survey-components {\n overflow: hidden;\n}\n.freemium-survey-components.widget-survey-components * {\n scrollbar-color: rgba(216, 216, 216, 0.5) transparent !important;\n}\n.freemium-survey-components.widget-survey-components * ::-webkit-scrollbar {\n height: auto;\n height: initial;\n width: 6px;\n}\n.freemium-survey-components.widget-survey-components * ::-webkit-scrollbar-track {\n background: transparent !important;\n}\n.freemium-survey-components.widget-survey-components * ::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: rgba(216, 216, 216, 0.5) !important;\n}\n.freemium-survey-components.widget-survey-components p {\n margin: 0;\n}\n.freemium-survey-components.widget-survey-components .questions {\n min-width: 100%;\n max-width: 100%;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n position: relative;\n display: flex;\n justify-content: row;\n align-items: flex-end;\n height: 100%;\n transition: height 200ms ease;\n}\n.freemium-survey-components.widget-survey-components .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n text-align: center;\n max-height: 100%;\n min-width: 100%;\n max-width: 700px;\n margin: 0 auto;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n padding: 28px 0;\n padding-top: 0;\n grid-gap: 28px;\n gap: 28px;\n overflow: auto;\n}\n.freemium-survey-components.widget-survey-components .question-wrapper {\n width: 100%;\n flex-grow: 1;\n padding: 4px 28px;\n overflow: auto;\n}\n.freemium-survey-components.widget-survey-components .hide-question-container {\n opacity: 0;\n}\n.freemium-survey-components.widget-survey-components .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n padding: 0 28px;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components.widget-survey-components .question-text p {\n all: inherit;\n padding: 0;\n}\n.freemium-survey-components.widget-survey-components .nps-container .footer {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components.widget-survey-components .fade-enter {\n opacity: 1;\n transform: translateX(80px);\n position: absolute;\n}\n.freemium-survey-components.widget-survey-components .fade-enter-active {\n position: absolute;\n opacity: 1;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-enter-done {\n position: absolute;\n}\n.freemium-survey-components.widget-survey-components .fade-exit {\n opacity: 0.05;\n pointer-events: none;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-exit-active {\n pointer-events: none;\n opacity: 0;\n transform: translateX(-80px);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-enter {\n opacity: 0;\n position: absolute;\n transform: translateX(-80px);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-enter-active {\n opacity: 1;\n position: absolute;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-exit {\n opacity: 0.05;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-exit-active {\n opacity: 0;\n transform: translateX(80px);\n}\n.freemium-survey-components.widget-survey-components .fade-enter-active,\n.freemium-survey-components.widget-survey-components .fade-reverse-enter-active,\n.freemium-survey-components.widget-survey-components .fade-reverse-exit-active,\n.freemium-survey-components.widget-survey-components .fade-exit-active {\n transition: opacity 200ms, transform 200ms;\n}\n.freemium-survey-components.widget-survey-components .question-footer {\n margin: 0px auto;\n display: flex;\n justify-content: space-between;\n align-items: center;\n position: -webkit-sticky;\n position: sticky;\n padding: 0 28px;\n bottom: -28px;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n}\n.freemium-survey-components.widget-survey-components .question-footer:empty {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .question-footer:only-child {\n margin-left: auto;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation {\n white-space: nowrap;\n border-radius: 3px;\n border: 1px solid #efefef;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 40px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #efefef;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n.freemium-survey-components.widget-survey-components .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n width: 100%;\n}\n.freemium-survey-components.widget-survey-components .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .skip-button {\n font-weight: 500;\n cursor: pointer;\n color: #3a4b67;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components.widget-survey-components .skip-button:hover {\n background-color: #f3f3f3;\n transform: translateY(-4px);\n}\n.freemium-survey-components.widget-survey-components .next-button,\n.freemium-survey-components.widget-survey-components .submit {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.widget-survey-components .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components.widget-survey-components .thankyou .heading {\n font-weight: 500;\n font-size: 22px;\n}\n.freemium-survey-components.widget-survey-components .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #475867;\n width: 75%;\n}\n.freemium-survey-components.widget-survey-components .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components.widget-survey-components .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components.widget-survey-components .responsive-text-field .input-container {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .responsive-text-field .textarea-container {\n display: flex;\n}\n.freemium-survey-components.widget-survey-components .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n}\n.freemium-survey-components.widget-survey-components .message-container:empty {\n display: none;\n}\n\n.freemium-survey-components.widget-survey-components.compact-style .nps-question-text {\n text-align: center;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-container {\n grid-gap: 20px;\n gap: 20px;\n max-width: 100%;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer {\n flex-direction: column-reverse;\n grid-gap: 0;\n gap: 0;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer > *:first-child {\n margin-bottom: 0px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer > * {\n margin-bottom: 20px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .compact-footer-layout {\n display: flex;\n justify-content: space-between;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .compact-footer-layout:empty {\n display: none;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .action-buttons {\n grid-gap: 32px;\n gap: 32px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .submit,\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .action-button {\n max-width: unset;\n width: 100%;\n}\n.freemium-survey-components.widget-survey-components.compact-style .nps-container .footer {\n padding-top: 12px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .nps-container .choices {\n grid-gap: 10px;\n gap: 10px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .thankyou .text {\n width: 95%;\n}\n\n.freemium-survey-components.widget-survey-components.default-style .question-footer {\n justify-content: space-between;\n}\n.freemium-survey-components.widget-survey-components.default-style .nps-container .footer {\n padding-top: 12px;\n}\n.freemium-survey-components.widget-survey-components.default-style .nps-container .choices {\n flex-wrap: unset;\n grid-gap: 12px;\n gap: 12px;\n}\n.freemium-survey-components.widget-survey-components.default-style .radio-group {\n flex-direction: column;\n flex-wrap: nowrap;\n}\n.freemium-survey-components.widget-survey-components.default-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n color: #3a4b67;\n}\n.freemium-survey-components.widget-survey-components.default-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.freemium-survey-components.widget-survey-components.default-style textarea {\n min-height: 84px;\n}\n.freemium-survey-components.widget-survey-components.default-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.widget-survey-components.cozy-style {\n max-width: 1000px;\n min-width: 600px;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .question-text {\n font-size: 1rem;\n text-align: left;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-question-text {\n text-align: center;\n width: 70%;\n margin: 0 auto;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .question-footer {\n justify-content: space-between;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .widget {\n display: flex;\n justify-content: center;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .button-container {\n width: 60%;\n min-width: 600px;\n margin: 0 auto;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .button-container .choices {\n justify-content: space-around;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .footer {\n padding-top: 8px;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .action-button {\n line-height: 1.2;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n color: #3a4b67;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.freemium-survey-components.widget-survey-components.cozy-style textarea {\n min-height: 60px;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const F=({thankYouQuestion:e,preview:n,placeholders:r,npsValue:o},s)=>t.createElement(t.Fragment,null,t.createElement("div",{className:"heading"},"Thank you!"),t.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:I(e.text,r,o)}})),Q=({currentBlockIndexOfBlocks:e,currentBlockIndexOfBlocksWithQns:n,blocksWithQns:r,blocks:o,setHorizontalScrollUnits:s,tempCurrentBlockIndexOfBlocksWithQns:i,setCurrentBlockIndexOfBlocksWithQnsDirty:a,setReverse:c,reverse:u})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:0==n.current,className:"navigation-button",onClick:()=>{u?(n.current=Math.max(n.current-1,0),e.current=o.findIndex((e=>e.name===r[n.current].name))):(i.current=Math.max(n.current-1,0),e.current=o.findIndex((e=>e.name===r[i.current].name))),a.current=!0,c(!0),s({})}},t.createElement(E,null)),t.createElement("button",{className:"navigation-button",disabled:n.current>=r.length-1,onClick:()=>{u?(i.current=Math.min(n.current+1,r.length-1),e.current=o.findIndex((e=>e.name===r[i.current].name))):(n.current=Math.min(n.current+1,r.length-1),e.current=o.findIndex((e=>e.name===r[n.current].name))),a.current=!0,c(!1),s({})}},t.createElement(q,null))),T=({widget:e,widgetStyle:n,surveyStyle:r,formValues:o,blocksWithQns:s,blocks:i,thankYouQuestion:a,currentBlockIndexOfBlocksWithQns:u,currentBlockIndexOfBlocks:l,currentEditingBlock:m,isSubmitting:d,isValuesCommitted:p,isCurrentBlockFinal:f,setHorizontalScrollUnits:y,handleFormValues:v,skipBlock:h,setIsSubmitting:g,onSubmit:x,setIsSurveyCompleted:b,preview:w,closePreview:k,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,question:C,block:N,reverse:S,othersMeta:B,setCurrentBlockIndexOfBlocksWithQnsDirty:z,...I})=>{const R=I.blockIndex??u.current,O=()=>!(!e&&"standard"===r||0===R&&void 0===o[C.name]||0===u.current&&!S),Z=()=>(!c.includes(C.type_info.question_type)||"DROPDOWN"===C.type_info.question_type&&"__others__"===o[C.name])&&!f(),M=()=>"RANGE"!==C.type_info.question_type&&!N.required&&!f(),L=()=>("DROPDOWN"===C.type_info.question_type&&!N.required&&o[C.name],!1),D=()=>f()&&(e||"standard"!==r),F=("MULTI_SELECT"===m.current.question.type_info.question_type&&o[m.current.question.name]?.includes("__others__")||"DROPDOWN"===m.current.question.type_info.question_type&&"__others__"===o[m.current.question.name])&&(!B[m.current.question.name]||""===B[m.current.question.name].trim()),T="compact"===n&&M()&&O(),W=!T&&O();return t.createElement("div",{className:"question-footer"},T?t.createElement("div",{className:"compact-footer-layout"},O()&&t.createElement(Q,{currentBlockIndexOfBlocks:l,currentBlockIndexOfBlocksWithQns:u,blocksWithQns:s,blocks:i,setHorizontalScrollUnits:y,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,setCurrentBlockIndexOfBlocksWithQnsDirty:z,reverse:S}),M()&&t.createElement("button",{className:"skip-button",onClick:()=>{q(!1),h(C)}},"Skip")):null,(Z()||L()||"compact"!==n&&M()||W||D())&&t.createElement("div",{className:"action-buttons"},W&&t.createElement("div",{style:{marginRight:"auto"}},t.createElement(Q,{currentBlockIndexOfBlocks:l,currentBlockIndexOfBlocksWithQns:u,blocksWithQns:s,blocks:i,setHorizontalScrollUnits:y,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,setCurrentBlockIndexOfBlocksWithQnsDirty:z,reverse:S})),Z()&&t.createElement(_,{onClick:()=>{z.current=!1,q(!1),v(s[R],null,!0)},disabled:m.current.required&&(!o[m.current.question.name]||Array.isArray(o[m.current.question.name])&&0===o[m.current.question.name].length)||m.current.question.type_info.meta?.othersRequired&&F,className:"next-button"},"Next"),D()&&t.createElement(_,{className:"submit",disabled:(m.current.required||m.current.question.type_info.pivot_question)&&(null==o[m.current.question.name]||0===o[m.current.question.name]?.length)||m.current.question.type_info.meta?.othersRequired&&F||d,onClick:()=>{x(),g(!0)}},d?"Submitting":"Submit survey"),L()&&t.createElement("button",{className:"skip-button",onClick:()=>{q(!1),m.current=s[R],l.current=i.findIndex((e=>e.name===s[R].name)),h(C)}},"Clear selection")))},W=({survey:e,placeholders:s,onSubmit:i,widgetStyle:a,widgetHeaderQuerySelector:l})=>{const m=e.question_details?.questions||[],d=e.meta?.blocks||[],[p,f]=n.useState(null),[y,v]=n.useState({}),[h,g]=n.useState(!1),[x,b]=n.useState([]),[k,_]=n.useState({}),[q,E]=n.useState(!1),[C,N]=n.useState(null),[S,B]=n.useState({}),R=n.useRef(null),O=n.useRef(null),Z=n.useRef(-1),[M,L]=n.useState(null),D=n.useRef(0),Q=n.useRef(0),W=n.useRef(!1),V=n.useRef([]),H=n.useRef(null),P=n.useRef(0),[Y,A]=n.useState(!1),$=n.useRef(0),U=n.useRef(!1);n.useEffect((()=>{d&&(H.current=d.find((e=>"TY"===e.name)),f(d.filter((e=>"TY"!==e.name))))}),[d]),n.useEffect((()=>{U.current&&(Q.current=P.current,_({}))}),[Y]),n.useEffect((()=>{if(p)return O.current=m.find((e=>e.type_info?.pivot_question))??m.find((e=>"RANGE"===e.type_info?.question_type))??m[0],!R.current&&p.length>0?(R.current=p[0],void X(p[0])):void 0}),[p]),n.useEffect((()=>{x.length&&(V.current=x,Q.current=x.length-1,_({}))}),[x]),n.useEffect((()=>{Object.keys(y).length>0&&R.current.question&&(c.includes(R.current.question.type_info.question_type)&&("DROPDOWN"!==R.current.question.type_info.question_type||"__others__"!==y[R.current.question.name])||W.current)&&!G()&&K()}),[y]),n.useEffect((()=>{if(null!=y?.[O.current?.name])if(H.current?.is_based_on_rating){const e=O.current?.type_info?.choices[y?.[O.current?.name]-O.current?.type_info?.validation?.min??0]?.dependent_question_names,n=H.current?.question_names.find((n=>e?.includes(n))),t=m.find((e=>e.name===n));N(t)}else{const e=m.find((e=>e.name==H.current?.question_names[0]));N(e)}}),[y?.[O.current?.name]]);n.useMemo((()=>{(()=>{if(M){M.style.minHeight="unset",M.style.maxHeight="unset",M.style.height="min-content",M.style.position="static";const e=Math.min(M?.scrollHeight+2,u[a]);M.style.height=e+"px",M.style.minHeight=e+"px",$.current=e}})()}),[M]);const j=()=>{i({...y,others_meta:S},(()=>{g(!0)}))},G=()=>(D.current===p.length-1||"end"===R.current.branchOption)&&Q.current===x.length-1,X=e=>{let n={};if(e.is_based_on_rating){const t=O.current?.type_info?.choices[y?.[O.current?.name]-O.current?.type_info?.validation?.min??0]?.dependent_question_names,r=e.question_names.find((e=>t?.includes(e)));n=m.find((e=>e.name===r))}else n=m.find((n=>n.name===e.question_names[0]));R.current.question=n;V.current.find((e=>e.question.name===n.name))?(_({}),Q.current+=1):b([...V.current,{...e,question:n}])},K=()=>{if(G())g(!0);else{if(R.current.nextBlock)D.current=p.findIndex((e=>e.name===R.current.nextBlock));else if(R.current.question.type_info?.meta?.branches){const e=R.current.question.type_info?.meta?.branches,n=y[R.current.question.name];let t;if(t="RANGE"===R.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return j(),void g(!0);D.current=p.findIndex((e=>e.name===t.nextBlock))}else D.current+=1}else D.current+=1;R.current=p[D.current],X(p[D.current])}},J=(e,n,t)=>{if(t){if(W.current=!0,null!=y[e.question.name]&&e.name!==x[x.length-1].name){const[t,r]=(e=>{const n=x.findIndex((n=>n.name===e.name)),t=x.slice(0,n+1),r=t.reduce(((e,n)=>(e[n.question.name]=y[n.question.name],e)),{});return D.current=p.findIndex((n=>n.name===e.name)),[t,r]})(e);v({...r,...null!=n&&{[e.question.name]:n}}),V.current=t}else v({...y,...null!=n&&{[e.question.name]:n}});O?.current?.name==e?.question?.name&&(Z.current=n)}else v({...y,...null!=n&&{[e.question.name]:n}})};if(!R.current||!R.current.question)return null;const ee=x[Math.min(Q.current??x.length-1,x.length-1)];return t.createElement("div",{className:`freemium-survey-components widget-survey-components\n ${a}-style `,id:"freemium-survey"},l&&!h&&document.querySelector(l)?o.createPortal(t.createElement(w,{totalSteps:p.length,completedSteps:D.current+(h?1:0),widget:!0}),document.querySelector(l)):null,t.createElement("div",{className:"questions",style:{height:$.current,...1===x.length?{transition:"none"}:{}}},t.createElement(r.TransitionGroup,{component:null},t.createElement(r.CSSTransition,{key:ee.question.name+String(h),unmountOnExit:!0,addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:Y?"fade-reverse":"fade"},t.createElement("div",{ref:e=>e?L(e):null,id:`${ee.question.name}`,className:"question-container "+(h?"thankyou":""),"data-test-question-name":ee.question.name},h?t.createElement(F,{thankYouQuestion:C,placeholders:s,npsValue:Z.current,setBlockElementRef:L}):t.createElement(t.Fragment,null,t.createElement("div",{className:"question-text "+("RANGE"===ee.question.type_info.question_type?"nps-question-text":""),dangerouslySetInnerHTML:{__html:I(ee.question.text,s,Z.current)},"aria-label":`question-${Q.current}`,role:"heading","aria-level":1}),t.createElement("div",{className:"question-wrapper",onTransitionEndCapture:e=>e.stopPropagation()},t.createElement(z,{question:ee.question,isFinalQn:G(),formValues:y,othersMeta:S,autoFocus:!0,autoFocusDelay:0,saveOthersValue:(e,n)=>{if(null===n){const n={...S};delete n[e],B({...n})}else B({...S,[e]:n})},onChangeHandler:e=>{W.current=!1,D.current=p.findIndex((e=>e.name===ee.name)),R.current=ee,U.current=!1,A(!1),J(ee,e,!("DROPDOWN"===ee.question.type_info.question_type&&"__others__"===e)&&c.includes(ee.question.type_info.question_type)&&!G())}})),t.createElement(T,{question:ee.question,block:ee,widgetStyle:a,formValues:y,othersMeta:S,blocksWithQns:x,blocks:p,thankYouQuestion:C,currentBlockIndexOfBlocksWithQns:Q,reverse:Y,setReverse:A,currentBlockIndexOfBlocks:D,currentEditingBlock:R,isSubmitting:q,isValuesCommitted:W,isCurrentBlockFinal:G,setHorizontalScrollUnits:_,handleFormValues:J,skipBlock:e=>{W.current=!0,delete y[e.name],v({...y})},setIsSubmitting:E,onSubmit:j,setIsSurveyCompleted:g,tempCurrentBlockIndexOfBlocksWithQns:P,setCurrentBlockIndexOfBlocksWithQnsDirty:U})))))))};s('#freshworks-survey-widget {\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;\n --container-width: 350px;\n --widget-header-height: 36px;\n --widget-footer-height: 32px;\n}\n#freshworks-survey-widget * {\n box-sizing: border-box;\n}\n#freshworks-survey-widget input,\n#freshworks-survey-widget select,\n#freshworks-survey-widget textarea,\n#freshworks-survey-widget button {\n font-family: inherit;\n}\n@-webkit-keyframes mountWidget {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes mountWidget {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n#freshworks-survey-widget div.widget-survey-components {\n border: none;\n}\n#freshworks-survey-widget .freemium-survey-components {\n width: 100%;\n height: 100%;\n min-height: inherit;\n}\n#freshworks-survey-widget .default-container-style {\n right: calc(50% - var(--container-width) / 2);\n}\n#freshworks-survey-widget .compact-container-style {\n right: 40px;\n}\n#freshworks-survey-widget .compact-container-style .widget-footer {\n padding: 8px 16px;\n}\n#freshworks-survey-widget .cozy-container-style {\n max-width: 1000px;\n min-width: 800px;\n left: 50%;\n transform: translate(-50%, 0);\n}\n#freshworks-survey-widget .container {\n position: fixed;\n bottom: 0;\n border-radius: 4px 4px 0 0;\n z-index: 2147483647;\n display: flex;\n flex-direction: column;\n background-color: #fff;\n background-color: var(--question-background-color, #fff);\n width: var(--container-width);\n box-shadow: 0px 7px 13px rgba(18, 52, 77, 0.19);\n transition: opacity 0.25s ease, height var(--height-transition-duration) ease;\n -webkit-animation: mountWidget 0.5s ease;\n animation: mountWidget 0.5s ease;\n height: auto;\n}\n#freshworks-survey-widget .widget-header {\n height: var(--widget-header-height);\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-direction: row-reverse;\n grid-gap: 8px;\n gap: 8px;\n background-color: #fff;\n background-color: var(--question-background-color, #fff);\n border-radius: inherit;\n position: relative;\n}\n#freshworks-survey-widget .widget-header .icons {\n height: 100%;\n display: flex;\n}\n#freshworks-survey-widget .widget-header .icon {\n cursor: pointer;\n height: 100%;\n width: 48px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n background-color: transparent;\n border: none;\n}\n#freshworks-survey-widget .widget-header .icon:hover .icon-tooltip {\n display: block;\n -webkit-animation: mountWidget 0.4s ease;\n animation: mountWidget 0.4s ease;\n opacity: 1;\n}\n#freshworks-survey-widget .widget-header .icon:hover .icon-tooltip:hover {\n display: none;\n}\n#freshworks-survey-widget .widget-header .icon-tooltip {\n background: rgba(18, 52, 77, 0.8901960784);\n color: #fff;\n letter-spacing: 0.5px;\n padding: 4px 8px;\n border-radius: 4px;\n font-weight: 500;\n font-size: 0.9rem;\n position: absolute;\n right: 48px;\n top: 12px;\n white-space: nowrap;\n z-index: 1;\n transition: opacity ease 0.2s;\n display: none;\n opacity: 0;\n}\n#freshworks-survey-widget .widget-header.minimized {\n min-height: var(--widget-header-height);\n width: 100%;\n flex-direction: row;\n}\n#freshworks-survey-widget .header-content.minimized {\n opacity: 0;\n text-overflow: ellipsis;\n width: calc(100% - 72px);\n padding-left: 28px;\n overflow: hidden;\n white-space: nowrap;\n -webkit-animation: mountWidget 0.8s ease forwards;\n animation: mountWidget 0.8s ease forwards;\n -webkit-animation-delay: 0.3s;\n animation-delay: 0.3s;\n font-weight: 500;\n line-height: 1.8;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n#freshworks-survey-widget .header-content.minimized p {\n all: inherit;\n width: 100%;\n padding: 0;\n margin: 0;\n}\n#freshworks-survey-widget .widget-main {\n opacity: 1;\n flex-grow: 1;\n transition: opacity 0.25s ease, height var(--height-transition-duration) ease;\n}\n#freshworks-survey-widget .widget-main.minimized {\n opacity: 0;\n height: 0;\n border-radius: 3px 3px 0 0;\n}\n#freshworks-survey-widget .widget-footer {\n height: var(--widget-footer-height);\n font-size: 12px;\n display: flex;\n padding: 8px 28px;\n justify-content: space-between;\n align-items: center;\n color: rgba(18, 52, 77, 0.831372549);\n background-color: rgba(187, 187, 187, 0.1);\n letter-spacing: 0.2px;\n}\n#freshworks-survey-widget .widget-footer .fw-link {\n display: flex;\n align-items: center;\n grid-gap: 6px;\n gap: 6px;\n}\n#freshworks-survey-widget .widget-footer .emoji {\n position: relative;\n top: -1px;\n left: -2px;\n}\n#freshworks-survey-widget .widget-footer a {\n color: inherit;\n text-decoration: none;\n box-sizing: border-box;\n border-bottom: 1px solid transparent;\n}\n#freshworks-survey-widget .widget-footer a:hover {\n border-bottom: 1px solid;\n}\n#freshworks-survey-widget .title,\n#freshworks-survey-widget .description {\n text-align: center;\n}\n#freshworks-survey-widget .description {\n color: #666;\n line-height: 1.2;\n}\n#freshworks-survey-widget .close-widget {\n position: absolute;\n z-index: 10;\n background-color: #fff;\n flex-direction: column;\n display: flex;\n top: 40px;\n right: 12px;\n box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);\n border-radius: 2px;\n padding: 4px;\n}\n#freshworks-survey-widget .close-widget button {\n cursor: pointer;\n border: none;\n background-color: transparent;\n padding: 8px 12px;\n border-radius: 2px;\n font-size: 14px;\n}\n#freshworks-survey-widget .close-widget button:hover {\n background-color: #f3f3f3;\n}\n#freshworks-survey-widget .close-widget.top {\n top: -72px;\n}');const V=({onDismiss:e,remindLater:r,closeMenu:o,closeIconRef:s,position:i="bottom"})=>(n.useEffect((()=>{const e=e=>{s.current===e.target||s.current.contains(e.target)||o()};return window.addEventListener("click",e),()=>window.removeEventListener("click",e)}),[]),t.createElement("div",{className:"close-widget "+("top"===i?"top":"")},t.createElement("button",{onClick:async()=>{await r()},autoFocus:!0},"Remind me later"),t.createElement("button",{onClick:async()=>{await e()},style:{color:"#D70B17"}},"Don't show again"))),H=({survey:e,placeholders:r,onSubmit:o,remindLater:s,onDismiss:i,onClose:a,surveyType:c,unsubscribeUrl:u,isSurveyCompleted:m})=>{const[d,p]=n.useState(!1),[f,y]=n.useState(!1),[v,h]=n.useState(0),{ui_theme:g}=e,[x,b]=n.useState(null),[w,k]=n.useState(!1),_=e.question_details.questions.find((e=>e.pivot_question))??e.question_details.questions.find((e=>"RANGE"===e.type_info.question_type))??e.question_details.questions[0],q=()=>{p(!0),setTimeout((()=>{window.SurveyWidget?.unmount()}),300)},E=n.useRef(null);return t.createElement("div",{className:`container ${c}-container-style ${f?"minimized":""}`,style:{opacity:d?0:1,"--container-width":`${l[c]}`,"--height-transition-duration":"600ms",...R(g)}},t.createElement("header",{id:"surveyserv-widget-header",className:"widget-header "+(f?"minimized":"")},f&&t.createElement("span",{className:"header-content minimized",dangerouslySetInnerHTML:{__html:I(_?.text,r)}}),t.createElement("div",{className:"icons"},!m&&t.createElement("button",{onClick:()=>{f?(y(!f),setTimeout((()=>{h(0)}),700)):(h(x?.clientHeight??0),setTimeout((()=>{y(!f)}),0))},className:"icon"},f?t.createElement(S,null):t.createElement(N,null)),t.createElement("button",{ref:E,onClick:()=>{m?(q(),a?.()):k(!w)},className:"icon"},t.createElement(C,null))),w&&t.createElement(V,{position:f?"top":"bottom",closeIconRef:E,onDismiss:async()=>{await i(),q()},remindLater:async()=>{await s(),q()},closeMenu:()=>k(!w)})),t.createElement("main",{ref:e=>b(e),className:"widget-main "+(f?"minimized":""),style:{height:f?0:v||"auto"}},t.createElement(W,{widgetStyle:c,survey:e,placeholders:r,onSubmit:o,widgetHeaderQuerySelector:f?void 0:"#surveyserv-widget-header"})),t.createElement("footer",{className:"widget-footer"},t.createElement("a",{className:"fw-link",href:"https://www.freshworks.com/?utm_source=survey&utm_medium=survey_public_page",target:"_blank",rel:"noopener noreferrer"},"NPS survey powered by",t.createElement(B,null)),u&&!f&&t.createElement("a",{href:u,target:"_blank",rel:"noopener noreferrer",onClick:e=>{e.stopPropagation(),q()}},"Unsubscribe")))};s(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #3a4b67;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 480px;\n --default-widget-max-height: 460px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-step-navigation {\n border-radius: 3px;\n border: 1px solid #efefef;\n white-space: nowrap;\n}\n.freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #efefef;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n\n.freemium-survey-components.standard-survey-style .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 800ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n margin-bottom: 28px;\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: auto;\n opacity: 1;\n}\n.freemium-survey-components.standard-survey-style .hide-question-container {\n pointer-events: none;\n opacity: 0;\n}\n.freemium-survey-components.standard-survey-style .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components.standard-survey-style .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components.standard-survey-style .question-footer {\n display: flex;\n justify-content: flex-start;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components.standard-survey-style .question-footer:empty {\n display: none;\n}\n.freemium-survey-components.standard-survey-style .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n}\n.freemium-survey-components.standard-survey-style .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components.standard-survey-style .skip-button {\n font-weight: 500;\n color: #3a4b67;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components.standard-survey-style .skip-button:hover {\n background-color: #f3f3f3;\n transform: translateY(-4px);\n}\n.freemium-survey-components.standard-survey-style .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.standard-survey-style .submit {\n max-width: 700px;\n margin: 0 auto;\n text-align: left;\n background: transparent;\n box-shadow: none;\n padding-bottom: 40px;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.standard-survey-style .fade-enter {\n transition: all ease 400ms;\n opacity: 0;\n transform: translateY(40px);\n}\n.freemium-survey-components.standard-survey-style .fade-enter-active {\n transition: all ease 400ms;\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.standard-survey-style .fade-exit {\n transition: all ease 400ms;\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.standard-survey-style .fade-exit-active {\n transition: all ease 400ms;\n opacity: 0;\n transform: translateY(-40px);\n}\n.freemium-survey-components.standard-survey-style .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components.standard-survey-style .thankyou .heading {\n font-weight: 500;\n font-size: 22px;\n}\n.freemium-survey-components.standard-survey-style .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #475867;\n width: 75%;\n}\n.freemium-survey-components.standard-survey-style .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components.standard-survey-style .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components.standard-survey-style .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components.standard-survey-style .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components.standard-survey-style .message-container:empty {\n display: none;\n}\n@media (max-width: 550px) {\n .freemium-survey-components.standard-survey-style .action-buttons {\n flex-direction: column;\n width: 100%;\n }\n .freemium-survey-components.standard-survey-style .action-buttons button {\n max-width: unset;\n }\n .freemium-survey-components.standard-survey-style .action-button {\n max-width: unset;\n width: 100%;\n }\n .freemium-survey-components.standard-survey-style .thankyou .text {\n width: auto;\n }\n}\n\n@media (max-width: 550px) {\n .freemium-survey-component .responsive-text-field .input-container {\n display: none;\n }\n .freemium-survey-component .responsive-text-field .textarea-container {\n display: flex;\n }\n .freemium-survey-component .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n }\n}\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const P=({thankYouQuestion:e,preview:r,placeholders:o,npsValue:s})=>(n.useEffect((()=>{r||e.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=e.type_info.meta?.redirectUrl}),1e3*(1e3*e.type_info.meta?.redirectDelay??1e4))}),[]),t.createElement("div",{className:"question-container thankyou"},t.createElement("div",{className:"heading"},"Thank you!"),t.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:I(e.text,o,s)}}),e.type_info.meta?.redirectUrl&&t.createElement("div",{style:{width:"100%"}},t.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",e.type_info.meta?.redirectDelay," seconds.",t.createElement("br",null)),t.createElement("a",{className:"link",href:e.type_info.meta?.redirectUrl},e?.type_info.meta?.redirectUrl)))),Y=({currentBlockIndex:e,currentBlockIndexOfBlocksWithQns:n,blocksWithQns:r,blocks:o,setHorizontalScrollUnits:s,preventQuestionAnimation:i})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:0==n.current,className:"navigation-button",onClick:()=>{n.current=Math.max(n.current-1,0),e.current=o.findIndex((e=>e.name===r[n.current].name)),i.current=!1,s(n.current)}},t.createElement(E,null)),t.createElement("button",{className:"navigation-button",disabled:n.current>=r.length-1,onClick:()=>{i.current=!1,n.current=Math.min(n.current+1,r.length-1),e.current=o.findIndex((e=>e.name===r[n.current].name)),s(n.current)}},t.createElement(q,null))),A=({widget:e,block:n,surveyStyle:r,formValues:o,othersMeta:s,blocksWithQns:i,blocks:a,thankYouQuestion:u,currentBlockIndexOfBlocksWithQns:l,currentBlockIndexOfBlocks:m,currentEditingBlock:d,isSubmitting:p,isValuesCommitted:f,isCurrentBlockFinal:y,setHorizontalScrollUnits:v,handleFormValues:h,skipBlock:g,setIsSubmitting:x,onSubmit:b,setIsSurveyCompleted:w,preventQuestionAnimation:k,preview:q,closePreview:E,...C})=>{const N=C.blockIndex??l.current,S=C.question??i[N].question,B=()=>S.name===d.current.question.name&&(!c.includes(S.type_info.question_type)||"DROPDOWN"===S.type_info.question_type&&"__others__"===o[S.name])&&!y(),z=()=>"RANGE"!==S.type_info.question_type&&!n.required&&S.name===d.current.question.name&&!y(),I=()=>("DROPDOWN"===S.type_info.question_type&&S.name!==d.current.question.name&&!n.required&&o[S.name],!1),R=()=>y()&&(e||"standard"!==r)&&S.name===d.current.question.name,O=("MULTI_SELECT"===d.current.question.type_info.question_type&&o[d.current.question.name]?.includes("__others__")||"DROPDOWN"===d.current.question.type_info.question_type&&"__others__"===o[d.current.question.name])&&(!s[d.current.question.name]||""===s[d.current.question.name].trim());return t.createElement("div",{className:"question-footer"},!(!e&&"standard"===r||0===N&&!o[S.name])&&t.createElement(Y,{currentBlockIndex:m,currentBlockIndexOfBlocksWithQns:l,blocksWithQns:i,blocks:a,setHorizontalScrollUnits:v,preventQuestionAnimation:k}),(B()||I()||z()||R())&&t.createElement("div",{className:"action-buttons"},B()&&t.createElement(_,{onClick:()=>{h(i[N],null,!0)},disabled:d.current.required&&(!o[d.current.question.name]||Array.isArray(o[d.current.question.name])&&0===o[d.current.question.name].length)||d.current.question.type_info.meta?.othersRequired&&O,className:"next-button"},"Next"),z()&&t.createElement("button",{className:"skip-button",onClick:()=>g(S)},"Skip"),I()&&t.createElement("button",{className:"skip-button",onClick:()=>{d.current=i[N],m.current=a.findIndex((e=>e.name===i[N].name)),g(S)}},"Clear selection"),R()&&t.createElement("div",{className:"submit"},t.createElement(_,{disabled:(d.current.required||d.current.question.type_info.pivot_question)&&(null==o[d.current.question.name]||0===o[d.current.question.name]?.length)||d.current.question.type_info.meta?.othersRequired&&O||p,onClick:()=>{x(!0),b()}},p?"Submitting":"Submit survey"))))},$=({survey:e,surveyStyle:o="standard",placeholders:s,onSubmit:i,widget:a,npsValue:u,preview:l,mobilePreview:m,closePreview:d})=>{const p=e.question_details?.questions||[],f=e.meta?.blocks||[],[y,v]=n.useState(null),[h,g]=n.useState({}),[x,b]=n.useState(!1),[k,q]=n.useState([]),[E,C]=n.useState(0),[N,S]=n.useState(!1),[B,R]=n.useState(null),[O,Z]=n.useState({}),M=n.useRef(null),L=n.useRef(null),D=n.useRef(-1),F=n.useRef(null),Q=n.useRef(0),T=n.useRef(0),W=n.useRef(!1),V=n.useRef([]),H=n.useRef(null!=u&&"card"===o),Y=n.useRef(null),$=n.useRef([]);n.useEffect((()=>{f&&(Y.current=f.find((e=>"TY"===e.name)),v(f.filter((e=>"TY"!==e.name))))}),[f]),n.useEffect((()=>{if(y)if(L.current=p.find((e=>e.type_info?.pivot_question))??p.find((e=>"RANGE"===e.type_info?.question_type))??p[0],null!=u){D.current=Math.min(L.current.type_info.validation.max,Math.max(L.current.type_info.validation.min,u));const e=p.find((e=>e.name===y[0].question_names[0]));M.current={...y[0],question:e},V.current=[...V.current,{...y[0],question:e}],q(V.current),g({Q_1:D.current})}else if(!M.current&&y.length>0)return M.current=y[0],void G(y[0])}),[y,u]),n.useEffect((()=>{k.length&&(V.current=k,T.current=k.length-1),a||"standard"!==o?(F.current&&(F.current.style.maxHeight="unset"),$.current[Q.current]=F.current?.scrollHeight||$.current[Q.current]||0,F.current&&(F.current.style.maxHeight="100%")):F.current?.scrollIntoView({block:"start",behavior:"smooth"}),C(k.length-1)}),[k]),n.useEffect((()=>{Object.keys(h).length>0&&M.current.question&&(c.includes(M.current.question.type_info.question_type)&&("DROPDOWN"!==M.current.question.type_info.question_type||"__others__"!==h[M.current.question.name])||W.current)&&!j()&&X()}),[h]),n.useEffect((()=>{if(null!=h?.[L.current?.name])if(Y.current?.is_based_on_rating){const e=L.current?.type_info?.choices[h?.[L.current?.name]-L.current?.type_info?.validation?.min??0]?.dependent_question_names,n=Y.current?.question_names.find((n=>e?.includes(n))),t=p.find((e=>e.name===n));R(t)}else{const e=p.find((e=>e.name==Y.current?.question_names[0]));R(e)}}),[h?.[L.current?.name]]);const U=()=>{i({...h,others_meta:O},(()=>{B?.type_info.meta?.skipThankYouPage?l?setTimeout((()=>{d?.()}),300):window.location.href=B?.type_info.meta?.redirectUrl:b(!0)}))},j=()=>Q.current===y.length-1||"end"===M.current.branchOption,G=e=>{let n={};if(e.is_based_on_rating){const t=L.current?.type_info?.choices[h?.[L.current?.name]-L.current?.type_info?.validation?.min??0]?.dependent_question_names,r=e.question_names.find((e=>t?.includes(e)));n=p.find((e=>e.name===r))}else n=p.find((n=>n.name===e.question_names[0]));M.current.question=n;V.current.find((e=>e.question.name===n.name))?(C(E+1),T.current+=1):q([...V.current,{...e,question:n}])},X=()=>{if(j())b(!0);else{if(M.current.nextBlock)Q.current=y.findIndex((e=>e.name===M.current.nextBlock));else if(M.current.question.type_info?.meta?.branches){const e=M.current.question.type_info?.meta?.branches,n=h[M.current.question.name];let t;if(t="RANGE"===M.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return U(),void b(!0);Q.current=y.findIndex((e=>e.name===t.nextBlock))}else Q.current+=1}else Q.current+=1;M.current=y[Q.current],G(y[Q.current])}},K=e=>{W.current=!0,delete h[e.name],g({...h})},J=(e,n,t)=>{if(H.current=!1,t){if(W.current=!0,null!=h[e.question.name]&&e.name!==k[k.length-1].name){const[t,r]=(e=>{const n=k.findIndex((n=>n.name===e.name)),t=k.slice(0,n+1),r=t.reduce(((e,n)=>(e[n.question.name]=h[n.question.name],e)),{});return Q.current=y.findIndex((n=>n.name===e.name)),[t,r]})(e);g({...r,...null!=n&&{[e.question.name]:n}}),V.current=t}else g({...h,...null!=n&&{[e.question.name]:n}});L?.current?.name==e?.question?.name&&(D.current=n)}else g({...h,...null!=n&&{[e.question.name]:n}})},ee=(e,n)=>{const t=k.find((n=>n.question.name===e));if(Q.current=y.findIndex((e=>e.name===t.name)),M.current=t,null===n){const n={...O};delete n[e],Z({...n})}else Z({...O,[e]:n})};if(!M.current||!M.current.question)return null;const ne=("MULTI_SELECT"===M.current.question.type_info.question_type&&h[M.current.question.name]?.includes("__others__")||"DROPDOWN"===M.current.question.type_info.question_type&&"__others__"===h[M.current.question.name])&&(!O[M.current.question.name]||""===O[M.current.question.name]);return t.createElement("div",{className:`freemium-survey-components ${a?"widget-survey-components":""} ${m?"mobile-preview":""} ${o}-survey-style`,id:"freemium-survey"},x?null:t.createElement(w,{totalSteps:y.length,completedSteps:Q.current}),t.createElement(r.SwitchTransition,{mode:"out-in"},t.createElement(r.CSSTransition,{key:String(x),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:a?"":"fade"},t.createElement("div",null,x?t.createElement(P,{thankYouQuestion:B,preview:l,placeholders:s,npsValue:D.current}):t.createElement(t.Fragment,null,t.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:a||"card"===o?{transform:`translateX(calc(-${E} * 100%))`,height:`${$.current[Q.current]}px`,transition:H.current||k?.length<=1?"none":"all 300ms ease-out 0ms"}:{},className:"questions"},k.map(((e,n)=>t.createElement("div",{key:e.question.name,ref:F,className:"question-container "+(!a&&"card"!==o||T.current===n?"":"hide-question-container")},t.createElement("div",{className:"question-text "+(0===n?"nps":""),dangerouslySetInnerHTML:{__html:I(e.question.text,s,D.current)},"aria-label":`question-${n}`,role:"heading","aria-level":1}),t.createElement("button",{disabled:!a&&"standard"===o,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),t.createElement(z,{question:e.question,isFinalQn:j(),formValues:h,othersMeta:O,autoFocus:T.current===n,autoFocusDelay:"standard"===o?350:20,saveOthersValue:ee,onChangeHandler:n=>{W.current=!1,Q.current=y.findIndex((n=>n.name===e.name)),M.current=e,J(e,n,!("DROPDOWN"===e.question.type_info.question_type&&"__others__"===n)&&c.includes(e.question.type_info.question_type)&&!j())}}),t.createElement("button",{disabled:!a&&"standard"===o,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),t.createElement(A,{question:e.question,block:e,blockIndex:n,widget:a,surveyStyle:o,formValues:h,othersMeta:O,blocksWithQns:k,blocks:y,thankYouQuestion:B,currentBlockIndexOfBlocksWithQns:T,currentBlockIndexOfBlocks:Q,currentEditingBlock:M,isSubmitting:N,isValuesCommitted:W,isCurrentBlockFinal:j,setHorizontalScrollUnits:C,handleFormValues:J,skipBlock:K,setIsSubmitting:S,onSubmit:U,setIsSurveyCompleted:b,preventQuestionAnimation:H,preview:l,closePreview:d})))),!a&&"card"!==o&&j()&&t.createElement("div",{className:"submit"},t.createElement(_,{disabled:(M.current.required||M.current.question.type_info.pivot_question)&&(null==h[M.current.question.name]||0===h[M.current.question.name]?.length)||M.current.question.type_info.meta?.othersRequired&&ne||N,onClick:()=>{S(!0),i({...h,others_meta:O},(()=>{B?.type_info.meta?.skipThankYouPage?l?setTimeout((()=>{d?.()}),300):window.location.href=B?.type_info.meta?.redirectUrl:b(!0)}))}},N?"Submitting":"Submit survey"))))))))};exports.BUTTON_SIZE_VARIANTS={LARGE:"large",MINI:"mini",NORMAL:"normal"},exports.Button=_,exports.CheckboxGroup=h,exports.Input=f,exports.NPS=i,exports.ProgressBar=w,exports.Radio=b,exports.RadioGroup=x,exports.Survey=e=>{const n=O(e.survey);return t.createElement(t.Fragment,null,"standard"===e.surveyStyle?t.createElement($,Object.assign({},e,{survey:n})):t.createElement(D,Object.assign({},e,{survey:n})))},exports.TextArea=y,exports.WebInAppSurvey=e=>{const n=O(e.survey);return t.createElement(H,Object.assign({},e,{survey:n}))};
package/lib/index.esm.js CHANGED
@@ -1 +1 @@
1
- import e,{useRef as n,forwardRef as t,useEffect as r,useMemo as o,useState as s}from"react";import{SwitchTransition as i,CSSTransition as a,TransitionGroup as u}from"react-transition-group";import c from"react-dom";function l(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}l(".freemium-survey-components .nps-container {\n margin: 0 auto;\n width: 100%;\n display: flex;\n flex-direction: column;\n grid-gap: 28px;\n gap: 28px;\n}\n.freemium-survey-components .nps-container .footer {\n border-top: 1px solid #ebeff3;\n padding-top: 20px;\n display: flex;\n justify-content: center;\n font-size: 0.875rem;\n line-height: 1.5;\n color: #666;\n}\n.freemium-survey-components .nps-container .footer:empty {\n display: none;\n}\n.freemium-survey-components .nps-container .nps-scale {\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale .button-container {\n flex-direction: column;\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n}\n.freemium-survey-components .nps-container .nps-scale .help-text-container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.freemium-survey-components .nps-container .nps-scale .positive-text {\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n right: 0px;\n text-align: right;\n}\n.freemium-survey-components .nps-container .nps-scale .negative-text {\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n left: 0;\n text-align: left;\n}\n.freemium-survey-components .nps-container .nps-scale span {\n color: #aaa;\n font-size: 0.75rem;\n}\n.freemium-survey-components .nps-container .nps-scale button {\n display: inline-block;\n font-size: 1rem;\n white-space: nowrap;\n vertical-align: middle;\n background: none;\n border: none;\n box-shadow: none;\n cursor: pointer;\n text-align: center;\n font-weight: 400;\n border-radius: 4px;\n margin: 0;\n outline: none;\n margin-left: -1px;\n width: 40px;\n height: 40px;\n transform: scale(1);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover {\n transition: background 0.2s ease-in, border-color 0.2s ease-in, transform 0.2s cubic-bezier(0.5, 2, 0.5, 0.75);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover, .freemium-survey-components .nps-container .nps-scale button:focus {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale button.active {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale.rounded button {\n border-radius: 50%;\n}\n.freemium-survey-components .nps-container .nps-scale.square button {\n border-radius: 0;\n}\n.freemium-survey-components .nps-container .nps-scale.curved button {\n border-radius: 3px;\n}\n.freemium-survey-components .nps-container .nps-scale.highlighted button:hover, .freemium-survey-components .nps-container .nps-scale.highlighted button:focus, .freemium-survey-components .nps-container .nps-scale.highlighted button.active {\n background: var(--default-brand-color) !important;\n background: var(--brand-color, var(--default-brand-color)) !important;\n}\n.freemium-survey-components .nps-container .nps-scale .choices {\n width: 100%;\n display: flex;\n justify-content: space-between;\n font-weight: 500;\n background-color: #ebeff3;\n border-radius: 4px;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choices {\n background-color: transparent;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice {\n background: #ebeff3;\n color: #000;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice.active, .freemium-survey-components .nps-container .nps-scale.standard .choice:hover {\n background: #e43e3d;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1):focus, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1).active, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1):hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2):focus, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2).active, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2):hover {\n background: #00af50;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(3):hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(4):hover {\n background: #f8c43e;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice.active {\n color: #fff;\n transform: scale(1.2);\n}\n\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .choices {\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .nps-container .nps-scale .choices,\n.card-survey-style .nps-container .nps-scale .choices {\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale .choices,\n.card-survey-style .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale button,\n.card-survey-style .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n }\n}\n.widget-survey-components .nps-container .nps-scale .choices {\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}");const m=t=>{const{type_info:{linear_scale:{button_style:r="highlighted",button_shape:o="rounded"}={},rating_presets:{start:s="Very unlikely",end:i="Very likely"}={},validation:{min:a},footer_text:u}}=t,c=e=>{switch(e){case e<=6:return"detractor";case e<=8:return"passive";default:return"promoter"}},l=n(Array.from({length:10+(0===a?1:0)},((e,n)=>n+a)));return e.createElement("div",{className:"nps-container","data-test-input":"nps"},e.createElement("div",{className:`nps-scale ${o} ${r}`},e.createElement("div",{className:"button-container"},e.createElement("div",{className:"choices",role:"radiogroup","aria-required":!0},l.current.map((n=>e.createElement("button",{role:"radio","aria-checked":t.npsValue===n,key:n,"data-test-nps-choice":n,onClick:e=>{t.onChangeHandler(n)},className:`choice ${c(n)} ${t.npsValue===n&&"active"}`},n)))),e.createElement("div",{className:"help-text-container"},e.createElement("span",{className:"negative-text",role:"note"},`${a} - ${s}`),e.createElement("span",{className:"positive-text",role:"note"},`${l.current[l.current.length-1]} - ${i}`)))),e.createElement("div",{className:"footer",role:"note"},u))},d=(e,n)=>(e.defaultProps=n,e);l('.freemium-survey-components .input-container,\n.freemium-survey-components .textarea-container {\n display: flex;\n flex-direction: column;\n width: 100%;\n border-radius: 4px;\n position: relative;\n}\n.freemium-survey-components label.input-label {\n display: inline-block;\n padding-bottom: 8px;\n padding-left: 2px;\n font-size: 0.75rem;\n font-weight: 400;\n}\n.freemium-survey-components label.required::after {\n content: "*";\n position: relative;\n top: 2px;\n font-weight: 500;\n font-size: 0.85rem;\n padding-left: 3px;\n color: #d72d30;\n}\n.freemium-survey-components .input-basic {\n width: 100%;\n display: flex;\n align-items: center;\n border-radius: 4px;\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n transition: border-color 0.2s linear;\n background: #fff;\n}\n.freemium-survey-components .textarea-container .input-basic {\n flex-direction: column;\n align-items: unset;\n}\n.freemium-survey-components .input-basic.error {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error:hover {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error[focus-within] {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic.error:focus-within {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: 0.2s linear;\n}\n.freemium-survey-components .input-basic[focus-within] {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .input-basic:focus-within {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .input-basic[focus-within] .end-max-length {\n opacity: 1;\n}\n.freemium-survey-components .input-basic:focus-within .end-max-length {\n opacity: 1;\n}\n.freemium-survey-components .end-max-length {\n transition: opacity ease 0.2s;\n opacity: 0;\n padding: 0 8px;\n font-size: 0.75rem;\n color: #264966;\n}\n.freemium-survey-components .textarea-container .end-max-length {\n padding: 8px;\n align-self: flex-end;\n}\n.freemium-survey-components span.input-error {\n display: block;\n padding-left: 2px;\n padding-top: 4px;\n font-size: 0.9rem;\n color: #d72d30;\n}\n.freemium-survey-components input[type=text] {\n padding: 6px 12px;\n flex: 1;\n border: unset;\n height: 32px;\n font-size: 1rem;\n min-width: 0;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components input[type=text],\n.freemium-survey-components textarea {\n outline: none;\n border: none;\n}\n.freemium-survey-components input[type=text]::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea {\n min-height: 116px;\n padding: 12px;\n flex: 1;\n border: unset;\n resize: none;\n font-size: 1rem;\n min-width: 0;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components textarea::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}');const p=["RANGE","NPS","RADIO","DROPDOWN"],f={default:500,compact:500,cozy:400},y={isRequired:!1,showCount:!0,isErrored:!1,inline:!1,spellCheck:!1,autoFocusInput:!0},v=t(((t,o)=>{const s=n(null);r((()=>{t.autoFocusInput&&setTimeout((()=>{s.current?.focus()}),300+t.autoFocusDelay)}),[t.autoFocusInput]);const{inputStyle:i,style:a,className:u,showCount:c,isErrored:l,startLabel:m,isRequired:d,errorText:p,endLabel:f,maxLength:y=256,onChange:v,autoFocusInput:h,...x}=t;return e.createElement("div",{className:"input-container",style:a},t.label&&e.createElement("label",{className:"input-label "+(d?"required":"")},t.label),e.createElement(e.Fragment,null,m&&e.createElement("div",{className:"start-label"},m),e.createElement("div",{className:`input-basic ${l?"error":""}${u||""}`},e.createElement("input",Object.assign({},x,{type:"text",autoComplete:"off",ref:s,style:i,onChange:e=>{e.target.value?.length>y||v?.(e)}})),c&&y>0&&e.createElement("div",{className:"end-max-length"},`${t.value&&t.value.length||0}/${y}`)),f&&e.createElement("div",{className:"end-label"},f)),l&&p&&e.createElement("span",{className:"input-error"},t.errorText))})),h=t(((t,o)=>{const s=n(null);r((()=>{t.autoFocusInput&&setTimeout((()=>{s.current?.focus()}),300+t.autoFocusDelay)}),[t.autoFocusInput]);const{inputStyle:i,style:a,className:u,showCount:c,maxLength:l=1500,startLabel:m,isRequired:d,autoFocusInput:p,onChange:f,...y}=t;return e.createElement(e.Fragment,null,e.createElement("div",{className:"textarea-container",style:a},t.label&&e.createElement("label",{className:"input-label "+(d?"required":"")},t.label),m&&e.createElement("div",{className:"start-label"},m),e.createElement("div",{className:`input-basic ${u||""}`},e.createElement("textarea",Object.assign({},y,{autoComplete:"off",ref:s,style:i,onChange:e=>{e.target.value?.length>l||f?.(e)}})),c&&l&&l>0&&e.createElement("div",{className:"end-max-length"},`${t.value&&t.value.length||0}/${l}`)),t.endLabel&&e.createElement("div",{className:"end-label"},t.endLabel)))})),x=d(v,y),g=d(h,y);l('.freemium-survey-components .checkbox-group {\n width: 100%;\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n flex-direction: column;\n white-space: nowrap;\n flex-wrap: wrap;\n}\n.freemium-survey-components .icon-container {\n display: inline-block;\n flex: 0 0 12px;\n width: 12px;\n height: 12px;\n min-width: 12px;\n min-height: 12px;\n color: inherit;\n position: absolute;\n left: 1px;\n top: 2px;\n}\n.freemium-survey-components .tick-icon {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: 100%;\n width: 100%;\n color: inherit;\n fill: currentColor;\n}\n.freemium-survey-components input[type=checkbox] {\n position: absolute;\n clip: rect(0px 0px 0px 0px);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=checkbox]:focus ~ .checkbox {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 2px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 2px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 2px;\n border-color: transparent;\n}\n.freemium-survey-components .checkbox-label {\n display: flex;\n align-items: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n opacity: 1;\n line-height: 1.2;\n cursor: pointer;\n font-size: 1rem;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n border-radius: 4px;\n white-space: pre-wrap;\n}\n.freemium-survey-components .checkbox-label:hover {\n border-color: #92a2b1;\n}\n.freemium-survey-components .checkbox-label.disabled {\n opacity: 0.5;\n cursor: "not-allowed";\n}\n.freemium-survey-components .checkbox {\n transition: background-color ease-in 0.2s;\n min-width: 14px;\n min-height: 14px;\n min-height: 14px;\n max-height: 14px;\n border-radius: 2px;\n position: relative;\n margin-right: 16px;\n background-color: #fff;\n border: 1px solid;\n text-align: left;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n box-shadow: var(--default-background-color) 0px 0px 0px 5px;\n box-shadow: var(--background-color, var(--default-background-color)) 0px 0px 0px 5px;\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:disabled ~ .checkbox:hover {\n box-shadow: unset;\n border-color: unset;\n}');const b=()=>e.createElement("svg",{id:"tick",className:"tick-icon",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"title",viewBox:"0 0 10 10"},e.createElement("path",{d:"M3 5.87c-.18666814.00267463-.36667109-.06932655-.5-.2L.21 3.41c-.1786328-.17863279-.24839684-.43899577-.1830127-.6830127.06538414-.24401694.25598306-.43461586.5-.5C.77100423 2.16160316 1.0313672 2.23136721 1.21 2.41L3 4.18 6.8.33c.27679776-.27455556.72320224-.27455556 1 0 .13696438.13025306.21450026.31098915.21450026.5S7.93696438 1.19974694 7.8 1.33L3.45 5.67c-.12082534.11896945-.28072735.19003701-.45.2Z",fill:"#fff",fillRule:"evenodd"})),w=({values:t=[],othersValue:o="",options:s,name:i,autoFocusGroup:a,autoFocusDelay:u,onChangeHandler:c,saveOthersValue:l})=>{const m=t.includes("__others__"),d=n(null);return r((()=>{a&&setTimeout((()=>{d.current?.focus()}),300+u)}),[a]),e.createElement("div",{className:"checkbox-group"},e.createElement("button",{ref:d,className:"autofocus-button","aria-hidden":!0}),s?.filter((e=>"__others__"!==e.value)).map(((n,r)=>e.createElement(k,{key:n.id,checked:t?.includes(n.value),name:n.value,id:n.id,onChange:(e,r)=>{if(r)c([...t||[],n.value]);else{const e=t.indexOf(n.value);e>-1&&t.splice(e,1),c([...t])}}},n.value))),s?.find((e=>"__others__"===e.value))&&e.createElement(k,{key:"others",checked:m,name:"__others__",id:"__others__",onChange:(e,n)=>{if(n)c([...t,"__others__"]);else{const e=t.findIndex((e=>"__others__"===e));t.splice(e,1),c(t)}}},"Others"),m&&e.createElement(e.Fragment,null,e.createElement(x,{placeholder:"Enter your comment",value:o,onChange:e=>{l(i,e.target.value)},autoFocusDelay:10,label:""})))},k=d((t=>{const o=n(null);return r((()=>{t.autoFocus&&setTimeout((()=>{o.current?.focus()}),320)}),[]),e.createElement("label",{className:`checkbox-label ${t.disabled&&"disabled"}`},e.createElement("input",{ref:o,id:t.id,type:"checkbox",name:t.name,readOnly:t.readOnly,disabled:t.disabled,"aria-disabled":t.disabled,checked:t.checked,onChange:t.readOnly?()=>{}:e=>t.onChange(e,e.target.checked)}),e.createElement("div",{className:"checkbox"},t.checked&&e.createElement("div",{className:"icon-container"},e.createElement(b,null)," ")),e.createElement("div",null,t.children))}),{checked:!1});l('.freemium-survey-components .radio-group {\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n white-space: nowrap;\n flex-direction: column;\n width: 100%;\n}\n.freemium-survey-components .radio {\n background-color: #fff;\n border: 1px solid;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: background-color ease-in 0.2s;\n min-width: 18px;\n max-width: 18px;\n min-height: 18px;\n max-height: 18px;\n border-radius: 50%;\n position: relative;\n margin-right: 16px;\n text-align: left;\n}\n.freemium-survey-components .radio:before {\n left: 3px;\n top: 3px;\n content: "";\n position: absolute;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n transition: all ease-in 0.2s;\n background-color: #fff;\n}\n.freemium-survey-components .radio-label {\n display: flex;\n align-items: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n cursor: pointer;\n line-height: 1.2;\n font-size: 1rem;\n font-weight: 400;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n border-radius: 4px;\n white-space: pre-wrap;\n color: #3a4b67;\n}\n.freemium-survey-components input[type=radio] {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=radio]:focus ~ .radio {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 3px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 3px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 3px;\n border-color: transparent;\n}\n.freemium-survey-components input[type=radio]:checked ~ .radio:before {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .radio-label:hover {\n border-color: #92a2b1;\n}');const _=({name:t,options:o,value:s,autoFocusGroup:i,autoFocusDelay:a,onChangeHandler:u,saveOthersValue:c,othersOption:l,othersRequired:m,othersValue:d,isFinalQn:p})=>{const f=n(null);return r((()=>{i&&setTimeout((()=>{f.current?.focus()}),300+a)}),[i]),e.createElement("div",{className:"radio-group",role:"radiogroup"},e.createElement("button",{ref:f,className:"autofocus-button","aria-hidden":!0,tabIndex:-1}),o?.sort(((e,n)=>"__others__"===e.value?1:"__others__"===n.value?-1:0))?.map(((n,r)=>e.createElement(q,{key:n.value,value:n.value,name:t,onChange:e=>{"__others__"!==e.currentTarget.value&&c(t,null),u(e.currentTarget.value)},checked:s===n.value},"__others__"===n.value?"Others":n.value))),"__others__"===s&&e.createElement(e.Fragment,null,e.createElement(x,{value:d??"",onChange:e=>{"__others__"!==s&&p&&u("__others__"),c(t,e.target.value)},placeholder:"Enter your comment",label:"",autoFocusDelay:10})))},q=d((t=>{const o=n(null);return r((()=>{t.autoFocus&&setTimeout((()=>{o.current?.focus()}),320)}),[]),e.createElement("label",{className:"radio-label"},e.createElement("input",{ref:o,type:"radio",name:t.name,value:t.value,checked:t.checked,onChange:t.onChange}),e.createElement("div",{className:"radio"}),e.createElement("div",null,t.children))}),{checked:!1,autoFocus:!1});l(".progressbar-container {\n width: 100%;\n height: 4px;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1;\n text-align: left;\n overflow: hidden;\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n}\n\n.progressbar-container.widget {\n position: absolute;\n top: 0;\n height: 2px;\n}\n\n.progressbar {\n transition: transform 0.2s linear 200ms;\n transform-origin: left;\n height: 100%;\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}");const E=n=>{const{totalSteps:t,completedSteps:r,widget:o}=n;return e.createElement("div",{className:"progressbar-container "+(o?"widget":"")},e.createElement("div",{className:"progressbar",style:{width:(r>0?100/t:0)+"%",transform:`scaleX(${r})`}}))};l(".freemium-survey-components .action-button {\n width: auto;\n display: block;\n padding: 8px 16px;\n cursor: pointer;\n line-height: 1.5;\n text-align: center;\n font-weight: 600;\n letter-spacing: 0.3px;\n border-radius: 4px;\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n color: --default-button-text-color;\n color: var(--button-text-color, --default-button-text-color);\n background: var(--default-brand-color);\n background: var(--brand-color, var(--default-brand-color));\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n border-radius: 4px;\n min-width: 200px;\n max-width: -webkit-fit-content;\n max-width: -moz-fit-content;\n max-width: fit-content;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components .action-button:not([disabled]):hover {\n transform: translateY(-4px);\n}\n.freemium-survey-components .action-button[disabled] {\n cursor: not-allowed;\n opacity: 0.6;\n}\n.freemium-survey-components button:focus:not(:active) {\n /* box-shadow: 0 0 0 2px ${pseudo.focus}; */\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .action-button {\n min-width: 120px;\n }\n}\n.widget-survey-components .action-button {\n min-width: 120px;\n}\n\n.freemium-survey-components.mobile-preview .action-button {\n min-width: 120px;\n}");const C=()=>e.createElement(e.Fragment,null,"..."),N={LARGE:"large",MINI:"mini",NORMAL:"normal"},B=n=>{const{inline:t=!1,children:r,disabled:o,className:s="",htmlType:i,type:a="primary",onClick:u,size:c,overrideStyleClassName:l="",loading:m=!1,...d}=n;return e.createElement("button",Object.assign({style:t?{display:"inline-block"}:{},disabled:o,className:`action-button ${s} ${l}`,type:i,onClick:u},d),m?e.createElement(C,null):r)},I=()=>e.createElement("svg",{width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M7.82585 6.15754C7.98999 6.32147 8.08232 6.54389 8.08252 6.77587L8.08252 7.2192C8.07983 7.45069 7.98788 7.6722 7.82585 7.83754L1.82919 13.8225C1.77496 13.8772 1.71044 13.9206 1.63936 13.9502C1.56827 13.9798 1.49203 13.9951 1.41502 13.9951C1.33801 13.9951 1.26177 13.9798 1.19068 13.9502C1.1196 13.9206 1.05508 13.8772 1.00085 13.8225L0.172521 12.9942C0.118197 12.941 0.0750381 12.8774 0.0455752 12.8073C0.0161124 12.7372 0.000937578 12.6619 0.000937585 12.5859C0.000937592 12.5098 0.0161125 12.4345 0.0455753 12.3644C0.0750381 12.2943 0.118197 12.2308 0.172521 12.1775L5.36419 6.99754L0.172522 1.81754C0.117847 1.76331 0.0744506 1.69879 0.0448352 1.62771C0.0152208 1.55662 -2.75162e-05 1.48038 -2.75094e-05 1.40337C-2.75027e-05 1.32636 0.0152208 1.25012 0.0448353 1.17904C0.0744507 1.10795 0.117847 1.04343 0.172522 0.989205L1.00086 0.172537C1.05508 0.117862 1.1196 0.0744661 1.19069 0.0448507C1.26177 0.0152353 1.33801 -1.20337e-05 1.41502 -1.2027e-05C1.49203 -1.20203e-05 1.56827 0.0152353 1.63936 0.0448507C1.71044 0.0744661 1.77496 0.117862 1.82919 0.172537L7.82585 6.15754Z",fill:"#6B6B6B"})),O=()=>e.createElement("svg",{width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M0.256667 7.83755C0.0925257 7.67361 0.000204227 7.4512 0 7.21921V6.77588C0.00268801 6.5444 0.0946357 6.32289 0.256667 6.15755L6.25333 0.172549C6.30756 0.117874 6.37208 0.0744776 6.44316 0.0448625C6.51425 0.0152474 6.59049 0 6.6675 0C6.74451 0 6.82075 0.0152474 6.89184 0.0448625C6.96292 0.0744776 7.02744 0.117874 7.08167 0.172549L7.91 1.00088C7.96432 1.05411 8.00748 1.11764 8.03694 1.18776C8.06641 1.25787 8.08158 1.33316 8.08158 1.40922C8.08158 1.48527 8.06641 1.56056 8.03694 1.63067C8.00748 1.70079 7.96432 1.76432 7.91 1.81755L2.71833 6.99755L7.91 12.1775C7.96467 12.2318 8.00807 12.2963 8.03769 12.3674C8.0673 12.4385 8.08255 12.5147 8.08255 12.5917C8.08255 12.6687 8.0673 12.745 8.03769 12.8161C8.00807 12.8871 7.96467 12.9517 7.91 13.0059L7.08167 13.8225C7.02744 13.8772 6.96292 13.9206 6.89184 13.9502C6.82075 13.9799 6.74451 13.9951 6.6675 13.9951C6.59049 13.9951 6.51425 13.9799 6.44316 13.9502C6.37208 13.9206 6.30756 13.8772 6.25333 13.8225L0.256667 7.83755Z",fill:"#6B6B6B"})),S=({question:n,formValues:t,othersMeta:r,onChangeHandler:o,saveOthersValue:s,autoFocus:i,autoFocusDelay:a,isFinalQn:u})=>{switch(n.type_info.question_type){case"RANGE":return e.createElement(m,{type_info:n.type_info,onChangeHandler:o,npsValue:t[n.name]});case"CHECKBOX":case"MULTI_SELECT":return e.createElement(w,{name:n.name,autoFocusGroup:i,values:t[n.name],othersValue:r[n.name],options:n.type_info.choices,onChangeHandler:o,saveOthersValue:s,othersOption:n.type_info.meta?.othersOption,othersRequired:n.type_info.meta?.othersRequired,autoFocusDelay:a});case"RADIO":case"DROPDOWN":return e.createElement(_,{autoFocusGroup:i,autoFocusDelay:a,name:n.name,onChangeHandler:o,saveOthersValue:s,options:n.type_info.choices,value:t[n.name],othersValue:r[n.name],othersOption:n.type_info.meta?.othersOption,othersRequired:n.type_info.meta?.othersRequired,isFinalQn:u});case"INPUT":case"TEXT":return n.type_info?.meta?.readOnly?e.createElement("div",{className:"message-container"},n.type_info?.meta?.value):e.createElement("div",{className:"responsive-text-field"},e.createElement(x,{autoFocusInput:i,autoFocusDelay:a,label:"",isRequired:n.is_required,value:t[n.name]||"",placeholder:n.type_info?.meta?.placeholder??"",onChange:e=>o(e.target.value)}),e.createElement(g,{autoFocusInput:i,autoFocusDelay:a,label:"",maxLength:256,isRequired:n.is_required,placeholder:n.type_info?.meta?.placeholder??"",value:t[n.name]||"",onChange:e=>o(e.target.value)}));case"PARAGRAPH":return e.createElement(g,{autoFocusInput:i,autoFocusDelay:a,label:"",isRequired:n.is_required,placeholder:n.type_info?.meta?.placeholder??"",value:t[n.name]||"",onChange:e=>o(e.target.value)});default:return console.error(`Question type ${n.type_info.question_type} not found`),null}},z=(e,n,t)=>{if(e){let r={"{{nps.rating}}":t};n&&(r={...r,...n});const o=new RegExp(Object.keys(r).join("|"),"gi");e=e.replace(o,(function(e){return r[e.toLowerCase()]}))}return e},Q=e=>o((()=>{const n=JSON.parse(JSON.stringify(e)),t=[];return(n.question_details?.questions||[]).forEach((e=>{const n=e.type_info?.meta?.block;n&&(n.question_names||(n.question_names=[e.name]),t.push(n))})),{...n,meta:{...n.meta,blocks:t}}}),[e]);l(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #3a4b67;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 560px;\n --default-widget-max-height: 400px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-components.card-survey-style {\n padding: 20px 0;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation {\n white-space: nowrap;\n border-radius: 3px;\n border: 1px solid #efefef;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button svg {\n transform: rotate(90deg);\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #efefef;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n.freemium-survey-components.card-survey-style .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 200ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n transition: opacity 50ms ease-out;\n overflow: auto;\n}\n.freemium-survey-components.card-survey-style .hide-question-container {\n opacity: 0;\n}\n.freemium-survey-components.card-survey-style .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components.card-survey-style .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components.card-survey-style .fade-enter .question-container {\n opacity: 0;\n transform: translateY(15px);\n}\n.freemium-survey-components.card-survey-style .fade-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-exit-active .question-container {\n opacity: 0.05;\n transform: translateY(-15px);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-enter .question-container {\n opacity: 0;\n transform: translateY(-15px);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-exit-active .question-container {\n opacity: 0.05;\n transform: translateY(15px);\n}\n.freemium-survey-components.card-survey-style .fade-enter-active .question-container,\n.freemium-survey-components.card-survey-style .fade-exit-active .question-container,\n.freemium-survey-components.card-survey-style .fade-reverse-enter-active .question-container,\n.freemium-survey-components.card-survey-style .fade-reverse-exit-active .question-container {\n transition: opacity 200ms, transform 200ms;\n}\n.freemium-survey-components.card-survey-style .question-footer {\n display: flex;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components.card-survey-style .question-footer:empty {\n display: none;\n}\n.freemium-survey-components.card-survey-style .question-footer:only-child {\n margin-left: auto;\n}\n.freemium-survey-components.card-survey-style .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n width: 100%;\n}\n.freemium-survey-components.card-survey-style .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components.card-survey-style .skip-button {\n font-weight: 500;\n color: #3a4b67;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components.card-survey-style .skip-button:hover {\n background-color: #f3f3f3;\n transform: translateY(-4px);\n}\n.freemium-survey-components.card-survey-style .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.card-survey-style .submit {\n max-width: 700px;\n text-align: left;\n background: transparent;\n box-shadow: none;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.card-survey-style .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components.card-survey-style .thankyou .heading {\n font-weight: 500;\n font-size: 22px;\n}\n.freemium-survey-components.card-survey-style .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #475867;\n width: 75%;\n}\n.freemium-survey-components.card-survey-style .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components.card-survey-style .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components.card-survey-style .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components.card-survey-style .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components.card-survey-style .message-container:empty {\n display: none;\n}\n\n@media (max-width: 550px) {\n div.freemium-survey-components.card-survey-style .responsive-text-field .input-container {\n display: none;\n }\n div.freemium-survey-components.card-survey-style .responsive-text-field .textarea-container {\n display: flex;\n }\n div.freemium-survey-components.card-survey-style .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n }\n div.freemium-survey-components.card-survey-style .question-footer {\n flex-direction: column-reverse;\n grid-gap: 20px;\n gap: 20px;\n }\n div.freemium-survey-components.card-survey-style .freemium-survey-step-navigation {\n width: 100%;\n }\n div.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button {\n width: 50%;\n }\n div.freemium-survey-components.card-survey-style .action-buttons {\n flex-direction: column;\n width: 100%;\n }\n div.freemium-survey-components.card-survey-style .action-buttons button {\n max-width: unset;\n }\n div.freemium-survey-components.card-survey-style .action-button {\n max-width: unset;\n width: 100%;\n }\n div.freemium-survey-components.card-survey-style .thankyou .text {\n width: auto;\n }\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .responsive-text-field .input-container {\n display: none;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .responsive-text-field .textarea-container {\n display: flex;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .question-footer {\n flex-direction: column-reverse;\n grid-gap: 20px;\n gap: 20px;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .freemium-survey-step-navigation {\n width: 100%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .freemium-survey-step-navigation .navigation-button {\n width: 50%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .action-buttons {\n flex-direction: column;\n width: 100%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .action-buttons button {\n max-width: unset;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .action-button {\n max-width: unset;\n width: 100%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .thankyou .text {\n width: auto;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const D=({thankYouQuestion:n,preview:t,placeholders:o,npsValue:s})=>(r((()=>{t||n.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=n.type_info.meta?.redirectUrl}),1e3*n.type_info.meta?.redirectDelay??1e4)}),[]),e.createElement("div",{className:"question-container thankyou"},e.createElement("div",{className:"heading"},"Thank you!"),e.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:z(n.text,o,s)}}),n.type_info.meta?.redirectUrl&&e.createElement("div",{style:{width:"100%"}},e.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",n.type_info.meta?.redirectDelay," seconds.",e.createElement("br",null)),e.createElement("a",{className:"link",href:n.type_info.meta?.redirectUrl},n?.type_info.meta?.redirectUrl)))),R=({currentBlockIndex:n,currentBlockIndexOfBlocksWithQns:t,setCurrentBlockIndexOfBlocksWithQnsDirty:r,blocksWithQns:o,blocks:s,setHorizontalScrollUnits:i,preventQuestionAnimation:a,tempCurrentBlockIndexOfBlocksWithQns:u,setReverse:c,reverse:l})=>e.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},e.createElement("button",{disabled:0==t.current,className:"navigation-button",onClick:()=>{l?(t.current=Math.max(t.current-1,0),n.current=s.findIndex((e=>e.name===o[t.current].name))):(u.current=Math.max(t.current-1,0),n.current=s.findIndex((e=>e.name===o[u.current].name))),a.current=!1,r.current=!0,c(!0),i({})}},e.createElement(O,null)),e.createElement("button",{className:"navigation-button",disabled:t.current>=o.length-1,onClick:()=>{a.current=!1,l?(u.current=Math.min(t.current+1,o.length-1),n.current=s.findIndex((e=>e.name===o[u.current].name))):(t.current=Math.min(t.current+1,o.length-1),n.current=s.findIndex((e=>e.name===o[t.current].name))),r.current=!0,c(!1),i({})}},e.createElement(I,null))),F=({widget:n,surveyStyle:t,formValues:r,blocksWithQns:o,blocks:s,thankYouQuestion:i,currentBlockIndexOfBlocksWithQns:a,currentBlockIndexOfBlocks:u,currentEditingBlock:c,isSubmitting:l,isValuesCommitted:m,isCurrentBlockFinal:d,setHorizontalScrollUnits:f,handleFormValues:y,skipBlock:v,setIsSubmitting:h,onSubmit:x,setIsSurveyCompleted:g,preventQuestionAnimation:b,preview:w,closePreview:k,setReverse:_,tempCurrentBlockIndexOfBlocksWithQns:q,question:E,block:C,reverse:N,othersMeta:I,setCurrentBlockIndexOfBlocksWithQnsDirty:O,...S})=>{const z=S.blockIndex??a.current,Q=()=>(!p.includes(E.type_info.question_type)||"DROPDOWN"===E.type_info.question_type&&"__others__"===r[E.name])&&!d(),D=()=>"RANGE"!==E.type_info.question_type&&!C.required&&!d(),F=()=>("DROPDOWN"===E.type_info.question_type&&!C.required&&r[E.name],!1),T=()=>d()&&(n||"standard"!==t),W=("MULTI_SELECT"===c.current.question.type_info.question_type&&r[c.current.question.name]?.includes("__others__")||"DROPDOWN"===c.current.question.type_info.question_type&&"__others__"===r[c.current.question.name])&&(!I[c.current.question.name]||""===I[c.current.question.name].trim());return e.createElement("div",{className:"question-footer"},!(!n&&"standard"===t||0===z&&void 0===r[E.name]||0===a.current&&!N)&&e.createElement(R,{currentBlockIndex:u,currentBlockIndexOfBlocksWithQns:a,blocksWithQns:o,blocks:s,setHorizontalScrollUnits:f,preventQuestionAnimation:b,setReverse:_,tempCurrentBlockIndexOfBlocksWithQns:q,reverse:N,setCurrentBlockIndexOfBlocksWithQnsDirty:O}),(Q()||F()||D()||T())&&e.createElement("div",{className:"action-buttons"},Q()&&e.createElement(B,{onClick:()=>{O.current=!1,_(!1),y(o[z],null,!0)},disabled:c.current.required&&(!r[c.current.question.name]||Array.isArray(r[c.current.question.name])&&0===r[c.current.question.name].length)||c.current.question.type_info.meta?.othersRequired&&W,className:"next-button"},"Next"),D()&&e.createElement("button",{className:"skip-button",onClick:()=>{O.current=!1,_(!1),v(E)}},"Skip"),T()&&e.createElement("div",{className:"submit"},e.createElement(B,{disabled:(c.current.required||c.current.question.type_info.pivot_question)&&(null==r[c.current.question.name]||0===r[c.current.question.name]?.length)||c.current.question.type_info.meta?.othersRequired&&W||l,onClick:()=>{h(!0),x()}},l?"Submitting":"Submit survey")),F()&&e.createElement("button",{className:"skip-button",onClick:()=>{_(!1),c.current=o[z],u.current=s.findIndex((e=>e.name===o[z].name)),v(E)}},"Clear selection")))},T=({survey:t,surveyStyle:o="standard",placeholders:u,onSubmit:c,widget:l,npsValue:m,preview:d,mobilePreview:f,closePreview:y})=>{const v=t.question_details?.questions||[],h=t.meta?.blocks||[],[x,g]=s(null),[b,w]=s({}),[k,_]=s(!1),[q,C]=s([]),[N,B]=s({}),[I,O]=s(!1),[Q,R]=s(null),[T,W]=s({}),L=n(null),V=n(null),Y=n(-1),P=n(null),M=n(0),H=n(0),$=n(!1),A=n(!1),U=n([]),j=e.useRef(null!=m&&"card"===o),G=n(null),X=n(0),[K,Z]=s(!1),J=n();r((()=>{h&&(G.current=h.find((e=>"TY"===e.name)),g(h.filter((e=>"TY"!==e.name))))}),[h]),r((()=>{$.current&&(H.current=X.current,B({}))}),[K]),r((()=>{if(x)if(V.current=v.find((e=>e.type_info?.pivot_question))??v.find((e=>"RANGE"===e.type_info?.question_type))??v[0],null!=m){Y.current=Math.min(V.current.type_info.validation.max,Math.max(V.current.type_info.validation.min,m));const e=v.find((e=>e.name===x[0].question_names[0]));L.current={...x[0],question:e},U.current=[...U.current,{...x[0],question:e}],C(U.current),w({Q_1:Y.current})}else if(!L.current&&x.length>0)return L.current=x[0],void te(x[0])}),[x,m]),e.useEffect((()=>{q.length&&(U.current=q,H.current=q.length-1),B({})}),[q]),r((()=>{Object.keys(b).length>0&&L.current.question&&(p.includes(L.current.question.type_info.question_type)&&("DROPDOWN"!==L.current.question.type_info.question_type||"__others__"!==b[L.current.question.name])||A.current)&&!ne()&&(null!=m&&1==q.length?J.current?(clearTimeout(J.current),J.current=null,re()):J.current=setTimeout((()=>{re()}),1500):re())}),[b]),r((()=>{if(null!=b?.[V.current?.name])if(G.current?.is_based_on_rating){const e=V.current?.type_info?.choices[b?.[V.current?.name]-V.current?.type_info?.validation?.min??0]?.dependent_question_names,n=G.current?.question_names.find((n=>e?.includes(n))),t=v.find((e=>e.name===n));R(t)}else{const e=v.find((e=>e.name==G.current?.question_names[0]));R(e)}}),[b?.[V.current?.name]]);const ee=()=>{c({...b,others_meta:T},(()=>{Q?.type_info.meta?.skipThankYouPage?d?setTimeout((()=>{y?.()}),300):window.location.href=Q?.type_info.meta?.redirectUrl:_(!0)}))},ne=()=>(M.current===x.length-1||"end"===L.current.branchOption)&&H.current===q.length-1,te=e=>{let n={};if(e.is_based_on_rating){const t=V.current?.type_info?.choices[b?.[V.current?.name]-V.current?.type_info?.validation?.min??0]?.dependent_question_names,r=e.question_names.find((e=>t?.includes(e)));n=v.find((e=>e.name===r))}else n=v.find((n=>n.name===e.question_names[0]));L.current.question=n;U.current.find((e=>e.question.name===n.name))?(H.current+=1,B({})):C([...U.current,{...e,question:n}])},re=()=>{if(ne())_(!0);else{if(L.current.nextBlock)M.current=x.findIndex((e=>e.name===L.current.nextBlock));else if(L.current.question.type_info?.meta?.branches){const e=L.current.question.type_info?.meta?.branches,n=b[L.current.question.name];let t;if(t="RANGE"===L.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return ee(),void _(!0);M.current=x.findIndex((e=>e.name===t.nextBlock))}else M.current+=1}else M.current+=1;L.current=x[M.current],te(x[M.current])}},oe=(e,n,t)=>{if(j.current=!1,t){if(A.current=!0,null!=b[e.question.name]&&e.name!==q[q.length-1].name){const[t,r]=(e=>{const n=q.findIndex((n=>n.name===e.name)),t=q.slice(0,n+1),r=t.reduce(((e,n)=>(e[n.question.name]=b[n.question.name],e)),{});return M.current=x.findIndex((n=>n.name===e.name)),[t,r]})(e);w({...r,...null!=n&&{[e.question.name]:n}}),U.current=t}else w({...b,...null!=n&&{[e.question.name]:n}});V?.current?.name==e?.question?.name&&(Y.current=n)}else w({...b,...null!=n&&{[e.question.name]:n}})};if(!L.current||!L.current.question)return null;const se=q[Math.min(H.current??q.length-1,q.length-1)];return e.createElement("div",{className:`freemium-survey-components ${f?"mobile-preview":""} ${o}-survey-style`,id:"freemium-survey"},k?null:e.createElement(E,{totalSteps:x.length,completedSteps:M.current+(k?1:0)}),e.createElement(i,{mode:"out-in"},e.createElement(a,{key:H.current+String(k),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:K?"fade-reverse":"fade"},e.createElement("div",{className:"questions"},k?e.createElement(D,{thankYouQuestion:Q,preview:d,placeholders:u,npsValue:Y.current}):e.createElement("div",{ref:P,id:`${se.question.name}`,className:`question-container ${l||"card"===o}`,"data-test-question-name":se.question.name},e.createElement("div",{className:"question-text",dangerouslySetInnerHTML:{__html:z(se.question.text,u,Y.current)},title:`question-${H.current}`,role:"heading","aria-level":1}),e.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:{width:"100%"}},e.createElement(S,{question:se.question,isFinalQn:ne(),formValues:b,othersMeta:T,autoFocus:!0,autoFocusDelay:"standard"===o?350:0,saveOthersValue:(e,n)=>{if(null===n){const n={...T};delete n[e],W({...n})}else W({...T,[e]:n})},onChangeHandler:e=>{A.current=!1,M.current=x.findIndex((e=>e.name===se.name)),L.current=se,$.current=!1,Z(!1),oe(se,e,!("DROPDOWN"===se.question.type_info.question_type&&"__others__"===e)&&p.includes(se.question.type_info.question_type)&&!ne())}})),e.createElement(F,{question:se.question,block:se,widget:l,surveyStyle:o,formValues:b,othersMeta:T,blocksWithQns:q,blocks:x,thankYouQuestion:Q,currentBlockIndexOfBlocksWithQns:H,reverse:K,setReverse:Z,currentBlockIndexOfBlocks:M,currentEditingBlock:L,isSubmitting:I,isValuesCommitted:A,isCurrentBlockFinal:ne,setHorizontalScrollUnits:B,handleFormValues:oe,skipBlock:e=>{A.current=!0,delete b[e.name],w({...b})},setIsSubmitting:O,onSubmit:ee,setIsSurveyCompleted:_,preventQuestionAnimation:j,preview:d,closePreview:y,tempCurrentBlockIndexOfBlocksWithQns:X,setCurrentBlockIndexOfBlocksWithQnsDirty:$}))))))};l(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #3a4b67;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n}\n\n.freemium-survey-components.widget-survey-components {\n overflow: hidden;\n}\n.freemium-survey-components.widget-survey-components * {\n scrollbar-color: rgba(216, 216, 216, 0.5) transparent !important;\n}\n.freemium-survey-components.widget-survey-components * ::-webkit-scrollbar {\n height: auto;\n height: initial;\n width: 6px;\n}\n.freemium-survey-components.widget-survey-components * ::-webkit-scrollbar-track {\n background: transparent !important;\n}\n.freemium-survey-components.widget-survey-components * ::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: rgba(216, 216, 216, 0.5) !important;\n}\n.freemium-survey-components.widget-survey-components p {\n margin: 0;\n}\n.freemium-survey-components.widget-survey-components .questions {\n min-width: 100%;\n max-width: 100%;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n position: relative;\n display: flex;\n justify-content: row;\n align-items: flex-end;\n height: 100%;\n transition: height 200ms ease;\n}\n.freemium-survey-components.widget-survey-components .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n text-align: center;\n max-height: 100%;\n min-width: 100%;\n max-width: 700px;\n margin: 0 auto;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n padding: 28px 0;\n padding-top: 0;\n grid-gap: 28px;\n gap: 28px;\n position: absolute;\n overflow: auto;\n}\n.freemium-survey-components.widget-survey-components .question-wrapper {\n width: 100%;\n flex-grow: 1;\n padding: 4px 28px;\n overflow: auto;\n}\n.freemium-survey-components.widget-survey-components .hide-question-container {\n opacity: 0;\n}\n.freemium-survey-components.widget-survey-components .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n padding: 0 28px;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components.widget-survey-components .question-text p {\n all: inherit;\n padding: 0;\n}\n.freemium-survey-components.widget-survey-components .nps-container .footer {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components.widget-survey-components .fade-enter {\n opacity: 1;\n transform: translateX(80px);\n position: absolute;\n}\n.freemium-survey-components.widget-survey-components .fade-enter-active {\n position: absolute;\n opacity: 1;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-enter-done {\n position: absolute;\n}\n.freemium-survey-components.widget-survey-components .fade-exit {\n opacity: 0.05;\n pointer-events: none;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-exit-active {\n pointer-events: none;\n opacity: 0;\n transform: translateX(-80px);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-enter {\n opacity: 0;\n position: absolute;\n transform: translateX(-80px);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-enter-active {\n opacity: 1;\n position: absolute;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-exit {\n opacity: 0.05;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-exit-active {\n opacity: 0;\n transform: translateX(80px);\n}\n.freemium-survey-components.widget-survey-components .fade-enter-active,\n.freemium-survey-components.widget-survey-components .fade-reverse-enter-active,\n.freemium-survey-components.widget-survey-components .fade-reverse-exit-active,\n.freemium-survey-components.widget-survey-components .fade-exit-active {\n transition: opacity 200ms, transform 200ms;\n}\n.freemium-survey-components.widget-survey-components .question-footer {\n margin: 0px auto;\n display: flex;\n justify-content: space-between;\n align-items: center;\n position: -webkit-sticky;\n position: sticky;\n padding: 0 28px;\n bottom: -28px;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n}\n.freemium-survey-components.widget-survey-components .question-footer:empty {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .question-footer:only-child {\n margin-left: auto;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation {\n white-space: nowrap;\n border-radius: 3px;\n border: 1px solid #efefef;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 40px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #efefef;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n.freemium-survey-components.widget-survey-components .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n width: 100%;\n}\n.freemium-survey-components.widget-survey-components .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .skip-button {\n font-weight: 500;\n cursor: pointer;\n color: #3a4b67;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components.widget-survey-components .skip-button:hover {\n background-color: #f3f3f3;\n transform: translateY(-4px);\n}\n.freemium-survey-components.widget-survey-components .next-button,\n.freemium-survey-components.widget-survey-components .submit {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.widget-survey-components .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components.widget-survey-components .thankyou .heading {\n font-weight: 500;\n font-size: 22px;\n}\n.freemium-survey-components.widget-survey-components .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #475867;\n width: 75%;\n}\n.freemium-survey-components.widget-survey-components .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components.widget-survey-components .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components.widget-survey-components .responsive-text-field .input-container {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .responsive-text-field .textarea-container {\n display: flex;\n}\n.freemium-survey-components.widget-survey-components .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n}\n.freemium-survey-components.widget-survey-components .message-container:empty {\n display: none;\n}\n\n.freemium-survey-components.widget-survey-components.compact-style .nps-question-text {\n text-align: center;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-container {\n grid-gap: 20px;\n gap: 20px;\n max-width: 100%;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer {\n flex-direction: column-reverse;\n grid-gap: 20px;\n gap: 20px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .compact-footer-layout {\n display: flex;\n justify-content: space-between;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .compact-footer-layout:empty {\n display: none;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .action-buttons {\n grid-gap: 32px;\n gap: 32px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .submit,\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .action-button {\n max-width: unset;\n width: 100%;\n}\n.freemium-survey-components.widget-survey-components.compact-style .nps-container .footer {\n padding-top: 12px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .nps-container .choices {\n grid-gap: 10px;\n gap: 10px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .thankyou .text {\n width: 95%;\n}\n\n.freemium-survey-components.widget-survey-components.default-style .question-footer {\n justify-content: space-between;\n}\n.freemium-survey-components.widget-survey-components.default-style .nps-container .footer {\n padding-top: 12px;\n}\n.freemium-survey-components.widget-survey-components.default-style .nps-container .choices {\n flex-wrap: unset;\n grid-gap: 12px;\n gap: 12px;\n}\n.freemium-survey-components.widget-survey-components.default-style .radio-group {\n flex-direction: column;\n flex-wrap: nowrap;\n}\n.freemium-survey-components.widget-survey-components.default-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n color: #3a4b67;\n}\n.freemium-survey-components.widget-survey-components.default-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.freemium-survey-components.widget-survey-components.default-style textarea {\n min-height: 84px;\n}\n.freemium-survey-components.widget-survey-components.default-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.widget-survey-components.cozy-style {\n max-width: 1000px;\n min-width: 600px;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .question-text {\n font-size: 1rem;\n text-align: left;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-question-text {\n text-align: center;\n width: 70%;\n margin: 0 auto;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .question-footer {\n justify-content: space-between;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .widget {\n display: flex;\n justify-content: center;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .button-container {\n width: 60%;\n min-width: 600px;\n margin: 0 auto;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .button-container .choices {\n justify-content: space-around;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .footer {\n padding-top: 8px;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .action-button {\n line-height: 1.2;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n color: #3a4b67;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.freemium-survey-components.widget-survey-components.cozy-style textarea {\n min-height: 60px;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const W=({thankYouQuestion:n,preview:t,placeholders:r,npsValue:o},s)=>e.createElement(e.Fragment,null,e.createElement("div",{className:"heading"},"Thank you!"),e.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:z(n.text,r,o)}})),L=({currentBlockIndexOfBlocks:n,currentBlockIndexOfBlocksWithQns:t,blocksWithQns:r,blocks:o,setHorizontalScrollUnits:s,preventQuestionAnimation:i,tempCurrentBlockIndexOfBlocksWithQns:a,setCurrentBlockIndexOfBlocksWithQnsDirty:u,setReverse:c,reverse:l})=>e.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},e.createElement("button",{disabled:0==t.current,className:"navigation-button",onClick:()=>{l?(t.current=Math.max(t.current-1,0),n.current=o.findIndex((e=>e.name===r[t.current].name))):(a.current=Math.max(t.current-1,0),n.current=o.findIndex((e=>e.name===r[a.current].name))),i.current=!1,u.current=!0,c(!0),s({})}},e.createElement(O,null)),e.createElement("button",{className:"navigation-button",disabled:t.current>=r.length-1,onClick:()=>{i.current=!1,l?(a.current=Math.min(t.current+1,r.length-1),n.current=o.findIndex((e=>e.name===r[a.current].name))):(t.current=Math.min(t.current+1,r.length-1),n.current=o.findIndex((e=>e.name===r[t.current].name))),u.current=!0,c(!1),s({})}},e.createElement(I,null))),V=({widget:n,widgetStyle:t,surveyStyle:r,formValues:o,blocksWithQns:s,blocks:i,thankYouQuestion:a,currentBlockIndexOfBlocksWithQns:u,currentBlockIndexOfBlocks:c,currentEditingBlock:l,isSubmitting:m,isValuesCommitted:d,isCurrentBlockFinal:f,setHorizontalScrollUnits:y,handleFormValues:v,skipBlock:h,setIsSubmitting:x,onSubmit:g,setIsSurveyCompleted:b,preventQuestionAnimation:w,preview:k,closePreview:_,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,question:C,block:N,reverse:I,othersMeta:O,setCurrentBlockIndexOfBlocksWithQnsDirty:S,...z})=>{const Q=z.blockIndex??u.current,D=()=>!(!n&&"standard"===r||0===Q&&void 0===o[C.name]||0===u.current&&!I),R=()=>(!p.includes(C.type_info.question_type)||"DROPDOWN"===C.type_info.question_type&&"__others__"===o[C.name])&&!f(),F=()=>"RANGE"!==C.type_info.question_type&&!N.required&&!f(),T=()=>("DROPDOWN"===C.type_info.question_type&&!N.required&&o[C.name],!1),W=()=>f()&&(n||"standard"!==r),V=("MULTI_SELECT"===l.current.question.type_info.question_type&&o[l.current.question.name]?.includes("__others__")||"DROPDOWN"===l.current.question.type_info.question_type&&"__others__"===o[l.current.question.name])&&(!O[l.current.question.name]||""===O[l.current.question.name].trim()),Y="compact"===t&&F()&&D(),P=!Y&&D();return e.createElement("div",{className:"question-footer"},Y?e.createElement("div",{className:"compact-footer-layout"},D()&&e.createElement(L,{currentBlockIndexOfBlocks:c,currentBlockIndexOfBlocksWithQns:u,blocksWithQns:s,blocks:i,setHorizontalScrollUnits:y,preventQuestionAnimation:w,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,setCurrentBlockIndexOfBlocksWithQnsDirty:S,reverse:I}),F()&&e.createElement("button",{className:"skip-button",onClick:()=>{q(!1),h(C)}},"Skip")):null,(R()||T()||"compact"!==t&&F()||P||W())&&e.createElement("div",{className:"action-buttons"},P&&e.createElement("div",{style:{marginRight:"auto"}},e.createElement(L,{currentBlockIndexOfBlocks:c,currentBlockIndexOfBlocksWithQns:u,blocksWithQns:s,blocks:i,setHorizontalScrollUnits:y,preventQuestionAnimation:w,setReverse:q,tempCurrentBlockIndexOfBlocksWithQns:E,setCurrentBlockIndexOfBlocksWithQnsDirty:S,reverse:I})),R()&&e.createElement(B,{onClick:()=>{S.current=!1,q(!1),v(s[Q],null,!0)},disabled:l.current.required&&(!o[l.current.question.name]||Array.isArray(o[l.current.question.name])&&0===o[l.current.question.name].length)||l.current.question.type_info.meta?.othersRequired&&V,className:"next-button"},"Next"),W()&&e.createElement(B,{className:"submit",disabled:(l.current.required||l.current.question.type_info.pivot_question)&&(null==o[l.current.question.name]||0===o[l.current.question.name]?.length)||l.current.question.type_info.meta?.othersRequired&&V||m,onClick:()=>{g(),x(!0)}},m?"Submitting":"Submit survey"),T()&&e.createElement("button",{className:"skip-button",onClick:()=>{q(!1),l.current=s[Q],c.current=i.findIndex((e=>e.name===s[Q].name)),h(C)}},"Clear selection")))},Y=({survey:t,surveyStyle:i="standard",placeholders:l,onSubmit:m,widget:d,npsValue:y,widgetStyle:v,widgetHeaderQuerySelector:h,preview:x,mobilePreview:g,closePreview:b})=>{const w=t.question_details?.questions||[],k=t.meta?.blocks||[],[_,q]=s(null),[C,N]=s({}),[B,I]=s(!1),[O,Q]=s([]),[D,R]=s({}),[F,T]=s(!1),[L,Y]=s(null),[P,M]=s({}),H=n(null),$=n(null),A=n(-1),[U,j]=s(null),G=n(0),X=n(0),K=n(!1),Z=n([]),J=n(!!y&&"card"===i),ee=n(null),ne=n(0),[te,re]=s(!1),oe=n(0),se=n(!1);r((()=>{k&&(ee.current=k.find((e=>"TY"===e.name)),q(k.filter((e=>"TY"!==e.name))))}),[k]),r((()=>{se.current&&(X.current=ne.current,R({}))}),[te]),r((()=>{if(_)if($.current=w.find((e=>e.type_info?.pivot_question))??w.find((e=>"RANGE"===e.type_info?.question_type))??w[0],null!=y){A.current=y;const e=w.find((e=>e.name===_[0].question_names[0]));H.current={..._[0],question:e},Z.current=[...Z.current,{..._[0],question:e}],Q(Z.current),N({Q_1:y})}else if(!H.current&&_.length>0)return H.current=_[0],void ue(_[0])}),[_,y]),r((()=>{O.length&&(Z.current=O,X.current=O.length-1,R({}))}),[O]),r((()=>{Object.keys(C).length>0&&H.current.question&&(p.includes(H.current.question.type_info.question_type)&&("DROPDOWN"!==H.current.question.type_info.question_type||"__others__"!==C[H.current.question.name])||K.current)&&!ae()&&(y&&1==O.length?setTimeout((()=>{ce()}),1500):ce())}),[C]),r((()=>{if(null!=C?.[$.current?.name])if(ee.current?.is_based_on_rating){const e=$.current?.type_info?.choices[C?.[$.current?.name]-$.current?.type_info?.validation?.min??0]?.dependent_question_names,n=ee.current?.question_names.find((n=>e?.includes(n))),t=w.find((e=>e.name===n));Y(t)}else{const e=w.find((e=>e.name==ee.current?.question_names[0]));Y(e)}}),[C?.[$.current?.name]]);o((()=>{(()=>{if(U){U.style.minHeight="unset",U.style.maxHeight="unset",U.style.height="min-content";const e=Math.min(U?.scrollHeight+2,f[v]);U.style.height=e+"px",U.style.minHeight=e+"px",oe.current=e}})()}),[U]);const ie=()=>{m({...C,others_meta:P},(()=>{L?.type_info.meta?.skipThankYouPage?x?setTimeout((()=>{b?.()}),300):window.location.href=L?.type_info.meta?.redirectUrl:I(!0)}))},ae=()=>(G.current===_.length-1||"end"===H.current.branchOption)&&X.current===O.length-1,ue=e=>{let n={};if(e.is_based_on_rating){const t=$.current?.type_info?.choices[C?.[$.current?.name]-$.current?.type_info?.validation?.min??0]?.dependent_question_names,r=e.question_names.find((e=>t?.includes(e)));n=w.find((e=>e.name===r))}else n=w.find((n=>n.name===e.question_names[0]));H.current.question=n;Z.current.find((e=>e.question.name===n.name))?(R({}),X.current+=1):Q([...Z.current,{...e,question:n}])},ce=()=>{if(ae())I(!0);else{if(H.current.nextBlock)G.current=_.findIndex((e=>e.name===H.current.nextBlock));else if(H.current.question.type_info?.meta?.branches){const e=H.current.question.type_info?.meta?.branches,n=C[H.current.question.name];let t;if(t="RANGE"===H.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return ie(),void I(!0);G.current=_.findIndex((e=>e.name===t.nextBlock))}else G.current+=1}else G.current+=1;H.current=_[G.current],ue(_[G.current])}},le=(e,n,t)=>{if(J.current=!1,t){if(K.current=!0,null!=C[e.question.name]&&e.name!==O[O.length-1].name){const[t,r]=(e=>{const n=O.findIndex((n=>n.name===e.name)),t=O.slice(0,n+1),r=t.reduce(((e,n)=>(e[n.question.name]=C[n.question.name],e)),{});return G.current=_.findIndex((n=>n.name===e.name)),[t,r]})(e);N({...r,...null!=n&&{[e.question.name]:n}}),Z.current=t}else N({...C,...null!=n&&{[e.question.name]:n}});$?.current?.name==e?.question?.name&&(A.current=n)}else N({...C,...null!=n&&{[e.question.name]:n}})};if(!H.current||!H.current.question)return null;const me=O[Math.min(X.current??O.length-1,O.length-1)];return e.createElement("div",{className:`freemium-survey-components ${d?"widget-survey-components":""} ${v}-style ${g?"mobile-preview":""}`,id:"freemium-survey"},h&&!B&&document.querySelector(h)?c.createPortal(e.createElement(E,{totalSteps:_.length,completedSteps:G.current+(B?1:0),widget:!0}),document.querySelector(h)):null,e.createElement("div",{className:"questions",style:{height:oe.current,...1===O.length?{transition:"none"}:{}}},e.createElement(u,{component:null},e.createElement(a,{key:me.question.name+String(B),unmountOnExit:!0,addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:te?"fade-reverse":"fade"},e.createElement("div",{ref:e=>e?j(e):null,id:`${me.question.name}`,className:"question-container "+(B?"thankyou":""),"data-test-question-name":me.question.name},B?e.createElement(W,{thankYouQuestion:L,preview:x,placeholders:l,npsValue:A.current,setBlockElementRef:j}):e.createElement(e.Fragment,null,e.createElement("div",{className:"question-text "+("RANGE"===me.question.type_info.question_type?"nps-question-text":""),dangerouslySetInnerHTML:{__html:z(me.question.text,l,A.current)},title:`question-${X.current}`,role:"heading","aria-level":1}),e.createElement("div",{className:"question-wrapper",onTransitionEndCapture:e=>e.stopPropagation()},e.createElement(S,{question:me.question,isFinalQn:ae(),formValues:C,othersMeta:P,autoFocus:!0,autoFocusDelay:"standard"===i?300:0,saveOthersValue:(e,n)=>{if(null===n){const n={...P};delete n[e],M({...n})}else M({...P,[e]:n})},onChangeHandler:e=>{K.current=!1,G.current=_.findIndex((e=>e.name===me.name)),H.current=me,se.current=!1,re(!1),le(me,e,!("DROPDOWN"===me.question.type_info.question_type&&"__others__"===e)&&p.includes(me.question.type_info.question_type)&&!ae())}})),e.createElement(V,{question:me.question,block:me,widget:d,widgetStyle:v,surveyStyle:i,formValues:C,othersMeta:P,blocksWithQns:O,blocks:_,thankYouQuestion:L,currentBlockIndexOfBlocksWithQns:X,reverse:te,setReverse:re,currentBlockIndexOfBlocks:G,currentEditingBlock:H,isSubmitting:F,isValuesCommitted:K,isCurrentBlockFinal:ae,setHorizontalScrollUnits:R,handleFormValues:le,skipBlock:e=>{K.current=!0,delete C[e.name],N({...C})},setIsSubmitting:T,onSubmit:ie,setIsSurveyCompleted:I,preventQuestionAnimation:J,preview:x,closePreview:b,tempCurrentBlockIndexOfBlocksWithQns:ne,setCurrentBlockIndexOfBlocksWithQnsDirty:se})))))))};l(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #3a4b67;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 480px;\n --default-widget-max-height: 460px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-step-navigation {\n border-radius: 3px;\n border: 1px solid #efefef;\n white-space: nowrap;\n}\n.freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #efefef;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n\n.freemium-survey-components.standard-survey-style .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 800ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n margin-bottom: 28px;\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: auto;\n opacity: 1;\n}\n.freemium-survey-components.standard-survey-style .hide-question-container {\n pointer-events: none;\n opacity: 0;\n}\n.freemium-survey-components.standard-survey-style .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components.standard-survey-style .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components.standard-survey-style .question-footer {\n display: flex;\n justify-content: flex-start;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components.standard-survey-style .question-footer:empty {\n display: none;\n}\n.freemium-survey-components.standard-survey-style .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n}\n.freemium-survey-components.standard-survey-style .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components.standard-survey-style .skip-button {\n font-weight: 500;\n color: #3a4b67;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components.standard-survey-style .skip-button:hover {\n background-color: #f3f3f3;\n transform: translateY(-4px);\n}\n.freemium-survey-components.standard-survey-style .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.standard-survey-style .submit {\n max-width: 700px;\n margin: 0 auto;\n text-align: left;\n background: transparent;\n box-shadow: none;\n padding-bottom: 40px;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.standard-survey-style .fade-enter {\n transition: all ease 400ms;\n opacity: 0;\n transform: translateY(40px);\n}\n.freemium-survey-components.standard-survey-style .fade-enter-active {\n transition: all ease 400ms;\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.standard-survey-style .fade-exit {\n transition: all ease 400ms;\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.standard-survey-style .fade-exit-active {\n transition: all ease 400ms;\n opacity: 0;\n transform: translateY(-40px);\n}\n.freemium-survey-components.standard-survey-style .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components.standard-survey-style .thankyou .heading {\n font-weight: 500;\n font-size: 22px;\n}\n.freemium-survey-components.standard-survey-style .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #475867;\n width: 75%;\n}\n.freemium-survey-components.standard-survey-style .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components.standard-survey-style .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components.standard-survey-style .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components.standard-survey-style .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components.standard-survey-style .message-container:empty {\n display: none;\n}\n@media (max-width: 550px) {\n .freemium-survey-components.standard-survey-style .action-buttons {\n flex-direction: column;\n width: 100%;\n }\n .freemium-survey-components.standard-survey-style .action-buttons button {\n max-width: unset;\n }\n .freemium-survey-components.standard-survey-style .action-button {\n max-width: unset;\n width: 100%;\n }\n .freemium-survey-components.standard-survey-style .thankyou .text {\n width: auto;\n }\n}\n\n@media (max-width: 550px) {\n .freemium-survey-component .responsive-text-field .input-container {\n display: none;\n }\n .freemium-survey-component .responsive-text-field .textarea-container {\n display: flex;\n }\n .freemium-survey-component .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n }\n}\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const P=({thankYouQuestion:n,preview:t,placeholders:o,npsValue:s})=>(r((()=>{t||n.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=n.type_info.meta?.redirectUrl}),1e3*(1e3*n.type_info.meta?.redirectDelay??1e4))}),[]),e.createElement("div",{className:"question-container thankyou"},e.createElement("div",{className:"heading"},"Thank you!"),e.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:z(n.text,o,s)}}),n.type_info.meta?.redirectUrl&&e.createElement("div",{style:{width:"100%"}},e.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",n.type_info.meta?.redirectDelay," seconds.",e.createElement("br",null)),e.createElement("a",{className:"link",href:n.type_info.meta?.redirectUrl},n?.type_info.meta?.redirectUrl)))),M=({currentBlockIndex:n,currentBlockIndexOfBlocksWithQns:t,blocksWithQns:r,blocks:o,setHorizontalScrollUnits:s,preventQuestionAnimation:i})=>e.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},e.createElement("button",{disabled:0==t.current,className:"navigation-button",onClick:()=>{t.current=Math.max(t.current-1,0),n.current=o.findIndex((e=>e.name===r[t.current].name)),i.current=!1,s(t.current)}},e.createElement(O,null)),e.createElement("button",{className:"navigation-button",disabled:t.current>=r.length-1,onClick:()=>{i.current=!1,t.current=Math.min(t.current+1,r.length-1),n.current=o.findIndex((e=>e.name===r[t.current].name)),s(t.current)}},e.createElement(I,null))),H=({widget:n,block:t,surveyStyle:r,formValues:o,othersMeta:s,blocksWithQns:i,blocks:a,thankYouQuestion:u,currentBlockIndexOfBlocksWithQns:c,currentBlockIndexOfBlocks:l,currentEditingBlock:m,isSubmitting:d,isValuesCommitted:f,isCurrentBlockFinal:y,setHorizontalScrollUnits:v,handleFormValues:h,skipBlock:x,setIsSubmitting:g,onSubmit:b,setIsSurveyCompleted:w,preventQuestionAnimation:k,preview:_,closePreview:q,...E})=>{const C=E.blockIndex??c.current,N=E.question??i[C].question,I=()=>N.name===m.current.question.name&&(!p.includes(N.type_info.question_type)||"DROPDOWN"===N.type_info.question_type&&"__others__"===o[N.name])&&!y(),O=()=>"RANGE"!==N.type_info.question_type&&!t.required&&N.name===m.current.question.name&&!y(),S=()=>("DROPDOWN"===N.type_info.question_type&&N.name!==m.current.question.name&&!t.required&&o[N.name],!1),z=()=>y()&&(n||"standard"!==r)&&N.name===m.current.question.name,Q=("MULTI_SELECT"===m.current.question.type_info.question_type&&o[m.current.question.name]?.includes("__others__")||"DROPDOWN"===m.current.question.type_info.question_type&&"__others__"===o[m.current.question.name])&&(!s[m.current.question.name]||""===s[m.current.question.name].trim());return e.createElement("div",{className:"question-footer"},!(!n&&"standard"===r||0===C&&!o[N.name])&&e.createElement(M,{currentBlockIndex:l,currentBlockIndexOfBlocksWithQns:c,blocksWithQns:i,blocks:a,setHorizontalScrollUnits:v,preventQuestionAnimation:k}),(I()||S()||O()||z())&&e.createElement("div",{className:"action-buttons"},I()&&e.createElement(B,{onClick:()=>{h(i[C],null,!0)},disabled:m.current.required&&(!o[m.current.question.name]||Array.isArray(o[m.current.question.name])&&0===o[m.current.question.name].length)||m.current.question.type_info.meta?.othersRequired&&Q,className:"next-button"},"Next"),O()&&e.createElement("button",{className:"skip-button",onClick:()=>x(N)},"Skip"),S()&&e.createElement("button",{className:"skip-button",onClick:()=>{m.current=i[C],l.current=a.findIndex((e=>e.name===i[C].name)),x(N)}},"Clear selection"),z()&&e.createElement("div",{className:"submit"},e.createElement(B,{disabled:(m.current.required||m.current.question.type_info.pivot_question)&&(null==o[m.current.question.name]||0===o[m.current.question.name]?.length)||m.current.question.type_info.meta?.othersRequired&&Q||d,onClick:()=>{g(!0),b()}},d?"Submitting":"Submit survey"))))},$=({survey:t,surveyStyle:o="standard",placeholders:u,onSubmit:c,widget:l,npsValue:m,preview:d,mobilePreview:f,closePreview:y})=>{const v=t.question_details?.questions||[],h=t.meta?.blocks||[],[x,g]=s(null),[b,w]=s({}),[k,_]=s(!1),[q,C]=s([]),[N,I]=s(0),[O,Q]=s(!1),[D,R]=s(null),[F,T]=s({}),W=n(null),L=n(null),V=n(-1),Y=n(null),M=n(0),$=n(0),A=n(!1),U=n([]),j=n(null!=m&&"card"===o),G=n(null),X=n([]);r((()=>{h&&(G.current=h.find((e=>"TY"===e.name)),g(h.filter((e=>"TY"!==e.name))))}),[h]),r((()=>{if(x)if(L.current=v.find((e=>e.type_info?.pivot_question))??v.find((e=>"RANGE"===e.type_info?.question_type))??v[0],null!=m){V.current=Math.min(L.current.type_info.validation.max,Math.max(L.current.type_info.validation.min,m));const e=v.find((e=>e.name===x[0].question_names[0]));W.current={...x[0],question:e},U.current=[...U.current,{...x[0],question:e}],C(U.current),w({Q_1:V.current})}else if(!W.current&&x.length>0)return W.current=x[0],void J(x[0])}),[x,m]),r((()=>{q.length&&(U.current=q,$.current=q.length-1),l||"standard"!==o?(Y.current&&(Y.current.style.maxHeight="unset"),X.current[M.current]=Y.current?.scrollHeight||X.current[M.current]||0,Y.current&&(Y.current.style.maxHeight="100%")):Y.current?.scrollIntoView({block:"start",behavior:"smooth"}),I(q.length-1)}),[q]),r((()=>{Object.keys(b).length>0&&W.current.question&&(p.includes(W.current.question.type_info.question_type)&&("DROPDOWN"!==W.current.question.type_info.question_type||"__others__"!==b[W.current.question.name])||A.current)&&!Z()&&ee()}),[b]),r((()=>{if(null!=b?.[L.current?.name])if(G.current?.is_based_on_rating){const e=L.current?.type_info?.choices[b?.[L.current?.name]-L.current?.type_info?.validation?.min??0]?.dependent_question_names,n=G.current?.question_names.find((n=>e?.includes(n))),t=v.find((e=>e.name===n));R(t)}else{const e=v.find((e=>e.name==G.current?.question_names[0]));R(e)}}),[b?.[L.current?.name]]);const K=()=>{c({...b,others_meta:F},(()=>{D?.type_info.meta?.skipThankYouPage?d?setTimeout((()=>{y?.()}),300):window.location.href=D?.type_info.meta?.redirectUrl:_(!0)}))},Z=()=>M.current===x.length-1||"end"===W.current.branchOption,J=e=>{let n={};if(e.is_based_on_rating){const t=L.current?.type_info?.choices[b?.[L.current?.name]-L.current?.type_info?.validation?.min??0]?.dependent_question_names,r=e.question_names.find((e=>t?.includes(e)));n=v.find((e=>e.name===r))}else n=v.find((n=>n.name===e.question_names[0]));W.current.question=n;U.current.find((e=>e.question.name===n.name))?(I(N+1),$.current+=1):C([...U.current,{...e,question:n}])},ee=()=>{if(Z())_(!0);else{if(W.current.nextBlock)M.current=x.findIndex((e=>e.name===W.current.nextBlock));else if(W.current.question.type_info?.meta?.branches){const e=W.current.question.type_info?.meta?.branches,n=b[W.current.question.name];let t;if(t="RANGE"===W.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return K(),void _(!0);M.current=x.findIndex((e=>e.name===t.nextBlock))}else M.current+=1}else M.current+=1;W.current=x[M.current],J(x[M.current])}},ne=e=>{A.current=!0,delete b[e.name],w({...b})},te=(e,n,t)=>{if(j.current=!1,t){if(A.current=!0,null!=b[e.question.name]&&e.name!==q[q.length-1].name){const[t,r]=(e=>{const n=q.findIndex((n=>n.name===e.name)),t=q.slice(0,n+1),r=t.reduce(((e,n)=>(e[n.question.name]=b[n.question.name],e)),{});return M.current=x.findIndex((n=>n.name===e.name)),[t,r]})(e);w({...r,...null!=n&&{[e.question.name]:n}}),U.current=t}else w({...b,...null!=n&&{[e.question.name]:n}});L?.current?.name==e?.question?.name&&(V.current=n)}else w({...b,...null!=n&&{[e.question.name]:n}})},re=(e,n)=>{const t=q.find((n=>n.question.name===e));if(M.current=x.findIndex((e=>e.name===t.name)),W.current=t,null===n){const n={...F};delete n[e],T({...n})}else T({...F,[e]:n})};if(!W.current||!W.current.question)return null;const oe=("MULTI_SELECT"===W.current.question.type_info.question_type&&b[W.current.question.name]?.includes("__others__")||"DROPDOWN"===W.current.question.type_info.question_type&&"__others__"===b[W.current.question.name])&&(!F[W.current.question.name]||""===F[W.current.question.name]);return e.createElement("div",{className:`freemium-survey-components ${l?"widget-survey-components":""} ${f?"mobile-preview":""} ${o}-survey-style`,id:"freemium-survey"},k?null:e.createElement(E,{totalSteps:x.length,completedSteps:M.current}),e.createElement(i,{mode:"out-in"},e.createElement(a,{key:String(k),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:l?"":"fade"},e.createElement("div",null,k?e.createElement(P,{thankYouQuestion:D,preview:d,placeholders:u,npsValue:V.current}):e.createElement(e.Fragment,null,e.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:l||"card"===o?{transform:`translateX(calc(-${N} * 100%))`,height:`${X.current[M.current]}px`,transition:j.current||q?.length<=1?"none":"all 300ms ease-out 0ms"}:{},className:"questions"},q.map(((n,t)=>e.createElement("div",{key:n.question.name,ref:Y,className:"question-container "+(!l&&"card"!==o||$.current===t?"":"hide-question-container")},e.createElement("div",{className:"question-text "+(0===t?"nps":""),dangerouslySetInnerHTML:{__html:z(n.question.text,u,V.current)},title:`question-${t}`,role:"heading","aria-level":1}),e.createElement("button",{disabled:!l&&"standard"===o,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),e.createElement(S,{question:n.question,isFinalQn:Z(),formValues:b,othersMeta:F,autoFocus:$.current===t,autoFocusDelay:"standard"===o?350:20,saveOthersValue:re,onChangeHandler:e=>{A.current=!1,M.current=x.findIndex((e=>e.name===n.name)),W.current=n,te(n,e,!("DROPDOWN"===n.question.type_info.question_type&&"__others__"===e)&&p.includes(n.question.type_info.question_type)&&!Z())}}),e.createElement("button",{disabled:!l&&"standard"===o,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),e.createElement(H,{question:n.question,block:n,blockIndex:t,widget:l,surveyStyle:o,formValues:b,othersMeta:F,blocksWithQns:q,blocks:x,thankYouQuestion:D,currentBlockIndexOfBlocksWithQns:$,currentBlockIndexOfBlocks:M,currentEditingBlock:W,isSubmitting:O,isValuesCommitted:A,isCurrentBlockFinal:Z,setHorizontalScrollUnits:I,handleFormValues:te,skipBlock:ne,setIsSubmitting:Q,onSubmit:K,setIsSurveyCompleted:_,preventQuestionAnimation:j,preview:d,closePreview:y})))),!l&&"card"!==o&&Z()&&e.createElement("div",{className:"submit"},e.createElement(B,{disabled:(W.current.required||W.current.question.type_info.pivot_question)&&(null==b[W.current.question.name]||0===b[W.current.question.name]?.length)||W.current.question.type_info.meta?.othersRequired&&oe||O,onClick:()=>{Q(!0),c({...b,others_meta:F},(()=>{D?.type_info.meta?.skipThankYouPage?d?setTimeout((()=>{y?.()}),300):window.location.href=D?.type_info.meta?.redirectUrl:_(!0)}))}},O?"Submitting":"Submit survey"))))))))},A=n=>{const t=Q(n.survey);return e.createElement(e.Fragment,null,"standard"===n.surveyStyle?e.createElement($,Object.assign({},n,{survey:t})):e.createElement(T,Object.assign({},n,{survey:t})))},U=n=>{const t=Q(n.survey);return e.createElement(Y,Object.assign({},n,{survey:t}))};export{N as BUTTON_SIZE_VARIANTS,B as Button,w as CheckboxGroup,x as Input,m as NPS,E as ProgressBar,q as Radio,_ as RadioGroup,A as Survey,g as TextArea,U as WebInAppSurvey};
1
+ import e,{useRef as n,forwardRef as t,useEffect as r,useMemo as o,useState as i}from"react";import{SwitchTransition as s,CSSTransition as a,TransitionGroup as c}from"react-transition-group";import u from"react-dom";function l(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===t&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}l(".freemium-survey-components .nps-container {\n margin: 0 auto;\n width: 100%;\n display: flex;\n flex-direction: column;\n grid-gap: 28px;\n gap: 28px;\n}\n.freemium-survey-components .nps-container .footer {\n border-top: 1px solid #ebeff3;\n padding-top: 20px;\n display: flex;\n justify-content: center;\n font-size: 0.875rem;\n line-height: 1.5;\n color: #666;\n}\n.freemium-survey-components .nps-container .footer:empty {\n display: none;\n}\n.freemium-survey-components .nps-container .nps-scale {\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale .button-container {\n flex-direction: column;\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n}\n.freemium-survey-components .nps-container .nps-scale .help-text-container {\n display: flex;\n justify-content: space-between;\n align-items: center;\n}\n.freemium-survey-components .nps-container .nps-scale .positive-text {\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n right: 0px;\n text-align: right;\n}\n.freemium-survey-components .nps-container .nps-scale .negative-text {\n color: #475867;\n bottom: -40px;\n font-size: 12px;\n left: 0;\n text-align: left;\n}\n.freemium-survey-components .nps-container .nps-scale span {\n color: #aaa;\n font-size: 0.75rem;\n}\n.freemium-survey-components .nps-container .nps-scale button {\n display: inline-block;\n font-size: 1rem;\n white-space: nowrap;\n vertical-align: middle;\n background: none;\n border: none;\n box-shadow: none;\n cursor: pointer;\n text-align: center;\n font-weight: 400;\n border-radius: 4px;\n margin: 0;\n outline: none;\n margin-left: -1px;\n width: 40px;\n height: 40px;\n transform: scale(1);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover {\n transition: background 0.2s ease-in, border-color 0.2s ease-in, transform 0.2s cubic-bezier(0.5, 2, 0.5, 0.75);\n}\n.freemium-survey-components .nps-container .nps-scale button:hover, .freemium-survey-components .nps-container .nps-scale button:focus {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale button.active {\n color: white;\n transform: scale(1.2);\n z-index: 2;\n position: relative;\n}\n.freemium-survey-components .nps-container .nps-scale.rounded button {\n border-radius: 50%;\n}\n.freemium-survey-components .nps-container .nps-scale.square button {\n border-radius: 0;\n}\n.freemium-survey-components .nps-container .nps-scale.curved button {\n border-radius: 3px;\n}\n.freemium-survey-components .nps-container .nps-scale.highlighted button:hover, .freemium-survey-components .nps-container .nps-scale.highlighted button:focus, .freemium-survey-components .nps-container .nps-scale.highlighted button.active {\n background: var(--default-brand-color) !important;\n background: var(--brand-color, var(--default-brand-color)) !important;\n}\n.freemium-survey-components .nps-container .nps-scale .choices {\n width: 100%;\n display: flex;\n justify-content: space-between;\n font-weight: 500;\n background-color: #ebeff3;\n border-radius: 4px;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choices {\n background-color: transparent;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice {\n background: #ebeff3;\n color: #000;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice.active, .freemium-survey-components .nps-container .nps-scale.standard .choice:hover {\n background: #e43e3d;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1):focus, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1).active, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1):hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2):focus, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2).active, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2):hover {\n background: #00af50;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(3):hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(4):hover {\n background: #f8c43e;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:hover, .freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice.active {\n color: #fff;\n transform: scale(1.2);\n}\n\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .choices {\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n}\n.freemium-survey-components.mobile-preview .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .nps-container .nps-scale .choices,\n.card-survey-style .nps-container .nps-scale .choices {\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale .choices,\n.card-survey-style .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n }\n .freemium-survey-components .nps-container .nps-scale button,\n.card-survey-style .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n }\n}\n.widget-survey-components .nps-container .nps-scale .choices {\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale .choices {\n flex-wrap: wrap;\n justify-content: center;\n grid-gap: 16px;\n gap: 16px;\n background: transparent;\n}\n.widget-survey-components .nps-container .nps-scale button {\n border-radius: 50%;\n background: #ebeff3;\n}");const m=t=>{const{type_info:{linear_scale:{button_style:r="highlighted",button_shape:o="rounded"}={},rating_presets:{start:i="Very unlikely",end:s="Very likely"}={},validation:{min:a},footer_text:c}}=t,u=e=>{switch(e){case e<=6:return"detractor";case e<=8:return"passive";default:return"promoter"}},l=n(Array.from({length:10+(0===a?1:0)},((e,n)=>n+a)));return e.createElement("div",{className:"nps-container","data-test-input":"nps"},e.createElement("div",{className:`nps-scale ${o} ${r}`},e.createElement("div",{className:"button-container"},e.createElement("div",{className:"choices",role:"radiogroup","aria-required":!0},l.current.map((n=>e.createElement("button",{role:"radio","aria-checked":t.npsValue===n,key:n,"data-test-nps-choice":n,onClick:e=>{t.onChangeHandler(n)},className:`choice ${u(n)} ${t.npsValue===n&&"active"}`},n)))),e.createElement("div",{className:"help-text-container"},e.createElement("span",{className:"negative-text",role:"note"},`${a} - ${i}`),e.createElement("span",{className:"positive-text",role:"note"},`${l.current[l.current.length-1]} - ${s}`)))),e.createElement("div",{className:"footer",role:"note"},c))},d=(e,n)=>(e.defaultProps=n,e);l('.freemium-survey-components .input-container,\n.freemium-survey-components .textarea-container {\n display: flex;\n flex-direction: column;\n width: 100%;\n border-radius: 4px;\n position: relative;\n}\n.freemium-survey-components label.input-label {\n display: inline-block;\n padding-bottom: 8px;\n padding-left: 2px;\n font-size: 0.75rem;\n font-weight: 400;\n}\n.freemium-survey-components label.required::after {\n content: "*";\n position: relative;\n top: 2px;\n font-weight: 500;\n font-size: 0.85rem;\n padding-left: 3px;\n color: #d72d30;\n}\n.freemium-survey-components .input-basic {\n width: 100%;\n display: flex;\n align-items: center;\n border-radius: 4px;\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n transition: border-color 0.2s linear;\n background: #fff;\n}\n.freemium-survey-components .textarea-container .input-basic {\n flex-direction: column;\n align-items: unset;\n}\n.freemium-survey-components .input-basic.error {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error:hover {\n border: 1px solid #d72d30;\n}\n.freemium-survey-components .input-basic.error[focus-within] {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic.error:focus-within {\n box-shadow: none;\n}\n.freemium-survey-components .input-basic:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: 0.2s linear;\n}\n.freemium-survey-components .input-basic[focus-within] {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .input-basic:focus-within {\n border: 1px solid transparent;\n box-shadow: 0 0 0 2px var(--default-brand-color);\n box-shadow: 0 0 0 2px var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .input-basic[focus-within] .end-max-length {\n opacity: 1;\n}\n.freemium-survey-components .input-basic:focus-within .end-max-length {\n opacity: 1;\n}\n.freemium-survey-components .end-max-length {\n transition: opacity ease 0.2s;\n opacity: 0;\n padding: 0 8px;\n font-size: 0.75rem;\n color: #264966;\n}\n.freemium-survey-components .textarea-container .end-max-length {\n padding: 8px;\n align-self: flex-end;\n}\n.freemium-survey-components span.input-error {\n display: block;\n padding-left: 2px;\n padding-top: 4px;\n font-size: 0.9rem;\n color: #d72d30;\n}\n.freemium-survey-components input[type=text] {\n padding: 6px 12px;\n flex: 1;\n border: unset;\n height: 32px;\n font-size: 1rem;\n min-width: 0;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components input[type=text],\n.freemium-survey-components textarea {\n outline: none;\n border: none;\n}\n.freemium-survey-components input[type=text]::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components input[type=text]::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea {\n min-height: 116px;\n padding: 12px;\n flex: 1;\n border: unset;\n resize: none;\n font-size: 1rem;\n min-width: 0;\n /* line-height: ${typography.input.text.lineHeight}; */\n border-radius: 4px;\n}\n.freemium-survey-components textarea::-moz-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea:-ms-input-placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}\n.freemium-survey-components textarea::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}');const p=["RANGE","NPS","RADIO","DROPDOWN"],f={default:500,compact:500,cozy:400},y={default:"600px",compact:"350px",cozy:"96%"},v={isRequired:!1,showCount:!0,isErrored:!1,inline:!1,spellCheck:!1,autoFocusInput:!0},h=t(((t,o)=>{const i=n(null);r((()=>{t.autoFocusInput&&setTimeout((()=>{i.current?.focus()}),300+t.autoFocusDelay)}),[t.autoFocusInput]);const{inputStyle:s,style:a,className:c,showCount:u,isErrored:l,startLabel:m,isRequired:d,errorText:p,endLabel:f,maxLength:y=256,onChange:v,autoFocusInput:h,...g}=t;return e.createElement("div",{className:"input-container",style:a},t.label&&e.createElement("label",{className:"input-label "+(d?"required":"")},t.label),e.createElement(e.Fragment,null,m&&e.createElement("div",{className:"start-label"},m),e.createElement("div",{className:`input-basic ${l?"error":""}${c||""}`},e.createElement("input",Object.assign({},g,{type:"text",autoComplete:"off",ref:i,style:s,onChange:e=>{e.target.value?.length>y||v?.(e)}})),u&&y>0&&e.createElement("div",{className:"end-max-length"},`${t.value&&t.value.length||0}/${y}`)),f&&e.createElement("div",{className:"end-label"},f)),l&&p&&e.createElement("span",{className:"input-error"},t.errorText))})),g=t(((t,o)=>{const i=n(null);r((()=>{t.autoFocusInput&&setTimeout((()=>{i.current?.focus()}),300+t.autoFocusDelay)}),[t.autoFocusInput]);const{inputStyle:s,style:a,className:c,showCount:u,maxLength:l=1500,startLabel:m,isRequired:d,autoFocusInput:p,onChange:f,...y}=t;return e.createElement(e.Fragment,null,e.createElement("div",{className:"textarea-container",style:a},t.label&&e.createElement("label",{className:"input-label "+(d?"required":"")},t.label),m&&e.createElement("div",{className:"start-label"},m),e.createElement("div",{className:`input-basic ${c||""}`},e.createElement("textarea",Object.assign({},y,{autoComplete:"off",ref:i,style:s,onChange:e=>{e.target.value?.length>l||f?.(e)}})),u&&l&&l>0&&e.createElement("div",{className:"end-max-length"},`${t.value&&t.value.length||0}/${l}`)),t.endLabel&&e.createElement("div",{className:"end-label"},t.endLabel)))})),x=d(h,v),b=d(g,v);l('.freemium-survey-components .checkbox-group {\n width: 100%;\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n flex-direction: column;\n white-space: nowrap;\n flex-wrap: wrap;\n}\n.freemium-survey-components .icon-container {\n display: inline-block;\n flex: 0 0 12px;\n width: 12px;\n height: 12px;\n min-width: 12px;\n min-height: 12px;\n color: inherit;\n position: absolute;\n left: 1px;\n top: 2px;\n}\n.freemium-survey-components .tick-icon {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n height: 100%;\n width: 100%;\n color: inherit;\n fill: currentColor;\n}\n.freemium-survey-components input[type=checkbox] {\n position: absolute;\n clip: rect(0px 0px 0px 0px);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=checkbox]:focus ~ .checkbox {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 2px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 2px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 2px;\n border-color: transparent;\n}\n.freemium-survey-components .checkbox-label {\n display: flex;\n align-items: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n opacity: 1;\n line-height: 1.2;\n cursor: pointer;\n font-size: 1rem;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n border-radius: 4px;\n white-space: pre-wrap;\n}\n.freemium-survey-components .checkbox-label:hover {\n border-color: #92a2b1;\n}\n.freemium-survey-components .checkbox-label.disabled {\n opacity: 0.5;\n cursor: "not-allowed";\n}\n.freemium-survey-components .checkbox {\n transition: background-color ease-in 0.2s;\n min-width: 14px;\n min-height: 14px;\n min-height: 14px;\n max-height: 14px;\n border-radius: 2px;\n position: relative;\n margin-right: 16px;\n background-color: #fff;\n border: 1px solid;\n text-align: left;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n box-shadow: var(--default-background-color) 0px 0px 0px 5px;\n box-shadow: var(--background-color, var(--default-background-color)) 0px 0px 0px 5px;\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:checked ~ .checkbox:hover {\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components input[type=checkbox]:disabled ~ .checkbox:hover {\n box-shadow: unset;\n border-color: unset;\n}');const w=()=>e.createElement("svg",{id:"tick",className:"tick-icon",xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"title",viewBox:"0 0 10 10"},e.createElement("path",{d:"M3 5.87c-.18666814.00267463-.36667109-.06932655-.5-.2L.21 3.41c-.1786328-.17863279-.24839684-.43899577-.1830127-.6830127.06538414-.24401694.25598306-.43461586.5-.5C.77100423 2.16160316 1.0313672 2.23136721 1.21 2.41L3 4.18 6.8.33c.27679776-.27455556.72320224-.27455556 1 0 .13696438.13025306.21450026.31098915.21450026.5S7.93696438 1.19974694 7.8 1.33L3.45 5.67c-.12082534.11896945-.28072735.19003701-.45.2Z",fill:"#fff",fillRule:"evenodd"})),k=({values:t=[],othersValue:o="",options:i,name:s,autoFocusGroup:a,autoFocusDelay:c,onChangeHandler:u,saveOthersValue:l})=>{const m=t.includes("__others__"),d=n(null);return r((()=>{a&&setTimeout((()=>{d.current?.focus()}),300+c)}),[a]),e.createElement("div",{className:"checkbox-group"},e.createElement("button",{ref:d,className:"autofocus-button","aria-hidden":!0}),i?.filter((e=>"__others__"!==e.value)).map(((n,r)=>e.createElement(_,{key:n.id,checked:t?.includes(n.value),name:n.value,id:n.id,onChange:(e,r)=>{if(r)u([...t||[],n.value]);else{const e=t.indexOf(n.value);e>-1&&t.splice(e,1),u([...t])}}},n.value))),i?.find((e=>"__others__"===e.value))&&e.createElement(_,{key:"others",checked:m,name:"__others__",id:"__others__",onChange:(e,n)=>{if(n)u([...t,"__others__"]);else{const e=t.findIndex((e=>"__others__"===e));t.splice(e,1),u(t)}}},"Others"),m&&e.createElement(e.Fragment,null,e.createElement(x,{placeholder:"Enter your comment",value:o,onChange:e=>{l(s,e.target.value)},autoFocusDelay:10,label:""})))},_=d((t=>{const o=n(null);return r((()=>{t.autoFocus&&setTimeout((()=>{o.current?.focus()}),320)}),[]),e.createElement("label",{className:`checkbox-label ${t.disabled&&"disabled"}`},e.createElement("input",{ref:o,id:t.id,type:"checkbox",name:t.name,readOnly:t.readOnly,disabled:t.disabled,"aria-disabled":t.disabled,checked:t.checked,onChange:t.readOnly?()=>{}:e=>t.onChange(e,e.target.checked)}),e.createElement("div",{className:"checkbox"},t.checked&&e.createElement("div",{className:"icon-container"},e.createElement(w,null)," ")),e.createElement("div",null,t.children))}),{checked:!1});l('.freemium-survey-components .radio-group {\n display: flex;\n grid-gap: 12px;\n gap: 12px;\n white-space: nowrap;\n flex-direction: column;\n width: 100%;\n}\n.freemium-survey-components .radio {\n background-color: #fff;\n border: 1px solid;\n border-color: var(--default-brand-color);\n border-color: var(--brand-color, var(--default-brand-color));\n transition: background-color ease-in 0.2s;\n min-width: 18px;\n max-width: 18px;\n min-height: 18px;\n max-height: 18px;\n border-radius: 50%;\n position: relative;\n margin-right: 16px;\n text-align: left;\n}\n.freemium-survey-components .radio:before {\n left: 3px;\n top: 3px;\n content: "";\n position: absolute;\n width: 10px;\n height: 10px;\n border-radius: 50%;\n transition: all ease-in 0.2s;\n background-color: #fff;\n}\n.freemium-survey-components .radio-label {\n display: flex;\n align-items: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-align: left;\n cursor: pointer;\n line-height: 1.2;\n font-size: 1rem;\n font-weight: 400;\n padding: 16px 24px;\n min-width: 200px;\n border: 1px solid #ebeff3;\n border-radius: 4px;\n white-space: pre-wrap;\n color: #3a4b67;\n}\n.freemium-survey-components input[type=radio] {\n position: absolute;\n clip: rect(0, 0, 0, 0);\n width: 0px;\n height: 0px;\n}\n.freemium-survey-components input[type=radio]:focus ~ .radio {\n /* box-shadow: ${pseudo.focus} 0px 0px 0px 3px; */\n box-shadow: var(--default-brand-color) 0px 0px 0px 3px;\n box-shadow: var(--brand-color, var(--default-brand-color)) 0px 0px 0px 3px;\n border-color: transparent;\n}\n.freemium-survey-components input[type=radio]:checked ~ .radio:before {\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}\n.freemium-survey-components .radio-label:hover {\n border-color: #92a2b1;\n}');const q=({name:t,options:o,value:i,autoFocusGroup:s,autoFocusDelay:a,onChangeHandler:c,saveOthersValue:u,othersOption:l,othersRequired:m,othersValue:d,isFinalQn:p})=>{const f=n(null);return r((()=>{s&&setTimeout((()=>{f.current?.focus()}),300+a)}),[s]),e.createElement("div",{className:"radio-group",role:"radiogroup"},e.createElement("button",{ref:f,className:"autofocus-button","aria-hidden":!0,tabIndex:-1}),o?.sort(((e,n)=>"__others__"===e.value?1:"__others__"===n.value?-1:0))?.map(((n,r)=>e.createElement(E,{key:n.value,value:n.value,name:t,onChange:e=>{"__others__"!==e.currentTarget.value&&u(t,null),c(e.currentTarget.value)},checked:i===n.value},"__others__"===n.value?"Others":n.value))),"__others__"===i&&e.createElement(e.Fragment,null,e.createElement(x,{value:d??"",onChange:e=>{"__others__"!==i&&p&&c("__others__"),u(t,e.target.value)},placeholder:"Enter your comment",label:"",autoFocusDelay:10})))},E=d((t=>{const o=n(null);return r((()=>{t.autoFocus&&setTimeout((()=>{o.current?.focus()}),320)}),[]),e.createElement("label",{className:"radio-label"},e.createElement("input",{ref:o,type:"radio",name:t.name,value:t.value,checked:t.checked,onChange:t.onChange}),e.createElement("div",{className:"radio"}),e.createElement("div",null,t.children))}),{checked:!1,autoFocus:!1});l(".progressbar-container {\n width: 100%;\n height: 4px;\n position: fixed;\n top: 0;\n left: 0;\n z-index: 1;\n text-align: left;\n overflow: hidden;\n border-top-left-radius: inherit;\n border-top-right-radius: inherit;\n}\n\n.progressbar-container.widget {\n position: absolute;\n top: 0;\n height: 2px;\n}\n\n.progressbar {\n transition: transform 0.2s linear 200ms;\n transform-origin: left;\n height: 100%;\n background-color: var(--default-brand-color);\n background-color: var(--brand-color, var(--default-brand-color));\n}");const C=n=>{const{totalSteps:t,completedSteps:r,widget:o}=n;return e.createElement("div",{className:"progressbar-container "+(o?"widget":"")},e.createElement("div",{className:"progressbar",style:{width:(r>0?100/t:0)+"%",transform:`scaleX(${r})`}}))};l(".freemium-survey-components .action-button {\n width: auto;\n display: block;\n padding: 8px 16px;\n cursor: pointer;\n line-height: 1.5;\n text-align: center;\n font-weight: 600;\n letter-spacing: 0.3px;\n border-radius: 4px;\n white-space: nowrap;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n color: --default-button-text-color;\n color: var(--button-text-color, --default-button-text-color);\n background: var(--default-brand-color);\n background: var(--brand-color, var(--default-brand-color));\n border: 1px solid var(--default-brand-color);\n border: 1px solid var(--brand-color, var(--default-brand-color));\n border-radius: 4px;\n min-width: 200px;\n max-width: -webkit-fit-content;\n max-width: -moz-fit-content;\n max-width: fit-content;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components .action-button:not([disabled]):hover {\n transform: translateY(-4px);\n}\n.freemium-survey-components .action-button[disabled] {\n cursor: not-allowed;\n opacity: 0.6;\n}\n.freemium-survey-components button:focus:not(:active) {\n /* box-shadow: 0 0 0 2px ${pseudo.focus}; */\n}\n\n@media (max-width: 550px) {\n .freemium-survey-components .action-button {\n min-width: 120px;\n }\n}\n.widget-survey-components .action-button {\n min-width: 120px;\n}\n\n.freemium-survey-components.mobile-preview .action-button {\n min-width: 120px;\n}");const N=()=>e.createElement(e.Fragment,null,"..."),B={LARGE:"large",MINI:"mini",NORMAL:"normal"},z=n=>{const{inline:t=!1,children:r,disabled:o,className:i="",htmlType:s,type:a="primary",onClick:c,size:u,overrideStyleClassName:l="",loading:m=!1,...d}=n;return e.createElement("button",Object.assign({style:t?{display:"inline-block"}:{},disabled:o,className:`action-button ${i} ${l}`,type:s,onClick:c},d),m?e.createElement(N,null):r)},I=()=>e.createElement("svg",{width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M7.82585 6.15754C7.98999 6.32147 8.08232 6.54389 8.08252 6.77587L8.08252 7.2192C8.07983 7.45069 7.98788 7.6722 7.82585 7.83754L1.82919 13.8225C1.77496 13.8772 1.71044 13.9206 1.63936 13.9502C1.56827 13.9798 1.49203 13.9951 1.41502 13.9951C1.33801 13.9951 1.26177 13.9798 1.19068 13.9502C1.1196 13.9206 1.05508 13.8772 1.00085 13.8225L0.172521 12.9942C0.118197 12.941 0.0750381 12.8774 0.0455752 12.8073C0.0161124 12.7372 0.000937578 12.6619 0.000937585 12.5859C0.000937592 12.5098 0.0161125 12.4345 0.0455753 12.3644C0.0750381 12.2943 0.118197 12.2308 0.172521 12.1775L5.36419 6.99754L0.172522 1.81754C0.117847 1.76331 0.0744506 1.69879 0.0448352 1.62771C0.0152208 1.55662 -2.75162e-05 1.48038 -2.75094e-05 1.40337C-2.75027e-05 1.32636 0.0152208 1.25012 0.0448353 1.17904C0.0744507 1.10795 0.117847 1.04343 0.172522 0.989205L1.00086 0.172537C1.05508 0.117862 1.1196 0.0744661 1.19069 0.0448507C1.26177 0.0152353 1.33801 -1.20337e-05 1.41502 -1.2027e-05C1.49203 -1.20203e-05 1.56827 0.0152353 1.63936 0.0448507C1.71044 0.0744661 1.77496 0.117862 1.82919 0.172537L7.82585 6.15754Z",fill:"#6B6B6B"})),O=()=>e.createElement("svg",{width:"9",height:"14",viewBox:"0 0 10 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M0.256667 7.83755C0.0925257 7.67361 0.000204227 7.4512 0 7.21921V6.77588C0.00268801 6.5444 0.0946357 6.32289 0.256667 6.15755L6.25333 0.172549C6.30756 0.117874 6.37208 0.0744776 6.44316 0.0448625C6.51425 0.0152474 6.59049 0 6.6675 0C6.74451 0 6.82075 0.0152474 6.89184 0.0448625C6.96292 0.0744776 7.02744 0.117874 7.08167 0.172549L7.91 1.00088C7.96432 1.05411 8.00748 1.11764 8.03694 1.18776C8.06641 1.25787 8.08158 1.33316 8.08158 1.40922C8.08158 1.48527 8.06641 1.56056 8.03694 1.63067C8.00748 1.70079 7.96432 1.76432 7.91 1.81755L2.71833 6.99755L7.91 12.1775C7.96467 12.2318 8.00807 12.2963 8.03769 12.3674C8.0673 12.4385 8.08255 12.5147 8.08255 12.5917C8.08255 12.6687 8.0673 12.745 8.03769 12.8161C8.00807 12.8871 7.96467 12.9517 7.91 13.0059L7.08167 13.8225C7.02744 13.8772 6.96292 13.9206 6.89184 13.9502C6.82075 13.9799 6.74451 13.9951 6.6675 13.9951C6.59049 13.9951 6.51425 13.9799 6.44316 13.9502C6.37208 13.9206 6.30756 13.8772 6.25333 13.8225L0.256667 7.83755Z",fill:"#6B6B6B"})),Z=()=>e.createElement("svg",{width:"11",height:"10",viewBox:"0 0 11 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("rect",{opacity:"0.01",x:"0.16748",width:"10",height:"10",fill:"white","fill-opacity":"0.01"}),e.createElement("path",{d:"M1.85129 1.68479L8.48395 8.31744",stroke:"#264966",strokeWidth:"1.5",strokeLinecap:"round"}),e.createElement("path",{d:"M8.48395 1.68479L1.85129 8.31744",stroke:"#264966",strokeWidth:"1.5",strokeLinecap:"round"})),S=()=>e.createElement("svg",{width:"8",height:"8",viewBox:"0 0 7 2",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M6.08333 1.32682H0.583333C0.261167 1.32682 0 1.06565 0 0.743489C0 0.421323 0.261167 0.160156 0.583333 0.160156H6.08333C6.4055 0.160156 6.66667 0.421323 6.66667 0.743489C6.66667 1.06565 6.4055 1.32682 6.08333 1.32682Z",fill:"#264966"})),M=()=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 11 11",fill:"none"},e.createElement("mask",{id:"a",maskUnits:"userSpaceOnUse",x:"-.400146",y:"-.400024",width:"11",height:"11",fill:"#000"},e.createElement("path",{fill:"#fff",d:"M-.400146-.400024h11v11h-11z"}),e.createElement("path",{d:"m4.70226 6.76428-2.6856 2.6856 2.60775-.00293c.02738-.00011.05452.0052.07983.01562.02532.01043.04833.02577.06769.04513.01936.01936.0347.04237.04512.06769.01043.02531.01574.05245.01563.07983l-.00293.41358c.00011.0274-.0052.0545-.01563.0799-.01043.0253-.02576.0483-.04512.0676-.01937.0194-.04237.0347-.06769.0452-.02532.0104-.05245.0157-.07983.0156l-3.59922.0029c-.082493.0001-.161625-.0326-.220005-.0909l-.111467-.1115c-.057526-.0589-.090102-.13767-.090934-.21998L.602787 6.2584c-.000112-.02738.005198-.05452.015625-.07984.010427-.02532.025763-.04832.045125-.06768.019362-.01936.042366-.0347.067685-.04513.025319-.01042.052451-.01573.079833-.01562h.416535c.02704-.00028.05387.00485.0789.01507.02504.01022.04779.02533.06691.04445.01912.01913.03424.04187.04446.06691s.01534.05186.01507.0789l-.00294 2.60775 4.74323-4.74323.0044-.00427 2.6856-2.6856-2.60775.00294c-.02738.00011-.05452-.0052-.07983-.01563-.02532-.01042-.04833-.02576-.06769-.04512-.01936-.01936-.0347-.04237-.04512-.06769-.01043-.02532-.01574-.05245-.01563-.07983l.00293-.413603c-.00011-.027382.0052-.054514.01563-.079833.01043-.025319.02576-.048323.04512-.067685.01937-.019362.04237-.034698.06769-.045125.02532-.010427.05245-.015737.07983-.015625L9.85762.599976c.08249-.000052.16158.032657.21998.090934l.1115.111467c.0575.058878.0901.13769.0909.220003l-.0029 3.59922c.0001.02738-.0052.05452-.0156.07983-.0105.02532-.0258.04833-.0452.06769-.0193.01936-.0423.0347-.0676.04512-.0254.01043-.0525.01574-.0799.01563h-.41651c-.02704.00027-.05387-.00485-.0789-.01507-.02504-.01022-.04779-.02533-.06691-.04446-.01912-.01912-.03424-.04187-.04446-.0669-.01022-.02504-.01534-.05186-.01506-.07891l.00293-2.60775-4.74323 4.74323-.0044.00427Z"})),e.createElement("path",{d:"m4.70226 6.76428-2.6856 2.6856 2.60775-.00293c.02738-.00011.05452.0052.07983.01562.02532.01043.04833.02577.06769.04513.01936.01936.0347.04237.04512.06769.01043.02531.01574.05245.01563.07983l-.00293.41358c.00011.0274-.0052.0545-.01563.0799-.01043.0253-.02576.0483-.04512.0676-.01937.0194-.04237.0347-.06769.0452-.02532.0104-.05245.0157-.07983.0156l-3.59922.0029c-.082493.0001-.161625-.0326-.220005-.0909l-.111467-.1115c-.057526-.0589-.090102-.13767-.090934-.21998L.602787 6.2584c-.000112-.02738.005198-.05452.015625-.07984.010427-.02532.025763-.04832.045125-.06768.019362-.01936.042366-.0347.067685-.04513.025319-.01042.052451-.01573.079833-.01562h.416535c.02704-.00028.05387.00485.0789.01507.02504.01022.04779.02533.06691.04445.01912.01913.03424.04187.04446.06691s.01534.05186.01507.0789l-.00294 2.60775 4.74323-4.74323.0044-.00427 2.6856-2.6856-2.60775.00294c-.02738.00011-.05452-.0052-.07983-.01563-.02532-.01042-.04833-.02576-.06769-.04512-.01936-.01936-.0347-.04237-.04512-.06769-.01043-.02532-.01574-.05245-.01563-.07983l.00293-.413603c-.00011-.027382.0052-.054514.01563-.079833.01043-.025319.02576-.048323.04512-.067685.01937-.019362.04237-.034698.06769-.045125.02532-.010427.05245-.015737.07983-.015625L9.85762.599976c.08249-.000052.16158.032657.21998.090934l.1115.111467c.0575.058878.0901.13769.0909.220003l-.0029 3.59922c.0001.02738-.0052.05452-.0156.07983-.0105.02532-.0258.04833-.0452.06769-.0193.01936-.0423.0347-.0676.04512-.0254.01043-.0525.01574-.0799.01563h-.41651c-.02704.00027-.05387-.00485-.0789-.01507-.02504-.01022-.04779-.02533-.06691-.04446-.01912-.01912-.03424-.04187-.04446-.0669-.01022-.02504-.01534-.05186-.01506-.07891l.00293-2.60775-4.74323 4.74323-.0044.00427Z",fill:"#264966"}),e.createElement("path",{d:"m4.70226 6.76428-.19158-.19732-.00287.00287.19445.19445Zm-2.6856 2.6856-.19445-.19445-.4702.4702.66496-.00075-.00031-.275Zm2.60775-.00293.00031.275h.00082l-.00113-.275Zm.14752.06075.19446-.19445-.00001-.00001-.19445.19446Zm.06075.14752.27499.00195.00001-.00082-.275-.00113Zm-.00293.41358-.27501-.0019.00001.003.275-.0011Zm-.06075.1475.19445.1945-.19445-.1945Zm-.06769.0452-.10471-.2543.10471.2543Zm-.07983.0156.00113-.275h-.00136l.00023.275Zm-3.59922.0029.00017.275h.00005l-.00022-.275Zm-.220005-.0909-.194454.1944.00017.0002.194284-.1946Zm-.111467-.1115-.196712.1922.002257.0023.194455-.1945Zm-.090934-.21998L.324837 9.8574l.000031.003.274986-.00278ZM.602787 6.2584l.275003.00022-.000005-.00135-.274998.00113Zm.015625-.07984L.36413 6.07385H.364129l.254283.10471Zm.045125-.06768.194453.19445h.000003l-.194456-.19445Zm.067685-.04513.104714.25429.000005-.00001-.104719-.25428Zm.079833-.01562-.001128.275h.001127l.000001-.275Zm.416535 0v.27501l.00281-.00002-.00281-.27499Zm.0789.01507-.10394.2546h.00001l.10393-.2546Zm.06691.04445.19445-.19445-.19445.19445Zm.04446.06691.2546-.10394-.2546.10394Zm.01507.0789-.275-.0028v.00249l.275.00031Zm-.00294 2.60775-.275-.00031-.00075.66497.47021-.4702-.19446-.19446Zm4.74323-4.74323-.19158-.19732-.00287.00287.19445.19445Zm.0044-.00427.19158.19733.00287-.00287-.19445-.19446Zm2.6856-2.6856.19445.19446.4702-.4702-.66496.00074.00031.275Zm-2.60775.00294-.00031-.275h-.00082l.00113.275Zm-.07983-.01563-.10472.25429.10472-.25429Zm-.06769-.04512.19446-.19446H6.3024l-.19445.19446Zm-.04512-.06769.25428-.10471v-.00001l-.25428.10472Zm-.01563-.07983-.27499-.00195-.00001.00082.275.00113Zm.00293-.413603.27502.001951L6.32513.81005l-.275.001127Zm.01563-.079833L5.81148.626625v.000004l.25428.104715Zm.04512-.067685L5.91643.469203v.000003l.19445.194453Zm.06769-.045125L6.07385.364252l.10472.254282ZM6.2584.602909 6.25728.87791l.00135-.000001-.00023-.275ZM9.85762.599976l-.00017-.275H9.8574l.00022.275Zm.21998.090934.1945-.194455-.0002-.000172-.1943.194627Zm.1115.111467.1967-.192197-.0023-.002257-.1944.194454Zm.0909.220003.275.00022v-.003l-.275.00278Zm-.0029 3.59922-.275-.00022v.00135l.275-.00113Zm-.0156.07983-.2543-.10472v.00001l.2543.10471Zm-.0452.06769-.1944-.19446.1944.19446Zm-.1475.06075.0012-.275h-.0012v.275Zm-.41651 0v-.27502l-.00281.00003.00281.27499Zm-.0789-.01507.10394-.2546-.10394.2546Zm-.06691-.04446.19446-.19445-.00001-.00001-.19445.19446Zm-.04446-.0669.25461-.10394-.00001-.00001-.2546.10395Zm-.01506-.07891.27499.00282.00001-.00251-.275-.00031Zm.00293-2.60775.275.00031.00075-.66496-.47021.4702.19446.19445ZM4.70666 6.76001l.19159.19733.00286-.00287-.19445-.19446Zm-.19885-.19018-2.6856 2.6856.38891.38891 2.6856-2.6856-.38891-.38891ZM2.01697 9.72488l2.60775-.00293-.00062-.55-2.60775.00293.00062.55Zm2.60857-.00293c-.00893.00003-.01777-.0017-.02601-.00509l.20943-.50857c-.05888-.02425-.12198-.0366-.18568-.03634l.00226.55Zm-.02601-.00509c-.00825-.0034-.01575-.0084-.02205-.0147l.3889-.38892c-.04503-.04503-.09853-.0807-.15742-.10495l-.20943.50857Zm-.02206-.01471c-.00631-.00631-.0113-.0138-.0147-.02205l.50857-.20943c-.02425-.05889-.05992-.11239-.10495-.15742l-.38892.3889Zm-.0147-.02205c-.0034-.00825-.00512-.01709-.00509-.02601l.55.00226c.00026-.06369-.01209-.12679-.03634-.18568l-.50857.20943Zm-.00508-.02683-.00294.41363.54999.0039.00293-.41363-.54998-.0039Zm-.00294.41663c-.00004-.0089.00169-.0177.00509-.026l.50856.2095c.02425-.0589.0366-.122.03634-.1857l-.54999.0022Zm.00509-.026c.0034-.0082.00839-.0157.0147-.022l.38891.3889c.04503-.045.0807-.0985.10495-.1574l-.50856-.2095Zm.01471-.022c.0063-.0063.01379-.0113.02205-.0147l.20943.5085c.05889-.0242.11239-.0599.15742-.1049l-.3889-.3889Zm.02205-.0147c.00824-.0034.01708-.0051.02601-.0051l-.00226.55c.06369.0002.1268-.0121.18568-.0364l-.20943-.5085Zm.02465-.0051-3.59922.0029.00045.55 3.59922-.0029-.00045-.55Zm-3.59917.0029c-.00957 0-.01876-.0038-.025541-.01054l-.388568.38924c.109981.1098.259058.1714.414459.1713l-.00035-.55Zm-.025371-.01037-.111467-.11146-.388909.38893.111468.1114.388908-.38887Zm-.109222-.10919c-.008001-.00819-.012532-.01915-.012648-.0306l-.549971.00556c.001548.1532.062169.2998.169221.4094l.393398-.38436Zm-.012634-.0276.002934-3.59922-.55-.00045L.324854 9.8574l.549999.00044Zm.002932-3.60057a.0675974.0675974 0 0 1-.005091.02601l-.508565-.20943c-.024249.05888-.036601.12199-.03634.18567l.549996-.00225Zm-.005092.02601c-.003395.00825-.008392.01574-.014703.02205l-.388906-.38891c-.045036.04504-.080705.09854-.104954.15743l.508563.20943Zm-.0147.02205c-.006311.00631-.013807.01131-.022057.01471l-.209429-.50857c-.058887.02425-.112392.05992-.157426.10496l.388912.3889Zm-.022052.0147c-.008251.0034-.017093.00513-.026013.0051l.002254-.55c-.063684-.00026-.12679.01209-.185679.03634l.209438.50856Zm-.024887.0051h.416536v-.55H.811055l-.000001.55Zm.419346-.00001c-.00954.00009-.01901-.00171-.02785-.00532l.20788-.5092c-.05891-.02405-.12202-.03611-.18564-.03546l.00561.54998Zm-.02784-.00532c-.00884-.00361-.01687-.00894-.02361-.01569l.3889-.38891c-.04499-.04499-.09851-.08055-.15742-.1046l-.20787.5092Zm-.02362-.01569c-.00674-.00675-.01208-.01477-.01568-.02361l.5092-.20788c-.02405-.05891-.05962-.11243-.10461-.15742l-.38891.38891Zm-.01568-.02361c-.00361-.00884-.00542-.0183-.00532-.02784l.54997.00561c.00065-.06362-.0114-.12674-.03545-.18565l-.5092.20788Zm-.00533-.02535L1.15499 8.8629l.55.00062.00294-2.60775-.55-.00062Zm.46652 2.80252 4.74323-4.74323-.38891-.38891-4.74323 4.74323.38891.38891Zm4.74033-4.74038.0044-.00427-.38312-.39461-.0044.00427.38312.39461Zm.00729-.00712 2.6856-2.6856-.38891-.38891-2.6856 2.6856.38891.38891Zm2.49084-3.15506-2.60775.00294.00062.55 2.60775-.00294-.00062-.55Zm-2.60857.00294c.00892-.00004.01776.00169.02601.00509l-.20943.50857c.05889.02424.12199.0366.18568.03634l-.00226-.55Zm.02601.00509c.00825.0034.01575.00839.02206.0147l-.38891.38891c.04503.04503.09853.0807.15742.10496l.20943-.50857Zm.02205.0147c.00631.00631.01131.01381.01471.02206l-.50857.20943c.02425.05888.05992.11239.10496.15742l.3889-.38891Zm.01471.02205c.0034.00826.00513.0171.00509.02602l-.55-.00226c-.00026.06369.01209.12679.03635.18568l.50856-.20944Zm.00508.02684.00294-.413602-.54999-.003901-.00293.413603.54998.0039Zm.00294-.41668c.00004.00892-.00169.01776-.00509.026009l-.50856-.20943c-.02425.058887-.0366.121992-.03634.185675L6.32513.81005Zm-.00509.026013c-.0034.008247-.00839.015741-.0147.022049L5.91643.469206c-.04503.045032-.0807.098534-.10495.157419l.50856.209438Zm-.0147.022052c-.00631.006307-.0138.011304-.02205.014701L6.07385.364252c-.05889.024251-.11239.059921-.15742.104951l.38891.388912Zm-.02205.014701a.0675974.0675974 0 0 1-.02601.005091l.00225-.549996c-.06369-.000261-.12679.012091-.18568.036341l.20944.508564Zm-.02466.005093L9.85785.874976l-.00045-.55-3.59922.002933.00045.55ZM9.8578.874976c.00957-.000006.01876.003791.02554.01056l.38856-.389253c-.11-.109784-.259-.171404-.41445-.171307l.00035.55Zm.02537.010388.11147.111467.38886-.388908-.1114-.111467-.38893.388908Zm.10922.109197c.00801.008189.01251.019149.01261.030599l.55-.00556c-.0015-.153176-.0622-.29984-.1692-.409407l-.39341.384368Zm.01261.027589-.0029 3.59923.55.00044.0029-3.59922-.55-.00045Zm-.0029 3.60058c0-.00892.0017-.01777.0051-.02602l.5085.20945c.0243-.05889.0367-.122.0364-.18569l-.55.00226Zm.0051-.02601c.0034-.00825.0084-.01574.0147-.02206l.3889.38892c.045-.04504.0807-.09855.105-.15743l-.5086-.20943Zm.0147-.02206c.0063-.00631.0138-.0113.022-.0147l.2095.50857c.0589-.02425.1124-.05992.1574-.10496l-.3889-.38891Zm.022-.0147c.0083-.0034.0171-.00513.0261-.00509l-.0023.55c.0637.00026.1268-.01209.1857-.03634l-.2095-.50857Zm.0249-.00509h-.41651v.55h.41651v-.55Zm-.41932.00001c.00954-.00009.01901.00171.02785.00532l-.20789.5092c.05892.02405.12203.0361.18566.03545l-.00562-.54997Zm.02785.00532c.00883.00361.01686.00894.02361.01569l-.38892.3889c.045.045.09852.08056.15743.10461l.20788-.5092Zm.0236.01568c.00675.00675.01209.01478.0157.02362l-.50921.20787c.02405.05892.05961.11244.10461.15743l.3889-.38892Zm.01569.02361c.00361.00884.00542.01831.00532.02786l-.54997-.00563c-.00065.06363.0114.12675.03546.18566l.50919-.20789Zm.00534.02535.00293-2.60775-.55-.00061-.00293 2.60774.55.00062Zm-.46653-2.80251L4.51221 6.56556l.3889.38891 4.74323-4.74323-.38891-.38891ZM4.51509 6.56271l-.00439.00427.38313.3946.0044-.00427-.38314-.3946Z",fill:"#264966",mask:"url(#a)"})),L=()=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"76",height:"16",viewBox:"0 0 200 40"},e.createElement("g",{fill:"none","fill-rule":"nonzero"},e.createElement("path",{fill:"#4D4D4D",d:"M48.6 1c-5 0-6.8 3.5-6.8 6.8v2h-1c-.8 0-1.4.6-1.4 1.4 0 .8.6 1.4 1.4 1.4h1v13.8c0 .8.6 1.5 1.5 1.5s1.5-.6 1.5-1.5V12.5H48c.8 0 1.4-.6 1.4-1.4 0-.8-.6-1.4-1.4-1.4h-3.2v-2c0-1.8.7-4 3.9-4 .8 0 1.4-.6 1.4-1.3-.1-.8-.7-1.4-1.5-1.4zM60 9.3c-2-.1-3.8.8-5 2.4v-.8c0-.8-.6-1.5-1.5-1.5s-1.5.7-1.5 1.5v15.4c0 .8.6 1.5 1.5 1.5s1.5-.6 1.5-1.5v-8.5c0-3.6 1.9-5.7 5-5.7.8 0 1.4-.6 1.4-1.4 0-.8-.7-1.4-1.4-1.4zM77.7 16.9c0-1.7-.5-3.4-1.4-4.8-1.4-1.9-3.7-3-6.1-2.8-5.1 0-8 3.4-8 9.3 0 6.1 2.9 9.4 8.4 9.4 2.2.1 4.4-.7 6.1-2.2.3-.2.5-.6.5-1 0-.7-.6-1.3-1.3-1.3-.3 0-.6.1-.8.3-1.2 1-2.8 1.6-4.4 1.6-3.3 0-5.4-2.2-5.5-5.7H76c1.7-.2 1.7-1.8 1.7-2.8zm-7.4-5c3 0 4.5 1.7 4.6 5h-9.7c.3-3.2 2.1-5 5.1-5zM87.5 17.1c-2.2-.8-4-1.4-4-3 0-1.8 2-2 3.1-2 1.5-.1 3 .5 4 1.5.5.5 1.4.5 1.9 0 .3-.3.4-.6.4-1 0-.3-.1-.6-.3-.9-1.5-1.7-3.7-2.7-5.9-2.5-3.7 0-6 1.9-6 4.8 0 3.6 3.2 4.7 6 5.7 2.1.7 4 1.3 4 2.9 0 2.1-2.4 2.5-3.8 2.5-1.7.1-3.4-.6-4.6-1.8-.3-.3-.6-.4-1-.5-.7 0-1.3.6-1.3 1.3 0 .3.1.6.3.9 1.7 2 4.1 3 6.6 3 4.2 0 6.7-2 6.7-5.2-.2-3.7-3.3-4.7-6.1-5.7zM104.8 9.2c-1.8-.1-3.6.7-4.8 2.1V1.5c0-.8-.6-1.5-1.5-1.5-.8 0-1.4.6-1.4 1.5v24.8c0 .8.6 1.5 1.4 1.5.8 0 1.5-.6 1.5-1.5V17c0-3.4 1.6-5.1 4.8-5.1 3.2 0 4.3 1.4 4.3 4.8v9.6c0 .8.6 1.5 1.5 1.5.8 0 1.4-.6 1.4-1.5V16.2c0-4.6-2.4-7-7.2-7zM136.2 9.5c-.6 0-1.2.4-1.4 1l-4.2 11.8-3.4-11.8c-.3-.8-1.1-1.1-1.9-.9-.4.1-.7.5-.9.9L121 22.3l-4-11.9c-.2-.6-.7-1-1.4-.9-.8 0-1.4.6-1.4 1.4 0 .2 0 .4.1.6l5.6 15.3c.2.6.7 1 1.4 1 .6 0 1.2-.4 1.4-1l3.3-11.2 3.3 11.2c.2.6.8 1 1.4 1 .6 0 1.2-.4 1.4-1l5.6-15.3c.1-.2.1-.4.1-.6-.2-.8-.8-1.4-1.6-1.4zM146.8 9.2c-5.3 0-8.2 3.3-8.2 9.3 0 6 2.9 9.4 8.2 9.4 5.3 0 8.2-3.3 8.2-9.4 0-6.1-2.9-9.3-8.2-9.3zm0 16c-3.5 0-5.3-2.2-5.3-6.7s1.8-6.7 5.3-6.7 5.2 2.3 5.2 6.7-1.7 6.8-5.2 6.7zM166.2 9.3c-2-.1-3.8.8-5 2.4v-.8c0-.8-.6-1.5-1.4-1.5-.8 0-1.5.6-1.5 1.4v15.4c0 .8.6 1.5 1.4 1.5.8 0 1.5-.6 1.5-1.4v-8.5c0-3.6 1.9-5.7 5-5.7.8 0 1.4-.6 1.4-1.4 0-.8-.6-1.4-1.4-1.4zM177.3 16.9l6-4.8c.4-.3.6-.7.6-1.2 0-.8-.6-1.4-1.4-1.4-.4 0-.7.1-1 .4l-8.6 7V1.5c0-.8-.6-1.5-1.4-1.5-.8 0-1.5.6-1.5 1.4v24.8c0 .8.6 1.5 1.4 1.5.8 0 1.5-.6 1.5-1.4v-6l2-1.6 6.6 8.4c.3.4.8.7 1.2.7.8 0 1.4-.6 1.4-1.4 0-.3-.1-.7-.3-.9l-6.5-8.6zM193.7 17.1c-2.2-.8-4-1.4-4-3 0-1.8 2-2 3.1-2 1.5-.1 3 .5 4 1.5.3.3.6.4 1 .4.7-.1 1.2-.7 1.2-1.4 0-.3-.1-.6-.3-.9-1.5-1.7-3.7-2.7-5.9-2.5-3.7 0-6 1.9-6 4.8 0 3.6 3.2 4.7 6 5.7 2.1.7 4 1.3 4 2.9 0 2.1-2.4 2.5-3.8 2.5-1.7.1-3.4-.6-4.6-1.8-.3-.3-.6-.4-1-.5-.7 0-1.3.6-1.3 1.3 0 .3.1.6.3.9 1.7 1.9 4.1 2.9 6.7 2.8 4.2 0 6.7-2 6.7-5.2-.2-3.5-3.3-4.5-6.1-5.5z"}),e.createElement("path",{fill:"#9B65C3",d:"M.2 25.5C.7 29.1 2.4 32.4 5 35l5.8-5.8c0-6.1 3.2-11.7 8.5-14.8L.2 25.5z"}),e.createElement("path",{fill:"#9B65C3",d:"M10.8 29.2c-3 0-5.9-.8-8.5-2.3-.7-.4-1.4-.9-2.1-1.4.5 3.6 2.2 6.9 4.8 9.5l5.8-5.8z"}),e.createElement("path",{fill:"#BE63C5",d:"M10.8 29.2L5 35c2.6 2.6 5.9 4.3 9.5 4.8l11-19.1c-3 5.2-8.6 8.5-14.7 8.5z"}),e.createElement("path",{fill:"#BF63C6",d:"M13.1 37.7c-1.5-2.6-2.3-5.5-2.3-8.5L5 35c2.6 2.6 5.9 4.3 9.5 4.8-.5-.7-1-1.4-1.4-2.1z"}),e.createElement("path",{fill:"#3278B1",d:"M32.5 6.8l-13.2 7.6c-5.3 3-11.7 3-17 0C.8 17 0 20 0 23c0 .8.1 1.7.2 2.5.7.5 1.4 1 2.1 1.4 2.6 1.5 5.5 2.3 8.5 2.3l22-22c-.1-.1-.2-.2-.3-.4z"}),e.createElement("path",{fill:"#3278B2",d:"M2.3 26.9c2.6 1.5 5.5 2.3 8.5 2.3 0-6.1 3.2-11.7 8.5-14.8L.2 25.4c.7.6 1.4 1.1 2.1 1.5z"}),e.createElement("path",{fill:"#45A4EC",d:"M2.3 14.4C.8 17 0 20 0 23c0 .8.1 1.7.2 2.5l19.1-11.1c-5.2 3.1-11.7 3.1-17 0z"}),e.createElement("path",{fill:"#19BB7D",d:"M32.8 7.2c-.3-.3-.5-.5-.8-.7-.6-.4-1.4-.6-2.1-.6H17c-6.1 0-11.7 3.3-14.7 8.5 5.3 3 11.7 3 17 0-5.3 3-8.5 8.7-8.5 14.8 6.1 0 11.7-3.2 14.8-8.5l7.6-13.2c-.2-.1-.3-.2-.4-.3z"}),e.createElement("path",{fill:"#08C7FB",d:"M19.3 14.4l13.2-7.6c-.2-.1-.3-.3-.5-.4l-29.7 8c5.3 3.1 11.8 3.1 17 0z"}),e.createElement("path",{fill:"#59F2F6",d:"M29.8 5.9H17c-6.1 0-11.7 3.3-14.7 8.5l29.7-8c-.7-.3-1.4-.5-2.2-.5z"}),e.createElement("path",{fill:"#DA3757",d:"M25.6 20.7l7.6-13.2c-.1-.1-.2-.2-.3-.4l-22 22c0 3 .8 5.9 2.3 8.5.4.7.9 1.4 1.4 2.1.8.1 1.6.2 2.4.2 3 0 5.9-.8 8.5-2.3-3-5.2-3-11.7.1-16.9z"}),e.createElement("path",{fill:"#D33C4E",d:"M10.8 29.2c0 3 .8 5.9 2.3 8.5.4.7.9 1.4 1.4 2.1l11-19.1c-3 5.2-8.6 8.5-14.7 8.5z"}),e.createElement("path",{fill:"#EE5A24",d:"M25.6 20.7l-11 19.1c.8.1 1.6.2 2.5.2 3 0 5.9-.8 8.5-2.3-3.1-5.3-3.1-11.8 0-17z"}),e.createElement("path",{fill:"#8BDF55",d:"M33.5 8c-.3-.5-.6-.9-1-1.2l-13.2 7.6c-5.3 3-8.5 8.7-8.5 14.8 6.1 0 11.7-3.2 14.8-8.5-3 5.3-3 11.7 0 17 5.2-3 8.5-8.6 8.5-14.6V10.2c0-.8-.2-1.5-.6-2.2z"}),e.createElement("path",{fill:"#25C16F",d:"M32.5 6.8l-13.2 7.6c-5.3 3-8.5 8.7-8.5 14.8l22-22c-.1-.1-.2-.3-.3-.4z"}),e.createElement("path",{fill:"#8BDF55",d:"M10.8 29.2c6.1 0 11.7-3.2 14.8-8.5l7.6-13.2c-.1-.1-.2-.2-.3-.4L10.8 29.2z"}),e.createElement("path",{fill:"#FB0",d:"M33.2 7.5l-7.6 13.2c-3 5.3-3 11.7 0 17l8-29.7c-.2-.2-.3-.3-.4-.5z"}),e.createElement("path",{fill:"#FFA800",d:"M25.6 37.7c5.3-3 8.5-8.6 8.5-14.7V10.2c0-.8-.2-1.5-.6-2.2l-7.9 29.7z"}))),D=({question:n,formValues:t,othersMeta:r,onChangeHandler:o,saveOthersValue:i,autoFocus:s,autoFocusDelay:a,isFinalQn:c})=>{switch(n.type_info.question_type){case"RANGE":return e.createElement(m,{type_info:n.type_info,onChangeHandler:o,npsValue:t[n.name]});case"CHECKBOX":case"MULTI_SELECT":return e.createElement(k,{name:n.name,autoFocusGroup:s,values:t[n.name],othersValue:r[n.name],options:n.type_info.choices,onChangeHandler:o,saveOthersValue:i,othersOption:n.type_info.meta?.othersOption,othersRequired:n.type_info.meta?.othersRequired,autoFocusDelay:a});case"RADIO":case"DROPDOWN":return e.createElement(q,{autoFocusGroup:s,autoFocusDelay:a,name:n.name,onChangeHandler:o,saveOthersValue:i,options:n.type_info.choices,value:t[n.name],othersValue:r[n.name],othersOption:n.type_info.meta?.othersOption,othersRequired:n.type_info.meta?.othersRequired,isFinalQn:c});case"INPUT":case"TEXT":return n.type_info?.meta?.readOnly?e.createElement("div",{className:"message-container"},n.type_info?.meta?.value):e.createElement("div",{className:"responsive-text-field"},e.createElement(x,{autoFocusInput:s,autoFocusDelay:a,label:"",isRequired:n.is_required,value:t[n.name]||"",placeholder:n.type_info?.meta?.placeholder??"",onChange:e=>o(e.target.value)}),e.createElement(b,{autoFocusInput:s,autoFocusDelay:a,label:"",maxLength:256,isRequired:n.is_required,placeholder:n.type_info?.meta?.placeholder??"",value:t[n.name]||"",onChange:e=>o(e.target.value)}));case"PARAGRAPH":return e.createElement(b,{autoFocusInput:s,autoFocusDelay:a,label:"",isRequired:n.is_required,placeholder:n.type_info?.meta?.placeholder??"",value:t[n.name]||"",onChange:e=>o(e.target.value)});default:return console.error(`Question type ${n.type_info.question_type} not found`),null}},F=(e,n,t)=>{if(e){let r={};t&&(r={"{{nps.rating}}":t}),n&&(r={...r,...n});const o=new RegExp(Object.keys(r).join("|"),"gi");e=e.replace(o,(function(e){return r[e.toLowerCase()]}))}return e},Q=e=>({...e.brand_color&&{"--brand-color":e.brand_color},...e.body_background_color&&{"--background-color":e.body_background_color},...e.secondary_button_color&&{"--secondary-button-color":e.secondary_button_color},...e.question_background_color&&{"--question-background-color":e.question_background_color},...e.primary_button_text_color&&{"--button-text-color":e.primary_button_text_color},...e.secondary_button_text_color&&{"--secondary-button-text-color":e.secondary_button_text_color},...e.question_text_color&&{"--question-text-color":e.question_text_color}}),R=e=>o((()=>{const n=JSON.parse(JSON.stringify(e)),t=[];return(n.question_details?.questions||[]).forEach((e=>{const n=e.type_info?.meta?.block;n&&(n.question_names||(n.question_names=[e.name]),t.push(n))})),{...n,meta:{...n.meta,blocks:t}}}),[e]);l(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #3a4b67;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 560px;\n --default-widget-max-height: 400px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-components.card-survey-style {\n padding: 20px 0;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation {\n white-space: nowrap;\n border-radius: 3px;\n border: 1px solid #efefef;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button svg {\n transform: rotate(90deg);\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #efefef;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n.freemium-survey-components.card-survey-style .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 200ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n transition: opacity 50ms ease-out;\n overflow: auto;\n}\n.freemium-survey-components.card-survey-style .hide-question-container {\n opacity: 0;\n}\n.freemium-survey-components.card-survey-style .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components.card-survey-style .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components.card-survey-style .fade-enter .question-container {\n opacity: 0;\n transform: translateY(15px);\n}\n.freemium-survey-components.card-survey-style .fade-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-exit-active .question-container {\n opacity: 0.05;\n transform: translateY(-15px);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-enter .question-container {\n opacity: 0;\n transform: translateY(-15px);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-enter-active .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-exit .question-container {\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.card-survey-style .fade-reverse-exit-active .question-container {\n opacity: 0.05;\n transform: translateY(15px);\n}\n.freemium-survey-components.card-survey-style .fade-enter-active .question-container,\n.freemium-survey-components.card-survey-style .fade-exit-active .question-container,\n.freemium-survey-components.card-survey-style .fade-reverse-enter-active .question-container,\n.freemium-survey-components.card-survey-style .fade-reverse-exit-active .question-container {\n transition: opacity 200ms, transform 200ms;\n}\n.freemium-survey-components.card-survey-style .question-footer {\n display: flex;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components.card-survey-style .question-footer:empty {\n display: none;\n}\n.freemium-survey-components.card-survey-style .question-footer:only-child {\n margin-left: auto;\n}\n.freemium-survey-components.card-survey-style .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n width: 100%;\n}\n.freemium-survey-components.card-survey-style .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components.card-survey-style .skip-button {\n font-weight: 500;\n color: #3a4b67;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components.card-survey-style .skip-button:hover {\n background-color: #f3f3f3;\n transform: translateY(-4px);\n}\n.freemium-survey-components.card-survey-style .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.card-survey-style .submit {\n max-width: 700px;\n text-align: left;\n background: transparent;\n box-shadow: none;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.card-survey-style .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components.card-survey-style .thankyou .heading {\n font-weight: 500;\n font-size: 22px;\n}\n.freemium-survey-components.card-survey-style .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #475867;\n width: 75%;\n}\n.freemium-survey-components.card-survey-style .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components.card-survey-style .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components.card-survey-style .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components.card-survey-style .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components.card-survey-style .message-container:empty {\n display: none;\n}\n\n@media (max-width: 550px) {\n div.freemium-survey-components.card-survey-style .responsive-text-field .input-container {\n display: none;\n }\n div.freemium-survey-components.card-survey-style .responsive-text-field .textarea-container {\n display: flex;\n }\n div.freemium-survey-components.card-survey-style .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n }\n div.freemium-survey-components.card-survey-style .question-footer {\n flex-direction: column-reverse;\n }\n div.freemium-survey-components.card-survey-style .question-footer > *:first-child {\n margin-bottom: 0px;\n }\n div.freemium-survey-components.card-survey-style .question-footer > * {\n margin-bottom: 20px;\n }\n div.freemium-survey-components.card-survey-style .freemium-survey-step-navigation {\n width: 100%;\n }\n div.freemium-survey-components.card-survey-style .freemium-survey-step-navigation .navigation-button {\n width: 50%;\n }\n div.freemium-survey-components.card-survey-style .action-buttons {\n flex-direction: column;\n width: 100%;\n }\n div.freemium-survey-components.card-survey-style .action-buttons button {\n max-width: unset;\n }\n div.freemium-survey-components.card-survey-style .action-button {\n max-width: unset;\n width: 100%;\n }\n div.freemium-survey-components.card-survey-style .thankyou .text {\n width: auto;\n }\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .responsive-text-field .input-container {\n display: none;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .responsive-text-field .textarea-container {\n display: flex;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .question-footer {\n flex-direction: column-reverse;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .question-footer > *:first-child {\n margin-bottom: 0px;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .question-footer > * {\n margin-bottom: 20px;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .freemium-survey-step-navigation {\n width: 100%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .freemium-survey-step-navigation .navigation-button {\n width: 50%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .action-buttons {\n flex-direction: column;\n width: 100%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .action-buttons button {\n max-width: unset;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .action-button {\n max-width: unset;\n width: 100%;\n}\ndiv.freemium-survey-components.card-survey-style.mobile-preview .thankyou .text {\n width: auto;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const W=({thankYouQuestion:n,preview:t,placeholders:o,npsValue:i})=>(r((()=>{t||n.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=n.type_info.meta?.redirectUrl}),1e3*n.type_info.meta?.redirectDelay??1e4)}),[]),e.createElement("div",{className:"question-container thankyou"},e.createElement("div",{className:"heading"},"Thank you!"),e.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:F(n.text,o,i)}}),n.type_info.meta?.redirectUrl&&e.createElement("div",{style:{width:"100%"}},e.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",n.type_info.meta?.redirectDelay," seconds.",e.createElement("br",null)),e.createElement("a",{className:"link",href:n.type_info.meta?.redirectUrl},n?.type_info.meta?.redirectUrl)))),T=({currentBlockIndex:n,currentBlockIndexOfBlocksWithQns:t,setCurrentBlockIndexOfBlocksWithQnsDirty:r,blocksWithQns:o,blocks:i,setHorizontalScrollUnits:s,preventQuestionAnimation:a,tempCurrentBlockIndexOfBlocksWithQns:c,setReverse:u,reverse:l})=>e.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},e.createElement("button",{disabled:0==t.current,className:"navigation-button",onClick:()=>{l?(t.current=Math.max(t.current-1,0),n.current=i.findIndex((e=>e.name===o[t.current].name))):(c.current=Math.max(t.current-1,0),n.current=i.findIndex((e=>e.name===o[c.current].name))),a.current=!1,r.current=!0,u(!0),s({})}},e.createElement(O,null)),e.createElement("button",{className:"navigation-button",disabled:t.current>=o.length-1,onClick:()=>{a.current=!1,l?(c.current=Math.min(t.current+1,o.length-1),n.current=i.findIndex((e=>e.name===o[c.current].name))):(t.current=Math.min(t.current+1,o.length-1),n.current=i.findIndex((e=>e.name===o[t.current].name))),r.current=!0,u(!1),s({})}},e.createElement(I,null))),V=({widget:n,surveyStyle:t,formValues:r,blocksWithQns:o,blocks:i,thankYouQuestion:s,currentBlockIndexOfBlocksWithQns:a,currentBlockIndexOfBlocks:c,currentEditingBlock:u,isSubmitting:l,isValuesCommitted:m,isCurrentBlockFinal:d,setHorizontalScrollUnits:f,handleFormValues:y,skipBlock:v,setIsSubmitting:h,onSubmit:g,setIsSurveyCompleted:x,preventQuestionAnimation:b,preview:w,closePreview:k,setReverse:_,tempCurrentBlockIndexOfBlocksWithQns:q,question:E,block:C,reverse:N,othersMeta:B,setCurrentBlockIndexOfBlocksWithQnsDirty:I,...O})=>{const Z=O.blockIndex??a.current,S=()=>(!p.includes(E.type_info.question_type)||"DROPDOWN"===E.type_info.question_type&&"__others__"===r[E.name])&&!d(),M=()=>"RANGE"!==E.type_info.question_type&&!C.required&&!d(),L=()=>("DROPDOWN"===E.type_info.question_type&&!C.required&&r[E.name],!1),D=()=>d()&&(n||"standard"!==t),F=("MULTI_SELECT"===u.current.question.type_info.question_type&&r[u.current.question.name]?.includes("__others__")||"DROPDOWN"===u.current.question.type_info.question_type&&"__others__"===r[u.current.question.name])&&(!B[u.current.question.name]||""===B[u.current.question.name].trim());return e.createElement("div",{className:"question-footer"},!(!n&&"standard"===t||0===Z&&void 0===r[E.name]||0===a.current&&!N)&&e.createElement(T,{currentBlockIndex:c,currentBlockIndexOfBlocksWithQns:a,blocksWithQns:o,blocks:i,setHorizontalScrollUnits:f,preventQuestionAnimation:b,setReverse:_,tempCurrentBlockIndexOfBlocksWithQns:q,reverse:N,setCurrentBlockIndexOfBlocksWithQnsDirty:I}),(S()||L()||M()||D())&&e.createElement("div",{className:"action-buttons"},S()&&e.createElement(z,{onClick:()=>{I.current=!1,_(!1),y(o[Z],null,!0)},disabled:u.current.required&&(!r[u.current.question.name]||Array.isArray(r[u.current.question.name])&&0===r[u.current.question.name].length)||u.current.question.type_info.meta?.othersRequired&&F,className:"next-button"},"Next"),M()&&e.createElement("button",{className:"skip-button",onClick:()=>{I.current=!1,_(!1),v(E)}},"Skip"),D()&&e.createElement("div",{className:"submit"},e.createElement(z,{disabled:(u.current.required||u.current.question.type_info.pivot_question)&&(null==r[u.current.question.name]||0===r[u.current.question.name]?.length)||u.current.question.type_info.meta?.othersRequired&&F||l,onClick:()=>{h(!0),g()}},l?"Submitting":"Submit survey")),L()&&e.createElement("button",{className:"skip-button",onClick:()=>{_(!1),u.current=o[Z],c.current=i.findIndex((e=>e.name===o[Z].name)),v(E)}},"Clear selection")))},H=({survey:t,surveyStyle:o="standard",placeholders:c,onSubmit:u,widget:l,npsValue:m,preview:d,mobilePreview:f,closePreview:y})=>{const v=t.question_details?.questions||[],h=t.meta?.blocks||[],[g,x]=i(null),[b,w]=i({}),[k,_]=i(!1),[q,E]=i([]),[N,B]=i({}),[z,I]=i(!1),[O,Z]=i(null),[S,M]=i({}),L=n(null),Q=n(null),R=n(-1),T=n(null),H=n(0),Y=n(0),P=n(!1),$=n(!1),A=n([]),U=e.useRef(null!=m&&"card"===o),j=n(null),G=n(0),[X,K]=i(!1),J=n();r((()=>{h&&(j.current=h.find((e=>"TY"===e.name)),x(h.filter((e=>"TY"!==e.name))))}),[h]),r((()=>{P.current&&(Y.current=G.current,B({}))}),[X]),r((()=>{if(g)if(Q.current=v.find((e=>e.type_info?.pivot_question))??v.find((e=>"RANGE"===e.type_info?.question_type))??v[0],null!=m){R.current=Math.min(Q.current.type_info.validation.max,Math.max(Q.current.type_info.validation.min,m));const e=v.find((e=>e.name===g[0].question_names[0]));L.current={...g[0],question:e},A.current=[...A.current,{...g[0],question:e}],E(A.current),w({Q_1:R.current})}else if(!L.current&&g.length>0)return L.current=g[0],void te(g[0])}),[g,m]),e.useEffect((()=>{q.length&&(A.current=q,Y.current=q.length-1),B({})}),[q]),r((()=>{Object.keys(b).length>0&&L.current.question&&(p.includes(L.current.question.type_info.question_type)&&("DROPDOWN"!==L.current.question.type_info.question_type||"__others__"!==b[L.current.question.name])||$.current)&&!ne()&&(null!=m&&1==q.length?J.current?(clearTimeout(J.current),J.current=null,re()):J.current=setTimeout((()=>{re()}),1500):re())}),[b]),r((()=>{if(null!=b?.[Q.current?.name])if(j.current?.is_based_on_rating){const e=Q.current?.type_info?.choices[b?.[Q.current?.name]-Q.current?.type_info?.validation?.min??0]?.dependent_question_names,n=j.current?.question_names.find((n=>e?.includes(n))),t=v.find((e=>e.name===n));Z(t)}else{const e=v.find((e=>e.name==j.current?.question_names[0]));Z(e)}}),[b?.[Q.current?.name]]);const ee=()=>{u({...b,others_meta:S},(()=>{O?.type_info.meta?.skipThankYouPage?d?setTimeout((()=>{y?.()}),300):window.location.href=O?.type_info.meta?.redirectUrl:_(!0)}))},ne=()=>(H.current===g.length-1||"end"===L.current.branchOption)&&Y.current===q.length-1,te=e=>{let n={};if(e.is_based_on_rating){const t=Q.current?.type_info?.choices[b?.[Q.current?.name]-Q.current?.type_info?.validation?.min??0]?.dependent_question_names,r=e.question_names.find((e=>t?.includes(e)));n=v.find((e=>e.name===r))}else n=v.find((n=>n.name===e.question_names[0]));L.current.question=n;A.current.find((e=>e.question.name===n.name))?(Y.current+=1,B({})):E([...A.current,{...e,question:n}])},re=()=>{if(ne())_(!0);else{if(L.current.nextBlock)H.current=g.findIndex((e=>e.name===L.current.nextBlock));else if(L.current.question.type_info?.meta?.branches){const e=L.current.question.type_info?.meta?.branches,n=b[L.current.question.name];let t;if(t="RANGE"===L.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return ee(),void _(!0);H.current=g.findIndex((e=>e.name===t.nextBlock))}else H.current+=1}else H.current+=1;L.current=g[H.current],te(g[H.current])}},oe=(e,n,t)=>{if(U.current=!1,t){if($.current=!0,null!=b[e.question.name]&&e.name!==q[q.length-1].name){const[t,r]=(e=>{const n=q.findIndex((n=>n.name===e.name)),t=q.slice(0,n+1),r=t.reduce(((e,n)=>(e[n.question.name]=b[n.question.name],e)),{});return H.current=g.findIndex((n=>n.name===e.name)),[t,r]})(e);w({...r,...null!=n&&{[e.question.name]:n}}),A.current=t}else w({...b,...null!=n&&{[e.question.name]:n}});Q?.current?.name==e?.question?.name&&(R.current=n)}else w({...b,...null!=n&&{[e.question.name]:n}})};if(!L.current||!L.current.question)return null;const ie=q[Math.min(Y.current??q.length-1,q.length-1)];return e.createElement("div",{className:`freemium-survey-components ${f?"mobile-preview":""} ${o}-survey-style`,id:"freemium-survey"},k?null:e.createElement(C,{totalSteps:g.length,completedSteps:H.current+(k?1:0)}),e.createElement(s,{mode:"out-in"},e.createElement(a,{key:Y.current+String(k),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:X?"fade-reverse":"fade"},e.createElement("div",{className:"questions"},k?e.createElement(W,{thankYouQuestion:O,preview:d,placeholders:c,npsValue:R.current}):e.createElement("div",{ref:T,id:`${ie.question.name}`,className:`question-container ${l||"card"===o}`,"data-test-question-name":ie.question.name},e.createElement("div",{className:"question-text",dangerouslySetInnerHTML:{__html:F(ie.question.text,c,R.current)},"aria-label":`question-${Y.current}`,role:"heading","aria-level":1}),e.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:{width:"100%"}},e.createElement(D,{question:ie.question,isFinalQn:ne(),formValues:b,othersMeta:S,autoFocus:!0,autoFocusDelay:"standard"===o?350:0,saveOthersValue:(e,n)=>{if(null===n){const n={...S};delete n[e],M({...n})}else M({...S,[e]:n})},onChangeHandler:e=>{$.current=!1,H.current=g.findIndex((e=>e.name===ie.name)),L.current=ie,P.current=!1,K(!1),oe(ie,e,!("DROPDOWN"===ie.question.type_info.question_type&&"__others__"===e)&&p.includes(ie.question.type_info.question_type)&&!ne())}})),e.createElement(V,{question:ie.question,block:ie,widget:l,surveyStyle:o,formValues:b,othersMeta:S,blocksWithQns:q,blocks:g,thankYouQuestion:O,currentBlockIndexOfBlocksWithQns:Y,reverse:X,setReverse:K,currentBlockIndexOfBlocks:H,currentEditingBlock:L,isSubmitting:z,isValuesCommitted:$,isCurrentBlockFinal:ne,setHorizontalScrollUnits:B,handleFormValues:oe,skipBlock:e=>{$.current=!0,delete b[e.name],w({...b})},setIsSubmitting:I,onSubmit:ee,setIsSurveyCompleted:_,preventQuestionAnimation:U,preview:d,closePreview:y,tempCurrentBlockIndexOfBlocksWithQns:G,setCurrentBlockIndexOfBlocksWithQnsDirty:P}))))))};l(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #3a4b67;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n}\n\n.freemium-survey-components.widget-survey-components {\n overflow: hidden;\n}\n.freemium-survey-components.widget-survey-components * {\n scrollbar-color: rgba(216, 216, 216, 0.5) transparent !important;\n}\n.freemium-survey-components.widget-survey-components * ::-webkit-scrollbar {\n height: auto;\n height: initial;\n width: 6px;\n}\n.freemium-survey-components.widget-survey-components * ::-webkit-scrollbar-track {\n background: transparent !important;\n}\n.freemium-survey-components.widget-survey-components * ::-webkit-scrollbar-thumb {\n border-radius: 5px;\n background: rgba(216, 216, 216, 0.5) !important;\n}\n.freemium-survey-components.widget-survey-components p {\n margin: 0;\n}\n.freemium-survey-components.widget-survey-components .questions {\n min-width: 100%;\n max-width: 100%;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n position: relative;\n display: flex;\n justify-content: row;\n align-items: flex-end;\n height: 100%;\n transition: height 200ms ease;\n}\n.freemium-survey-components.widget-survey-components .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n text-align: center;\n max-height: 100%;\n min-width: 100%;\n max-width: 700px;\n margin: 0 auto;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n padding: 28px 0;\n padding-top: 0;\n grid-gap: 28px;\n gap: 28px;\n overflow: auto;\n}\n.freemium-survey-components.widget-survey-components .question-wrapper {\n width: 100%;\n flex-grow: 1;\n padding: 4px 28px;\n overflow: auto;\n}\n.freemium-survey-components.widget-survey-components .hide-question-container {\n opacity: 0;\n}\n.freemium-survey-components.widget-survey-components .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n padding: 0 28px;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components.widget-survey-components .question-text p {\n all: inherit;\n padding: 0;\n}\n.freemium-survey-components.widget-survey-components .nps-container .footer {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components.widget-survey-components .fade-enter {\n opacity: 1;\n transform: translateX(80px);\n position: absolute;\n}\n.freemium-survey-components.widget-survey-components .fade-enter-active {\n position: absolute;\n opacity: 1;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-enter-done {\n position: absolute;\n}\n.freemium-survey-components.widget-survey-components .fade-exit {\n opacity: 0.05;\n pointer-events: none;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-exit-active {\n pointer-events: none;\n opacity: 0;\n transform: translateX(-80px);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-enter {\n opacity: 0;\n position: absolute;\n transform: translateX(-80px);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-enter-active {\n opacity: 1;\n position: absolute;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-exit {\n opacity: 0.05;\n transform: translateX(0);\n}\n.freemium-survey-components.widget-survey-components .fade-reverse-exit-active {\n opacity: 0;\n transform: translateX(80px);\n}\n.freemium-survey-components.widget-survey-components .fade-enter-active,\n.freemium-survey-components.widget-survey-components .fade-reverse-enter-active,\n.freemium-survey-components.widget-survey-components .fade-reverse-exit-active,\n.freemium-survey-components.widget-survey-components .fade-exit-active {\n transition: opacity 200ms, transform 200ms;\n}\n.freemium-survey-components.widget-survey-components .question-footer {\n margin: 0px auto;\n display: flex;\n justify-content: space-between;\n align-items: center;\n position: -webkit-sticky;\n position: sticky;\n padding: 0 28px;\n bottom: -28px;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n}\n.freemium-survey-components.widget-survey-components .question-footer:empty {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .question-footer:only-child {\n margin-left: auto;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation {\n white-space: nowrap;\n border-radius: 3px;\n border: 1px solid #efefef;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 40px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #efefef;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-components.widget-survey-components .freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n.freemium-survey-components.widget-survey-components .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n width: 100%;\n}\n.freemium-survey-components.widget-survey-components .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .skip-button {\n font-weight: 500;\n cursor: pointer;\n color: #3a4b67;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components.widget-survey-components .skip-button:hover {\n background-color: #f3f3f3;\n transform: translateY(-4px);\n}\n.freemium-survey-components.widget-survey-components .next-button,\n.freemium-survey-components.widget-survey-components .submit {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.widget-survey-components .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components.widget-survey-components .thankyou .heading {\n font-weight: 500;\n font-size: 22px;\n}\n.freemium-survey-components.widget-survey-components .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #475867;\n width: 75%;\n}\n.freemium-survey-components.widget-survey-components .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components.widget-survey-components .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components.widget-survey-components .responsive-text-field .input-container {\n display: none;\n}\n.freemium-survey-components.widget-survey-components .responsive-text-field .textarea-container {\n display: flex;\n}\n.freemium-survey-components.widget-survey-components .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n}\n.freemium-survey-components.widget-survey-components .message-container:empty {\n display: none;\n}\n\n.freemium-survey-components.widget-survey-components.compact-style .nps-question-text {\n text-align: center;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-container {\n grid-gap: 20px;\n gap: 20px;\n max-width: 100%;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer {\n flex-direction: column-reverse;\n grid-gap: 0;\n gap: 0;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer > *:first-child {\n margin-bottom: 0px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer > * {\n margin-bottom: 20px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .compact-footer-layout {\n display: flex;\n justify-content: space-between;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .compact-footer-layout:empty {\n display: none;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .action-buttons {\n grid-gap: 32px;\n gap: 32px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .submit,\n.freemium-survey-components.widget-survey-components.compact-style .question-footer .action-button {\n max-width: unset;\n width: 100%;\n}\n.freemium-survey-components.widget-survey-components.compact-style .nps-container .footer {\n padding-top: 12px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .nps-container .choices {\n grid-gap: 10px;\n gap: 10px;\n}\n.freemium-survey-components.widget-survey-components.compact-style .thankyou .text {\n width: 95%;\n}\n\n.freemium-survey-components.widget-survey-components.default-style .question-footer {\n justify-content: space-between;\n}\n.freemium-survey-components.widget-survey-components.default-style .nps-container .footer {\n padding-top: 12px;\n}\n.freemium-survey-components.widget-survey-components.default-style .nps-container .choices {\n flex-wrap: unset;\n grid-gap: 12px;\n gap: 12px;\n}\n.freemium-survey-components.widget-survey-components.default-style .radio-group {\n flex-direction: column;\n flex-wrap: nowrap;\n}\n.freemium-survey-components.widget-survey-components.default-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n color: #3a4b67;\n}\n.freemium-survey-components.widget-survey-components.default-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.freemium-survey-components.widget-survey-components.default-style textarea {\n min-height: 84px;\n}\n.freemium-survey-components.widget-survey-components.default-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.widget-survey-components.cozy-style {\n max-width: 1000px;\n min-width: 600px;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .question-text {\n font-size: 1rem;\n text-align: left;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-question-text {\n text-align: center;\n width: 70%;\n margin: 0 auto;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .question-footer {\n justify-content: space-between;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .widget {\n display: flex;\n justify-content: center;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .button-container {\n width: 60%;\n min-width: 600px;\n margin: 0 auto;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .button-container .choices {\n justify-content: space-around;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .nps-container .footer {\n padding-top: 8px;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .action-button {\n line-height: 1.2;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .radio-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .radio-group .radio-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n color: #3a4b67;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .checkbox-group {\n flex-direction: row;\n flex-wrap: wrap;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .checkbox-group .checkbox-label {\n padding: 12px 16px;\n min-width: 160px;\n font-size: 0.9rem;\n}\n.freemium-survey-components.widget-survey-components.cozy-style textarea {\n min-height: 60px;\n}\n.freemium-survey-components.widget-survey-components.cozy-style .end-max-length {\n font-size: 0.8rem;\n font-weight: 300;\n padding: 4px;\n}\n\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const Y=({thankYouQuestion:n,preview:t,placeholders:r,npsValue:o},i)=>e.createElement(e.Fragment,null,e.createElement("div",{className:"heading"},"Thank you!"),e.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:F(n.text,r,o)}})),P=({currentBlockIndexOfBlocks:n,currentBlockIndexOfBlocksWithQns:t,blocksWithQns:r,blocks:o,setHorizontalScrollUnits:i,tempCurrentBlockIndexOfBlocksWithQns:s,setCurrentBlockIndexOfBlocksWithQnsDirty:a,setReverse:c,reverse:u})=>e.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},e.createElement("button",{disabled:0==t.current,className:"navigation-button",onClick:()=>{u?(t.current=Math.max(t.current-1,0),n.current=o.findIndex((e=>e.name===r[t.current].name))):(s.current=Math.max(t.current-1,0),n.current=o.findIndex((e=>e.name===r[s.current].name))),a.current=!0,c(!0),i({})}},e.createElement(O,null)),e.createElement("button",{className:"navigation-button",disabled:t.current>=r.length-1,onClick:()=>{u?(s.current=Math.min(t.current+1,r.length-1),n.current=o.findIndex((e=>e.name===r[s.current].name))):(t.current=Math.min(t.current+1,r.length-1),n.current=o.findIndex((e=>e.name===r[t.current].name))),a.current=!0,c(!1),i({})}},e.createElement(I,null))),$=({widget:n,widgetStyle:t,surveyStyle:r,formValues:o,blocksWithQns:i,blocks:s,thankYouQuestion:a,currentBlockIndexOfBlocksWithQns:c,currentBlockIndexOfBlocks:u,currentEditingBlock:l,isSubmitting:m,isValuesCommitted:d,isCurrentBlockFinal:f,setHorizontalScrollUnits:y,handleFormValues:v,skipBlock:h,setIsSubmitting:g,onSubmit:x,setIsSurveyCompleted:b,preview:w,closePreview:k,setReverse:_,tempCurrentBlockIndexOfBlocksWithQns:q,question:E,block:C,reverse:N,othersMeta:B,setCurrentBlockIndexOfBlocksWithQnsDirty:I,...O})=>{const Z=O.blockIndex??c.current,S=()=>!(!n&&"standard"===r||0===Z&&void 0===o[E.name]||0===c.current&&!N),M=()=>(!p.includes(E.type_info.question_type)||"DROPDOWN"===E.type_info.question_type&&"__others__"===o[E.name])&&!f(),L=()=>"RANGE"!==E.type_info.question_type&&!C.required&&!f(),D=()=>("DROPDOWN"===E.type_info.question_type&&!C.required&&o[E.name],!1),F=()=>f()&&(n||"standard"!==r),Q=("MULTI_SELECT"===l.current.question.type_info.question_type&&o[l.current.question.name]?.includes("__others__")||"DROPDOWN"===l.current.question.type_info.question_type&&"__others__"===o[l.current.question.name])&&(!B[l.current.question.name]||""===B[l.current.question.name].trim()),R="compact"===t&&L()&&S(),W=!R&&S();return e.createElement("div",{className:"question-footer"},R?e.createElement("div",{className:"compact-footer-layout"},S()&&e.createElement(P,{currentBlockIndexOfBlocks:u,currentBlockIndexOfBlocksWithQns:c,blocksWithQns:i,blocks:s,setHorizontalScrollUnits:y,setReverse:_,tempCurrentBlockIndexOfBlocksWithQns:q,setCurrentBlockIndexOfBlocksWithQnsDirty:I,reverse:N}),L()&&e.createElement("button",{className:"skip-button",onClick:()=>{_(!1),h(E)}},"Skip")):null,(M()||D()||"compact"!==t&&L()||W||F())&&e.createElement("div",{className:"action-buttons"},W&&e.createElement("div",{style:{marginRight:"auto"}},e.createElement(P,{currentBlockIndexOfBlocks:u,currentBlockIndexOfBlocksWithQns:c,blocksWithQns:i,blocks:s,setHorizontalScrollUnits:y,setReverse:_,tempCurrentBlockIndexOfBlocksWithQns:q,setCurrentBlockIndexOfBlocksWithQnsDirty:I,reverse:N})),M()&&e.createElement(z,{onClick:()=>{I.current=!1,_(!1),v(i[Z],null,!0)},disabled:l.current.required&&(!o[l.current.question.name]||Array.isArray(o[l.current.question.name])&&0===o[l.current.question.name].length)||l.current.question.type_info.meta?.othersRequired&&Q,className:"next-button"},"Next"),F()&&e.createElement(z,{className:"submit",disabled:(l.current.required||l.current.question.type_info.pivot_question)&&(null==o[l.current.question.name]||0===o[l.current.question.name]?.length)||l.current.question.type_info.meta?.othersRequired&&Q||m,onClick:()=>{x(),g(!0)}},m?"Submitting":"Submit survey"),D()&&e.createElement("button",{className:"skip-button",onClick:()=>{_(!1),l.current=i[Z],u.current=s.findIndex((e=>e.name===i[Z].name)),h(E)}},"Clear selection")))},A=({survey:t,placeholders:s,onSubmit:l,widgetStyle:m,widgetHeaderQuerySelector:d})=>{const y=t.question_details?.questions||[],v=t.meta?.blocks||[],[h,g]=i(null),[x,b]=i({}),[w,k]=i(!1),[_,q]=i([]),[E,N]=i({}),[B,z]=i(!1),[I,O]=i(null),[Z,S]=i({}),M=n(null),L=n(null),Q=n(-1),[R,W]=i(null),T=n(0),V=n(0),H=n(!1),P=n([]),A=n(null),U=n(0),[j,G]=i(!1),X=n(0),K=n(!1);r((()=>{v&&(A.current=v.find((e=>"TY"===e.name)),g(v.filter((e=>"TY"!==e.name))))}),[v]),r((()=>{K.current&&(V.current=U.current,N({}))}),[j]),r((()=>{if(h)return L.current=y.find((e=>e.type_info?.pivot_question))??y.find((e=>"RANGE"===e.type_info?.question_type))??y[0],!M.current&&h.length>0?(M.current=h[0],void ne(h[0])):void 0}),[h]),r((()=>{_.length&&(P.current=_,V.current=_.length-1,N({}))}),[_]),r((()=>{Object.keys(x).length>0&&M.current.question&&(p.includes(M.current.question.type_info.question_type)&&("DROPDOWN"!==M.current.question.type_info.question_type||"__others__"!==x[M.current.question.name])||H.current)&&!ee()&&te()}),[x]),r((()=>{if(null!=x?.[L.current?.name])if(A.current?.is_based_on_rating){const e=L.current?.type_info?.choices[x?.[L.current?.name]-L.current?.type_info?.validation?.min??0]?.dependent_question_names,n=A.current?.question_names.find((n=>e?.includes(n))),t=y.find((e=>e.name===n));O(t)}else{const e=y.find((e=>e.name==A.current?.question_names[0]));O(e)}}),[x?.[L.current?.name]]);o((()=>{(()=>{if(R){R.style.minHeight="unset",R.style.maxHeight="unset",R.style.height="min-content",R.style.position="static";const e=Math.min(R?.scrollHeight+2,f[m]);R.style.height=e+"px",R.style.minHeight=e+"px",X.current=e}})()}),[R]);const J=()=>{l({...x,others_meta:Z},(()=>{k(!0)}))},ee=()=>(T.current===h.length-1||"end"===M.current.branchOption)&&V.current===_.length-1,ne=e=>{let n={};if(e.is_based_on_rating){const t=L.current?.type_info?.choices[x?.[L.current?.name]-L.current?.type_info?.validation?.min??0]?.dependent_question_names,r=e.question_names.find((e=>t?.includes(e)));n=y.find((e=>e.name===r))}else n=y.find((n=>n.name===e.question_names[0]));M.current.question=n;P.current.find((e=>e.question.name===n.name))?(N({}),V.current+=1):q([...P.current,{...e,question:n}])},te=()=>{if(ee())k(!0);else{if(M.current.nextBlock)T.current=h.findIndex((e=>e.name===M.current.nextBlock));else if(M.current.question.type_info?.meta?.branches){const e=M.current.question.type_info?.meta?.branches,n=x[M.current.question.name];let t;if(t="RANGE"===M.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return J(),void k(!0);T.current=h.findIndex((e=>e.name===t.nextBlock))}else T.current+=1}else T.current+=1;M.current=h[T.current],ne(h[T.current])}},re=(e,n,t)=>{if(t){if(H.current=!0,null!=x[e.question.name]&&e.name!==_[_.length-1].name){const[t,r]=(e=>{const n=_.findIndex((n=>n.name===e.name)),t=_.slice(0,n+1),r=t.reduce(((e,n)=>(e[n.question.name]=x[n.question.name],e)),{});return T.current=h.findIndex((n=>n.name===e.name)),[t,r]})(e);b({...r,...null!=n&&{[e.question.name]:n}}),P.current=t}else b({...x,...null!=n&&{[e.question.name]:n}});L?.current?.name==e?.question?.name&&(Q.current=n)}else b({...x,...null!=n&&{[e.question.name]:n}})};if(!M.current||!M.current.question)return null;const oe=_[Math.min(V.current??_.length-1,_.length-1)];return e.createElement("div",{className:`freemium-survey-components widget-survey-components\n ${m}-style `,id:"freemium-survey"},d&&!w&&document.querySelector(d)?u.createPortal(e.createElement(C,{totalSteps:h.length,completedSteps:T.current+(w?1:0),widget:!0}),document.querySelector(d)):null,e.createElement("div",{className:"questions",style:{height:X.current,...1===_.length?{transition:"none"}:{}}},e.createElement(c,{component:null},e.createElement(a,{key:oe.question.name+String(w),unmountOnExit:!0,addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:j?"fade-reverse":"fade"},e.createElement("div",{ref:e=>e?W(e):null,id:`${oe.question.name}`,className:"question-container "+(w?"thankyou":""),"data-test-question-name":oe.question.name},w?e.createElement(Y,{thankYouQuestion:I,placeholders:s,npsValue:Q.current,setBlockElementRef:W}):e.createElement(e.Fragment,null,e.createElement("div",{className:"question-text "+("RANGE"===oe.question.type_info.question_type?"nps-question-text":""),dangerouslySetInnerHTML:{__html:F(oe.question.text,s,Q.current)},"aria-label":`question-${V.current}`,role:"heading","aria-level":1}),e.createElement("div",{className:"question-wrapper",onTransitionEndCapture:e=>e.stopPropagation()},e.createElement(D,{question:oe.question,isFinalQn:ee(),formValues:x,othersMeta:Z,autoFocus:!0,autoFocusDelay:0,saveOthersValue:(e,n)=>{if(null===n){const n={...Z};delete n[e],S({...n})}else S({...Z,[e]:n})},onChangeHandler:e=>{H.current=!1,T.current=h.findIndex((e=>e.name===oe.name)),M.current=oe,K.current=!1,G(!1),re(oe,e,!("DROPDOWN"===oe.question.type_info.question_type&&"__others__"===e)&&p.includes(oe.question.type_info.question_type)&&!ee())}})),e.createElement($,{question:oe.question,block:oe,widgetStyle:m,formValues:x,othersMeta:Z,blocksWithQns:_,blocks:h,thankYouQuestion:I,currentBlockIndexOfBlocksWithQns:V,reverse:j,setReverse:G,currentBlockIndexOfBlocks:T,currentEditingBlock:M,isSubmitting:B,isValuesCommitted:H,isCurrentBlockFinal:ee,setHorizontalScrollUnits:N,handleFormValues:re,skipBlock:e=>{H.current=!0,delete x[e.name],b({...x})},setIsSubmitting:z,onSubmit:J,setIsSurveyCompleted:k,tempCurrentBlockIndexOfBlocksWithQns:U,setCurrentBlockIndexOfBlocksWithQnsDirty:K})))))))};l('#freshworks-survey-widget {\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;\n --container-width: 350px;\n --widget-header-height: 36px;\n --widget-footer-height: 32px;\n}\n#freshworks-survey-widget * {\n box-sizing: border-box;\n}\n#freshworks-survey-widget input,\n#freshworks-survey-widget select,\n#freshworks-survey-widget textarea,\n#freshworks-survey-widget button {\n font-family: inherit;\n}\n@-webkit-keyframes mountWidget {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n@keyframes mountWidget {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n#freshworks-survey-widget div.widget-survey-components {\n border: none;\n}\n#freshworks-survey-widget .freemium-survey-components {\n width: 100%;\n height: 100%;\n min-height: inherit;\n}\n#freshworks-survey-widget .default-container-style {\n right: calc(50% - var(--container-width) / 2);\n}\n#freshworks-survey-widget .compact-container-style {\n right: 40px;\n}\n#freshworks-survey-widget .compact-container-style .widget-footer {\n padding: 8px 16px;\n}\n#freshworks-survey-widget .cozy-container-style {\n max-width: 1000px;\n min-width: 800px;\n left: 50%;\n transform: translate(-50%, 0);\n}\n#freshworks-survey-widget .container {\n position: fixed;\n bottom: 0;\n border-radius: 4px 4px 0 0;\n z-index: 2147483647;\n display: flex;\n flex-direction: column;\n background-color: #fff;\n background-color: var(--question-background-color, #fff);\n width: var(--container-width);\n box-shadow: 0px 7px 13px rgba(18, 52, 77, 0.19);\n transition: opacity 0.25s ease, height var(--height-transition-duration) ease;\n -webkit-animation: mountWidget 0.5s ease;\n animation: mountWidget 0.5s ease;\n height: auto;\n}\n#freshworks-survey-widget .widget-header {\n height: var(--widget-header-height);\n display: flex;\n align-items: center;\n justify-content: space-between;\n flex-direction: row-reverse;\n grid-gap: 8px;\n gap: 8px;\n background-color: #fff;\n background-color: var(--question-background-color, #fff);\n border-radius: inherit;\n position: relative;\n}\n#freshworks-survey-widget .widget-header .icons {\n height: 100%;\n display: flex;\n}\n#freshworks-survey-widget .widget-header .icon {\n cursor: pointer;\n height: 100%;\n width: 48px;\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n background-color: transparent;\n border: none;\n}\n#freshworks-survey-widget .widget-header .icon:hover .icon-tooltip {\n display: block;\n -webkit-animation: mountWidget 0.4s ease;\n animation: mountWidget 0.4s ease;\n opacity: 1;\n}\n#freshworks-survey-widget .widget-header .icon:hover .icon-tooltip:hover {\n display: none;\n}\n#freshworks-survey-widget .widget-header .icon-tooltip {\n background: rgba(18, 52, 77, 0.8901960784);\n color: #fff;\n letter-spacing: 0.5px;\n padding: 4px 8px;\n border-radius: 4px;\n font-weight: 500;\n font-size: 0.9rem;\n position: absolute;\n right: 48px;\n top: 12px;\n white-space: nowrap;\n z-index: 1;\n transition: opacity ease 0.2s;\n display: none;\n opacity: 0;\n}\n#freshworks-survey-widget .widget-header.minimized {\n min-height: var(--widget-header-height);\n width: 100%;\n flex-direction: row;\n}\n#freshworks-survey-widget .header-content.minimized {\n opacity: 0;\n text-overflow: ellipsis;\n width: calc(100% - 72px);\n padding-left: 28px;\n overflow: hidden;\n white-space: nowrap;\n -webkit-animation: mountWidget 0.8s ease forwards;\n animation: mountWidget 0.8s ease forwards;\n -webkit-animation-delay: 0.3s;\n animation-delay: 0.3s;\n font-weight: 500;\n line-height: 1.8;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n#freshworks-survey-widget .header-content.minimized p {\n all: inherit;\n width: 100%;\n padding: 0;\n margin: 0;\n}\n#freshworks-survey-widget .widget-main {\n opacity: 1;\n flex-grow: 1;\n transition: opacity 0.25s ease, height var(--height-transition-duration) ease;\n}\n#freshworks-survey-widget .widget-main.minimized {\n opacity: 0;\n height: 0;\n border-radius: 3px 3px 0 0;\n}\n#freshworks-survey-widget .widget-footer {\n height: var(--widget-footer-height);\n font-size: 12px;\n display: flex;\n padding: 8px 28px;\n justify-content: space-between;\n align-items: center;\n color: rgba(18, 52, 77, 0.831372549);\n background-color: rgba(187, 187, 187, 0.1);\n letter-spacing: 0.2px;\n}\n#freshworks-survey-widget .widget-footer .fw-link {\n display: flex;\n align-items: center;\n grid-gap: 6px;\n gap: 6px;\n}\n#freshworks-survey-widget .widget-footer .emoji {\n position: relative;\n top: -1px;\n left: -2px;\n}\n#freshworks-survey-widget .widget-footer a {\n color: inherit;\n text-decoration: none;\n box-sizing: border-box;\n border-bottom: 1px solid transparent;\n}\n#freshworks-survey-widget .widget-footer a:hover {\n border-bottom: 1px solid;\n}\n#freshworks-survey-widget .title,\n#freshworks-survey-widget .description {\n text-align: center;\n}\n#freshworks-survey-widget .description {\n color: #666;\n line-height: 1.2;\n}\n#freshworks-survey-widget .close-widget {\n position: absolute;\n z-index: 10;\n background-color: #fff;\n flex-direction: column;\n display: flex;\n top: 40px;\n right: 12px;\n box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);\n border-radius: 2px;\n padding: 4px;\n}\n#freshworks-survey-widget .close-widget button {\n cursor: pointer;\n border: none;\n background-color: transparent;\n padding: 8px 12px;\n border-radius: 2px;\n font-size: 14px;\n}\n#freshworks-survey-widget .close-widget button:hover {\n background-color: #f3f3f3;\n}\n#freshworks-survey-widget .close-widget.top {\n top: -72px;\n}');const U=({onDismiss:n,remindLater:t,closeMenu:o,closeIconRef:i,position:s="bottom"})=>(r((()=>{const e=e=>{i.current===e.target||i.current.contains(e.target)||o()};return window.addEventListener("click",e),()=>window.removeEventListener("click",e)}),[]),e.createElement("div",{className:"close-widget "+("top"===s?"top":"")},e.createElement("button",{onClick:async()=>{await t()},autoFocus:!0},"Remind me later"),e.createElement("button",{onClick:async()=>{await n()},style:{color:"#D70B17"}},"Don't show again"))),j=({survey:t,placeholders:r,onSubmit:o,remindLater:s,onDismiss:a,onClose:c,surveyType:u,unsubscribeUrl:l,isSurveyCompleted:m})=>{const[d,p]=i(!1),[f,v]=i(!1),[h,g]=i(0),{ui_theme:x}=t,[b,w]=i(null),[k,_]=i(!1),q=t.question_details.questions.find((e=>e.pivot_question))??t.question_details.questions.find((e=>"RANGE"===e.type_info.question_type))??t.question_details.questions[0],E=()=>{p(!0),setTimeout((()=>{window.SurveyWidget?.unmount()}),300)},C=n(null);return e.createElement("div",{className:`container ${u}-container-style ${f?"minimized":""}`,style:{opacity:d?0:1,"--container-width":`${y[u]}`,"--height-transition-duration":"600ms",...Q(x)}},e.createElement("header",{id:"surveyserv-widget-header",className:"widget-header "+(f?"minimized":"")},f&&e.createElement("span",{className:"header-content minimized",dangerouslySetInnerHTML:{__html:F(q?.text,r)}}),e.createElement("div",{className:"icons"},!m&&e.createElement("button",{onClick:()=>{f?(v(!f),setTimeout((()=>{g(0)}),700)):(g(b?.clientHeight??0),setTimeout((()=>{v(!f)}),0))},className:"icon"},f?e.createElement(M,null):e.createElement(S,null)),e.createElement("button",{ref:C,onClick:()=>{m?(E(),c?.()):_(!k)},className:"icon"},e.createElement(Z,null))),k&&e.createElement(U,{position:f?"top":"bottom",closeIconRef:C,onDismiss:async()=>{await a(),E()},remindLater:async()=>{await s(),E()},closeMenu:()=>_(!k)})),e.createElement("main",{ref:e=>w(e),className:"widget-main "+(f?"minimized":""),style:{height:f?0:h||"auto"}},e.createElement(A,{widgetStyle:u,survey:t,placeholders:r,onSubmit:o,widgetHeaderQuerySelector:f?void 0:"#surveyserv-widget-header"})),e.createElement("footer",{className:"widget-footer"},e.createElement("a",{className:"fw-link",href:"https://www.freshworks.com/?utm_source=survey&utm_medium=survey_public_page",target:"_blank",rel:"noopener noreferrer"},"NPS survey powered by",e.createElement(L,null)),l&&!f&&e.createElement("a",{href:l,target:"_blank",rel:"noopener noreferrer",onClick:e=>{e.stopPropagation(),E()}},"Unsubscribe")))};l(":root {\n --default-brand-color: #264966;\n --default-question-text-color: #3a4b67;\n --default-question-background-color: #fff;\n --default-background-color: #f8f8f8;\n --default-button-text-color: #fff;\n --default-secondary-button-text-color: #000;\n --default-input-placeholder-color: #92a2b1;\n --compact-widget-max-height: 480px;\n --default-widget-max-height: 460px;\n --cozy-widget-max-height: 380px;\n}\n\n.freemium-survey-step-navigation {\n border-radius: 3px;\n border: 1px solid #efefef;\n white-space: nowrap;\n}\n.freemium-survey-step-navigation .navigation-button {\n width: 38px;\n text-align: -webkit-center;\n height: 38px;\n background-color: #fff;\n border: none;\n cursor: pointer;\n border-radius: 0 3px 3px 0;\n}\n.freemium-survey-step-navigation .navigation-button:first-of-type {\n border-right: 1px solid #efefef;\n border-radius: 3px 0 0 3px;\n}\n.freemium-survey-step-navigation .navigation-button:disabled {\n cursor: not-allowed;\n opacity: 0.5;\n}\n.freemium-survey-step-navigation .navigation-button:focus {\n position: relative;\n z-index: 1;\n}\n\n.freemium-survey-components.standard-survey-style .question-container {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n text-align: center;\n max-width: 700px;\n margin: 0 auto;\n background: var(--default-question-background-color);\n background: var(--question-background-color, var(--default-question-background-color));\n border-radius: 4px;\n transition: transform 500ms ease 0ms, opacity 800ms ease 0ms;\n box-shadow: 0px 12px 15px rgba(18, 52, 77, 0.03);\n margin-bottom: 28px;\n padding: 28px;\n grid-gap: 28px;\n gap: 28px;\n position: relative;\n height: -webkit-fit-content;\n height: -moz-fit-content;\n height: fit-content;\n overflow: auto;\n opacity: 1;\n}\n.freemium-survey-components.standard-survey-style .hide-question-container {\n pointer-events: none;\n opacity: 0;\n}\n.freemium-survey-components.standard-survey-style .question-text {\n font-size: 1rem;\n font-weight: 600;\n line-height: 1.8;\n width: 100%;\n text-align: left;\n color: var(--default-question-text-color);\n color: var(--question-text-color, var(--default-question-text-color));\n}\n.freemium-survey-components.standard-survey-style .autofocus-button {\n border: none;\n width: 0;\n height: 0;\n opacity: 0;\n margin-top: -12px;\n margin-left: -12px;\n position: absolute;\n}\n.freemium-survey-components.standard-survey-style .question-footer {\n display: flex;\n justify-content: flex-start;\n grid-gap: 40px;\n gap: 40px;\n width: 100%;\n align-items: center;\n}\n.freemium-survey-components.standard-survey-style .question-footer:empty {\n display: none;\n}\n.freemium-survey-components.standard-survey-style .action-buttons {\n display: flex;\n grid-gap: 20px;\n gap: 20px;\n flex-direction: row-reverse;\n}\n.freemium-survey-components.standard-survey-style .action-buttons:empty {\n display: none;\n}\n.freemium-survey-components.standard-survey-style .skip-button {\n font-weight: 500;\n color: #3a4b67;\n cursor: pointer;\n background: transparent;\n border: none;\n min-width: 40px;\n padding: 8px 16px;\n border-radius: 4px;\n color: var(--default-secondary-button-text-color);\n color: var(--secondary-button-text-color, var(--default-secondary-button-text-color));\n letter-spacing: 0.05rem;\n line-height: 1.5;\n border: 1px solid transparent;\n transform: translateY(0px);\n transition: transform ease 0.2s;\n}\n.freemium-survey-components.standard-survey-style .skip-button:hover {\n background-color: #f3f3f3;\n transform: translateY(-4px);\n}\n.freemium-survey-components.standard-survey-style .next-button {\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.standard-survey-style .submit {\n max-width: 700px;\n margin: 0 auto;\n text-align: left;\n background: transparent;\n box-shadow: none;\n padding-bottom: 40px;\n color: var(--default-button-text-color);\n color: var(--button-text-color, var(--default-button-text-color));\n}\n.freemium-survey-components.standard-survey-style .fade-enter {\n transition: all ease 400ms;\n opacity: 0;\n transform: translateY(40px);\n}\n.freemium-survey-components.standard-survey-style .fade-enter-active {\n transition: all ease 400ms;\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.standard-survey-style .fade-exit {\n transition: all ease 400ms;\n opacity: 1;\n transform: translateY(0);\n}\n.freemium-survey-components.standard-survey-style .fade-exit-active {\n transition: all ease 400ms;\n opacity: 0;\n transform: translateY(-40px);\n}\n.freemium-survey-components.standard-survey-style .thankyou {\n display: flex;\n align-items: center;\n justify-content: center;\n grid-gap: 20px;\n gap: 20px;\n min-height: 180px;\n}\n.freemium-survey-components.standard-survey-style .thankyou .heading {\n font-weight: 500;\n font-size: 22px;\n}\n.freemium-survey-components.standard-survey-style .thankyou .text {\n white-space: pre-wrap;\n font-weight: 500;\n font-size: 0.875rem;\n line-height: 1.6;\n color: #475867;\n width: 75%;\n}\n.freemium-survey-components.standard-survey-style .thankyou .redirection-text {\n color: #929292;\n margin-bottom: 12px;\n font-weight: 300;\n}\n.freemium-survey-components.standard-survey-style .thankyou .link {\n width: 100%;\n display: inline-block;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n color: #666;\n font-weight: 500;\n text-decoration: underline;\n}\n.freemium-survey-components.standard-survey-style .responsive-text-field {\n width: 100%;\n}\n.freemium-survey-components.standard-survey-style .responsive-text-field .textarea-container {\n display: none;\n}\n.freemium-survey-components.standard-survey-style .message-container:empty {\n display: none;\n}\n@media (max-width: 550px) {\n .freemium-survey-components.standard-survey-style .action-buttons {\n flex-direction: column;\n width: 100%;\n }\n .freemium-survey-components.standard-survey-style .action-buttons button {\n max-width: unset;\n }\n .freemium-survey-components.standard-survey-style .action-button {\n max-width: unset;\n width: 100%;\n }\n .freemium-survey-components.standard-survey-style .thankyou .text {\n width: auto;\n }\n}\n\n@media (max-width: 550px) {\n .freemium-survey-component .responsive-text-field .input-container {\n display: none;\n }\n .freemium-survey-component .responsive-text-field .textarea-container {\n display: flex;\n }\n .freemium-survey-component .responsive-text-field .textarea-container textarea {\n min-height: 80px;\n height: 80px;\n }\n}\n.freemium-survey-components.mobile-preview .thankyou .text {\n width: unset;\n}");const G=({thankYouQuestion:n,preview:t,placeholders:o,npsValue:i})=>(r((()=>{t||n.type_info.meta?.redirectUrl&&setTimeout((()=>{window.location.href=n.type_info.meta?.redirectUrl}),1e3*(1e3*n.type_info.meta?.redirectDelay??1e4))}),[]),e.createElement("div",{className:"question-container thankyou"},e.createElement("div",{className:"heading"},"Thank you!"),e.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:F(n.text,o,i)}}),n.type_info.meta?.redirectUrl&&e.createElement("div",{style:{width:"100%"}},e.createElement("div",{className:"redirection-text"},"You will be redirected to the below URL automatically in"," ",n.type_info.meta?.redirectDelay," seconds.",e.createElement("br",null)),e.createElement("a",{className:"link",href:n.type_info.meta?.redirectUrl},n?.type_info.meta?.redirectUrl)))),X=({currentBlockIndex:n,currentBlockIndexOfBlocksWithQns:t,blocksWithQns:r,blocks:o,setHorizontalScrollUnits:i,preventQuestionAnimation:s})=>e.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},e.createElement("button",{disabled:0==t.current,className:"navigation-button",onClick:()=>{t.current=Math.max(t.current-1,0),n.current=o.findIndex((e=>e.name===r[t.current].name)),s.current=!1,i(t.current)}},e.createElement(O,null)),e.createElement("button",{className:"navigation-button",disabled:t.current>=r.length-1,onClick:()=>{s.current=!1,t.current=Math.min(t.current+1,r.length-1),n.current=o.findIndex((e=>e.name===r[t.current].name)),i(t.current)}},e.createElement(I,null))),K=({widget:n,block:t,surveyStyle:r,formValues:o,othersMeta:i,blocksWithQns:s,blocks:a,thankYouQuestion:c,currentBlockIndexOfBlocksWithQns:u,currentBlockIndexOfBlocks:l,currentEditingBlock:m,isSubmitting:d,isValuesCommitted:f,isCurrentBlockFinal:y,setHorizontalScrollUnits:v,handleFormValues:h,skipBlock:g,setIsSubmitting:x,onSubmit:b,setIsSurveyCompleted:w,preventQuestionAnimation:k,preview:_,closePreview:q,...E})=>{const C=E.blockIndex??u.current,N=E.question??s[C].question,B=()=>N.name===m.current.question.name&&(!p.includes(N.type_info.question_type)||"DROPDOWN"===N.type_info.question_type&&"__others__"===o[N.name])&&!y(),I=()=>"RANGE"!==N.type_info.question_type&&!t.required&&N.name===m.current.question.name&&!y(),O=()=>("DROPDOWN"===N.type_info.question_type&&N.name!==m.current.question.name&&!t.required&&o[N.name],!1),Z=()=>y()&&(n||"standard"!==r)&&N.name===m.current.question.name,S=("MULTI_SELECT"===m.current.question.type_info.question_type&&o[m.current.question.name]?.includes("__others__")||"DROPDOWN"===m.current.question.type_info.question_type&&"__others__"===o[m.current.question.name])&&(!i[m.current.question.name]||""===i[m.current.question.name].trim());return e.createElement("div",{className:"question-footer"},!(!n&&"standard"===r||0===C&&!o[N.name])&&e.createElement(X,{currentBlockIndex:l,currentBlockIndexOfBlocksWithQns:u,blocksWithQns:s,blocks:a,setHorizontalScrollUnits:v,preventQuestionAnimation:k}),(B()||O()||I()||Z())&&e.createElement("div",{className:"action-buttons"},B()&&e.createElement(z,{onClick:()=>{h(s[C],null,!0)},disabled:m.current.required&&(!o[m.current.question.name]||Array.isArray(o[m.current.question.name])&&0===o[m.current.question.name].length)||m.current.question.type_info.meta?.othersRequired&&S,className:"next-button"},"Next"),I()&&e.createElement("button",{className:"skip-button",onClick:()=>g(N)},"Skip"),O()&&e.createElement("button",{className:"skip-button",onClick:()=>{m.current=s[C],l.current=a.findIndex((e=>e.name===s[C].name)),g(N)}},"Clear selection"),Z()&&e.createElement("div",{className:"submit"},e.createElement(z,{disabled:(m.current.required||m.current.question.type_info.pivot_question)&&(null==o[m.current.question.name]||0===o[m.current.question.name]?.length)||m.current.question.type_info.meta?.othersRequired&&S||d,onClick:()=>{x(!0),b()}},d?"Submitting":"Submit survey"))))},J=({survey:t,surveyStyle:o="standard",placeholders:c,onSubmit:u,widget:l,npsValue:m,preview:d,mobilePreview:f,closePreview:y})=>{const v=t.question_details?.questions||[],h=t.meta?.blocks||[],[g,x]=i(null),[b,w]=i({}),[k,_]=i(!1),[q,E]=i([]),[N,B]=i(0),[I,O]=i(!1),[Z,S]=i(null),[M,L]=i({}),Q=n(null),R=n(null),W=n(-1),T=n(null),V=n(0),H=n(0),Y=n(!1),P=n([]),$=n(null!=m&&"card"===o),A=n(null),U=n([]);r((()=>{h&&(A.current=h.find((e=>"TY"===e.name)),x(h.filter((e=>"TY"!==e.name))))}),[h]),r((()=>{if(g)if(R.current=v.find((e=>e.type_info?.pivot_question))??v.find((e=>"RANGE"===e.type_info?.question_type))??v[0],null!=m){W.current=Math.min(R.current.type_info.validation.max,Math.max(R.current.type_info.validation.min,m));const e=v.find((e=>e.name===g[0].question_names[0]));Q.current={...g[0],question:e},P.current=[...P.current,{...g[0],question:e}],E(P.current),w({Q_1:W.current})}else if(!Q.current&&g.length>0)return Q.current=g[0],void J(g[0])}),[g,m]),r((()=>{q.length&&(P.current=q,H.current=q.length-1),l||"standard"!==o?(T.current&&(T.current.style.maxHeight="unset"),U.current[V.current]=T.current?.scrollHeight||U.current[V.current]||0,T.current&&(T.current.style.maxHeight="100%")):T.current?.scrollIntoView({block:"start",behavior:"smooth"}),B(q.length-1)}),[q]),r((()=>{Object.keys(b).length>0&&Q.current.question&&(p.includes(Q.current.question.type_info.question_type)&&("DROPDOWN"!==Q.current.question.type_info.question_type||"__others__"!==b[Q.current.question.name])||Y.current)&&!X()&&ee()}),[b]),r((()=>{if(null!=b?.[R.current?.name])if(A.current?.is_based_on_rating){const e=R.current?.type_info?.choices[b?.[R.current?.name]-R.current?.type_info?.validation?.min??0]?.dependent_question_names,n=A.current?.question_names.find((n=>e?.includes(n))),t=v.find((e=>e.name===n));S(t)}else{const e=v.find((e=>e.name==A.current?.question_names[0]));S(e)}}),[b?.[R.current?.name]]);const j=()=>{u({...b,others_meta:M},(()=>{Z?.type_info.meta?.skipThankYouPage?d?setTimeout((()=>{y?.()}),300):window.location.href=Z?.type_info.meta?.redirectUrl:_(!0)}))},X=()=>V.current===g.length-1||"end"===Q.current.branchOption,J=e=>{let n={};if(e.is_based_on_rating){const t=R.current?.type_info?.choices[b?.[R.current?.name]-R.current?.type_info?.validation?.min??0]?.dependent_question_names,r=e.question_names.find((e=>t?.includes(e)));n=v.find((e=>e.name===r))}else n=v.find((n=>n.name===e.question_names[0]));Q.current.question=n;P.current.find((e=>e.question.name===n.name))?(B(N+1),H.current+=1):E([...P.current,{...e,question:n}])},ee=()=>{if(X())_(!0);else{if(Q.current.nextBlock)V.current=g.findIndex((e=>e.name===Q.current.nextBlock));else if(Q.current.question.type_info?.meta?.branches){const e=Q.current.question.type_info?.meta?.branches,n=b[Q.current.question.name];let t;if(t="RANGE"===Q.current.question.type_info.question_type?e.find((e=>n>=e.min&&n<=e.max)):e.find((e=>n===e.value)),t?.nextBlock){if("TY"===t.nextBlock)return j(),void _(!0);V.current=g.findIndex((e=>e.name===t.nextBlock))}else V.current+=1}else V.current+=1;Q.current=g[V.current],J(g[V.current])}},ne=e=>{Y.current=!0,delete b[e.name],w({...b})},te=(e,n,t)=>{if($.current=!1,t){if(Y.current=!0,null!=b[e.question.name]&&e.name!==q[q.length-1].name){const[t,r]=(e=>{const n=q.findIndex((n=>n.name===e.name)),t=q.slice(0,n+1),r=t.reduce(((e,n)=>(e[n.question.name]=b[n.question.name],e)),{});return V.current=g.findIndex((n=>n.name===e.name)),[t,r]})(e);w({...r,...null!=n&&{[e.question.name]:n}}),P.current=t}else w({...b,...null!=n&&{[e.question.name]:n}});R?.current?.name==e?.question?.name&&(W.current=n)}else w({...b,...null!=n&&{[e.question.name]:n}})},re=(e,n)=>{const t=q.find((n=>n.question.name===e));if(V.current=g.findIndex((e=>e.name===t.name)),Q.current=t,null===n){const n={...M};delete n[e],L({...n})}else L({...M,[e]:n})};if(!Q.current||!Q.current.question)return null;const oe=("MULTI_SELECT"===Q.current.question.type_info.question_type&&b[Q.current.question.name]?.includes("__others__")||"DROPDOWN"===Q.current.question.type_info.question_type&&"__others__"===b[Q.current.question.name])&&(!M[Q.current.question.name]||""===M[Q.current.question.name]);return e.createElement("div",{className:`freemium-survey-components ${l?"widget-survey-components":""} ${f?"mobile-preview":""} ${o}-survey-style`,id:"freemium-survey"},k?null:e.createElement(C,{totalSteps:g.length,completedSteps:V.current}),e.createElement(s,{mode:"out-in"},e.createElement(a,{key:String(k),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:l?"":"fade"},e.createElement("div",null,k?e.createElement(G,{thankYouQuestion:Z,preview:d,placeholders:c,npsValue:W.current}):e.createElement(e.Fragment,null,e.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:l||"card"===o?{transform:`translateX(calc(-${N} * 100%))`,height:`${U.current[V.current]}px`,transition:$.current||q?.length<=1?"none":"all 300ms ease-out 0ms"}:{},className:"questions"},q.map(((n,t)=>e.createElement("div",{key:n.question.name,ref:T,className:"question-container "+(!l&&"card"!==o||H.current===t?"":"hide-question-container")},e.createElement("div",{className:"question-text "+(0===t?"nps":""),dangerouslySetInnerHTML:{__html:F(n.question.text,c,W.current)},"aria-label":`question-${t}`,role:"heading","aria-level":1}),e.createElement("button",{disabled:!l&&"standard"===o,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),e.createElement(D,{question:n.question,isFinalQn:X(),formValues:b,othersMeta:M,autoFocus:H.current===t,autoFocusDelay:"standard"===o?350:20,saveOthersValue:re,onChangeHandler:e=>{Y.current=!1,V.current=g.findIndex((e=>e.name===n.name)),Q.current=n,te(n,e,!("DROPDOWN"===n.question.type_info.question_type&&"__others__"===e)&&p.includes(n.question.type_info.question_type)&&!X())}}),e.createElement("button",{disabled:!l&&"standard"===o,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),e.createElement(K,{question:n.question,block:n,blockIndex:t,widget:l,surveyStyle:o,formValues:b,othersMeta:M,blocksWithQns:q,blocks:g,thankYouQuestion:Z,currentBlockIndexOfBlocksWithQns:H,currentBlockIndexOfBlocks:V,currentEditingBlock:Q,isSubmitting:I,isValuesCommitted:Y,isCurrentBlockFinal:X,setHorizontalScrollUnits:B,handleFormValues:te,skipBlock:ne,setIsSubmitting:O,onSubmit:j,setIsSurveyCompleted:_,preventQuestionAnimation:$,preview:d,closePreview:y})))),!l&&"card"!==o&&X()&&e.createElement("div",{className:"submit"},e.createElement(z,{disabled:(Q.current.required||Q.current.question.type_info.pivot_question)&&(null==b[Q.current.question.name]||0===b[Q.current.question.name]?.length)||Q.current.question.type_info.meta?.othersRequired&&oe||I,onClick:()=>{O(!0),u({...b,others_meta:M},(()=>{Z?.type_info.meta?.skipThankYouPage?d?setTimeout((()=>{y?.()}),300):window.location.href=Z?.type_info.meta?.redirectUrl:_(!0)}))}},I?"Submitting":"Submit survey"))))))))},ee=n=>{const t=R(n.survey);return e.createElement(e.Fragment,null,"standard"===n.surveyStyle?e.createElement(J,Object.assign({},n,{survey:t})):e.createElement(H,Object.assign({},n,{survey:t})))},ne=n=>{const t=R(n.survey);return e.createElement(j,Object.assign({},n,{survey:t}))};export{B as BUTTON_SIZE_VARIANTS,z as Button,k as CheckboxGroup,x as Input,m as NPS,C as ProgressBar,E as Radio,q as RadioGroup,ee as Survey,b as TextArea,ne as WebInAppSurvey};
@@ -1,3 +1,7 @@
1
1
  /// <reference types="react" />
2
2
  export declare const NextArrow: () => JSX.Element;
3
3
  export declare const PreviousArrow: () => JSX.Element;
4
+ export declare const CloseIcon: () => JSX.Element;
5
+ export declare const MinimizeIcon: () => JSX.Element;
6
+ export declare const MaximizeIcon: () => JSX.Element;
7
+ export declare const FreshworksLogo: () => JSX.Element;
@@ -1,9 +1,15 @@
1
1
  export declare const AUTO_COMMIT_FIELD_TYPES: string[];
2
+ export declare const RADIO_CHECKBOX_OTHERS_OPTION_KEY = "__others__";
2
3
  export declare const TRANSITION_DURATION = 300;
3
4
  export declare const AUTO_REDIRECT_DELAY: number;
4
- export declare const RADIO_CHECKBOX_OTHERS_OPTION_KEY = "__others__";
5
+ export declare const WIDGET_MINIMIZE_ANIMATION_DURATION = 600;
5
6
  export declare const WIDGET_MAX_HEIGHT: {
6
7
  default: number;
7
8
  compact: number;
8
9
  cozy: number;
9
10
  };
11
+ export declare const WIDGET_CONTAINER_WIDTH: {
12
+ default: string;
13
+ compact: string;
14
+ cozy: string;
15
+ };
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { SurveyProps, WidgetSurveyProps } from '../types';
3
- declare const Survey: (props: SurveyProps | WidgetSurveyProps) => JSX.Element;
4
- declare const WebInAppSurvey: (props: WidgetSurveyProps) => JSX.Element;
2
+ import { SurveyProps, WidgetProps } from '../types';
3
+ declare const Survey: (props: SurveyProps) => JSX.Element;
4
+ declare const WebInAppSurvey: (props: WidgetProps) => JSX.Element;
5
5
  export { Survey, WebInAppSurvey };
@@ -1,5 +1,14 @@
1
1
  import { SurveyType } from '../types';
2
- export declare const sanitiseQuestion: (questionText: any, placeholders: any, npsRating: any) => any;
2
+ export declare const resolvePlaceholders: (questionText: string, placeholders: any, npsRating?: string | number | undefined) => string;
3
+ export declare const spreadCSSVariablesIfPresent: (ui_theme: any) => {
4
+ '--question-text-color': any;
5
+ '--secondary-button-text-color': any;
6
+ '--button-text-color': any;
7
+ '--question-background-color': any;
8
+ '--secondary-button-color': any;
9
+ '--background-color': any;
10
+ '--brand-color': any;
11
+ };
3
12
  export declare const useExtractBlockFromQuestions: (survey: SurveyType) => {
4
13
  meta: {
5
14
  blocks: any[];
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import './index.scss';
3
- import { WidgetSurveyProps } from '../../types';
4
- declare const WidgetSurvey: ({ survey, surveyStyle, placeholders, onSubmit, widget, npsValue, widgetStyle, widgetHeaderQuerySelector, preview, mobilePreview, closePreview, }: WidgetSurveyProps) => JSX.Element | null;
3
+ import { WidgetProps } from '../../types';
4
+ declare const WidgetSurvey: ({ survey, placeholders, onSubmit, remindLater, onDismiss, onClose, surveyType, unsubscribeUrl, isSurveyCompleted, }: WidgetProps) => JSX.Element;
5
5
  export { WidgetSurvey };
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ import './survey.scss';
3
+ import { WidgetSurveyProps } from '../../types';
4
+ declare const Survey: ({ survey, placeholders, onSubmit, widgetStyle, widgetHeaderQuerySelector, }: WidgetSurveyProps) => JSX.Element | null;
5
+ export { Survey };
@@ -11,10 +11,24 @@ export interface SurveyProps {
11
11
  mobilePreview?: boolean;
12
12
  closePreview?: () => void;
13
13
  }
14
- export interface WidgetSurveyProps extends SurveyProps {
14
+ export declare type WidgetProps = {
15
+ survey: any;
16
+ placeholders: any;
17
+ onSubmit: (data: any, callback: any) => void;
18
+ onDismiss: () => void;
19
+ remindLater: () => void;
20
+ onClose?: () => void;
21
+ surveyType: 'default' | 'compact' | 'cozy';
22
+ unsubscribeUrl?: string;
23
+ isSurveyCompleted: boolean;
24
+ };
25
+ export declare type WidgetSurveyProps = {
26
+ widgetStyle: 'default' | 'compact' | 'cozy';
27
+ survey: any;
28
+ placeholders: any;
29
+ onSubmit: (data: any, callback: any) => void;
15
30
  widgetHeaderQuerySelector?: string;
16
- widgetStyle: 'default' | 'cozy' | 'compact';
17
- }
31
+ };
18
32
  export declare type BlockType = {
19
33
  name?: string;
20
34
  title?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freemium-survey-components",
3
- "version": "0.10.54",
3
+ "version": "0.11.0",
4
4
  "description": "React Survey Ui Components",
5
5
  "main": "lib/index.cjs.js",
6
6
  "module": "lib/index.esm.js",