freemium-survey-components 0.12.1 → 0.12.2

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),o=require("react-transition-group"),r=e(require("react-dom"));function s(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===t&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.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 .choices {\n width: 100%;\n display: flex;\n justify-content: space-between;\n font-weight: 500;\n border-radius: 4px;\n}\n.freemium-survey-components .nps-container .nps-scale .choice {\n background: #ebeff3;\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.standard .choice {\n background: rgba(228, 62, 61, 0.3);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2) {\n background: rgba(0, 175, 80, 0.3);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(4) {\n background: rgba(248, 196, 62, 0.3);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice:hover, .freemium-survey-components .nps-container .nps-scale.standard .choice.active {\n background: rgb(228, 62, 61);\n color: #fff;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(2), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(2), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(2) {\n background: rgb(0, 175, 80);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(4), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(4), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(4) {\n background: rgb(248, 196, 62);\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-row-gap: 6px;\n row-gap: 6px;\n grid-column-gap: 6px;\n -moz-column-gap: 6px;\n column-gap: 6px;\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-row-gap: 6px;\n row-gap: 6px;\n grid-column-gap: 6px;\n -moz-column-gap: 6px;\n column-gap: 6px;\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:o="highlighted",button_shape:r="rounded"}={},rating_presets:{start:s="Very unlikely",end:i="Very likely"}={},validation:{min:a},footer_text:c}}=e,l=e=>{switch(e){case e<=6:return"detractor";case e<=8:return"passive";default:return"promoter"}},u=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 ${r} ${o}`},t.createElement("div",{className:"button-container"},t.createElement("div",{className:"choices",role:"radiogroup","aria-required":!0},u.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 ${l(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"},`${u.current[u.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]::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::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}');const c=["RANGE","NPS","RADIO","DROPDOWN"],l={default:500,compact:500,cozy:400},u={default:"600px",compact:"350px",cozy:"96%"},m={isRequired:!1,showCount:!0,isErrored:!1,inline:!1,spellCheck:!1,autoFocusInput:!0},d=n.forwardRef(((e,o)=>{const r=n.useRef(null);n.useEffect((()=>{e.autoFocusInput&&setTimeout((()=>{r.current?.focus()}),300+(e.autoFocusDelay??0))}),[e.autoFocusInput]);const{inputStyle:s,style:i,className:a,showCount:c,isErrored:l,startLabel:u,isRequired:m,errorText:d,endLabel:p,maxLength:f=256,onChange:v,autoFocusInput:y,...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,u&&t.createElement("div",{className:"start-label"},u),t.createElement("div",{className:`input-basic ${l?"error":""}${a||""}`},t.createElement("input",Object.assign({},h,{type:"text",autoComplete:"off",ref:r,style:s,onChange:e=>{e.target.value?.length>f||v?.(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)),l&&d&&t.createElement("span",{className:"input-error"},e.errorText))})),p=n.forwardRef(((e,o)=>{const r=n.useRef(null);n.useEffect((()=>{e.autoFocusInput&&setTimeout((()=>{r.current?.focus()}),300+(e.autoFocusDelay??0))}),[e.autoFocusInput]);const{inputStyle:s,style:i,className:a,showCount:c,maxLength:l=1500,startLabel:u,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),u&&t.createElement("div",{className:"start-label"},u),t.createElement("div",{className:`input-basic ${a||""}`},t.createElement("textarea",Object.assign({},f,{autoComplete:"off",ref:r,style:s,onChange:e=>{e.target.value?.length>l||p?.(e)}})),c&&l&&l>0&&t.createElement("div",{className:"end-max-length"},`${e.value&&e.value.length||0}/${l}`)),e.endLabel&&t.createElement("div",{className:"end-label"},e.endLabel)))})),f=a(d,m),v=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 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"})),h=({values:e=[],othersValue:o="",options:r,name:s,autoFocusGroup:i,autoFocusDelay:a,onChangeHandler:c,saveOthersValue:l})=>{const u=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}),r?.filter((e=>"Others"!==e.value)).map(((n,o)=>t.createElement(g,{key:n.id,checked:e?.includes(n.value),name:n.value,id:n.id,onChange:(t,o)=>{if(o)c([...e||[],n.value]);else{const t=e.indexOf(n.value);t>-1&&e.splice(t,1),c([...e])}}},n.value))),r?.find((e=>"Others"===e.value))&&t.createElement(g,{key:"others",checked:u,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"),u&&t.createElement(t.Fragment,null,t.createElement(f,{placeholder:"Enter your comment",value:o,onChange:e=>{l(s,e.target.value)},autoFocusDelay:10,label:""})))},g=a((e=>{const o=n.useRef(null);return n.useEffect((()=>{e.autoFocus&&setTimeout((()=>{o.current?.focus()}),320)}),[]),t.createElement("label",{className:`checkbox-label ${e.disabled&&"disabled"}`},t.createElement("input",{ref:o,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 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:o,value:r,autoFocusGroup:s,autoFocusDelay:i,onChangeHandler:a,saveOthersValue:c,othersOption:l,othersRequired:u,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}),o?.sort(((e,n)=>"Others"===e.value?1:"Others"===n.value?-1:0))?.map(((n,o)=>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:r===n.value},"Others"===n.value?"Others":n.value))),"Others"===r&&t.createElement(t.Fragment,null,t.createElement(f,{value:m??"",onChange:n=>{"Others"!==r&&d&&a("Others"),c(e,n.target.value)},placeholder:"Enter your comment",label:"",autoFocusDelay:10})))},b=a((e=>{const o=n.useRef(null);return n.useEffect((()=>{e.autoFocus&&setTimeout((()=>{o.current?.focus()}),320)}),[]),t.createElement("label",{className:"radio-label"},t.createElement("input",{ref:o,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:o,widget:r}=e;return t.createElement("div",{className:"progressbar-container "+(r?"widget":"")},t.createElement("div",{className:"progressbar",style:{width:(o>0?100/n:0)+"%",transform:`scaleX(${o})`}}))};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 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,"..."),q=e=>{const{inline:n=!1,children:o,disabled:r,className:s="",htmlType:i,type:a="primary",onClick:c,size:l,overrideStyleClassName:u="",loading:m=!1,...d}=e;return t.createElement("button",Object.assign({style:n?{display:"inline-block"}:{},disabled:r,className:`action-button ${s} ${u}`,type:i,onClick:c},d),m?t.createElement(k,null):o)},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:"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"})),B=()=>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"})),_=()=>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",fillOpacity:"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"})),O=()=>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"})),N=()=>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)"})),S=()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"76",height:"16",viewBox:"0 0 200 40"},t.createElement("g",{fill:"none",fillRule:"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"}))),C=({question:e,formValues:n,othersMeta:o,onChangeHandler:r,saveOthersValue:s,autoFocus:a,autoFocusDelay:c,isFinalQn:l})=>{switch(e.type_info.question_type){case"RANGE":return t.createElement(i,{type_info:e.type_info,onChangeHandler:r,npsValue:n[e.name]});case"CHECKBOX":case"MULTI_SELECT":return t.createElement(h,{name:e.name,autoFocusGroup:a,values:n[e.name],othersValue:o[e.name],options:e.type_info.choices,onChangeHandler:r,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:r,saveOthersValue:s,options:e.type_info.choices,value:n[e.name],othersValue:o[e.name],othersOption:e.type_info.meta?.othersOption,othersRequired:e.type_info.meta?.othersRequired,isFinalQn:l});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=>r(e.target.value)}),t.createElement(v,{autoFocusInput:a,autoFocusDelay:c,label:"",maxLength:256,isRequired:e.is_required,placeholder:e.type_info?.meta?.placeholder??"",value:n[e.name]||"",onChange:e=>r(e.target.value)}));case"PARAGRAPH":return t.createElement(v,{autoFocusInput:a,autoFocusDelay:c,label:"",isRequired:e.is_required,placeholder:e.type_info?.meta?.placeholder??"",value:n[e.name]||"",onChange:e=>r(e.target.value)});default:return console.error(`Question type ${e.type_info.question_type} not found`),null}},I=(e={})=>0==Object.values(e).length,z=e=>!e||"string"==typeof e&&""===e.trim()||Array.isArray(e)&&0===e.length,Z=(e,n,t)=>{if(e){let o={};t&&(o={"{{nps.rating}}":t}),n&&(o={...n,...o});const r=new RegExp(Object.keys(o).join("|"),"gi");e=e.replace(r,(function(e){return o[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}});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: 0;\n gap: 0;\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 grid-gap: 0;\n gap: 0;\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=({questions:e})=>e.find((e=>e.type_info?.pivot_question))??e.find((e=>"RANGE"===e.type_info?.question_type))??e[0],T=({blocks:e,activeBlockIndexOfBlocks:n,blocksWithQns:t,activeBlockIndexOfBlocksWithQns:o})=>{const r=e[n];return(n===e.length-1||"end"===r.branchOption)&&o===t.length-1},R=({pivotQn:e,pivotQnAnswer:n,block:t,questions:o})=>{if(t?.is_based_on_rating){const r=e?.type_info?.choices?.[n-(e?.type_info?.validation?.min??0)??0]?.dependent_question_names,s=t?.question_names?.find((e=>r?.includes(e)));return o.find((e=>e.name===s))}return o.find((e=>e.name===t?.question_names?.[0]))},V=({question:e,answers:n})=>c.includes(e?.type_info?.question_type||"")&&!("DROPDOWN"===e.type_info?.question_type&&"Others"===n.formValues[e.name])||n.commitDirtyValue,L=(e,{answers:n,blocks:t,activeBlockIndexOfBlocks:o,blocksWithQns:r,activeBlockIndexOfBlocksWithQns:s,surveyStyle:i,widget:a})=>{const l=T({blocks:t,activeBlockIndexOfBlocks:o,blocksWithQns:r,activeBlockIndexOfBlocksWithQns:s}),u=r[s],m=u.question;switch(e){case"next":return(!c.includes(m.type_info?.question_type??"")||"DROPDOWN"===m.type_info?.question_type&&"Others"===n.formValues[m.name])&&!l;case"skip":return"RANGE"!==m.type_info?.question_type&&!u.required&&!l;case"submit":return l&&(a||"standard"!==i);case"navigation":return(a||"card"===i)&&!(0===s&&1===r.length)}},M=(e,n)=>("MULTI_SELECT"===e.question.type_info.question_type&&n.formValues[e.question.name]?.includes("Others")||"DROPDOWN"===e.question.type_info.question_type&&"Others"===n.formValues[e.question.name])&&z(n.others[e.question.name]),F=(e,{answers:n,blocks:t,activeBlockIndexOfBlocks:o,blocksWithQns:r,activeBlockIndexOfBlocksWithQns:s,isSubmitting:i})=>{const a=r[s];switch(e){case"next":return a.required&&z(n?.formValues[a.question.name])||a.question.type_info?.meta?.othersRequired&&M(a,n);case"submit":return(a.required||a.question.type_info?.pivot_question)&&z(n?.formValues[a.question.name])||a.question?.type_info?.meta?.othersRequired&&M(a,n)||i;case"navigation-prev":return 0==s;case"navigation-next":return s>=r.length-1;default:return!1}},D=({blocksWithQns:e,activeBlockIndexOfBlocksWithQns:n,answers:t})=>{const o=H({blocksWithQns:e,activeBlockIndexOfBlocksWithQns:n}).reduce(((e,n)=>(t.formValues[n.question.name]&&(e[n.question.name]=t.formValues[n.question.name]),e)),{});return{...t,formValues:o}},H=({blocksWithQns:e,activeBlockIndexOfBlocksWithQns:n})=>e.slice(0,n+1),P=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]),A=e=>{const o=e.survey.question_details?.questions||[],[r,s]=n.useState([]),[i,a]=n.useState({formValues:{},others:{},commitDirtyValue:!1}),[c,l]=n.useState([]),[u,m]=n.useState(0),[d,p]=n.useState(!1),f=n.useRef(),[v,y]=n.useState(!1),h=n.useRef(!1),g=n.useRef(),x=c[u],b=t.useMemo((()=>c.length>0?r?.findIndex((e=>e.name===c[u].name)):0),[u]);n.useEffect((()=>{e.survey.meta?.blocks&&s(e.survey.meta?.blocks.filter((e=>"TY"!==e.name)))}),[e.survey.meta?.blocks]),n.useEffect((()=>{if(!r||!r.length)return;var n,t;f.current={...f.current,question:W({questions:o})},null!=e.npsValue&&(f.current={...f.current,answer:(n=f.current.question,t=e.npsValue,Math.min(n.type_info.validation.max,Math.max(n.type_info.validation.min,t)))},a({...i,formValues:{[f.current.question.name]:f.current.answer}}));const s=R({pivotQn:f.current.question,pivotQnAnswer:f.current.answer,block:r[0],questions:o});l([{...r[0],question:s}])}),[r,e.npsValue]),n.useEffect((()=>{c.length&&m(c.length-1)}),[c]),n.useEffect((()=>{if(!I(i.formValues)&&r&&(({blocks:e,activeBlockIndexOfBlocks:n,blocksWithQns:t,activeBlockIndexOfBlocksWithQns:o,answers:r})=>{const{question:s}=t[o];return!!s&&!T({blocks:e,activeBlockIndexOfBlocks:n,blocksWithQns:t,activeBlockIndexOfBlocksWithQns:o})&&V({question:s,answers:r})})({blocks:r,activeBlockIndexOfBlocks:b,blocksWithQns:c,activeBlockIndexOfBlocksWithQns:u,answers:i})){const n=()=>{p(!1);const e=(({activeBlock:e,blocks:n,activeBlockIndexOfBlocks:t,answers:o})=>{if(e.nextBlock&&"specific"===e.branchOption)return n.findIndex((e=>e.name===e.nextBlock));if("logic"===e.branchOption&&e.question.type_info?.meta?.branches){const r=e.question.type_info?.meta?.branches,s=o.formValues[e.question.name];let i;return i="RANGE"===e.question.type_info.question_type?r.find((e=>s>=e.min&&s<=e.max)):r.find((e=>s===e.value)),i?.nextBlock?"TY"===i.nextBlock?Number.MAX_SAFE_INTEGER:n.findIndex((e=>e.name===i.nextBlock)):t+1}return t+1})({activeBlock:x,blocks:r,activeBlockIndexOfBlocks:b,answers:i}),n=R({pivotQn:f.current?.question,pivotQnAnswer:f.current?.answer,block:r?.[e],questions:o}),t=H({blocksWithQns:c,activeBlockIndexOfBlocksWithQns:u});l([...t,{...r?.[e],question:n}])};null!=e.npsValue&&1==c.length?g.current?(clearTimeout(g.current),g.current=null,n()):g.current=setTimeout((()=>{n()}),1500):n()}}),[i,r]),n.useEffect((()=>{!I(i.formValues)&&h.current&&(d?k():w(),h.current=!1)}),[d]);const w=()=>{d?(h.current=!0,p(!1)):m(u+1)},k=()=>{d?m(u-1):(h.current=!0,p(!0))};return{blocks:r,questions:o,blocksWithQns:c,activeBlock:x,activeBlockIndexOfBlocks:b,activeBlockIndexOfBlocksWithQns:u,isSurveyCompleted:v,isReverseAnimation:d,isNavigating:h.current,pivot:f.current,answers:i,navigateToNextBlock:w,navigateToPreviousBlock:k,saveFormValues:(e,n,t=!1)=>{e.question.name===f.current?.question.name&&(f.current={...f.current,answer:n});let o=i;(t||V({question:e.question,answers:i}))&&(o=D({blocksWithQns:c,activeBlockIndexOfBlocksWithQns:u,answers:i})),a({...o,formValues:{...o.formValues,...null!=n&&{[e.question.name]:n}},commitDirtyValue:t})},saveOthersValue:(e,n)=>{if(null===n){const n={...i.others};delete n[e],a({...i,others:n})}else a({...i,others:{...i.others,[e]:n}})},skipBlock:()=>{p(!1);const e=x.question;if(delete i.formValues[e.name],delete i.others[e.name],u!==c.length-1){const e=D({blocksWithQns:c,activeBlockIndexOfBlocksWithQns:u,answers:i}),n=H({blocksWithQns:c,activeBlockIndexOfBlocksWithQns:u});l(n),a({...e,commitDirtyValue:!0})}else a({...i,commitDirtyValue:!0})},onSubmitHandler:()=>{e.onSubmit({...i.formValues,others_meta:i.others},(()=>{y(!0)}))}}},$=({thankYouQuestion:e,preview:o,placeholders:r,npsValue:s})=>(n.useEffect((()=>{o||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:Z(e.text,r,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=({activeBlockIndexOfBlocks:e,activeBlockIndexOfBlocksWithQns:n,blocksWithQns:o,blocks:r,navigateToPreviousBlock:s,navigateToNextBlock:i})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:F("navigation-prev",{blocks:r,blocksWithQns:o,activeBlockIndexOfBlocks:e,activeBlockIndexOfBlocksWithQns:n}),className:"navigation-button",onClick:s},t.createElement(B,null)),t.createElement("button",{className:"navigation-button",disabled:F("navigation-next",{blocks:r,blocksWithQns:o,activeBlockIndexOfBlocks:e,activeBlockIndexOfBlocksWithQns:n}),onClick:i},t.createElement(E,null))),j=e=>{const{widget:o,surveyStyle:r,answers:s,blocksWithQns:i,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,saveFormValues:u,onSubmit:m,skipBlock:d,navigateToNextBlock:p,navigateToPreviousBlock:f}=e,[v,y]=n.useState(!1),h={answers:s,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,surveyStyle:r,widget:o},g={answers:s,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,isSubmitting:v};return 1===i.length&&1!==a.length?null:t.createElement("div",{className:"question-footer"},L("navigation",h)&&t.createElement(Y,{activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,blocks:a,navigateToNextBlock:p,navigateToPreviousBlock:f}),t.createElement("div",{className:"action-buttons"},L("next",h)&&t.createElement(q,{onClick:()=>{u(i[l],null,!0)},disabled:F("next",g),className:"next-button"},"Next"),L("skip",h)&&t.createElement("button",{className:"skip-button",onClick:d},"Skip"),L("submit",h)&&t.createElement("div",{className:"submit"},t.createElement(q,{disabled:F("submit",g),onClick:()=>{y(!0),m()}},v?"Submitting":"Submit survey"))))},U=e=>{const{blocks:r,blocksWithQns:s,activeBlock:i,activeBlockIndexOfBlocks:a,activeBlockIndexOfBlocksWithQns:c,isSurveyCompleted:l,isReverseAnimation:u,saveFormValues:m,saveOthersValue:d,skipBlock:p,onSubmitHandler:f,navigateToNextBlock:v,navigateToPreviousBlock:y,answers:h,questions:g,pivot:x}=A(e);return n.useEffect((()=>{void 0!==x?.answer&&e.onSubmit({[x.question.name]:x.answer})}),[x?.answer]),i&&i.question?t.createElement("div",{className:`freemium-survey-components ${e.mobilePreview?"mobile-preview":""} ${e.surveyStyle}-survey-style`,id:"freemium-survey"},l?null:t.createElement(w,{totalSteps:r.length,completedSteps:a+(l?1:0)}),t.createElement(o.SwitchTransition,{mode:"out-in"},t.createElement(o.CSSTransition,{key:c+String(l),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:u?"fade-reverse":"fade"},t.createElement("div",{className:"questions"},l?t.createElement($,{thankYouQuestion:R({pivotQn:x?.question,pivotQnAnswer:x?.answer,block:e.survey.meta?.blocks?.find((e=>"TY"===e.name)),questions:g}),preview:e.preview,placeholders:e.placeholders,npsValue:x?.answer}):t.createElement("div",{id:`${i.question.name}`,className:"question-container","data-test-question-name":i.question.name},t.createElement("div",{className:"question-text",dangerouslySetInnerHTML:{__html:Z(i?.question.text,e.placeholders,x?.answer)},"aria-label":`question-${c}`,role:"heading","aria-level":1}),t.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:{width:"100%"}},t.createElement(C,{question:i.question,isFinalQn:T({blocks:r,activeBlockIndexOfBlocks:a,blocksWithQns:s,activeBlockIndexOfBlocksWithQns:c}),formValues:h.formValues,othersMeta:h.others,autoFocus:!0,autoFocusDelay:"standard"===e.surveyStyle?350:0,saveOthersValue:d,onChangeHandler:e=>{m(i,e)}})),t.createElement(j,{widget:e.widget,surveyStyle:e.surveyStyle,answers:h,blocksWithQns:s,blocks:r,activeBlockIndexOfBlocksWithQns:c,activeBlockIndexOfBlocks:a,saveFormValues:m,skipBlock:p,onSubmit:f,navigateToPreviousBlock:y,navigateToNextBlock:v})))))):null};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 G=({thankYouQuestion:e,preview:o,placeholders:r,npsValue:s})=>(n.useEffect((()=>{o||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:Z(e.text,r,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)))),X=({currentBlockIndex:e,currentBlockIndexOfBlocksWithQns:n,blocksWithQns:o,blocks:r,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=r.findIndex((e=>e.name===o[n.current].name)),i.current=!1,s(n.current)}},t.createElement(B,null)),t.createElement("button",{className:"navigation-button",disabled:n.current>=o.length-1,onClick:()=>{i.current=!1,n.current=Math.min(n.current+1,o.length-1),e.current=r.findIndex((e=>e.name===o[n.current].name)),s(n.current)}},t.createElement(E,null))),K=({widget:e,block:n,surveyStyle:o,formValues:r,othersMeta:s,blocksWithQns:i,blocks:a,thankYouQuestion:l,currentBlockIndexOfBlocksWithQns:u,currentBlockIndexOfBlocks:m,currentEditingBlock:d,isSubmitting:p,isValuesCommitted:f,isCurrentBlockFinal:v,setHorizontalScrollUnits:y,handleFormValues:h,skipBlock:g,setIsSubmitting:x,onSubmit:b,setIsSurveyCompleted:w,preventQuestionAnimation:k,preview:E,closePreview:B,..._})=>{const O=_.blockIndex??u.current,N=_.question??i[O].question,S=()=>N.name===d.current.question.name&&(!c.includes(N.type_info.question_type)||"DROPDOWN"===N.type_info.question_type&&"Others"===r[N.name])&&!v(),C=()=>"RANGE"!==N.type_info.question_type&&!n.required&&N.name===d.current.question.name&&!v(),I=()=>("DROPDOWN"===N.type_info.question_type&&N.name!==d.current.question.name&&!n.required&&r[N.name],!1),z=()=>v()&&(e||"standard"!==o)&&N.name===d.current.question.name,Z=("MULTI_SELECT"===d.current.question.type_info.question_type&&r[d.current.question.name]?.includes("Others")||"DROPDOWN"===d.current.question.type_info.question_type&&"Others"===r[d.current.question.name])&&(!s[d.current.question.name]||""===s[d.current.question.name].trim());return t.createElement("div",{className:"question-footer"},!(!e&&"standard"===o||0===O&&!r[N.name])&&t.createElement(X,{currentBlockIndex:m,currentBlockIndexOfBlocksWithQns:u,blocksWithQns:i,blocks:a,setHorizontalScrollUnits:y,preventQuestionAnimation:k}),(S()||I()||C()||z())&&t.createElement("div",{className:"action-buttons"},S()&&t.createElement(q,{onClick:()=>{h(i[O],null,!0)},disabled:d.current.required&&(!r[d.current.question.name]||Array.isArray(r[d.current.question.name])&&0===r[d.current.question.name].length)||d.current.question.type_info.meta?.othersRequired&&Z,className:"next-button"},"Next"),C()&&t.createElement("button",{className:"skip-button",onClick:()=>g(N)},"Skip"),I()&&t.createElement("button",{className:"skip-button",onClick:()=>{d.current=i[O],m.current=a.findIndex((e=>e.name===i[O].name)),g(N)}},"Clear selection"),z()&&t.createElement("div",{className:"submit"},t.createElement(q,{disabled:(d.current.required||d.current.question.type_info.pivot_question)&&(null==r[d.current.question.name]||0===r[d.current.question.name]?.length)||d.current.question.type_info.meta?.othersRequired&&Z||p,onClick:()=>{x(!0),b()}},p?"Submitting":"Submit survey"))))},J=({survey:e,surveyStyle:r="standard",placeholders:s,onSubmit:i,widget:a,npsValue:l,preview:u,mobilePreview:m,closePreview:d})=>{const p=e.question_details?.questions||[],f=e.meta?.blocks||[],[v,y]=n.useState(null),[h,g]=n.useState({}),[x,b]=n.useState(!1),[k,E]=n.useState([]),[B,_]=n.useState(0),[O,N]=n.useState(!1),[S,I]=n.useState(null),[z,Q]=n.useState({}),W=n.useRef(null),T=n.useRef(null),R=n.useRef(-1),V=n.useRef(null),L=n.useRef(0),M=n.useRef(0),F=n.useRef(!1),D=n.useRef([]),H=n.useRef(null!=l&&"card"===r),P=n.useRef(null),A=n.useRef([]);n.useEffect((()=>{f&&(P.current=f.find((e=>"TY"===e.name)),y(f.filter((e=>"TY"!==e.name))))}),[f]),n.useEffect((()=>{if(v)if(T.current=p.find((e=>e.type_info?.pivot_question))??p.find((e=>"RANGE"===e.type_info?.question_type))??p[0],null!=l){R.current=Math.min(T.current.type_info.validation.max,Math.max(T.current.type_info.validation.min,l));const e=p.find((e=>e.name===v[0].question_names[0]));W.current={...v[0],question:e},D.current=[...D.current,{...v[0],question:e}],E(D.current),g({Q_1:R.current})}else if(!W.current&&v.length>0)return W.current=v[0],void j(v[0])}),[v,l]),n.useEffect((()=>{void 0!==h[T.current?.name]&&i?.({[T.current.name]:R.current})}),[h[T.current?.name]]),n.useEffect((()=>{k.length&&(D.current=k,M.current=k.length-1),a||"standard"!==r?(V.current&&(V.current.style.maxHeight="unset"),A.current[L.current]=V.current?.scrollHeight||A.current[L.current]||0,V.current&&(V.current.style.maxHeight="100%")):V.current?.scrollIntoView({block:"start",behavior:"smooth"}),_(k.length-1)}),[k]),n.useEffect((()=>{Object.keys(h).length>0&&W.current.question&&(c.includes(W.current.question.type_info.question_type)&&("DROPDOWN"!==W.current.question.type_info.question_type||"Others"!==h[W.current.question.name])||F.current)&&!Y()&&U()}),[h]),n.useEffect((()=>{if(null!=h?.[T.current?.name])if(P.current?.is_based_on_rating){const e=T.current?.type_info?.choices[h?.[T.current?.name]-T.current?.type_info?.validation?.min??0]?.dependent_question_names,n=P.current?.question_names.find((n=>e?.includes(n))),t=p.find((e=>e.name===n));I(t)}else{const e=p.find((e=>e.name==P.current?.question_names[0]));I(e)}}),[h?.[T.current?.name]]);const $=()=>{i({...h,others_meta:z},(()=>{S?.type_info.meta?.skipThankYouPage?u?setTimeout((()=>{d?.()}),300):window.location.href=S?.type_info.meta?.redirectUrl:b(!0)}))},Y=()=>L.current===v.length-1||"end"===W.current.branchOption,j=e=>{let n={};if(e.is_based_on_rating){const t=T.current?.type_info?.choices[h?.[T.current?.name]-T.current?.type_info?.validation?.min??0]?.dependent_question_names,o=e.question_names.find((e=>t?.includes(e)));n=p.find((e=>e.name===o))}else n=p.find((n=>n.name===e.question_names[0]));W.current.question=n;D.current.find((e=>e.question.name===n.name))?(_(B+1),M.current+=1):E([...D.current,{...e,question:n}])},U=()=>{if(Y())b(!0);else{if(W.current.nextBlock&&"specific"===W.current.branchOption)L.current=v.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=h[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 $(),void b(!0);L.current=v.findIndex((e=>e.name===t.nextBlock))}else L.current+=1}else L.current+=1;W.current=v[L.current],j(v[L.current])}},X=e=>{F.current=!0,delete h[e.name],g({...h})},J=(e,n,t)=>{if(H.current=!1,t){if(F.current=!0,null!=h[e.question.name]&&e.name!==k[k.length-1].name){const[t,o]=(e=>{const n=k.findIndex((n=>n.name===e.name)),t=k.slice(0,n+1),o=t.reduce(((e,n)=>(e[n.question.name]=h[n.question.name],e)),{});return L.current=v.findIndex((n=>n.name===e.name)),[t,o]})(e);g({...o,...null!=n&&{[e.question.name]:n}}),D.current=t}else g({...h,...null!=n&&{[e.question.name]:n}});T?.current?.name==e?.question?.name&&(R.current=n)}else g({...h,...null!=n&&{[e.question.name]:n}})},ee=(e,n)=>{const t=k.find((n=>n.question.name===e));if(L.current=v.findIndex((e=>e.name===t.name)),W.current=t,null===n){const n={...z};delete n[e],Q({...n})}else Q({...z,[e]:n})};if(!W.current||!W.current.question)return null;const ne=("MULTI_SELECT"===W.current.question.type_info.question_type&&h[W.current.question.name]?.includes("Others")||"DROPDOWN"===W.current.question.type_info.question_type&&"Others"===h[W.current.question.name])&&(!z[W.current.question.name]||""===z[W.current.question.name]);return t.createElement("div",{className:`freemium-survey-components ${a?"widget-survey-components":""} ${m?"mobile-preview":""} ${r}-survey-style`,id:"freemium-survey"},x?null:t.createElement(w,{totalSteps:v.length,completedSteps:L.current}),t.createElement(o.SwitchTransition,{mode:"out-in"},t.createElement(o.CSSTransition,{key:String(x),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:a?"":"fade"},t.createElement("div",null,x?t.createElement(G,{thankYouQuestion:S,preview:u,placeholders:s,npsValue:R.current}):t.createElement(t.Fragment,null,t.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:a||"card"===r?{transform:`translateX(calc(-${B} * 100%))`,height:`${A.current[L.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:V,className:"question-container "+(!a&&"card"!==r||M.current===n?"":"hide-question-container")},t.createElement("div",{className:"question-text "+(0===n?"nps":""),dangerouslySetInnerHTML:{__html:Z(e.question.text,s,R.current)},"aria-label":`question-${n}`,role:"heading","aria-level":1}),t.createElement("button",{disabled:!a&&"standard"===r,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),t.createElement(C,{question:e.question,isFinalQn:Y(),formValues:h,othersMeta:z,autoFocus:M.current===n,autoFocusDelay:"standard"===r?350:20,saveOthersValue:ee,onChangeHandler:n=>{F.current=!1,L.current=v.findIndex((n=>n.name===e.name)),W.current=e,J(e,n,!("DROPDOWN"===e.question.type_info.question_type&&"Others"===n)&&c.includes(e.question.type_info.question_type)&&!Y())}}),t.createElement("button",{disabled:!a&&"standard"===r,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),t.createElement(K,{question:e.question,block:e,blockIndex:n,widget:a,surveyStyle:r,formValues:h,othersMeta:z,blocksWithQns:k,blocks:v,thankYouQuestion:S,currentBlockIndexOfBlocksWithQns:M,currentBlockIndexOfBlocks:L,currentEditingBlock:W,isSubmitting:O,isValuesCommitted:F,isCurrentBlockFinal:Y,setHorizontalScrollUnits:_,handleFormValues:J,skipBlock:X,setIsSubmitting:N,onSubmit:$,setIsSurveyCompleted:b,preventQuestionAnimation:H,preview:u,closePreview:d})))),!a&&"card"!==r&&Y()&&t.createElement("div",{className:"submit"},t.createElement(q,{disabled:(W.current.required||W.current.question.type_info.pivot_question)&&(null==h[W.current.question.name]||0===h[W.current.question.name]?.length)||W.current.question.type_info.meta?.othersRequired&&ne||O,onClick:()=>{N(!0),i({...h,others_meta:z},(()=>{S?.type_info.meta?.skipThankYouPage?u?setTimeout((()=>{d?.()}),300):window.location.href=S?.type_info.meta?.redirectUrl:b(!0)}))}},O?"Submitting":"Submit survey"))))))))};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: 86%;\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 ee=({thankYouQuestion:e,placeholders:n,npsValue:o},r)=>t.createElement(t.Fragment,null,t.createElement("div",{className:"heading"},"Thank you!"),t.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:Z(e.text,n,o)}})),ne=({activeBlockIndexOfBlocks:e,activeBlockIndexOfBlocksWithQns:n,blocksWithQns:o,blocks:r,navigateToPreviousBlock:s,navigateToNextBlock:i})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:F("navigation-prev",{blocks:r,blocksWithQns:o,activeBlockIndexOfBlocks:e,activeBlockIndexOfBlocksWithQns:n}),className:"navigation-button",onClick:s},t.createElement(B,null)),t.createElement("button",{className:"navigation-button",disabled:F("navigation-next",{blocks:r,blocksWithQns:o,activeBlockIndexOfBlocks:e,activeBlockIndexOfBlocksWithQns:n}),onClick:i},t.createElement(E,null))),te=e=>{const{widget:o,widgetStyle:r,answers:s,blocksWithQns:i,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,saveFormValues:u,onSubmit:m,skipBlock:d,navigateToNextBlock:p,navigateToPreviousBlock:f}=e,[v,y]=n.useState(!1),h={answers:s,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,widget:o},g={answers:s,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,isSubmitting:v},x="compact"===r&&L("navigation",h)&&L("skip",h);return 1===i.length&&1!==a.length?null:t.createElement("div",{className:"question-footer"},x?t.createElement("div",{className:"compact-footer-layout"},t.createElement(ne,{activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,blocks:a,navigateToNextBlock:p,navigateToPreviousBlock:f}),t.createElement("button",{className:"skip-button",onClick:d},"Skip")):null,t.createElement("div",{className:"action-buttons"},!x&&L("navigation",h)&&t.createElement("div",{style:{marginRight:"auto"}},t.createElement(ne,{activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,blocks:a,navigateToNextBlock:p,navigateToPreviousBlock:f})),"compact"!==r&&L("skip",h)&&t.createElement("button",{className:"skip-button",onClick:d},"Skip"),L("next",h)&&t.createElement(q,{onClick:()=>{u(i[l],null,!0)},disabled:F("next",g),className:"next-button"},"Next"),L("submit",h)&&t.createElement("div",{className:"submit"},t.createElement(q,{disabled:F("submit",g),onClick:()=>{y(!0),m()}},v?"Submitting":"Submit survey"))))},oe=e=>{const{blocks:s,blocksWithQns:i,activeBlock:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:u,isSurveyCompleted:m,isReverseAnimation:d,saveFormValues:p,saveOthersValue:f,skipBlock:v,onSubmitHandler:y,navigateToNextBlock:h,navigateToPreviousBlock:g,answers:x,questions:b,pivot:k}=A(e),[q,E]=n.useState(null),B=n.useRef(0);n.useEffect((()=>{void 0!==k?.answer&&e.onSubmit({[k.question.name]:k.answer})}),[k?.answer]);return n.useMemo((()=>{(()=>{if(q){q.style.minHeight="unset",q.style.maxHeight="unset",q.style.height="min-content",q.style.position="static";const n=Math.min(q?.scrollHeight+2,l[e.widgetStyle]);q.style.height=n+"px",q.style.minHeight=n+"px",B.current=n}})()}),[q]),n.useEffect((()=>{e.setCurrentSurveyState?.({question:i?.[u]?.question,npsScore:k?.answer})}),[u,k?.answer]),a&&a.question?t.createElement("div",{className:`freemium-survey-components widget-survey-components\n ${e.widgetStyle}-style `,id:"freemium-survey"},e.widgetHeaderQuerySelector&&!m&&document.querySelector(e.widgetHeaderQuerySelector)?r.createPortal(t.createElement(w,{totalSteps:s.length,completedSteps:c+(m?1:0),widget:!0}),document.querySelector(e.widgetHeaderQuerySelector)):null,t.createElement("div",{className:"questions",style:{height:B.current,...1===i.length?{transition:"none"}:{}}},t.createElement(o.TransitionGroup,{component:null},t.createElement(o.CSSTransition,{key:u+String(m),unmountOnExit:!0,addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:d?"fade-reverse":"fade"},t.createElement("div",{ref:e=>e?E(e):null,id:`${a.question.name}`,className:"question-container "+(m?"thankyou":""),"data-test-question-name":a.question.name},m?t.createElement(ee,{thankYouQuestion:R({pivotQn:k?.question,pivotQnAnswer:k?.answer,block:e.survey.meta?.blocks?.find((e=>"TY"===e.name)),questions:b}),placeholders:e.placeholders,npsValue:k?.answer}):t.createElement(t.Fragment,null,t.createElement("div",{className:"question-text "+("RANGE"===a?.question?.type_info?.question_type?"nps-question-text":""),dangerouslySetInnerHTML:{__html:Z(a?.question.text,e.placeholders,k?.answer)},"aria-label":`question-${u}`,role:"heading","aria-level":1}),t.createElement("div",{className:"question-wrapper",onTransitionEndCapture:e=>e.stopPropagation()},t.createElement(C,{question:a.question,isFinalQn:T({blocks:s,activeBlockIndexOfBlocks:c,blocksWithQns:i,activeBlockIndexOfBlocksWithQns:u}),formValues:x.formValues,othersMeta:x.others,autoFocus:!0,autoFocusDelay:0,saveOthersValue:f,onChangeHandler:e=>{p(a,e)}})),t.createElement(te,{widget:!0,widgetStyle:e.widgetStyle,surveyStyle:"standard",answers:x,blocksWithQns:i,blocks:s,activeBlockIndexOfBlocksWithQns:u,activeBlockIndexOfBlocks:c,saveFormValues:p,skipBlock:v,onSubmit:y,navigateToPreviousBlock:g,navigateToNextBlock:h}))))))):null};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 .compact-container-style .header-content.minimized {\n padding-left: 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 re=({onDismiss:e,remindLater:o,closeMenu:r,closeIconRef:s,position:i="bottom"})=>(n.useEffect((()=>{const e=e=>{s.current===e.target||s.current.contains(e.target)||r()};return window.addEventListener("click",e),()=>window.removeEventListener("click",e)}),[]),t.createElement("div",{className:"close-widget "+("top"===i?"top":"")},t.createElement("button",{onClick:async()=>{await o()},autoFocus:!0},"Remind me later"),t.createElement("button",{onClick:async()=>{await e()}},"Dismiss"))),se=({survey:e,preview:o,placeholders:r,onSubmit:s,remindLater:i,onDismiss:a,onClose:c,surveyType:l,unsubscribeUrl:m,isSurveyCompleted:d,children:p=null})=>{const[f,v]=n.useState(!1),[y,h]=n.useState(!1),[g,x]=n.useState(0),{ui_theme:b}=e,[w,k]=n.useState(null),[q,E]=n.useState(!1),[B,C]=n.useState(null),I=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],z=()=>{v(!0),setTimeout((()=>{window.SurveyWidget?.unmount()}),300)},W=n.useRef(null);return t.createElement("div",{className:`container ${l}-container-style ${y?"minimized":""}`,style:{opacity:f?0:1,"--container-width":`${u[l]}`,"--height-transition-duration":"600ms",...Q(b)}},p,t.createElement("header",{id:"surveyserv-widget-header",className:"widget-header "+(y?"minimized":"")},y&&t.createElement("span",{className:"header-content minimized",dangerouslySetInnerHTML:{__html:Z(B?.question?.text??I?.text,{...r,"{{nps.rating}}":B?.npsScore})}}),t.createElement("div",{className:"icons"},!d&&t.createElement("button",{onClick:()=>{y?(h(!y),setTimeout((()=>{x(0)}),700)):(x(w?.clientHeight??0),setTimeout((()=>{h(!y)}),0))},className:"icon"},y?t.createElement(N,null):t.createElement(O,null)),t.createElement("button",{ref:W,onClick:()=>{d?(z(),c?.()):E(!q)},className:"icon"},t.createElement(_,null))),q&&t.createElement(re,{position:y?"top":"bottom",closeIconRef:W,onDismiss:async()=>{await a(),z()},remindLater:async()=>{await i(),z()},closeMenu:()=>E(!q)})),t.createElement("main",{ref:e=>k(e),className:"widget-main "+(y?"minimized":""),style:{height:y?0:g||"auto"}},t.createElement(oe,{widgetStyle:l,survey:e,placeholders:r,onSubmit:s,setCurrentSurveyState:C,widgetHeaderQuerySelector:y?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"},"Powered by",t.createElement(S,null)),m&&!y&&t.createElement("a",{href:m,target:"_blank",rel:"noopener noreferrer",onClick:e=>{o&&(e.preventDefault(),c?.()),e.stopPropagation(),z()}},"Unsubscribe")))};exports.BUTTON_SIZE_VARIANTS={LARGE:"large",MINI:"mini",NORMAL:"normal"},exports.Button=q,exports.CheckboxGroup=h,exports.Input=f,exports.NPS=i,exports.ProgressBar=w,exports.Radio=b,exports.RadioGroup=x,exports.Survey=e=>{const n=P(e.survey);return t.createElement(t.Fragment,null,"standard"===e.surveyStyle?t.createElement(J,Object.assign({},e,{survey:n})):t.createElement(U,Object.assign({},e,{survey:n})))},exports.TextArea=v,exports.WebInAppSurvey=e=>{const n=P(e.survey);return t.createElement(se,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),o=require("react-transition-group"),r=e(require("react-dom"));function s(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===t&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.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 .choices {\n width: 100%;\n display: flex;\n justify-content: space-between;\n font-weight: 500;\n border-radius: 4px;\n}\n.freemium-survey-components .nps-container .nps-scale .choice {\n background: #ebeff3;\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.standard .choice {\n background: rgba(228, 62, 61, 0.3);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2) {\n background: rgba(0, 175, 80, 0.3);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(4) {\n background: rgba(248, 196, 62, 0.3);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice:hover, .freemium-survey-components .nps-container .nps-scale.standard .choice.active {\n background: rgb(228, 62, 61);\n color: #fff;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(2), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(2), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(2) {\n background: rgb(0, 175, 80);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(4), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(4), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(4) {\n background: rgb(248, 196, 62);\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-row-gap: 6px;\n row-gap: 6px;\n grid-column-gap: 6px;\n -moz-column-gap: 6px;\n column-gap: 6px;\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-row-gap: 6px;\n row-gap: 6px;\n grid-column-gap: 6px;\n -moz-column-gap: 6px;\n column-gap: 6px;\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:o="highlighted",button_shape:r="rounded"}={},rating_presets:{start:s="Very unlikely",end:i="Very likely"}={},validation:{min:a},footer_text:c}}=e,l=e=>{switch(e){case e<=6:return"detractor";case e<=8:return"passive";default:return"promoter"}},u=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 ${r} ${o}`},t.createElement("div",{className:"button-container"},t.createElement("div",{className:"choices",role:"radiogroup","aria-required":!0},u.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 ${l(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"},`${u.current[u.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]::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::placeholder {\n color: #92a2b2;\n font-weight: 400;\n font-size: 0.85rem;\n}');const c=["RANGE","NPS","RADIO","DROPDOWN"],l={default:500,compact:500,cozy:400},u={default:"600px",compact:"350px",cozy:"96%"},m={isRequired:!1,showCount:!0,isErrored:!1,inline:!1,spellCheck:!1,autoFocusInput:!0},d=n.forwardRef(((e,o)=>{const r=n.useRef(null);n.useEffect((()=>{e.autoFocusInput&&setTimeout((()=>{r.current?.focus()}),300+(e.autoFocusDelay??0))}),[e.autoFocusInput]);const{inputStyle:s,style:i,className:a,showCount:c,isErrored:l,startLabel:u,isRequired:m,errorText:d,endLabel:p,maxLength:f=256,onChange:v,autoFocusInput:y,...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,u&&t.createElement("div",{className:"start-label"},u),t.createElement("div",{className:`input-basic ${l?"error":""}${a||""}`},t.createElement("input",Object.assign({},h,{type:"text",autoComplete:"off",ref:r,style:s,onChange:e=>{e.target.value?.length>f||v?.(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)),l&&d&&t.createElement("span",{className:"input-error"},e.errorText))})),p=n.forwardRef(((e,o)=>{const r=n.useRef(null);n.useEffect((()=>{e.autoFocusInput&&setTimeout((()=>{r.current?.focus()}),300+(e.autoFocusDelay??0))}),[e.autoFocusInput]);const{inputStyle:s,style:i,className:a,showCount:c,maxLength:l=1500,startLabel:u,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),u&&t.createElement("div",{className:"start-label"},u),t.createElement("div",{className:`input-basic ${a||""}`},t.createElement("textarea",Object.assign({},f,{autoComplete:"off",ref:r,style:s,onChange:e=>{e.target.value?.length>l||p?.(e)}})),c&&l&&l>0&&t.createElement("div",{className:"end-max-length"},`${e.value&&e.value.length||0}/${l}`)),e.endLabel&&t.createElement("div",{className:"end-label"},e.endLabel)))})),f=a(d,m),v=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 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"})),h=({values:e=[],othersValue:o="",options:r,name:s,autoFocusGroup:i,autoFocusDelay:a,onChangeHandler:c,saveOthersValue:l})=>{const u=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}),r?.filter((e=>"Others"!==e.value)).map(((n,o)=>t.createElement(g,{key:n.id,checked:e?.includes(n.value),name:n.value,id:n.id,onChange:(t,o)=>{if(o)c([...e||[],n.value]);else{const t=e.indexOf(n.value);t>-1&&e.splice(t,1),c([...e])}}},n.value))),r?.find((e=>"Others"===e.value))&&t.createElement(g,{key:"others",checked:u,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"),u&&t.createElement(t.Fragment,null,t.createElement(f,{placeholder:"Enter your comment",value:o,onChange:e=>{l(s,e.target.value)},autoFocusDelay:10,label:""})))},g=a((e=>{const o=n.useRef(null);return n.useEffect((()=>{e.autoFocus&&setTimeout((()=>{o.current?.focus()}),320)}),[]),t.createElement("label",{className:`checkbox-label ${e.disabled&&"disabled"}`},t.createElement("input",{ref:o,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 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:o,value:r,autoFocusGroup:s,autoFocusDelay:i,onChangeHandler:a,saveOthersValue:c,othersOption:l,othersRequired:u,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}),o?.sort(((e,n)=>"Others"===e.value?1:"Others"===n.value?-1:0))?.map(((n,o)=>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:r===n.value},"Others"===n.value?"Others":n.value))),"Others"===r&&t.createElement(t.Fragment,null,t.createElement(f,{value:m??"",onChange:n=>{"Others"!==r&&d&&a("Others"),c(e,n.target.value)},placeholder:"Enter your comment",label:"",autoFocusDelay:10})))},b=a((e=>{const o=n.useRef(null);return n.useEffect((()=>{e.autoFocus&&setTimeout((()=>{o.current?.focus()}),320)}),[]),t.createElement("label",{className:"radio-label"},t.createElement("input",{ref:o,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:o,widget:r}=e;return t.createElement("div",{className:"progressbar-container "+(r?"widget":"")},t.createElement("div",{className:"progressbar",style:{width:(o>0?100/n:0)+"%",transform:`scaleX(${o})`}}))};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 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,"..."),q=e=>{const{inline:n=!1,children:o,disabled:r,className:s="",htmlType:i,type:a="primary",onClick:c,size:l,overrideStyleClassName:u="",loading:m=!1,...d}=e;return t.createElement("button",Object.assign({style:n?{display:"inline-block"}:{},disabled:r,className:`action-button ${s} ${u}`,type:i,onClick:c},d),m?t.createElement(k,null):o)},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:"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"})),B=()=>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"})),_=()=>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",fillOpacity:"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"})),O=()=>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"})),N=()=>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)"})),S=()=>t.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"76",height:"16",viewBox:"0 0 200 40"},t.createElement("g",{fill:"none",fillRule:"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"}))),C=({question:e,formValues:n,othersMeta:o,onChangeHandler:r,saveOthersValue:s,autoFocus:a,autoFocusDelay:c,isFinalQn:l})=>{switch(e.type_info.question_type){case"RANGE":return t.createElement(i,{type_info:e.type_info,onChangeHandler:r,npsValue:n[e.name]});case"CHECKBOX":case"MULTI_SELECT":return t.createElement(h,{name:e.name,autoFocusGroup:a,values:n[e.name],othersValue:o[e.name],options:e.type_info.choices,onChangeHandler:r,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:r,saveOthersValue:s,options:e.type_info.choices,value:n[e.name],othersValue:o[e.name],othersOption:e.type_info.meta?.othersOption,othersRequired:e.type_info.meta?.othersRequired,isFinalQn:l});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=>r(e.target.value)}),t.createElement(v,{autoFocusInput:a,autoFocusDelay:c,label:"",maxLength:256,isRequired:e.is_required,placeholder:e.type_info?.meta?.placeholder??"",value:n[e.name]||"",onChange:e=>r(e.target.value)}));case"PARAGRAPH":return t.createElement(v,{autoFocusInput:a,autoFocusDelay:c,label:"",isRequired:e.is_required,placeholder:e.type_info?.meta?.placeholder??"",value:n[e.name]||"",onChange:e=>r(e.target.value)});default:return console.error(`Question type ${e.type_info.question_type} not found`),null}},I=(e={})=>0==Object.values(e).length,z=e=>!e||"string"==typeof e&&""===e.trim()||Array.isArray(e)&&0===e.length,Z=(e,n,t)=>{if(e){let o;if(t&&(o={"{{nps.rating}}":t}),n&&(o={...n,...o??{}}),o){const n=new RegExp(Object.keys(o).join("|"),"gi");e=e.replace(n,(function(e){return o[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}});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: 0;\n gap: 0;\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 grid-gap: 0;\n gap: 0;\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=({questions:e})=>e.find((e=>e.type_info?.pivot_question))??e.find((e=>"RANGE"===e.type_info?.question_type))??e[0],T=({blocks:e,activeBlockIndexOfBlocks:n,blocksWithQns:t,activeBlockIndexOfBlocksWithQns:o})=>{const r=e[n];return(n===e.length-1||"end"===r.branchOption)&&o===t.length-1},R=({pivotQn:e,pivotQnAnswer:n,block:t,questions:o})=>{if(t?.is_based_on_rating){const r=e?.type_info?.choices?.[n-(e?.type_info?.validation?.min??0)??0]?.dependent_question_names,s=t?.question_names?.find((e=>r?.includes(e)));return o.find((e=>e.name===s))}return o.find((e=>e.name===t?.question_names?.[0]))},V=({question:e,answers:n})=>c.includes(e?.type_info?.question_type||"")&&!("DROPDOWN"===e.type_info?.question_type&&"Others"===n.formValues[e.name])||n.commitDirtyValue,L=(e,{answers:n,blocks:t,activeBlockIndexOfBlocks:o,blocksWithQns:r,activeBlockIndexOfBlocksWithQns:s,surveyStyle:i,widget:a})=>{const l=T({blocks:t,activeBlockIndexOfBlocks:o,blocksWithQns:r,activeBlockIndexOfBlocksWithQns:s}),u=r[s],m=u.question;switch(e){case"next":return(!c.includes(m.type_info?.question_type??"")||"DROPDOWN"===m.type_info?.question_type&&"Others"===n.formValues[m.name])&&!l;case"skip":return"RANGE"!==m.type_info?.question_type&&!u.required&&!l;case"submit":return l&&(a||"standard"!==i);case"navigation":return(a||"card"===i)&&!(0===s&&1===r.length)}},M=(e,n)=>("MULTI_SELECT"===e.question.type_info.question_type&&n.formValues[e.question.name]?.includes("Others")||"DROPDOWN"===e.question.type_info.question_type&&"Others"===n.formValues[e.question.name])&&z(n.others[e.question.name]),F=(e,{answers:n,blocks:t,activeBlockIndexOfBlocks:o,blocksWithQns:r,activeBlockIndexOfBlocksWithQns:s,isSubmitting:i})=>{const a=r[s];switch(e){case"next":return a.required&&z(n?.formValues[a.question.name])||a.question.type_info?.meta?.othersRequired&&M(a,n);case"submit":return(a.required||a.question.type_info?.pivot_question)&&z(n?.formValues[a.question.name])||a.question?.type_info?.meta?.othersRequired&&M(a,n)||i;case"navigation-prev":return 0==s;case"navigation-next":return s>=r.length-1;default:return!1}},D=({blocksWithQns:e,activeBlockIndexOfBlocksWithQns:n,answers:t})=>{const o=H({blocksWithQns:e,activeBlockIndexOfBlocksWithQns:n}).reduce(((e,n)=>(t.formValues[n.question.name]&&(e[n.question.name]=t.formValues[n.question.name]),e)),{});return{...t,formValues:o}},H=({blocksWithQns:e,activeBlockIndexOfBlocksWithQns:n})=>e.slice(0,n+1),P=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]),A=e=>{const o=e.survey.question_details?.questions||[],[r,s]=n.useState([]),[i,a]=n.useState({formValues:{},others:{},commitDirtyValue:!1}),[c,l]=n.useState([]),[u,m]=n.useState(0),[d,p]=n.useState(!1),f=n.useRef(),[v,y]=n.useState(!1),h=n.useRef(!1),g=n.useRef(),x=c[u],b=t.useMemo((()=>c.length>0?r?.findIndex((e=>e.name===c[u].name)):0),[u]);n.useEffect((()=>{e.survey.meta?.blocks&&s(e.survey.meta?.blocks.filter((e=>"TY"!==e.name)))}),[e.survey.meta?.blocks]),n.useEffect((()=>{if(!r||!r.length)return;var n,t;f.current={...f.current,question:W({questions:o})},null!=e.npsValue&&(f.current={...f.current,answer:(n=f.current.question,t=e.npsValue,Math.min(n.type_info.validation.max,Math.max(n.type_info.validation.min,t)))},a({...i,formValues:{[f.current.question.name]:f.current.answer}}));const s=R({pivotQn:f.current.question,pivotQnAnswer:f.current.answer,block:r[0],questions:o});l([{...r[0],question:s}])}),[r,e.npsValue]),n.useEffect((()=>{c.length&&m(c.length-1)}),[c]),n.useEffect((()=>{if(!I(i.formValues)&&r&&(({blocks:e,activeBlockIndexOfBlocks:n,blocksWithQns:t,activeBlockIndexOfBlocksWithQns:o,answers:r})=>{const{question:s}=t[o];return!!s&&!T({blocks:e,activeBlockIndexOfBlocks:n,blocksWithQns:t,activeBlockIndexOfBlocksWithQns:o})&&V({question:s,answers:r})})({blocks:r,activeBlockIndexOfBlocks:b,blocksWithQns:c,activeBlockIndexOfBlocksWithQns:u,answers:i})){const n=()=>{p(!1);const e=(({activeBlock:e,blocks:n,activeBlockIndexOfBlocks:t,answers:o})=>{if(e.nextBlock&&"specific"===e.branchOption)return n.findIndex((e=>e.name===e.nextBlock));if("logic"===e.branchOption&&e.question.type_info?.meta?.branches){const r=e.question.type_info?.meta?.branches,s=o.formValues[e.question.name];let i;return i="RANGE"===e.question.type_info.question_type?r.find((e=>s>=e.min&&s<=e.max)):r.find((e=>s===e.value)),i?.nextBlock?"TY"===i.nextBlock?Number.MAX_SAFE_INTEGER:n.findIndex((e=>e.name===i.nextBlock)):t+1}return t+1})({activeBlock:x,blocks:r,activeBlockIndexOfBlocks:b,answers:i}),n=R({pivotQn:f.current?.question,pivotQnAnswer:f.current?.answer,block:r?.[e],questions:o}),t=H({blocksWithQns:c,activeBlockIndexOfBlocksWithQns:u});l([...t,{...r?.[e],question:n}])};null!=e.npsValue&&1==c.length?g.current?(clearTimeout(g.current),g.current=null,n()):g.current=setTimeout((()=>{n()}),1500):n()}}),[i,r]),n.useEffect((()=>{!I(i.formValues)&&h.current&&(d?k():w(),h.current=!1)}),[d]);const w=()=>{d?(h.current=!0,p(!1)):m(u+1)},k=()=>{d?m(u-1):(h.current=!0,p(!0))};return{blocks:r,questions:o,blocksWithQns:c,activeBlock:x,activeBlockIndexOfBlocks:b,activeBlockIndexOfBlocksWithQns:u,isSurveyCompleted:v,isReverseAnimation:d,isNavigating:h.current,pivot:f.current,answers:i,navigateToNextBlock:w,navigateToPreviousBlock:k,saveFormValues:(e,n,t=!1)=>{e.question.name===f.current?.question.name&&(f.current={...f.current,answer:n});let o=i;(t||V({question:e.question,answers:i}))&&(o=D({blocksWithQns:c,activeBlockIndexOfBlocksWithQns:u,answers:i})),a({...o,formValues:{...o.formValues,...null!=n&&{[e.question.name]:n}},commitDirtyValue:t})},saveOthersValue:(e,n)=>{if(null===n){const n={...i.others};delete n[e],a({...i,others:n})}else a({...i,others:{...i.others,[e]:n}})},skipBlock:()=>{p(!1);const e=x.question;if(delete i.formValues[e.name],delete i.others[e.name],u!==c.length-1){const e=D({blocksWithQns:c,activeBlockIndexOfBlocksWithQns:u,answers:i}),n=H({blocksWithQns:c,activeBlockIndexOfBlocksWithQns:u});l(n),a({...e,commitDirtyValue:!0})}else a({...i,commitDirtyValue:!0})},onSubmitHandler:()=>{e.onSubmit({...i.formValues,others_meta:i.others},(()=>{y(!0)}))}}},$=({thankYouQuestion:e,preview:o,placeholders:r,npsValue:s})=>(n.useEffect((()=>{o||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:Z(e.text,r,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=({activeBlockIndexOfBlocks:e,activeBlockIndexOfBlocksWithQns:n,blocksWithQns:o,blocks:r,navigateToPreviousBlock:s,navigateToNextBlock:i})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:F("navigation-prev",{blocks:r,blocksWithQns:o,activeBlockIndexOfBlocks:e,activeBlockIndexOfBlocksWithQns:n}),className:"navigation-button",onClick:s},t.createElement(B,null)),t.createElement("button",{className:"navigation-button",disabled:F("navigation-next",{blocks:r,blocksWithQns:o,activeBlockIndexOfBlocks:e,activeBlockIndexOfBlocksWithQns:n}),onClick:i},t.createElement(E,null))),j=e=>{const{widget:o,surveyStyle:r,answers:s,blocksWithQns:i,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,saveFormValues:u,onSubmit:m,skipBlock:d,navigateToNextBlock:p,navigateToPreviousBlock:f}=e,[v,y]=n.useState(!1),h={answers:s,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,surveyStyle:r,widget:o},g={answers:s,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,isSubmitting:v};return 1===i.length&&1!==a.length?null:t.createElement("div",{className:"question-footer"},L("navigation",h)&&t.createElement(Y,{activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,blocks:a,navigateToNextBlock:p,navigateToPreviousBlock:f}),t.createElement("div",{className:"action-buttons"},L("next",h)&&t.createElement(q,{onClick:()=>{u(i[l],null,!0)},disabled:F("next",g),className:"next-button"},"Next"),L("skip",h)&&t.createElement("button",{className:"skip-button",onClick:d},"Skip"),L("submit",h)&&t.createElement("div",{className:"submit"},t.createElement(q,{disabled:F("submit",g),onClick:()=>{y(!0),m()}},v?"Submitting":"Submit survey"))))},U=e=>{const{blocks:r,blocksWithQns:s,activeBlock:i,activeBlockIndexOfBlocks:a,activeBlockIndexOfBlocksWithQns:c,isSurveyCompleted:l,isReverseAnimation:u,saveFormValues:m,saveOthersValue:d,skipBlock:p,onSubmitHandler:f,navigateToNextBlock:v,navigateToPreviousBlock:y,answers:h,questions:g,pivot:x}=A(e);return n.useEffect((()=>{void 0!==x?.answer&&e.onSubmit({[x.question.name]:x.answer})}),[x?.answer]),i&&i.question?t.createElement("div",{className:`freemium-survey-components ${e.mobilePreview?"mobile-preview":""} ${e.surveyStyle}-survey-style`,id:"freemium-survey"},l?null:t.createElement(w,{totalSteps:r.length,completedSteps:a+(l?1:0)}),t.createElement(o.SwitchTransition,{mode:"out-in"},t.createElement(o.CSSTransition,{key:c+String(l),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:u?"fade-reverse":"fade"},t.createElement("div",{className:"questions"},l?t.createElement($,{thankYouQuestion:R({pivotQn:x?.question,pivotQnAnswer:x?.answer,block:e.survey.meta?.blocks?.find((e=>"TY"===e.name)),questions:g}),preview:e.preview,placeholders:e.placeholders,npsValue:x?.answer}):t.createElement("div",{id:`${i.question.name}`,className:"question-container","data-test-question-name":i.question.name},t.createElement("div",{className:"question-text",dangerouslySetInnerHTML:{__html:Z(i?.question.text,e.placeholders,x?.answer)},"aria-label":`question-${c}`,role:"heading","aria-level":1}),t.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:{width:"100%"}},t.createElement(C,{question:i.question,isFinalQn:T({blocks:r,activeBlockIndexOfBlocks:a,blocksWithQns:s,activeBlockIndexOfBlocksWithQns:c}),formValues:h.formValues,othersMeta:h.others,autoFocus:!0,autoFocusDelay:"standard"===e.surveyStyle?350:0,saveOthersValue:d,onChangeHandler:e=>{m(i,e)}})),t.createElement(j,{widget:e.widget,surveyStyle:e.surveyStyle,answers:h,blocksWithQns:s,blocks:r,activeBlockIndexOfBlocksWithQns:c,activeBlockIndexOfBlocks:a,saveFormValues:m,skipBlock:p,onSubmit:f,navigateToPreviousBlock:y,navigateToNextBlock:v})))))):null};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 G=({thankYouQuestion:e,preview:o,placeholders:r,npsValue:s})=>(n.useEffect((()=>{o||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:Z(e.text,r,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)))),X=({currentBlockIndex:e,currentBlockIndexOfBlocksWithQns:n,blocksWithQns:o,blocks:r,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=r.findIndex((e=>e.name===o[n.current].name)),i.current=!1,s(n.current)}},t.createElement(B,null)),t.createElement("button",{className:"navigation-button",disabled:n.current>=o.length-1,onClick:()=>{i.current=!1,n.current=Math.min(n.current+1,o.length-1),e.current=r.findIndex((e=>e.name===o[n.current].name)),s(n.current)}},t.createElement(E,null))),K=({widget:e,block:n,surveyStyle:o,formValues:r,othersMeta:s,blocksWithQns:i,blocks:a,thankYouQuestion:l,currentBlockIndexOfBlocksWithQns:u,currentBlockIndexOfBlocks:m,currentEditingBlock:d,isSubmitting:p,isValuesCommitted:f,isCurrentBlockFinal:v,setHorizontalScrollUnits:y,handleFormValues:h,skipBlock:g,setIsSubmitting:x,onSubmit:b,setIsSurveyCompleted:w,preventQuestionAnimation:k,preview:E,closePreview:B,..._})=>{const O=_.blockIndex??u.current,N=_.question??i[O].question,S=()=>N.name===d.current.question.name&&(!c.includes(N.type_info.question_type)||"DROPDOWN"===N.type_info.question_type&&"Others"===r[N.name])&&!v(),C=()=>"RANGE"!==N.type_info.question_type&&!n.required&&N.name===d.current.question.name&&!v(),I=()=>("DROPDOWN"===N.type_info.question_type&&N.name!==d.current.question.name&&!n.required&&r[N.name],!1),z=()=>v()&&(e||"standard"!==o)&&N.name===d.current.question.name,Z=("MULTI_SELECT"===d.current.question.type_info.question_type&&r[d.current.question.name]?.includes("Others")||"DROPDOWN"===d.current.question.type_info.question_type&&"Others"===r[d.current.question.name])&&(!s[d.current.question.name]||""===s[d.current.question.name].trim());return t.createElement("div",{className:"question-footer"},!(!e&&"standard"===o||0===O&&!r[N.name])&&t.createElement(X,{currentBlockIndex:m,currentBlockIndexOfBlocksWithQns:u,blocksWithQns:i,blocks:a,setHorizontalScrollUnits:y,preventQuestionAnimation:k}),(S()||I()||C()||z())&&t.createElement("div",{className:"action-buttons"},S()&&t.createElement(q,{onClick:()=>{h(i[O],null,!0)},disabled:d.current.required&&(!r[d.current.question.name]||Array.isArray(r[d.current.question.name])&&0===r[d.current.question.name].length)||d.current.question.type_info.meta?.othersRequired&&Z,className:"next-button"},"Next"),C()&&t.createElement("button",{className:"skip-button",onClick:()=>g(N)},"Skip"),I()&&t.createElement("button",{className:"skip-button",onClick:()=>{d.current=i[O],m.current=a.findIndex((e=>e.name===i[O].name)),g(N)}},"Clear selection"),z()&&t.createElement("div",{className:"submit"},t.createElement(q,{disabled:(d.current.required||d.current.question.type_info.pivot_question)&&(null==r[d.current.question.name]||0===r[d.current.question.name]?.length)||d.current.question.type_info.meta?.othersRequired&&Z||p,onClick:()=>{x(!0),b()}},p?"Submitting":"Submit survey"))))},J=({survey:e,surveyStyle:r="standard",placeholders:s,onSubmit:i,widget:a,npsValue:l,preview:u,mobilePreview:m,closePreview:d})=>{const p=e.question_details?.questions||[],f=e.meta?.blocks||[],[v,y]=n.useState(null),[h,g]=n.useState({}),[x,b]=n.useState(!1),[k,E]=n.useState([]),[B,_]=n.useState(0),[O,N]=n.useState(!1),[S,I]=n.useState(null),[z,Q]=n.useState({}),W=n.useRef(null),T=n.useRef(null),R=n.useRef(-1),V=n.useRef(null),L=n.useRef(0),M=n.useRef(0),F=n.useRef(!1),D=n.useRef([]),H=n.useRef(null!=l&&"card"===r),P=n.useRef(null),A=n.useRef([]);n.useEffect((()=>{f&&(P.current=f.find((e=>"TY"===e.name)),y(f.filter((e=>"TY"!==e.name))))}),[f]),n.useEffect((()=>{if(v)if(T.current=p.find((e=>e.type_info?.pivot_question))??p.find((e=>"RANGE"===e.type_info?.question_type))??p[0],null!=l){R.current=Math.min(T.current.type_info.validation.max,Math.max(T.current.type_info.validation.min,l));const e=p.find((e=>e.name===v[0].question_names[0]));W.current={...v[0],question:e},D.current=[...D.current,{...v[0],question:e}],E(D.current),g({Q_1:R.current})}else if(!W.current&&v.length>0)return W.current=v[0],void j(v[0])}),[v,l]),n.useEffect((()=>{void 0!==h[T.current?.name]&&i?.({[T.current.name]:R.current})}),[h[T.current?.name]]),n.useEffect((()=>{k.length&&(D.current=k,M.current=k.length-1),a||"standard"!==r?(V.current&&(V.current.style.maxHeight="unset"),A.current[L.current]=V.current?.scrollHeight||A.current[L.current]||0,V.current&&(V.current.style.maxHeight="100%")):V.current?.scrollIntoView({block:"start",behavior:"smooth"}),_(k.length-1)}),[k]),n.useEffect((()=>{Object.keys(h).length>0&&W.current.question&&(c.includes(W.current.question.type_info.question_type)&&("DROPDOWN"!==W.current.question.type_info.question_type||"Others"!==h[W.current.question.name])||F.current)&&!Y()&&U()}),[h]),n.useEffect((()=>{if(null!=h?.[T.current?.name])if(P.current?.is_based_on_rating){const e=T.current?.type_info?.choices[h?.[T.current?.name]-T.current?.type_info?.validation?.min??0]?.dependent_question_names,n=P.current?.question_names.find((n=>e?.includes(n))),t=p.find((e=>e.name===n));I(t)}else{const e=p.find((e=>e.name==P.current?.question_names[0]));I(e)}}),[h?.[T.current?.name]]);const $=()=>{i({...h,others_meta:z},(()=>{S?.type_info.meta?.skipThankYouPage?u?setTimeout((()=>{d?.()}),300):window.location.href=S?.type_info.meta?.redirectUrl:b(!0)}))},Y=()=>L.current===v.length-1||"end"===W.current.branchOption,j=e=>{let n={};if(e.is_based_on_rating){const t=T.current?.type_info?.choices[h?.[T.current?.name]-T.current?.type_info?.validation?.min??0]?.dependent_question_names,o=e.question_names.find((e=>t?.includes(e)));n=p.find((e=>e.name===o))}else n=p.find((n=>n.name===e.question_names[0]));W.current.question=n;D.current.find((e=>e.question.name===n.name))?(_(B+1),M.current+=1):E([...D.current,{...e,question:n}])},U=()=>{if(Y())b(!0);else{if(W.current.nextBlock&&"specific"===W.current.branchOption)L.current=v.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=h[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 $(),void b(!0);L.current=v.findIndex((e=>e.name===t.nextBlock))}else L.current+=1}else L.current+=1;W.current=v[L.current],j(v[L.current])}},X=e=>{F.current=!0,delete h[e.name],g({...h})},J=(e,n,t)=>{if(H.current=!1,t){if(F.current=!0,null!=h[e.question.name]&&e.name!==k[k.length-1].name){const[t,o]=(e=>{const n=k.findIndex((n=>n.name===e.name)),t=k.slice(0,n+1),o=t.reduce(((e,n)=>(e[n.question.name]=h[n.question.name],e)),{});return L.current=v.findIndex((n=>n.name===e.name)),[t,o]})(e);g({...o,...null!=n&&{[e.question.name]:n}}),D.current=t}else g({...h,...null!=n&&{[e.question.name]:n}});T?.current?.name==e?.question?.name&&(R.current=n)}else g({...h,...null!=n&&{[e.question.name]:n}})},ee=(e,n)=>{const t=k.find((n=>n.question.name===e));if(L.current=v.findIndex((e=>e.name===t.name)),W.current=t,null===n){const n={...z};delete n[e],Q({...n})}else Q({...z,[e]:n})};if(!W.current||!W.current.question)return null;const ne=("MULTI_SELECT"===W.current.question.type_info.question_type&&h[W.current.question.name]?.includes("Others")||"DROPDOWN"===W.current.question.type_info.question_type&&"Others"===h[W.current.question.name])&&(!z[W.current.question.name]||""===z[W.current.question.name]);return t.createElement("div",{className:`freemium-survey-components ${a?"widget-survey-components":""} ${m?"mobile-preview":""} ${r}-survey-style`,id:"freemium-survey"},x?null:t.createElement(w,{totalSteps:v.length,completedSteps:L.current}),t.createElement(o.SwitchTransition,{mode:"out-in"},t.createElement(o.CSSTransition,{key:String(x),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:a?"":"fade"},t.createElement("div",null,x?t.createElement(G,{thankYouQuestion:S,preview:u,placeholders:s,npsValue:R.current}):t.createElement(t.Fragment,null,t.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:a||"card"===r?{transform:`translateX(calc(-${B} * 100%))`,height:`${A.current[L.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:V,className:"question-container "+(!a&&"card"!==r||M.current===n?"":"hide-question-container")},t.createElement("div",{className:"question-text "+(0===n?"nps":""),dangerouslySetInnerHTML:{__html:Z(e.question.text,s,R.current)},"aria-label":`question-${n}`,role:"heading","aria-level":1}),t.createElement("button",{disabled:!a&&"standard"===r,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),t.createElement(C,{question:e.question,isFinalQn:Y(),formValues:h,othersMeta:z,autoFocus:M.current===n,autoFocusDelay:"standard"===r?350:20,saveOthersValue:ee,onChangeHandler:n=>{F.current=!1,L.current=v.findIndex((n=>n.name===e.name)),W.current=e,J(e,n,!("DROPDOWN"===e.question.type_info.question_type&&"Others"===n)&&c.includes(e.question.type_info.question_type)&&!Y())}}),t.createElement("button",{disabled:!a&&"standard"===r,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),t.createElement(K,{question:e.question,block:e,blockIndex:n,widget:a,surveyStyle:r,formValues:h,othersMeta:z,blocksWithQns:k,blocks:v,thankYouQuestion:S,currentBlockIndexOfBlocksWithQns:M,currentBlockIndexOfBlocks:L,currentEditingBlock:W,isSubmitting:O,isValuesCommitted:F,isCurrentBlockFinal:Y,setHorizontalScrollUnits:_,handleFormValues:J,skipBlock:X,setIsSubmitting:N,onSubmit:$,setIsSurveyCompleted:b,preventQuestionAnimation:H,preview:u,closePreview:d})))),!a&&"card"!==r&&Y()&&t.createElement("div",{className:"submit"},t.createElement(q,{disabled:(W.current.required||W.current.question.type_info.pivot_question)&&(null==h[W.current.question.name]||0===h[W.current.question.name]?.length)||W.current.question.type_info.meta?.othersRequired&&ne||O,onClick:()=>{N(!0),i({...h,others_meta:z},(()=>{S?.type_info.meta?.skipThankYouPage?u?setTimeout((()=>{d?.()}),300):window.location.href=S?.type_info.meta?.redirectUrl:b(!0)}))}},O?"Submitting":"Submit survey"))))))))};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: 86%;\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 ee=({thankYouQuestion:e,placeholders:n,npsValue:o},r)=>t.createElement(t.Fragment,null,t.createElement("div",{className:"heading"},"Thank you!"),t.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:Z(e.text,n,o)}})),ne=({activeBlockIndexOfBlocks:e,activeBlockIndexOfBlocksWithQns:n,blocksWithQns:o,blocks:r,navigateToPreviousBlock:s,navigateToNextBlock:i})=>t.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},t.createElement("button",{disabled:F("navigation-prev",{blocks:r,blocksWithQns:o,activeBlockIndexOfBlocks:e,activeBlockIndexOfBlocksWithQns:n}),className:"navigation-button",onClick:s},t.createElement(B,null)),t.createElement("button",{className:"navigation-button",disabled:F("navigation-next",{blocks:r,blocksWithQns:o,activeBlockIndexOfBlocks:e,activeBlockIndexOfBlocksWithQns:n}),onClick:i},t.createElement(E,null))),te=e=>{const{widget:o,widgetStyle:r,answers:s,blocksWithQns:i,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,saveFormValues:u,onSubmit:m,skipBlock:d,navigateToNextBlock:p,navigateToPreviousBlock:f}=e,[v,y]=n.useState(!1),h={answers:s,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,widget:o},g={answers:s,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,isSubmitting:v},x="compact"===r&&L("navigation",h)&&L("skip",h);return 1===i.length&&1!==a.length?null:t.createElement("div",{className:"question-footer"},x?t.createElement("div",{className:"compact-footer-layout"},t.createElement(ne,{activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,blocks:a,navigateToNextBlock:p,navigateToPreviousBlock:f}),t.createElement("button",{className:"skip-button",onClick:d},"Skip")):null,t.createElement("div",{className:"action-buttons"},!x&&L("navigation",h)&&t.createElement("div",{style:{marginRight:"auto"}},t.createElement(ne,{activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,blocks:a,navigateToNextBlock:p,navigateToPreviousBlock:f})),"compact"!==r&&L("skip",h)&&t.createElement("button",{className:"skip-button",onClick:d},"Skip"),L("next",h)&&t.createElement(q,{onClick:()=>{u(i[l],null,!0)},disabled:F("next",g),className:"next-button"},"Next"),L("submit",h)&&t.createElement("div",{className:"submit"},t.createElement(q,{disabled:F("submit",g),onClick:()=>{y(!0),m()}},v?"Submitting":"Submit survey"))))},oe=e=>{const{blocks:s,blocksWithQns:i,activeBlock:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:u,isSurveyCompleted:m,isReverseAnimation:d,saveFormValues:p,saveOthersValue:f,skipBlock:v,onSubmitHandler:y,navigateToNextBlock:h,navigateToPreviousBlock:g,answers:x,questions:b,pivot:k}=A(e),[q,E]=n.useState(null),B=n.useRef(0);n.useEffect((()=>{void 0!==k?.answer&&e.onSubmit({[k.question.name]:k.answer})}),[k?.answer]);return n.useMemo((()=>{(()=>{if(q){q.style.minHeight="unset",q.style.maxHeight="unset",q.style.height="min-content",q.style.position="static";const n=Math.min(q?.scrollHeight+2,l[e.widgetStyle]);q.style.height=n+"px",q.style.minHeight=n+"px",B.current=n}})()}),[q]),n.useEffect((()=>{e.setCurrentSurveyState?.({question:i?.[u]?.question,npsScore:k?.answer})}),[u,k?.answer]),a&&a.question?t.createElement("div",{className:`freemium-survey-components widget-survey-components\n ${e.widgetStyle}-style `,id:"freemium-survey"},e.widgetHeaderQuerySelector&&!m&&document.querySelector(e.widgetHeaderQuerySelector)?r.createPortal(t.createElement(w,{totalSteps:s.length,completedSteps:c+(m?1:0),widget:!0}),document.querySelector(e.widgetHeaderQuerySelector)):null,t.createElement("div",{className:"questions",style:{height:B.current,...1===i.length?{transition:"none"}:{}}},t.createElement(o.TransitionGroup,{component:null},t.createElement(o.CSSTransition,{key:u+String(m),unmountOnExit:!0,addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:d?"fade-reverse":"fade"},t.createElement("div",{ref:e=>e?E(e):null,id:`${a.question.name}`,className:"question-container "+(m?"thankyou":""),"data-test-question-name":a.question.name},m?t.createElement(ee,{thankYouQuestion:R({pivotQn:k?.question,pivotQnAnswer:k?.answer,block:e.survey.meta?.blocks?.find((e=>"TY"===e.name)),questions:b}),placeholders:e.placeholders,npsValue:k?.answer}):t.createElement(t.Fragment,null,t.createElement("div",{className:"question-text "+("RANGE"===a?.question?.type_info?.question_type?"nps-question-text":""),dangerouslySetInnerHTML:{__html:Z(a?.question.text,e.placeholders,k?.answer)},"aria-label":`question-${u}`,role:"heading","aria-level":1}),t.createElement("div",{className:"question-wrapper",onTransitionEndCapture:e=>e.stopPropagation()},t.createElement(C,{question:a.question,isFinalQn:T({blocks:s,activeBlockIndexOfBlocks:c,blocksWithQns:i,activeBlockIndexOfBlocksWithQns:u}),formValues:x.formValues,othersMeta:x.others,autoFocus:!0,autoFocusDelay:0,saveOthersValue:f,onChangeHandler:e=>{p(a,e)}})),t.createElement(te,{widget:!0,widgetStyle:e.widgetStyle,surveyStyle:"standard",answers:x,blocksWithQns:i,blocks:s,activeBlockIndexOfBlocksWithQns:u,activeBlockIndexOfBlocks:c,saveFormValues:p,skipBlock:v,onSubmit:y,navigateToPreviousBlock:g,navigateToNextBlock:h}))))))):null};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 .compact-container-style .header-content.minimized {\n padding-left: 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 re=({onDismiss:e,remindLater:o,closeMenu:r,closeIconRef:s,position:i="bottom"})=>(n.useEffect((()=>{const e=e=>{s.current===e.target||s.current.contains(e.target)||r()};return window.addEventListener("click",e),()=>window.removeEventListener("click",e)}),[]),t.createElement("div",{className:"close-widget "+("top"===i?"top":"")},t.createElement("button",{onClick:async()=>{await o()},autoFocus:!0},"Remind me later"),t.createElement("button",{onClick:async()=>{await e()}},"Dismiss"))),se=({survey:e,preview:o,placeholders:r,onSubmit:s,remindLater:i,onDismiss:a,onClose:c,surveyType:l,unsubscribeUrl:m,isSurveyCompleted:d,children:p=null})=>{const[f,v]=n.useState(!1),[y,h]=n.useState(!1),[g,x]=n.useState(0),{ui_theme:b}=e,[w,k]=n.useState(null),[q,E]=n.useState(!1),[B,C]=n.useState(null),I=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],z=()=>{v(!0),setTimeout((()=>{window.SurveyWidget?.unmount()}),300)},W=n.useRef(null);return t.createElement("div",{className:`container ${l}-container-style ${y?"minimized":""}`,style:{opacity:f?0:1,"--container-width":`${u[l]}`,"--height-transition-duration":"600ms",...Q(b)}},p,t.createElement("header",{id:"surveyserv-widget-header",className:"widget-header "+(y?"minimized":"")},y&&t.createElement("span",{className:"header-content minimized",dangerouslySetInnerHTML:{__html:Z(B?.question?.text??I?.text,{...r,"{{nps.rating}}":B?.npsScore})}}),t.createElement("div",{className:"icons"},!d&&t.createElement("button",{onClick:()=>{y?(h(!y),setTimeout((()=>{x(0)}),700)):(x(w?.clientHeight??0),setTimeout((()=>{h(!y)}),0))},className:"icon"},y?t.createElement(N,null):t.createElement(O,null)),t.createElement("button",{ref:W,onClick:()=>{d?(z(),c?.()):E(!q)},className:"icon"},t.createElement(_,null))),q&&t.createElement(re,{position:y?"top":"bottom",closeIconRef:W,onDismiss:async()=>{await a(),z()},remindLater:async()=>{await i(),z()},closeMenu:()=>E(!q)})),t.createElement("main",{ref:e=>k(e),className:"widget-main "+(y?"minimized":""),style:{height:y?0:g||"auto"}},t.createElement(oe,{widgetStyle:l,survey:e,placeholders:r,onSubmit:s,setCurrentSurveyState:C,widgetHeaderQuerySelector:y?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"},"Powered by",t.createElement(S,null)),m&&!y&&t.createElement("a",{href:m,target:"_blank",rel:"noopener noreferrer",onClick:e=>{o&&(e.preventDefault(),c?.()),e.stopPropagation(),z()}},"Unsubscribe")))};exports.BUTTON_SIZE_VARIANTS={LARGE:"large",MINI:"mini",NORMAL:"normal"},exports.Button=q,exports.CheckboxGroup=h,exports.Input=f,exports.NPS=i,exports.ProgressBar=w,exports.Radio=b,exports.RadioGroup=x,exports.Survey=e=>{const n=P(e.survey);return t.createElement(t.Fragment,null,"standard"===e.surveyStyle?t.createElement(J,Object.assign({},e,{survey:n})):t.createElement(U,Object.assign({},e,{survey:n})))},exports.TextArea=v,exports.WebInAppSurvey=e=>{const n=P(e.survey);return t.createElement(se,Object.assign({},e,{survey:n}))};
package/lib/index.esm.js CHANGED
@@ -1 +1 @@
1
- import e,{useRef as n,forwardRef as t,useEffect as o,useMemo as r,useState as s}from"react";import{SwitchTransition as i,CSSTransition as a,TransitionGroup as c}from"react-transition-group";import l from"react-dom";function u(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===t&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}u(".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 .choices {\n width: 100%;\n display: flex;\n justify-content: space-between;\n font-weight: 500;\n border-radius: 4px;\n}\n.freemium-survey-components .nps-container .nps-scale .choice {\n background: #ebeff3;\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.standard .choice {\n background: rgba(228, 62, 61, 0.3);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2) {\n background: rgba(0, 175, 80, 0.3);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(4) {\n background: rgba(248, 196, 62, 0.3);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice:hover, .freemium-survey-components .nps-container .nps-scale.standard .choice.active {\n background: rgb(228, 62, 61);\n color: #fff;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(2), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(2), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(2) {\n background: rgb(0, 175, 80);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(4), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(4), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(4) {\n background: rgb(248, 196, 62);\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-row-gap: 6px;\n row-gap: 6px;\n grid-column-gap: 6px;\n -moz-column-gap: 6px;\n column-gap: 6px;\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-row-gap: 6px;\n row-gap: 6px;\n grid-column-gap: 6px;\n -moz-column-gap: 6px;\n column-gap: 6px;\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:o="highlighted",button_shape:r="rounded"}={},rating_presets:{start:s="Very unlikely",end:i="Very likely"}={},validation:{min:a},footer_text:c}}=t,l=e=>{switch(e){case e<=6:return"detractor";case e<=8:return"passive";default:return"promoter"}},u=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 ${r} ${o}`},e.createElement("div",{className:"button-container"},e.createElement("div",{className:"choices",role:"radiogroup","aria-required":!0},u.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 ${l(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"},`${u.current[u.current.length-1]} - ${i}`)))),e.createElement("div",{className:"footer",role:"note"},c))},d=(e,n)=>(e.defaultProps=n,e);u('.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]::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::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},v={default:"600px",compact:"350px",cozy:"96%"},y={isRequired:!1,showCount:!0,isErrored:!1,inline:!1,spellCheck:!1,autoFocusInput:!0},h=t(((t,r)=>{const s=n(null);o((()=>{t.autoFocusInput&&setTimeout((()=>{s.current?.focus()}),300+(t.autoFocusDelay??0))}),[t.autoFocusInput]);const{inputStyle:i,style:a,className:c,showCount:l,isErrored:u,startLabel:m,isRequired:d,errorText:p,endLabel:f,maxLength:v=256,onChange:y,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 ${u?"error":""}${c||""}`},e.createElement("input",Object.assign({},g,{type:"text",autoComplete:"off",ref:s,style:i,onChange:e=>{e.target.value?.length>v||y?.(e)}})),l&&v>0&&e.createElement("div",{className:"end-max-length"},`${t.value&&t.value.length||0}/${v}`)),f&&e.createElement("div",{className:"end-label"},f)),u&&p&&e.createElement("span",{className:"input-error"},t.errorText))})),g=t(((t,r)=>{const s=n(null);o((()=>{t.autoFocusInput&&setTimeout((()=>{s.current?.focus()}),300+(t.autoFocusDelay??0))}),[t.autoFocusInput]);const{inputStyle:i,style:a,className:c,showCount:l,maxLength:u=1500,startLabel:m,isRequired:d,autoFocusInput:p,onChange:f,...v}=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({},v,{autoComplete:"off",ref:s,style:i,onChange:e=>{e.target.value?.length>u||f?.(e)}})),l&&u&&u>0&&e.createElement("div",{className:"end-max-length"},`${t.value&&t.value.length||0}/${u}`)),t.endLabel&&e.createElement("div",{className:"end-label"},t.endLabel)))})),x=d(h,y),b=d(g,y);u('.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 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:r="",options:s,name:i,autoFocusGroup:a,autoFocusDelay:c,onChangeHandler:l,saveOthersValue:u})=>{const m=t.includes("Others"),d=n(null);return o((()=>{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}),s?.filter((e=>"Others"!==e.value)).map(((n,o)=>e.createElement(q,{key:n.id,checked:t?.includes(n.value),name:n.value,id:n.id,onChange:(e,o)=>{if(o)l([...t||[],n.value]);else{const e=t.indexOf(n.value);e>-1&&t.splice(e,1),l([...t])}}},n.value))),s?.find((e=>"Others"===e.value))&&e.createElement(q,{key:"others",checked:m,name:"Others",id:"Others",onChange:(e,n)=>{if(n)l([...t,"Others"]);else{const e=t.findIndex((e=>"Others"===e));t.splice(e,1),l(t)}}},"Others"),m&&e.createElement(e.Fragment,null,e.createElement(x,{placeholder:"Enter your comment",value:r,onChange:e=>{u(i,e.target.value)},autoFocusDelay:10,label:""})))},q=d((t=>{const r=n(null);return o((()=>{t.autoFocus&&setTimeout((()=>{r.current?.focus()}),320)}),[]),e.createElement("label",{className:`checkbox-label ${t.disabled&&"disabled"}`},e.createElement("input",{ref:r,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});u('.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 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 E=({name:t,options:r,value:s,autoFocusGroup:i,autoFocusDelay:a,onChangeHandler:c,saveOthersValue:l,othersOption:u,othersRequired:m,othersValue:d,isFinalQn:p})=>{const f=n(null);return o((()=>{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}),r?.sort(((e,n)=>"Others"===e.value?1:"Others"===n.value?-1:0))?.map(((n,o)=>e.createElement(B,{key:n.value,value:n.value,name:t,onChange:e=>{"Others"!==e.currentTarget.value&&l(t,null),c(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&&c("Others"),l(t,e.target.value)},placeholder:"Enter your comment",label:"",autoFocusDelay:10})))},B=d((t=>{const r=n(null);return o((()=>{t.autoFocus&&setTimeout((()=>{r.current?.focus()}),320)}),[]),e.createElement("label",{className:"radio-label"},e.createElement("input",{ref:r,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});u(".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 _=n=>{const{totalSteps:t,completedSteps:o,widget:r}=n;return e.createElement("div",{className:"progressbar-container "+(r?"widget":"")},e.createElement("div",{className:"progressbar",style:{width:(o>0?100/t:0)+"%",transform:`scaleX(${o})`}}))};u(".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 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 O=()=>e.createElement(e.Fragment,null,"..."),N={LARGE:"large",MINI:"mini",NORMAL:"normal"},C=n=>{const{inline:t=!1,children:o,disabled:r,className:s="",htmlType:i,type:a="primary",onClick:c,size:l,overrideStyleClassName:u="",loading:m=!1,...d}=n;return e.createElement("button",Object.assign({style:t?{display:"inline-block"}:{},disabled:r,className:`action-button ${s} ${u}`,type:i,onClick:c},d),m?e.createElement(O,null):o)},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"})),z=()=>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"})),Q=()=>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",fillOpacity:"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"})),Z=()=>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"})),S=()=>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)"})),W=()=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"76",height:"16",viewBox:"0 0 200 40"},e.createElement("g",{fill:"none",fillRule:"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"}))),T=({question:n,formValues:t,othersMeta:o,onChangeHandler:r,saveOthersValue:s,autoFocus:i,autoFocusDelay:a,isFinalQn:c})=>{switch(n.type_info.question_type){case"RANGE":return e.createElement(m,{type_info:n.type_info,onChangeHandler:r,npsValue:t[n.name]});case"CHECKBOX":case"MULTI_SELECT":return e.createElement(k,{name:n.name,autoFocusGroup:i,values:t[n.name],othersValue:o[n.name],options:n.type_info.choices,onChangeHandler:r,saveOthersValue:s,othersOption:n.type_info.meta?.othersOption,othersRequired:n.type_info.meta?.othersRequired,autoFocusDelay:a});case"RADIO":case"DROPDOWN":return e.createElement(E,{autoFocusGroup:i,autoFocusDelay:a,name:n.name,onChangeHandler:r,saveOthersValue:s,options:n.type_info.choices,value:t[n.name],othersValue:o[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:i,autoFocusDelay:a,label:"",isRequired:n.is_required,value:t[n.name]||"",placeholder:n.type_info?.meta?.placeholder??"",onChange:e=>r(e.target.value)}),e.createElement(b,{autoFocusInput:i,autoFocusDelay:a,label:"",maxLength:256,isRequired:n.is_required,placeholder:n.type_info?.meta?.placeholder??"",value:t[n.name]||"",onChange:e=>r(e.target.value)}));case"PARAGRAPH":return e.createElement(b,{autoFocusInput:i,autoFocusDelay:a,label:"",isRequired:n.is_required,placeholder:n.type_info?.meta?.placeholder??"",value:t[n.name]||"",onChange:e=>r(e.target.value)});default:return console.error(`Question type ${n.type_info.question_type} not found`),null}},L=(e={})=>0==Object.values(e).length,V=e=>!e||"string"==typeof e&&""===e.trim()||Array.isArray(e)&&0===e.length,F=(e,n,t)=>{if(e){let o={};t&&(o={"{{nps.rating}}":t}),n&&(o={...n,...o});const r=new RegExp(Object.keys(o).join("|"),"gi");e=e.replace(r,(function(e){return o[e.toLowerCase()]}))}return e??""},M=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}});u(":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: 0;\n gap: 0;\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 grid-gap: 0;\n gap: 0;\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 D=({questions:e})=>e.find((e=>e.type_info?.pivot_question))??e.find((e=>"RANGE"===e.type_info?.question_type))??e[0],R=({blocks:e,activeBlockIndexOfBlocks:n,blocksWithQns:t,activeBlockIndexOfBlocksWithQns:o})=>{const r=e[n];return(n===e.length-1||"end"===r.branchOption)&&o===t.length-1},H=({pivotQn:e,pivotQnAnswer:n,block:t,questions:o})=>{if(t?.is_based_on_rating){const r=e?.type_info?.choices?.[n-(e?.type_info?.validation?.min??0)??0]?.dependent_question_names,s=t?.question_names?.find((e=>r?.includes(e)));return o.find((e=>e.name===s))}return o.find((e=>e.name===t?.question_names?.[0]))},P=({question:e,answers:n})=>p.includes(e?.type_info?.question_type||"")&&!("DROPDOWN"===e.type_info?.question_type&&"Others"===n.formValues[e.name])||n.commitDirtyValue,A=(e,{answers:n,blocks:t,activeBlockIndexOfBlocks:o,blocksWithQns:r,activeBlockIndexOfBlocksWithQns:s,surveyStyle:i,widget:a})=>{const c=R({blocks:t,activeBlockIndexOfBlocks:o,blocksWithQns:r,activeBlockIndexOfBlocksWithQns:s}),l=r[s],u=l.question;switch(e){case"next":return(!p.includes(u.type_info?.question_type??"")||"DROPDOWN"===u.type_info?.question_type&&"Others"===n.formValues[u.name])&&!c;case"skip":return"RANGE"!==u.type_info?.question_type&&!l.required&&!c;case"submit":return c&&(a||"standard"!==i);case"navigation":return(a||"card"===i)&&!(0===s&&1===r.length)}},$=(e,n)=>("MULTI_SELECT"===e.question.type_info.question_type&&n.formValues[e.question.name]?.includes("Others")||"DROPDOWN"===e.question.type_info.question_type&&"Others"===n.formValues[e.question.name])&&V(n.others[e.question.name]),Y=(e,{answers:n,blocks:t,activeBlockIndexOfBlocks:o,blocksWithQns:r,activeBlockIndexOfBlocksWithQns:s,isSubmitting:i})=>{const a=r[s];switch(e){case"next":return a.required&&V(n?.formValues[a.question.name])||a.question.type_info?.meta?.othersRequired&&$(a,n);case"submit":return(a.required||a.question.type_info?.pivot_question)&&V(n?.formValues[a.question.name])||a.question?.type_info?.meta?.othersRequired&&$(a,n)||i;case"navigation-prev":return 0==s;case"navigation-next":return s>=r.length-1;default:return!1}},j=({blocksWithQns:e,activeBlockIndexOfBlocksWithQns:n,answers:t})=>{const o=U({blocksWithQns:e,activeBlockIndexOfBlocksWithQns:n}).reduce(((e,n)=>(t.formValues[n.question.name]&&(e[n.question.name]=t.formValues[n.question.name]),e)),{});return{...t,formValues:o}},U=({blocksWithQns:e,activeBlockIndexOfBlocksWithQns:n})=>e.slice(0,n+1),G=e=>r((()=>{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]),X=t=>{const r=t.survey.question_details?.questions||[],[i,a]=s([]),[c,l]=s({formValues:{},others:{},commitDirtyValue:!1}),[u,m]=s([]),[d,p]=s(0),[f,v]=s(!1),y=n(),[h,g]=s(!1),x=n(!1),b=n(),w=u[d],k=e.useMemo((()=>u.length>0?i?.findIndex((e=>e.name===u[d].name)):0),[d]);o((()=>{t.survey.meta?.blocks&&a(t.survey.meta?.blocks.filter((e=>"TY"!==e.name)))}),[t.survey.meta?.blocks]),o((()=>{if(!i||!i.length)return;var e,n;y.current={...y.current,question:D({questions:r})},null!=t.npsValue&&(y.current={...y.current,answer:(e=y.current.question,n=t.npsValue,Math.min(e.type_info.validation.max,Math.max(e.type_info.validation.min,n)))},l({...c,formValues:{[y.current.question.name]:y.current.answer}}));const o=H({pivotQn:y.current.question,pivotQnAnswer:y.current.answer,block:i[0],questions:r});m([{...i[0],question:o}])}),[i,t.npsValue]),o((()=>{u.length&&p(u.length-1)}),[u]),o((()=>{if(!L(c.formValues)&&i&&(({blocks:e,activeBlockIndexOfBlocks:n,blocksWithQns:t,activeBlockIndexOfBlocksWithQns:o,answers:r})=>{const{question:s}=t[o];return!!s&&!R({blocks:e,activeBlockIndexOfBlocks:n,blocksWithQns:t,activeBlockIndexOfBlocksWithQns:o})&&P({question:s,answers:r})})({blocks:i,activeBlockIndexOfBlocks:k,blocksWithQns:u,activeBlockIndexOfBlocksWithQns:d,answers:c})){const e=()=>{v(!1);const e=(({activeBlock:e,blocks:n,activeBlockIndexOfBlocks:t,answers:o})=>{if(e.nextBlock&&"specific"===e.branchOption)return n.findIndex((e=>e.name===e.nextBlock));if("logic"===e.branchOption&&e.question.type_info?.meta?.branches){const r=e.question.type_info?.meta?.branches,s=o.formValues[e.question.name];let i;return i="RANGE"===e.question.type_info.question_type?r.find((e=>s>=e.min&&s<=e.max)):r.find((e=>s===e.value)),i?.nextBlock?"TY"===i.nextBlock?Number.MAX_SAFE_INTEGER:n.findIndex((e=>e.name===i.nextBlock)):t+1}return t+1})({activeBlock:w,blocks:i,activeBlockIndexOfBlocks:k,answers:c}),n=H({pivotQn:y.current?.question,pivotQnAnswer:y.current?.answer,block:i?.[e],questions:r}),t=U({blocksWithQns:u,activeBlockIndexOfBlocksWithQns:d});m([...t,{...i?.[e],question:n}])};null!=t.npsValue&&1==u.length?b.current?(clearTimeout(b.current),b.current=null,e()):b.current=setTimeout((()=>{e()}),1500):e()}}),[c,i]),o((()=>{!L(c.formValues)&&x.current&&(f?E():q(),x.current=!1)}),[f]);const q=()=>{f?(x.current=!0,v(!1)):p(d+1)},E=()=>{f?p(d-1):(x.current=!0,v(!0))};return{blocks:i,questions:r,blocksWithQns:u,activeBlock:w,activeBlockIndexOfBlocks:k,activeBlockIndexOfBlocksWithQns:d,isSurveyCompleted:h,isReverseAnimation:f,isNavigating:x.current,pivot:y.current,answers:c,navigateToNextBlock:q,navigateToPreviousBlock:E,saveFormValues:(e,n,t=!1)=>{e.question.name===y.current?.question.name&&(y.current={...y.current,answer:n});let o=c;(t||P({question:e.question,answers:c}))&&(o=j({blocksWithQns:u,activeBlockIndexOfBlocksWithQns:d,answers:c})),l({...o,formValues:{...o.formValues,...null!=n&&{[e.question.name]:n}},commitDirtyValue:t})},saveOthersValue:(e,n)=>{if(null===n){const n={...c.others};delete n[e],l({...c,others:n})}else l({...c,others:{...c.others,[e]:n}})},skipBlock:()=>{v(!1);const e=w.question;if(delete c.formValues[e.name],delete c.others[e.name],d!==u.length-1){const e=j({blocksWithQns:u,activeBlockIndexOfBlocksWithQns:d,answers:c}),n=U({blocksWithQns:u,activeBlockIndexOfBlocksWithQns:d});m(n),l({...e,commitDirtyValue:!0})}else l({...c,commitDirtyValue:!0})},onSubmitHandler:()=>{t.onSubmit({...c.formValues,others_meta:c.others},(()=>{g(!0)}))}}},K=({thankYouQuestion:n,preview:t,placeholders:r,npsValue:s})=>(o((()=>{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,r,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)))),J=({activeBlockIndexOfBlocks:n,activeBlockIndexOfBlocksWithQns:t,blocksWithQns:o,blocks:r,navigateToPreviousBlock:s,navigateToNextBlock:i})=>e.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},e.createElement("button",{disabled:Y("navigation-prev",{blocks:r,blocksWithQns:o,activeBlockIndexOfBlocks:n,activeBlockIndexOfBlocksWithQns:t}),className:"navigation-button",onClick:s},e.createElement(z,null)),e.createElement("button",{className:"navigation-button",disabled:Y("navigation-next",{blocks:r,blocksWithQns:o,activeBlockIndexOfBlocks:n,activeBlockIndexOfBlocksWithQns:t}),onClick:i},e.createElement(I,null))),ee=n=>{const{widget:t,surveyStyle:o,answers:r,blocksWithQns:i,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,saveFormValues:u,onSubmit:m,skipBlock:d,navigateToNextBlock:p,navigateToPreviousBlock:f}=n,[v,y]=s(!1),h={answers:r,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,surveyStyle:o,widget:t},g={answers:r,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,isSubmitting:v};return 1===i.length&&1!==a.length?null:e.createElement("div",{className:"question-footer"},A("navigation",h)&&e.createElement(J,{activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,blocks:a,navigateToNextBlock:p,navigateToPreviousBlock:f}),e.createElement("div",{className:"action-buttons"},A("next",h)&&e.createElement(C,{onClick:()=>{u(i[l],null,!0)},disabled:Y("next",g),className:"next-button"},"Next"),A("skip",h)&&e.createElement("button",{className:"skip-button",onClick:d},"Skip"),A("submit",h)&&e.createElement("div",{className:"submit"},e.createElement(C,{disabled:Y("submit",g),onClick:()=>{y(!0),m()}},v?"Submitting":"Submit survey"))))},ne=n=>{const{blocks:t,blocksWithQns:r,activeBlock:s,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,isSurveyCompleted:u,isReverseAnimation:m,saveFormValues:d,saveOthersValue:p,skipBlock:f,onSubmitHandler:v,navigateToNextBlock:y,navigateToPreviousBlock:h,answers:g,questions:x,pivot:b}=X(n);return o((()=>{void 0!==b?.answer&&n.onSubmit({[b.question.name]:b.answer})}),[b?.answer]),s&&s.question?e.createElement("div",{className:`freemium-survey-components ${n.mobilePreview?"mobile-preview":""} ${n.surveyStyle}-survey-style`,id:"freemium-survey"},u?null:e.createElement(_,{totalSteps:t.length,completedSteps:c+(u?1:0)}),e.createElement(i,{mode:"out-in"},e.createElement(a,{key:l+String(u),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:m?"fade-reverse":"fade"},e.createElement("div",{className:"questions"},u?e.createElement(K,{thankYouQuestion:H({pivotQn:b?.question,pivotQnAnswer:b?.answer,block:n.survey.meta?.blocks?.find((e=>"TY"===e.name)),questions:x}),preview:n.preview,placeholders:n.placeholders,npsValue:b?.answer}):e.createElement("div",{id:`${s.question.name}`,className:"question-container","data-test-question-name":s.question.name},e.createElement("div",{className:"question-text",dangerouslySetInnerHTML:{__html:F(s?.question.text,n.placeholders,b?.answer)},"aria-label":`question-${l}`,role:"heading","aria-level":1}),e.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:{width:"100%"}},e.createElement(T,{question:s.question,isFinalQn:R({blocks:t,activeBlockIndexOfBlocks:c,blocksWithQns:r,activeBlockIndexOfBlocksWithQns:l}),formValues:g.formValues,othersMeta:g.others,autoFocus:!0,autoFocusDelay:"standard"===n.surveyStyle?350:0,saveOthersValue:p,onChangeHandler:e=>{d(s,e)}})),e.createElement(ee,{widget:n.widget,surveyStyle:n.surveyStyle,answers:g,blocksWithQns:r,blocks:t,activeBlockIndexOfBlocksWithQns:l,activeBlockIndexOfBlocks:c,saveFormValues:d,skipBlock:f,onSubmit:v,navigateToPreviousBlock:h,navigateToNextBlock:y})))))):null};u(":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 te=({thankYouQuestion:n,preview:t,placeholders:r,npsValue:s})=>(o((()=>{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,r,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)))),oe=({currentBlockIndex:n,currentBlockIndexOfBlocksWithQns:t,blocksWithQns:o,blocks:r,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=r.findIndex((e=>e.name===o[t.current].name)),i.current=!1,s(t.current)}},e.createElement(z,null)),e.createElement("button",{className:"navigation-button",disabled:t.current>=o.length-1,onClick:()=>{i.current=!1,t.current=Math.min(t.current+1,o.length-1),n.current=r.findIndex((e=>e.name===o[t.current].name)),s(t.current)}},e.createElement(I,null))),re=({widget:n,block:t,surveyStyle:o,formValues:r,othersMeta:s,blocksWithQns:i,blocks:a,thankYouQuestion:c,currentBlockIndexOfBlocksWithQns:l,currentBlockIndexOfBlocks:u,currentEditingBlock:m,isSubmitting:d,isValuesCommitted:f,isCurrentBlockFinal:v,setHorizontalScrollUnits:y,handleFormValues:h,skipBlock:g,setIsSubmitting:x,onSubmit:b,setIsSurveyCompleted:w,preventQuestionAnimation:k,preview:q,closePreview:E,...B})=>{const _=B.blockIndex??l.current,O=B.question??i[_].question,N=()=>O.name===m.current.question.name&&(!p.includes(O.type_info.question_type)||"DROPDOWN"===O.type_info.question_type&&"Others"===r[O.name])&&!v(),I=()=>"RANGE"!==O.type_info.question_type&&!t.required&&O.name===m.current.question.name&&!v(),z=()=>("DROPDOWN"===O.type_info.question_type&&O.name!==m.current.question.name&&!t.required&&r[O.name],!1),Q=()=>v()&&(n||"standard"!==o)&&O.name===m.current.question.name,Z=("MULTI_SELECT"===m.current.question.type_info.question_type&&r[m.current.question.name]?.includes("Others")||"DROPDOWN"===m.current.question.type_info.question_type&&"Others"===r[m.current.question.name])&&(!s[m.current.question.name]||""===s[m.current.question.name].trim());return e.createElement("div",{className:"question-footer"},!(!n&&"standard"===o||0===_&&!r[O.name])&&e.createElement(oe,{currentBlockIndex:u,currentBlockIndexOfBlocksWithQns:l,blocksWithQns:i,blocks:a,setHorizontalScrollUnits:y,preventQuestionAnimation:k}),(N()||z()||I()||Q())&&e.createElement("div",{className:"action-buttons"},N()&&e.createElement(C,{onClick:()=>{h(i[_],null,!0)},disabled:m.current.required&&(!r[m.current.question.name]||Array.isArray(r[m.current.question.name])&&0===r[m.current.question.name].length)||m.current.question.type_info.meta?.othersRequired&&Z,className:"next-button"},"Next"),I()&&e.createElement("button",{className:"skip-button",onClick:()=>g(O)},"Skip"),z()&&e.createElement("button",{className:"skip-button",onClick:()=>{m.current=i[_],u.current=a.findIndex((e=>e.name===i[_].name)),g(O)}},"Clear selection"),Q()&&e.createElement("div",{className:"submit"},e.createElement(C,{disabled:(m.current.required||m.current.question.type_info.pivot_question)&&(null==r[m.current.question.name]||0===r[m.current.question.name]?.length)||m.current.question.type_info.meta?.othersRequired&&Z||d,onClick:()=>{x(!0),b()}},d?"Submitting":"Submit survey"))))},se=({survey:t,surveyStyle:r="standard",placeholders:c,onSubmit:l,widget:u,npsValue:m,preview:d,mobilePreview:f,closePreview:v})=>{const y=t.question_details?.questions||[],h=t.meta?.blocks||[],[g,x]=s(null),[b,w]=s({}),[k,q]=s(!1),[E,B]=s([]),[O,N]=s(0),[I,z]=s(!1),[Q,Z]=s(null),[S,W]=s({}),L=n(null),V=n(null),M=n(-1),D=n(null),R=n(0),H=n(0),P=n(!1),A=n([]),$=n(null!=m&&"card"===r),Y=n(null),j=n([]);o((()=>{h&&(Y.current=h.find((e=>"TY"===e.name)),x(h.filter((e=>"TY"!==e.name))))}),[h]),o((()=>{if(g)if(V.current=y.find((e=>e.type_info?.pivot_question))??y.find((e=>"RANGE"===e.type_info?.question_type))??y[0],null!=m){M.current=Math.min(V.current.type_info.validation.max,Math.max(V.current.type_info.validation.min,m));const e=y.find((e=>e.name===g[0].question_names[0]));L.current={...g[0],question:e},A.current=[...A.current,{...g[0],question:e}],B(A.current),w({Q_1:M.current})}else if(!L.current&&g.length>0)return L.current=g[0],void X(g[0])}),[g,m]),o((()=>{void 0!==b[V.current?.name]&&l?.({[V.current.name]:M.current})}),[b[V.current?.name]]),o((()=>{E.length&&(A.current=E,H.current=E.length-1),u||"standard"!==r?(D.current&&(D.current.style.maxHeight="unset"),j.current[R.current]=D.current?.scrollHeight||j.current[R.current]||0,D.current&&(D.current.style.maxHeight="100%")):D.current?.scrollIntoView({block:"start",behavior:"smooth"}),N(E.length-1)}),[E]),o((()=>{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])||P.current)&&!G()&&K()}),[b]),o((()=>{if(null!=b?.[V.current?.name])if(Y.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=Y.current?.question_names.find((n=>e?.includes(n))),t=y.find((e=>e.name===n));Z(t)}else{const e=y.find((e=>e.name==Y.current?.question_names[0]));Z(e)}}),[b?.[V.current?.name]]);const U=()=>{l({...b,others_meta:S},(()=>{Q?.type_info.meta?.skipThankYouPage?d?setTimeout((()=>{v?.()}),300):window.location.href=Q?.type_info.meta?.redirectUrl:q(!0)}))},G=()=>R.current===g.length-1||"end"===L.current.branchOption,X=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,o=e.question_names.find((e=>t?.includes(e)));n=y.find((e=>e.name===o))}else n=y.find((n=>n.name===e.question_names[0]));L.current.question=n;A.current.find((e=>e.question.name===n.name))?(N(O+1),H.current+=1):B([...A.current,{...e,question:n}])},K=()=>{if(G())q(!0);else{if(L.current.nextBlock&&"specific"===L.current.branchOption)R.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 U(),void q(!0);R.current=g.findIndex((e=>e.name===t.nextBlock))}else R.current+=1}else R.current+=1;L.current=g[R.current],X(g[R.current])}},J=e=>{P.current=!0,delete b[e.name],w({...b})},ee=(e,n,t)=>{if($.current=!1,t){if(P.current=!0,null!=b[e.question.name]&&e.name!==E[E.length-1].name){const[t,o]=(e=>{const n=E.findIndex((n=>n.name===e.name)),t=E.slice(0,n+1),o=t.reduce(((e,n)=>(e[n.question.name]=b[n.question.name],e)),{});return R.current=g.findIndex((n=>n.name===e.name)),[t,o]})(e);w({...o,...null!=n&&{[e.question.name]:n}}),A.current=t}else w({...b,...null!=n&&{[e.question.name]:n}});V?.current?.name==e?.question?.name&&(M.current=n)}else w({...b,...null!=n&&{[e.question.name]:n}})},ne=(e,n)=>{const t=E.find((n=>n.question.name===e));if(R.current=g.findIndex((e=>e.name===t.name)),L.current=t,null===n){const n={...S};delete n[e],W({...n})}else W({...S,[e]:n})};if(!L.current||!L.current.question)return null;const oe=("MULTI_SELECT"===L.current.question.type_info.question_type&&b[L.current.question.name]?.includes("Others")||"DROPDOWN"===L.current.question.type_info.question_type&&"Others"===b[L.current.question.name])&&(!S[L.current.question.name]||""===S[L.current.question.name]);return e.createElement("div",{className:`freemium-survey-components ${u?"widget-survey-components":""} ${f?"mobile-preview":""} ${r}-survey-style`,id:"freemium-survey"},k?null:e.createElement(_,{totalSteps:g.length,completedSteps:R.current}),e.createElement(i,{mode:"out-in"},e.createElement(a,{key:String(k),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:u?"":"fade"},e.createElement("div",null,k?e.createElement(te,{thankYouQuestion:Q,preview:d,placeholders:c,npsValue:M.current}):e.createElement(e.Fragment,null,e.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:u||"card"===r?{transform:`translateX(calc(-${O} * 100%))`,height:`${j.current[R.current]}px`,transition:$.current||E?.length<=1?"none":"all 300ms ease-out 0ms"}:{},className:"questions"},E.map(((n,t)=>e.createElement("div",{key:n.question.name,ref:D,className:"question-container "+(!u&&"card"!==r||H.current===t?"":"hide-question-container")},e.createElement("div",{className:"question-text "+(0===t?"nps":""),dangerouslySetInnerHTML:{__html:F(n.question.text,c,M.current)},"aria-label":`question-${t}`,role:"heading","aria-level":1}),e.createElement("button",{disabled:!u&&"standard"===r,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),e.createElement(T,{question:n.question,isFinalQn:G(),formValues:b,othersMeta:S,autoFocus:H.current===t,autoFocusDelay:"standard"===r?350:20,saveOthersValue:ne,onChangeHandler:e=>{P.current=!1,R.current=g.findIndex((e=>e.name===n.name)),L.current=n,ee(n,e,!("DROPDOWN"===n.question.type_info.question_type&&"Others"===e)&&p.includes(n.question.type_info.question_type)&&!G())}}),e.createElement("button",{disabled:!u&&"standard"===r,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),e.createElement(re,{question:n.question,block:n,blockIndex:t,widget:u,surveyStyle:r,formValues:b,othersMeta:S,blocksWithQns:E,blocks:g,thankYouQuestion:Q,currentBlockIndexOfBlocksWithQns:H,currentBlockIndexOfBlocks:R,currentEditingBlock:L,isSubmitting:I,isValuesCommitted:P,isCurrentBlockFinal:G,setHorizontalScrollUnits:N,handleFormValues:ee,skipBlock:J,setIsSubmitting:z,onSubmit:U,setIsSurveyCompleted:q,preventQuestionAnimation:$,preview:d,closePreview:v})))),!u&&"card"!==r&&G()&&e.createElement("div",{className:"submit"},e.createElement(C,{disabled:(L.current.required||L.current.question.type_info.pivot_question)&&(null==b[L.current.question.name]||0===b[L.current.question.name]?.length)||L.current.question.type_info.meta?.othersRequired&&oe||I,onClick:()=>{z(!0),l({...b,others_meta:S},(()=>{Q?.type_info.meta?.skipThankYouPage?d?setTimeout((()=>{v?.()}),300):window.location.href=Q?.type_info.meta?.redirectUrl:q(!0)}))}},I?"Submitting":"Submit survey"))))))))};u(":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: 86%;\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 ie=({thankYouQuestion:n,placeholders:t,npsValue:o},r)=>e.createElement(e.Fragment,null,e.createElement("div",{className:"heading"},"Thank you!"),e.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:F(n.text,t,o)}})),ae=({activeBlockIndexOfBlocks:n,activeBlockIndexOfBlocksWithQns:t,blocksWithQns:o,blocks:r,navigateToPreviousBlock:s,navigateToNextBlock:i})=>e.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},e.createElement("button",{disabled:Y("navigation-prev",{blocks:r,blocksWithQns:o,activeBlockIndexOfBlocks:n,activeBlockIndexOfBlocksWithQns:t}),className:"navigation-button",onClick:s},e.createElement(z,null)),e.createElement("button",{className:"navigation-button",disabled:Y("navigation-next",{blocks:r,blocksWithQns:o,activeBlockIndexOfBlocks:n,activeBlockIndexOfBlocksWithQns:t}),onClick:i},e.createElement(I,null))),ce=n=>{const{widget:t,widgetStyle:o,answers:r,blocksWithQns:i,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,saveFormValues:u,onSubmit:m,skipBlock:d,navigateToNextBlock:p,navigateToPreviousBlock:f}=n,[v,y]=s(!1),h={answers:r,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,widget:t},g={answers:r,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,isSubmitting:v},x="compact"===o&&A("navigation",h)&&A("skip",h);return 1===i.length&&1!==a.length?null:e.createElement("div",{className:"question-footer"},x?e.createElement("div",{className:"compact-footer-layout"},e.createElement(ae,{activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,blocks:a,navigateToNextBlock:p,navigateToPreviousBlock:f}),e.createElement("button",{className:"skip-button",onClick:d},"Skip")):null,e.createElement("div",{className:"action-buttons"},!x&&A("navigation",h)&&e.createElement("div",{style:{marginRight:"auto"}},e.createElement(ae,{activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,blocks:a,navigateToNextBlock:p,navigateToPreviousBlock:f})),"compact"!==o&&A("skip",h)&&e.createElement("button",{className:"skip-button",onClick:d},"Skip"),A("next",h)&&e.createElement(C,{onClick:()=>{u(i[l],null,!0)},disabled:Y("next",g),className:"next-button"},"Next"),A("submit",h)&&e.createElement("div",{className:"submit"},e.createElement(C,{disabled:Y("submit",g),onClick:()=>{y(!0),m()}},v?"Submitting":"Submit survey"))))},le=t=>{const{blocks:i,blocksWithQns:u,activeBlock:m,activeBlockIndexOfBlocks:d,activeBlockIndexOfBlocksWithQns:p,isSurveyCompleted:v,isReverseAnimation:y,saveFormValues:h,saveOthersValue:g,skipBlock:x,onSubmitHandler:b,navigateToNextBlock:w,navigateToPreviousBlock:k,answers:q,questions:E,pivot:B}=X(t),[O,N]=s(null),C=n(0);o((()=>{void 0!==B?.answer&&t.onSubmit({[B.question.name]:B.answer})}),[B?.answer]);return r((()=>{(()=>{if(O){O.style.minHeight="unset",O.style.maxHeight="unset",O.style.height="min-content",O.style.position="static";const e=Math.min(O?.scrollHeight+2,f[t.widgetStyle]);O.style.height=e+"px",O.style.minHeight=e+"px",C.current=e}})()}),[O]),o((()=>{t.setCurrentSurveyState?.({question:u?.[p]?.question,npsScore:B?.answer})}),[p,B?.answer]),m&&m.question?e.createElement("div",{className:`freemium-survey-components widget-survey-components\n ${t.widgetStyle}-style `,id:"freemium-survey"},t.widgetHeaderQuerySelector&&!v&&document.querySelector(t.widgetHeaderQuerySelector)?l.createPortal(e.createElement(_,{totalSteps:i.length,completedSteps:d+(v?1:0),widget:!0}),document.querySelector(t.widgetHeaderQuerySelector)):null,e.createElement("div",{className:"questions",style:{height:C.current,...1===u.length?{transition:"none"}:{}}},e.createElement(c,{component:null},e.createElement(a,{key:p+String(v),unmountOnExit:!0,addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:y?"fade-reverse":"fade"},e.createElement("div",{ref:e=>e?N(e):null,id:`${m.question.name}`,className:"question-container "+(v?"thankyou":""),"data-test-question-name":m.question.name},v?e.createElement(ie,{thankYouQuestion:H({pivotQn:B?.question,pivotQnAnswer:B?.answer,block:t.survey.meta?.blocks?.find((e=>"TY"===e.name)),questions:E}),placeholders:t.placeholders,npsValue:B?.answer}):e.createElement(e.Fragment,null,e.createElement("div",{className:"question-text "+("RANGE"===m?.question?.type_info?.question_type?"nps-question-text":""),dangerouslySetInnerHTML:{__html:F(m?.question.text,t.placeholders,B?.answer)},"aria-label":`question-${p}`,role:"heading","aria-level":1}),e.createElement("div",{className:"question-wrapper",onTransitionEndCapture:e=>e.stopPropagation()},e.createElement(T,{question:m.question,isFinalQn:R({blocks:i,activeBlockIndexOfBlocks:d,blocksWithQns:u,activeBlockIndexOfBlocksWithQns:p}),formValues:q.formValues,othersMeta:q.others,autoFocus:!0,autoFocusDelay:0,saveOthersValue:g,onChangeHandler:e=>{h(m,e)}})),e.createElement(ce,{widget:!0,widgetStyle:t.widgetStyle,surveyStyle:"standard",answers:q,blocksWithQns:u,blocks:i,activeBlockIndexOfBlocksWithQns:p,activeBlockIndexOfBlocks:d,saveFormValues:h,skipBlock:x,onSubmit:b,navigateToPreviousBlock:k,navigateToNextBlock:w}))))))):null};u('#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 .compact-container-style .header-content.minimized {\n padding-left: 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 ue=({onDismiss:n,remindLater:t,closeMenu:r,closeIconRef:s,position:i="bottom"})=>(o((()=>{const e=e=>{s.current===e.target||s.current.contains(e.target)||r()};return window.addEventListener("click",e),()=>window.removeEventListener("click",e)}),[]),e.createElement("div",{className:"close-widget "+("top"===i?"top":"")},e.createElement("button",{onClick:async()=>{await t()},autoFocus:!0},"Remind me later"),e.createElement("button",{onClick:async()=>{await n()}},"Dismiss"))),me=({survey:t,preview:o,placeholders:r,onSubmit:i,remindLater:a,onDismiss:c,onClose:l,surveyType:u,unsubscribeUrl:m,isSurveyCompleted:d,children:p=null})=>{const[f,y]=s(!1),[h,g]=s(!1),[x,b]=s(0),{ui_theme:w}=t,[k,q]=s(null),[E,B]=s(!1),[_,O]=s(null),N=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],C=()=>{y(!0),setTimeout((()=>{window.SurveyWidget?.unmount()}),300)},I=n(null);return e.createElement("div",{className:`container ${u}-container-style ${h?"minimized":""}`,style:{opacity:f?0:1,"--container-width":`${v[u]}`,"--height-transition-duration":"600ms",...M(w)}},p,e.createElement("header",{id:"surveyserv-widget-header",className:"widget-header "+(h?"minimized":"")},h&&e.createElement("span",{className:"header-content minimized",dangerouslySetInnerHTML:{__html:F(_?.question?.text??N?.text,{...r,"{{nps.rating}}":_?.npsScore})}}),e.createElement("div",{className:"icons"},!d&&e.createElement("button",{onClick:()=>{h?(g(!h),setTimeout((()=>{b(0)}),700)):(b(k?.clientHeight??0),setTimeout((()=>{g(!h)}),0))},className:"icon"},h?e.createElement(S,null):e.createElement(Z,null)),e.createElement("button",{ref:I,onClick:()=>{d?(C(),l?.()):B(!E)},className:"icon"},e.createElement(Q,null))),E&&e.createElement(ue,{position:h?"top":"bottom",closeIconRef:I,onDismiss:async()=>{await c(),C()},remindLater:async()=>{await a(),C()},closeMenu:()=>B(!E)})),e.createElement("main",{ref:e=>q(e),className:"widget-main "+(h?"minimized":""),style:{height:h?0:x||"auto"}},e.createElement(le,{widgetStyle:u,survey:t,placeholders:r,onSubmit:i,setCurrentSurveyState:O,widgetHeaderQuerySelector:h?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"},"Powered by",e.createElement(W,null)),m&&!h&&e.createElement("a",{href:m,target:"_blank",rel:"noopener noreferrer",onClick:e=>{o&&(e.preventDefault(),l?.()),e.stopPropagation(),C()}},"Unsubscribe")))},de=n=>{const t=G(n.survey);return e.createElement(e.Fragment,null,"standard"===n.surveyStyle?e.createElement(se,Object.assign({},n,{survey:t})):e.createElement(ne,Object.assign({},n,{survey:t})))},pe=n=>{const t=G(n.survey);return e.createElement(me,Object.assign({},n,{survey:t}))};export{N as BUTTON_SIZE_VARIANTS,C as Button,k as CheckboxGroup,x as Input,m as NPS,_ as ProgressBar,B as Radio,E as RadioGroup,de as Survey,b as TextArea,pe as WebInAppSurvey};
1
+ import e,{useRef as n,forwardRef as t,useEffect as o,useMemo as r,useState as s}from"react";import{SwitchTransition as i,CSSTransition as a,TransitionGroup as c}from"react-transition-group";import l from"react-dom";function u(e,n){void 0===n&&(n={});var t=n.insertAt;if(e&&"undefined"!=typeof document){var o=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===t&&o.firstChild?o.insertBefore(r,o.firstChild):o.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}u(".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 .choices {\n width: 100%;\n display: flex;\n justify-content: space-between;\n font-weight: 500;\n border-radius: 4px;\n}\n.freemium-survey-components .nps-container .nps-scale .choice {\n background: #ebeff3;\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.standard .choice {\n background: rgba(228, 62, 61, 0.3);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(2) {\n background: rgba(0, 175, 80, 0.3);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice:nth-last-child(4) {\n background: rgba(248, 196, 62, 0.3);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus, .freemium-survey-components .nps-container .nps-scale.standard .choice:hover, .freemium-survey-components .nps-container .nps-scale.standard .choice.active {\n background: rgb(228, 62, 61);\n color: #fff;\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(2), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(2), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(1), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(2) {\n background: rgb(0, 175, 80);\n}\n.freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice:focus:nth-last-child(4), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice:hover:nth-last-child(4), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(3), .freemium-survey-components .nps-container .nps-scale.standard .choice.active:nth-last-child(4) {\n background: rgb(248, 196, 62);\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-row-gap: 6px;\n row-gap: 6px;\n grid-column-gap: 6px;\n -moz-column-gap: 6px;\n column-gap: 6px;\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-row-gap: 6px;\n row-gap: 6px;\n grid-column-gap: 6px;\n -moz-column-gap: 6px;\n column-gap: 6px;\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:o="highlighted",button_shape:r="rounded"}={},rating_presets:{start:s="Very unlikely",end:i="Very likely"}={},validation:{min:a},footer_text:c}}=t,l=e=>{switch(e){case e<=6:return"detractor";case e<=8:return"passive";default:return"promoter"}},u=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 ${r} ${o}`},e.createElement("div",{className:"button-container"},e.createElement("div",{className:"choices",role:"radiogroup","aria-required":!0},u.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 ${l(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"},`${u.current[u.current.length-1]} - ${i}`)))),e.createElement("div",{className:"footer",role:"note"},c))},d=(e,n)=>(e.defaultProps=n,e);u('.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]::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::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},v={default:"600px",compact:"350px",cozy:"96%"},y={isRequired:!1,showCount:!0,isErrored:!1,inline:!1,spellCheck:!1,autoFocusInput:!0},h=t(((t,r)=>{const s=n(null);o((()=>{t.autoFocusInput&&setTimeout((()=>{s.current?.focus()}),300+(t.autoFocusDelay??0))}),[t.autoFocusInput]);const{inputStyle:i,style:a,className:c,showCount:l,isErrored:u,startLabel:m,isRequired:d,errorText:p,endLabel:f,maxLength:v=256,onChange:y,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 ${u?"error":""}${c||""}`},e.createElement("input",Object.assign({},g,{type:"text",autoComplete:"off",ref:s,style:i,onChange:e=>{e.target.value?.length>v||y?.(e)}})),l&&v>0&&e.createElement("div",{className:"end-max-length"},`${t.value&&t.value.length||0}/${v}`)),f&&e.createElement("div",{className:"end-label"},f)),u&&p&&e.createElement("span",{className:"input-error"},t.errorText))})),g=t(((t,r)=>{const s=n(null);o((()=>{t.autoFocusInput&&setTimeout((()=>{s.current?.focus()}),300+(t.autoFocusDelay??0))}),[t.autoFocusInput]);const{inputStyle:i,style:a,className:c,showCount:l,maxLength:u=1500,startLabel:m,isRequired:d,autoFocusInput:p,onChange:f,...v}=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({},v,{autoComplete:"off",ref:s,style:i,onChange:e=>{e.target.value?.length>u||f?.(e)}})),l&&u&&u>0&&e.createElement("div",{className:"end-max-length"},`${t.value&&t.value.length||0}/${u}`)),t.endLabel&&e.createElement("div",{className:"end-label"},t.endLabel)))})),x=d(h,y),b=d(g,y);u('.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 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:r="",options:s,name:i,autoFocusGroup:a,autoFocusDelay:c,onChangeHandler:l,saveOthersValue:u})=>{const m=t.includes("Others"),d=n(null);return o((()=>{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}),s?.filter((e=>"Others"!==e.value)).map(((n,o)=>e.createElement(q,{key:n.id,checked:t?.includes(n.value),name:n.value,id:n.id,onChange:(e,o)=>{if(o)l([...t||[],n.value]);else{const e=t.indexOf(n.value);e>-1&&t.splice(e,1),l([...t])}}},n.value))),s?.find((e=>"Others"===e.value))&&e.createElement(q,{key:"others",checked:m,name:"Others",id:"Others",onChange:(e,n)=>{if(n)l([...t,"Others"]);else{const e=t.findIndex((e=>"Others"===e));t.splice(e,1),l(t)}}},"Others"),m&&e.createElement(e.Fragment,null,e.createElement(x,{placeholder:"Enter your comment",value:r,onChange:e=>{u(i,e.target.value)},autoFocusDelay:10,label:""})))},q=d((t=>{const r=n(null);return o((()=>{t.autoFocus&&setTimeout((()=>{r.current?.focus()}),320)}),[]),e.createElement("label",{className:`checkbox-label ${t.disabled&&"disabled"}`},e.createElement("input",{ref:r,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});u('.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 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 E=({name:t,options:r,value:s,autoFocusGroup:i,autoFocusDelay:a,onChangeHandler:c,saveOthersValue:l,othersOption:u,othersRequired:m,othersValue:d,isFinalQn:p})=>{const f=n(null);return o((()=>{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}),r?.sort(((e,n)=>"Others"===e.value?1:"Others"===n.value?-1:0))?.map(((n,o)=>e.createElement(B,{key:n.value,value:n.value,name:t,onChange:e=>{"Others"!==e.currentTarget.value&&l(t,null),c(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&&c("Others"),l(t,e.target.value)},placeholder:"Enter your comment",label:"",autoFocusDelay:10})))},B=d((t=>{const r=n(null);return o((()=>{t.autoFocus&&setTimeout((()=>{r.current?.focus()}),320)}),[]),e.createElement("label",{className:"radio-label"},e.createElement("input",{ref:r,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});u(".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 _=n=>{const{totalSteps:t,completedSteps:o,widget:r}=n;return e.createElement("div",{className:"progressbar-container "+(r?"widget":"")},e.createElement("div",{className:"progressbar",style:{width:(o>0?100/t:0)+"%",transform:`scaleX(${o})`}}))};u(".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 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 O=()=>e.createElement(e.Fragment,null,"..."),N={LARGE:"large",MINI:"mini",NORMAL:"normal"},C=n=>{const{inline:t=!1,children:o,disabled:r,className:s="",htmlType:i,type:a="primary",onClick:c,size:l,overrideStyleClassName:u="",loading:m=!1,...d}=n;return e.createElement("button",Object.assign({style:t?{display:"inline-block"}:{},disabled:r,className:`action-button ${s} ${u}`,type:i,onClick:c},d),m?e.createElement(O,null):o)},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"})),z=()=>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"})),Q=()=>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",fillOpacity:"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"})),Z=()=>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"})),S=()=>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)"})),W=()=>e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"76",height:"16",viewBox:"0 0 200 40"},e.createElement("g",{fill:"none",fillRule:"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"}))),T=({question:n,formValues:t,othersMeta:o,onChangeHandler:r,saveOthersValue:s,autoFocus:i,autoFocusDelay:a,isFinalQn:c})=>{switch(n.type_info.question_type){case"RANGE":return e.createElement(m,{type_info:n.type_info,onChangeHandler:r,npsValue:t[n.name]});case"CHECKBOX":case"MULTI_SELECT":return e.createElement(k,{name:n.name,autoFocusGroup:i,values:t[n.name],othersValue:o[n.name],options:n.type_info.choices,onChangeHandler:r,saveOthersValue:s,othersOption:n.type_info.meta?.othersOption,othersRequired:n.type_info.meta?.othersRequired,autoFocusDelay:a});case"RADIO":case"DROPDOWN":return e.createElement(E,{autoFocusGroup:i,autoFocusDelay:a,name:n.name,onChangeHandler:r,saveOthersValue:s,options:n.type_info.choices,value:t[n.name],othersValue:o[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:i,autoFocusDelay:a,label:"",isRequired:n.is_required,value:t[n.name]||"",placeholder:n.type_info?.meta?.placeholder??"",onChange:e=>r(e.target.value)}),e.createElement(b,{autoFocusInput:i,autoFocusDelay:a,label:"",maxLength:256,isRequired:n.is_required,placeholder:n.type_info?.meta?.placeholder??"",value:t[n.name]||"",onChange:e=>r(e.target.value)}));case"PARAGRAPH":return e.createElement(b,{autoFocusInput:i,autoFocusDelay:a,label:"",isRequired:n.is_required,placeholder:n.type_info?.meta?.placeholder??"",value:t[n.name]||"",onChange:e=>r(e.target.value)});default:return console.error(`Question type ${n.type_info.question_type} not found`),null}},L=(e={})=>0==Object.values(e).length,V=e=>!e||"string"==typeof e&&""===e.trim()||Array.isArray(e)&&0===e.length,F=(e,n,t)=>{if(e){let o;if(t&&(o={"{{nps.rating}}":t}),n&&(o={...n,...o??{}}),o){const n=new RegExp(Object.keys(o).join("|"),"gi");e=e.replace(n,(function(e){return o[e.toLowerCase()]}))}}return e??""},M=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}});u(":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: 0;\n gap: 0;\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 grid-gap: 0;\n gap: 0;\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 D=({questions:e})=>e.find((e=>e.type_info?.pivot_question))??e.find((e=>"RANGE"===e.type_info?.question_type))??e[0],R=({blocks:e,activeBlockIndexOfBlocks:n,blocksWithQns:t,activeBlockIndexOfBlocksWithQns:o})=>{const r=e[n];return(n===e.length-1||"end"===r.branchOption)&&o===t.length-1},H=({pivotQn:e,pivotQnAnswer:n,block:t,questions:o})=>{if(t?.is_based_on_rating){const r=e?.type_info?.choices?.[n-(e?.type_info?.validation?.min??0)??0]?.dependent_question_names,s=t?.question_names?.find((e=>r?.includes(e)));return o.find((e=>e.name===s))}return o.find((e=>e.name===t?.question_names?.[0]))},P=({question:e,answers:n})=>p.includes(e?.type_info?.question_type||"")&&!("DROPDOWN"===e.type_info?.question_type&&"Others"===n.formValues[e.name])||n.commitDirtyValue,A=(e,{answers:n,blocks:t,activeBlockIndexOfBlocks:o,blocksWithQns:r,activeBlockIndexOfBlocksWithQns:s,surveyStyle:i,widget:a})=>{const c=R({blocks:t,activeBlockIndexOfBlocks:o,blocksWithQns:r,activeBlockIndexOfBlocksWithQns:s}),l=r[s],u=l.question;switch(e){case"next":return(!p.includes(u.type_info?.question_type??"")||"DROPDOWN"===u.type_info?.question_type&&"Others"===n.formValues[u.name])&&!c;case"skip":return"RANGE"!==u.type_info?.question_type&&!l.required&&!c;case"submit":return c&&(a||"standard"!==i);case"navigation":return(a||"card"===i)&&!(0===s&&1===r.length)}},$=(e,n)=>("MULTI_SELECT"===e.question.type_info.question_type&&n.formValues[e.question.name]?.includes("Others")||"DROPDOWN"===e.question.type_info.question_type&&"Others"===n.formValues[e.question.name])&&V(n.others[e.question.name]),Y=(e,{answers:n,blocks:t,activeBlockIndexOfBlocks:o,blocksWithQns:r,activeBlockIndexOfBlocksWithQns:s,isSubmitting:i})=>{const a=r[s];switch(e){case"next":return a.required&&V(n?.formValues[a.question.name])||a.question.type_info?.meta?.othersRequired&&$(a,n);case"submit":return(a.required||a.question.type_info?.pivot_question)&&V(n?.formValues[a.question.name])||a.question?.type_info?.meta?.othersRequired&&$(a,n)||i;case"navigation-prev":return 0==s;case"navigation-next":return s>=r.length-1;default:return!1}},j=({blocksWithQns:e,activeBlockIndexOfBlocksWithQns:n,answers:t})=>{const o=U({blocksWithQns:e,activeBlockIndexOfBlocksWithQns:n}).reduce(((e,n)=>(t.formValues[n.question.name]&&(e[n.question.name]=t.formValues[n.question.name]),e)),{});return{...t,formValues:o}},U=({blocksWithQns:e,activeBlockIndexOfBlocksWithQns:n})=>e.slice(0,n+1),G=e=>r((()=>{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]),X=t=>{const r=t.survey.question_details?.questions||[],[i,a]=s([]),[c,l]=s({formValues:{},others:{},commitDirtyValue:!1}),[u,m]=s([]),[d,p]=s(0),[f,v]=s(!1),y=n(),[h,g]=s(!1),x=n(!1),b=n(),w=u[d],k=e.useMemo((()=>u.length>0?i?.findIndex((e=>e.name===u[d].name)):0),[d]);o((()=>{t.survey.meta?.blocks&&a(t.survey.meta?.blocks.filter((e=>"TY"!==e.name)))}),[t.survey.meta?.blocks]),o((()=>{if(!i||!i.length)return;var e,n;y.current={...y.current,question:D({questions:r})},null!=t.npsValue&&(y.current={...y.current,answer:(e=y.current.question,n=t.npsValue,Math.min(e.type_info.validation.max,Math.max(e.type_info.validation.min,n)))},l({...c,formValues:{[y.current.question.name]:y.current.answer}}));const o=H({pivotQn:y.current.question,pivotQnAnswer:y.current.answer,block:i[0],questions:r});m([{...i[0],question:o}])}),[i,t.npsValue]),o((()=>{u.length&&p(u.length-1)}),[u]),o((()=>{if(!L(c.formValues)&&i&&(({blocks:e,activeBlockIndexOfBlocks:n,blocksWithQns:t,activeBlockIndexOfBlocksWithQns:o,answers:r})=>{const{question:s}=t[o];return!!s&&!R({blocks:e,activeBlockIndexOfBlocks:n,blocksWithQns:t,activeBlockIndexOfBlocksWithQns:o})&&P({question:s,answers:r})})({blocks:i,activeBlockIndexOfBlocks:k,blocksWithQns:u,activeBlockIndexOfBlocksWithQns:d,answers:c})){const e=()=>{v(!1);const e=(({activeBlock:e,blocks:n,activeBlockIndexOfBlocks:t,answers:o})=>{if(e.nextBlock&&"specific"===e.branchOption)return n.findIndex((e=>e.name===e.nextBlock));if("logic"===e.branchOption&&e.question.type_info?.meta?.branches){const r=e.question.type_info?.meta?.branches,s=o.formValues[e.question.name];let i;return i="RANGE"===e.question.type_info.question_type?r.find((e=>s>=e.min&&s<=e.max)):r.find((e=>s===e.value)),i?.nextBlock?"TY"===i.nextBlock?Number.MAX_SAFE_INTEGER:n.findIndex((e=>e.name===i.nextBlock)):t+1}return t+1})({activeBlock:w,blocks:i,activeBlockIndexOfBlocks:k,answers:c}),n=H({pivotQn:y.current?.question,pivotQnAnswer:y.current?.answer,block:i?.[e],questions:r}),t=U({blocksWithQns:u,activeBlockIndexOfBlocksWithQns:d});m([...t,{...i?.[e],question:n}])};null!=t.npsValue&&1==u.length?b.current?(clearTimeout(b.current),b.current=null,e()):b.current=setTimeout((()=>{e()}),1500):e()}}),[c,i]),o((()=>{!L(c.formValues)&&x.current&&(f?E():q(),x.current=!1)}),[f]);const q=()=>{f?(x.current=!0,v(!1)):p(d+1)},E=()=>{f?p(d-1):(x.current=!0,v(!0))};return{blocks:i,questions:r,blocksWithQns:u,activeBlock:w,activeBlockIndexOfBlocks:k,activeBlockIndexOfBlocksWithQns:d,isSurveyCompleted:h,isReverseAnimation:f,isNavigating:x.current,pivot:y.current,answers:c,navigateToNextBlock:q,navigateToPreviousBlock:E,saveFormValues:(e,n,t=!1)=>{e.question.name===y.current?.question.name&&(y.current={...y.current,answer:n});let o=c;(t||P({question:e.question,answers:c}))&&(o=j({blocksWithQns:u,activeBlockIndexOfBlocksWithQns:d,answers:c})),l({...o,formValues:{...o.formValues,...null!=n&&{[e.question.name]:n}},commitDirtyValue:t})},saveOthersValue:(e,n)=>{if(null===n){const n={...c.others};delete n[e],l({...c,others:n})}else l({...c,others:{...c.others,[e]:n}})},skipBlock:()=>{v(!1);const e=w.question;if(delete c.formValues[e.name],delete c.others[e.name],d!==u.length-1){const e=j({blocksWithQns:u,activeBlockIndexOfBlocksWithQns:d,answers:c}),n=U({blocksWithQns:u,activeBlockIndexOfBlocksWithQns:d});m(n),l({...e,commitDirtyValue:!0})}else l({...c,commitDirtyValue:!0})},onSubmitHandler:()=>{t.onSubmit({...c.formValues,others_meta:c.others},(()=>{g(!0)}))}}},K=({thankYouQuestion:n,preview:t,placeholders:r,npsValue:s})=>(o((()=>{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,r,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)))),J=({activeBlockIndexOfBlocks:n,activeBlockIndexOfBlocksWithQns:t,blocksWithQns:o,blocks:r,navigateToPreviousBlock:s,navigateToNextBlock:i})=>e.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},e.createElement("button",{disabled:Y("navigation-prev",{blocks:r,blocksWithQns:o,activeBlockIndexOfBlocks:n,activeBlockIndexOfBlocksWithQns:t}),className:"navigation-button",onClick:s},e.createElement(z,null)),e.createElement("button",{className:"navigation-button",disabled:Y("navigation-next",{blocks:r,blocksWithQns:o,activeBlockIndexOfBlocks:n,activeBlockIndexOfBlocksWithQns:t}),onClick:i},e.createElement(I,null))),ee=n=>{const{widget:t,surveyStyle:o,answers:r,blocksWithQns:i,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,saveFormValues:u,onSubmit:m,skipBlock:d,navigateToNextBlock:p,navigateToPreviousBlock:f}=n,[v,y]=s(!1),h={answers:r,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,surveyStyle:o,widget:t},g={answers:r,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,isSubmitting:v};return 1===i.length&&1!==a.length?null:e.createElement("div",{className:"question-footer"},A("navigation",h)&&e.createElement(J,{activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,blocks:a,navigateToNextBlock:p,navigateToPreviousBlock:f}),e.createElement("div",{className:"action-buttons"},A("next",h)&&e.createElement(C,{onClick:()=>{u(i[l],null,!0)},disabled:Y("next",g),className:"next-button"},"Next"),A("skip",h)&&e.createElement("button",{className:"skip-button",onClick:d},"Skip"),A("submit",h)&&e.createElement("div",{className:"submit"},e.createElement(C,{disabled:Y("submit",g),onClick:()=>{y(!0),m()}},v?"Submitting":"Submit survey"))))},ne=n=>{const{blocks:t,blocksWithQns:r,activeBlock:s,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,isSurveyCompleted:u,isReverseAnimation:m,saveFormValues:d,saveOthersValue:p,skipBlock:f,onSubmitHandler:v,navigateToNextBlock:y,navigateToPreviousBlock:h,answers:g,questions:x,pivot:b}=X(n);return o((()=>{void 0!==b?.answer&&n.onSubmit({[b.question.name]:b.answer})}),[b?.answer]),s&&s.question?e.createElement("div",{className:`freemium-survey-components ${n.mobilePreview?"mobile-preview":""} ${n.surveyStyle}-survey-style`,id:"freemium-survey"},u?null:e.createElement(_,{totalSteps:t.length,completedSteps:c+(u?1:0)}),e.createElement(i,{mode:"out-in"},e.createElement(a,{key:l+String(u),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:m?"fade-reverse":"fade"},e.createElement("div",{className:"questions"},u?e.createElement(K,{thankYouQuestion:H({pivotQn:b?.question,pivotQnAnswer:b?.answer,block:n.survey.meta?.blocks?.find((e=>"TY"===e.name)),questions:x}),preview:n.preview,placeholders:n.placeholders,npsValue:b?.answer}):e.createElement("div",{id:`${s.question.name}`,className:"question-container","data-test-question-name":s.question.name},e.createElement("div",{className:"question-text",dangerouslySetInnerHTML:{__html:F(s?.question.text,n.placeholders,b?.answer)},"aria-label":`question-${l}`,role:"heading","aria-level":1}),e.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:{width:"100%"}},e.createElement(T,{question:s.question,isFinalQn:R({blocks:t,activeBlockIndexOfBlocks:c,blocksWithQns:r,activeBlockIndexOfBlocksWithQns:l}),formValues:g.formValues,othersMeta:g.others,autoFocus:!0,autoFocusDelay:"standard"===n.surveyStyle?350:0,saveOthersValue:p,onChangeHandler:e=>{d(s,e)}})),e.createElement(ee,{widget:n.widget,surveyStyle:n.surveyStyle,answers:g,blocksWithQns:r,blocks:t,activeBlockIndexOfBlocksWithQns:l,activeBlockIndexOfBlocks:c,saveFormValues:d,skipBlock:f,onSubmit:v,navigateToPreviousBlock:h,navigateToNextBlock:y})))))):null};u(":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 te=({thankYouQuestion:n,preview:t,placeholders:r,npsValue:s})=>(o((()=>{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,r,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)))),oe=({currentBlockIndex:n,currentBlockIndexOfBlocksWithQns:t,blocksWithQns:o,blocks:r,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=r.findIndex((e=>e.name===o[t.current].name)),i.current=!1,s(t.current)}},e.createElement(z,null)),e.createElement("button",{className:"navigation-button",disabled:t.current>=o.length-1,onClick:()=>{i.current=!1,t.current=Math.min(t.current+1,o.length-1),n.current=r.findIndex((e=>e.name===o[t.current].name)),s(t.current)}},e.createElement(I,null))),re=({widget:n,block:t,surveyStyle:o,formValues:r,othersMeta:s,blocksWithQns:i,blocks:a,thankYouQuestion:c,currentBlockIndexOfBlocksWithQns:l,currentBlockIndexOfBlocks:u,currentEditingBlock:m,isSubmitting:d,isValuesCommitted:f,isCurrentBlockFinal:v,setHorizontalScrollUnits:y,handleFormValues:h,skipBlock:g,setIsSubmitting:x,onSubmit:b,setIsSurveyCompleted:w,preventQuestionAnimation:k,preview:q,closePreview:E,...B})=>{const _=B.blockIndex??l.current,O=B.question??i[_].question,N=()=>O.name===m.current.question.name&&(!p.includes(O.type_info.question_type)||"DROPDOWN"===O.type_info.question_type&&"Others"===r[O.name])&&!v(),I=()=>"RANGE"!==O.type_info.question_type&&!t.required&&O.name===m.current.question.name&&!v(),z=()=>("DROPDOWN"===O.type_info.question_type&&O.name!==m.current.question.name&&!t.required&&r[O.name],!1),Q=()=>v()&&(n||"standard"!==o)&&O.name===m.current.question.name,Z=("MULTI_SELECT"===m.current.question.type_info.question_type&&r[m.current.question.name]?.includes("Others")||"DROPDOWN"===m.current.question.type_info.question_type&&"Others"===r[m.current.question.name])&&(!s[m.current.question.name]||""===s[m.current.question.name].trim());return e.createElement("div",{className:"question-footer"},!(!n&&"standard"===o||0===_&&!r[O.name])&&e.createElement(oe,{currentBlockIndex:u,currentBlockIndexOfBlocksWithQns:l,blocksWithQns:i,blocks:a,setHorizontalScrollUnits:y,preventQuestionAnimation:k}),(N()||z()||I()||Q())&&e.createElement("div",{className:"action-buttons"},N()&&e.createElement(C,{onClick:()=>{h(i[_],null,!0)},disabled:m.current.required&&(!r[m.current.question.name]||Array.isArray(r[m.current.question.name])&&0===r[m.current.question.name].length)||m.current.question.type_info.meta?.othersRequired&&Z,className:"next-button"},"Next"),I()&&e.createElement("button",{className:"skip-button",onClick:()=>g(O)},"Skip"),z()&&e.createElement("button",{className:"skip-button",onClick:()=>{m.current=i[_],u.current=a.findIndex((e=>e.name===i[_].name)),g(O)}},"Clear selection"),Q()&&e.createElement("div",{className:"submit"},e.createElement(C,{disabled:(m.current.required||m.current.question.type_info.pivot_question)&&(null==r[m.current.question.name]||0===r[m.current.question.name]?.length)||m.current.question.type_info.meta?.othersRequired&&Z||d,onClick:()=>{x(!0),b()}},d?"Submitting":"Submit survey"))))},se=({survey:t,surveyStyle:r="standard",placeholders:c,onSubmit:l,widget:u,npsValue:m,preview:d,mobilePreview:f,closePreview:v})=>{const y=t.question_details?.questions||[],h=t.meta?.blocks||[],[g,x]=s(null),[b,w]=s({}),[k,q]=s(!1),[E,B]=s([]),[O,N]=s(0),[I,z]=s(!1),[Q,Z]=s(null),[S,W]=s({}),L=n(null),V=n(null),M=n(-1),D=n(null),R=n(0),H=n(0),P=n(!1),A=n([]),$=n(null!=m&&"card"===r),Y=n(null),j=n([]);o((()=>{h&&(Y.current=h.find((e=>"TY"===e.name)),x(h.filter((e=>"TY"!==e.name))))}),[h]),o((()=>{if(g)if(V.current=y.find((e=>e.type_info?.pivot_question))??y.find((e=>"RANGE"===e.type_info?.question_type))??y[0],null!=m){M.current=Math.min(V.current.type_info.validation.max,Math.max(V.current.type_info.validation.min,m));const e=y.find((e=>e.name===g[0].question_names[0]));L.current={...g[0],question:e},A.current=[...A.current,{...g[0],question:e}],B(A.current),w({Q_1:M.current})}else if(!L.current&&g.length>0)return L.current=g[0],void X(g[0])}),[g,m]),o((()=>{void 0!==b[V.current?.name]&&l?.({[V.current.name]:M.current})}),[b[V.current?.name]]),o((()=>{E.length&&(A.current=E,H.current=E.length-1),u||"standard"!==r?(D.current&&(D.current.style.maxHeight="unset"),j.current[R.current]=D.current?.scrollHeight||j.current[R.current]||0,D.current&&(D.current.style.maxHeight="100%")):D.current?.scrollIntoView({block:"start",behavior:"smooth"}),N(E.length-1)}),[E]),o((()=>{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])||P.current)&&!G()&&K()}),[b]),o((()=>{if(null!=b?.[V.current?.name])if(Y.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=Y.current?.question_names.find((n=>e?.includes(n))),t=y.find((e=>e.name===n));Z(t)}else{const e=y.find((e=>e.name==Y.current?.question_names[0]));Z(e)}}),[b?.[V.current?.name]]);const U=()=>{l({...b,others_meta:S},(()=>{Q?.type_info.meta?.skipThankYouPage?d?setTimeout((()=>{v?.()}),300):window.location.href=Q?.type_info.meta?.redirectUrl:q(!0)}))},G=()=>R.current===g.length-1||"end"===L.current.branchOption,X=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,o=e.question_names.find((e=>t?.includes(e)));n=y.find((e=>e.name===o))}else n=y.find((n=>n.name===e.question_names[0]));L.current.question=n;A.current.find((e=>e.question.name===n.name))?(N(O+1),H.current+=1):B([...A.current,{...e,question:n}])},K=()=>{if(G())q(!0);else{if(L.current.nextBlock&&"specific"===L.current.branchOption)R.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 U(),void q(!0);R.current=g.findIndex((e=>e.name===t.nextBlock))}else R.current+=1}else R.current+=1;L.current=g[R.current],X(g[R.current])}},J=e=>{P.current=!0,delete b[e.name],w({...b})},ee=(e,n,t)=>{if($.current=!1,t){if(P.current=!0,null!=b[e.question.name]&&e.name!==E[E.length-1].name){const[t,o]=(e=>{const n=E.findIndex((n=>n.name===e.name)),t=E.slice(0,n+1),o=t.reduce(((e,n)=>(e[n.question.name]=b[n.question.name],e)),{});return R.current=g.findIndex((n=>n.name===e.name)),[t,o]})(e);w({...o,...null!=n&&{[e.question.name]:n}}),A.current=t}else w({...b,...null!=n&&{[e.question.name]:n}});V?.current?.name==e?.question?.name&&(M.current=n)}else w({...b,...null!=n&&{[e.question.name]:n}})},ne=(e,n)=>{const t=E.find((n=>n.question.name===e));if(R.current=g.findIndex((e=>e.name===t.name)),L.current=t,null===n){const n={...S};delete n[e],W({...n})}else W({...S,[e]:n})};if(!L.current||!L.current.question)return null;const oe=("MULTI_SELECT"===L.current.question.type_info.question_type&&b[L.current.question.name]?.includes("Others")||"DROPDOWN"===L.current.question.type_info.question_type&&"Others"===b[L.current.question.name])&&(!S[L.current.question.name]||""===S[L.current.question.name]);return e.createElement("div",{className:`freemium-survey-components ${u?"widget-survey-components":""} ${f?"mobile-preview":""} ${r}-survey-style`,id:"freemium-survey"},k?null:e.createElement(_,{totalSteps:g.length,completedSteps:R.current}),e.createElement(i,{mode:"out-in"},e.createElement(a,{key:String(k),addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:u?"":"fade"},e.createElement("div",null,k?e.createElement(te,{thankYouQuestion:Q,preview:d,placeholders:c,npsValue:M.current}):e.createElement(e.Fragment,null,e.createElement("div",{onTransitionEndCapture:e=>e.stopPropagation(),style:u||"card"===r?{transform:`translateX(calc(-${O} * 100%))`,height:`${j.current[R.current]}px`,transition:$.current||E?.length<=1?"none":"all 300ms ease-out 0ms"}:{},className:"questions"},E.map(((n,t)=>e.createElement("div",{key:n.question.name,ref:D,className:"question-container "+(!u&&"card"!==r||H.current===t?"":"hide-question-container")},e.createElement("div",{className:"question-text "+(0===t?"nps":""),dangerouslySetInnerHTML:{__html:F(n.question.text,c,M.current)},"aria-label":`question-${t}`,role:"heading","aria-level":1}),e.createElement("button",{disabled:!u&&"standard"===r,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),e.createElement(T,{question:n.question,isFinalQn:G(),formValues:b,othersMeta:S,autoFocus:H.current===t,autoFocusDelay:"standard"===r?350:20,saveOthersValue:ne,onChangeHandler:e=>{P.current=!1,R.current=g.findIndex((e=>e.name===n.name)),L.current=n,ee(n,e,!("DROPDOWN"===n.question.type_info.question_type&&"Others"===e)&&p.includes(n.question.type_info.question_type)&&!G())}}),e.createElement("button",{disabled:!u&&"standard"===r,className:"autofocus-button",onKeyDown:e=>{"Tab"===e.key&&(e.stopPropagation(),e.preventDefault())}}),e.createElement(re,{question:n.question,block:n,blockIndex:t,widget:u,surveyStyle:r,formValues:b,othersMeta:S,blocksWithQns:E,blocks:g,thankYouQuestion:Q,currentBlockIndexOfBlocksWithQns:H,currentBlockIndexOfBlocks:R,currentEditingBlock:L,isSubmitting:I,isValuesCommitted:P,isCurrentBlockFinal:G,setHorizontalScrollUnits:N,handleFormValues:ee,skipBlock:J,setIsSubmitting:z,onSubmit:U,setIsSurveyCompleted:q,preventQuestionAnimation:$,preview:d,closePreview:v})))),!u&&"card"!==r&&G()&&e.createElement("div",{className:"submit"},e.createElement(C,{disabled:(L.current.required||L.current.question.type_info.pivot_question)&&(null==b[L.current.question.name]||0===b[L.current.question.name]?.length)||L.current.question.type_info.meta?.othersRequired&&oe||I,onClick:()=>{z(!0),l({...b,others_meta:S},(()=>{Q?.type_info.meta?.skipThankYouPage?d?setTimeout((()=>{v?.()}),300):window.location.href=Q?.type_info.meta?.redirectUrl:q(!0)}))}},I?"Submitting":"Submit survey"))))))))};u(":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: 86%;\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 ie=({thankYouQuestion:n,placeholders:t,npsValue:o},r)=>e.createElement(e.Fragment,null,e.createElement("div",{className:"heading"},"Thank you!"),e.createElement("div",{className:"text",dangerouslySetInnerHTML:{__html:F(n.text,t,o)}})),ae=({activeBlockIndexOfBlocks:n,activeBlockIndexOfBlocksWithQns:t,blocksWithQns:o,blocks:r,navigateToPreviousBlock:s,navigateToNextBlock:i})=>e.createElement("div",{className:"freemium-survey-step-navigation","data-navigation-element":"1"},e.createElement("button",{disabled:Y("navigation-prev",{blocks:r,blocksWithQns:o,activeBlockIndexOfBlocks:n,activeBlockIndexOfBlocksWithQns:t}),className:"navigation-button",onClick:s},e.createElement(z,null)),e.createElement("button",{className:"navigation-button",disabled:Y("navigation-next",{blocks:r,blocksWithQns:o,activeBlockIndexOfBlocks:n,activeBlockIndexOfBlocksWithQns:t}),onClick:i},e.createElement(I,null))),ce=n=>{const{widget:t,widgetStyle:o,answers:r,blocksWithQns:i,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,saveFormValues:u,onSubmit:m,skipBlock:d,navigateToNextBlock:p,navigateToPreviousBlock:f}=n,[v,y]=s(!1),h={answers:r,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,widget:t},g={answers:r,blocks:a,activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,isSubmitting:v},x="compact"===o&&A("navigation",h)&&A("skip",h);return 1===i.length&&1!==a.length?null:e.createElement("div",{className:"question-footer"},x?e.createElement("div",{className:"compact-footer-layout"},e.createElement(ae,{activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,blocks:a,navigateToNextBlock:p,navigateToPreviousBlock:f}),e.createElement("button",{className:"skip-button",onClick:d},"Skip")):null,e.createElement("div",{className:"action-buttons"},!x&&A("navigation",h)&&e.createElement("div",{style:{marginRight:"auto"}},e.createElement(ae,{activeBlockIndexOfBlocks:c,activeBlockIndexOfBlocksWithQns:l,blocksWithQns:i,blocks:a,navigateToNextBlock:p,navigateToPreviousBlock:f})),"compact"!==o&&A("skip",h)&&e.createElement("button",{className:"skip-button",onClick:d},"Skip"),A("next",h)&&e.createElement(C,{onClick:()=>{u(i[l],null,!0)},disabled:Y("next",g),className:"next-button"},"Next"),A("submit",h)&&e.createElement("div",{className:"submit"},e.createElement(C,{disabled:Y("submit",g),onClick:()=>{y(!0),m()}},v?"Submitting":"Submit survey"))))},le=t=>{const{blocks:i,blocksWithQns:u,activeBlock:m,activeBlockIndexOfBlocks:d,activeBlockIndexOfBlocksWithQns:p,isSurveyCompleted:v,isReverseAnimation:y,saveFormValues:h,saveOthersValue:g,skipBlock:x,onSubmitHandler:b,navigateToNextBlock:w,navigateToPreviousBlock:k,answers:q,questions:E,pivot:B}=X(t),[O,N]=s(null),C=n(0);o((()=>{void 0!==B?.answer&&t.onSubmit({[B.question.name]:B.answer})}),[B?.answer]);return r((()=>{(()=>{if(O){O.style.minHeight="unset",O.style.maxHeight="unset",O.style.height="min-content",O.style.position="static";const e=Math.min(O?.scrollHeight+2,f[t.widgetStyle]);O.style.height=e+"px",O.style.minHeight=e+"px",C.current=e}})()}),[O]),o((()=>{t.setCurrentSurveyState?.({question:u?.[p]?.question,npsScore:B?.answer})}),[p,B?.answer]),m&&m.question?e.createElement("div",{className:`freemium-survey-components widget-survey-components\n ${t.widgetStyle}-style `,id:"freemium-survey"},t.widgetHeaderQuerySelector&&!v&&document.querySelector(t.widgetHeaderQuerySelector)?l.createPortal(e.createElement(_,{totalSteps:i.length,completedSteps:d+(v?1:0),widget:!0}),document.querySelector(t.widgetHeaderQuerySelector)):null,e.createElement("div",{className:"questions",style:{height:C.current,...1===u.length?{transition:"none"}:{}}},e.createElement(c,{component:null},e.createElement(a,{key:p+String(v),unmountOnExit:!0,addEndListener:(e,n)=>{e.addEventListener("transitionend",n,!1)},classNames:y?"fade-reverse":"fade"},e.createElement("div",{ref:e=>e?N(e):null,id:`${m.question.name}`,className:"question-container "+(v?"thankyou":""),"data-test-question-name":m.question.name},v?e.createElement(ie,{thankYouQuestion:H({pivotQn:B?.question,pivotQnAnswer:B?.answer,block:t.survey.meta?.blocks?.find((e=>"TY"===e.name)),questions:E}),placeholders:t.placeholders,npsValue:B?.answer}):e.createElement(e.Fragment,null,e.createElement("div",{className:"question-text "+("RANGE"===m?.question?.type_info?.question_type?"nps-question-text":""),dangerouslySetInnerHTML:{__html:F(m?.question.text,t.placeholders,B?.answer)},"aria-label":`question-${p}`,role:"heading","aria-level":1}),e.createElement("div",{className:"question-wrapper",onTransitionEndCapture:e=>e.stopPropagation()},e.createElement(T,{question:m.question,isFinalQn:R({blocks:i,activeBlockIndexOfBlocks:d,blocksWithQns:u,activeBlockIndexOfBlocksWithQns:p}),formValues:q.formValues,othersMeta:q.others,autoFocus:!0,autoFocusDelay:0,saveOthersValue:g,onChangeHandler:e=>{h(m,e)}})),e.createElement(ce,{widget:!0,widgetStyle:t.widgetStyle,surveyStyle:"standard",answers:q,blocksWithQns:u,blocks:i,activeBlockIndexOfBlocksWithQns:p,activeBlockIndexOfBlocks:d,saveFormValues:h,skipBlock:x,onSubmit:b,navigateToPreviousBlock:k,navigateToNextBlock:w}))))))):null};u('#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 .compact-container-style .header-content.minimized {\n padding-left: 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 ue=({onDismiss:n,remindLater:t,closeMenu:r,closeIconRef:s,position:i="bottom"})=>(o((()=>{const e=e=>{s.current===e.target||s.current.contains(e.target)||r()};return window.addEventListener("click",e),()=>window.removeEventListener("click",e)}),[]),e.createElement("div",{className:"close-widget "+("top"===i?"top":"")},e.createElement("button",{onClick:async()=>{await t()},autoFocus:!0},"Remind me later"),e.createElement("button",{onClick:async()=>{await n()}},"Dismiss"))),me=({survey:t,preview:o,placeholders:r,onSubmit:i,remindLater:a,onDismiss:c,onClose:l,surveyType:u,unsubscribeUrl:m,isSurveyCompleted:d,children:p=null})=>{const[f,y]=s(!1),[h,g]=s(!1),[x,b]=s(0),{ui_theme:w}=t,[k,q]=s(null),[E,B]=s(!1),[_,O]=s(null),N=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],C=()=>{y(!0),setTimeout((()=>{window.SurveyWidget?.unmount()}),300)},I=n(null);return e.createElement("div",{className:`container ${u}-container-style ${h?"minimized":""}`,style:{opacity:f?0:1,"--container-width":`${v[u]}`,"--height-transition-duration":"600ms",...M(w)}},p,e.createElement("header",{id:"surveyserv-widget-header",className:"widget-header "+(h?"minimized":"")},h&&e.createElement("span",{className:"header-content minimized",dangerouslySetInnerHTML:{__html:F(_?.question?.text??N?.text,{...r,"{{nps.rating}}":_?.npsScore})}}),e.createElement("div",{className:"icons"},!d&&e.createElement("button",{onClick:()=>{h?(g(!h),setTimeout((()=>{b(0)}),700)):(b(k?.clientHeight??0),setTimeout((()=>{g(!h)}),0))},className:"icon"},h?e.createElement(S,null):e.createElement(Z,null)),e.createElement("button",{ref:I,onClick:()=>{d?(C(),l?.()):B(!E)},className:"icon"},e.createElement(Q,null))),E&&e.createElement(ue,{position:h?"top":"bottom",closeIconRef:I,onDismiss:async()=>{await c(),C()},remindLater:async()=>{await a(),C()},closeMenu:()=>B(!E)})),e.createElement("main",{ref:e=>q(e),className:"widget-main "+(h?"minimized":""),style:{height:h?0:x||"auto"}},e.createElement(le,{widgetStyle:u,survey:t,placeholders:r,onSubmit:i,setCurrentSurveyState:O,widgetHeaderQuerySelector:h?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"},"Powered by",e.createElement(W,null)),m&&!h&&e.createElement("a",{href:m,target:"_blank",rel:"noopener noreferrer",onClick:e=>{o&&(e.preventDefault(),l?.()),e.stopPropagation(),C()}},"Unsubscribe")))},de=n=>{const t=G(n.survey);return e.createElement(e.Fragment,null,"standard"===n.surveyStyle?e.createElement(se,Object.assign({},n,{survey:t})):e.createElement(ne,Object.assign({},n,{survey:t})))},pe=n=>{const t=G(n.survey);return e.createElement(me,Object.assign({},n,{survey:t}))};export{N as BUTTON_SIZE_VARIANTS,C as Button,k as CheckboxGroup,x as Input,m as NPS,_ as ProgressBar,B as Radio,E as RadioGroup,de as Survey,b as TextArea,pe as WebInAppSurvey};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "freemium-survey-components",
3
- "version": "0.12.1",
3
+ "version": "0.12.2",
4
4
  "description": "React Survey Ui Components",
5
5
  "main": "lib/index.cjs.js",
6
6
  "module": "lib/index.esm.js",