@sprig-technologies/sprig-browser 2.39.4 → 2.40.1
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/dist/conversational-styles-BiL7hMhj.js +4 -0
- package/dist/conversational-styles-DlhTFTL6.cjs +1 -0
- package/dist/conversational-ui-DWOygt3h.cjs +1 -0
- package/dist/conversational-ui-Qad4jSLB.js +579 -0
- package/dist/{core-DGzfRh0z.cjs → core-oShYwNGS.cjs} +3 -3
- package/dist/{core-BAdMqSxY.js → core-swSxd_ys.js} +447 -454
- package/dist/core.cjs +1 -1
- package/dist/core.d.ts +11 -0
- package/dist/core.js +2 -2
- package/dist/debounce-CMb8f7wh.js +9 -0
- package/dist/debounce-DsC7462b.cjs +1 -0
- package/dist/{getAttributedUrl-5g_EQiGQ.js → getAttributedUrl-C8OLV7E9.js} +254 -245
- package/dist/{getAttributedUrl-DmbhGoBX.cjs → getAttributedUrl-DuHEi0A7.cjs} +6 -6
- package/dist/index-DCMlaRyW.cjs +1 -0
- package/dist/index-Zzh93qL6.js +695 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +11 -0
- package/dist/index.js +2 -2
- package/dist/{metricsReporter-Chz3rKxD.js → metricsReporter-D0NmprYW.js} +1 -1
- package/dist/{metricsReporter-DOjBAl52.cjs → metricsReporter-DC-3J5Sa.cjs} +1 -1
- package/dist/replay.cjs +1 -1
- package/dist/replay.js +134 -138
- package/dist/view-Cu1EeVuN.js +1503 -0
- package/dist/view-DAxlTNxd.cjs +1 -0
- package/package.json +1 -1
- package/dist/conversational-styles-DHBMIjKf.js +0 -4
- package/dist/conversational-styles-DLzzNPKy.cjs +0 -1
- package/dist/conversational-ui-loLw6bPe.cjs +0 -1
- package/dist/conversational-ui-sHjWeSW0.js +0 -589
- package/dist/index-DmjRxajT.cjs +0 -1
- package/dist/index-hWjFkOYS.js +0 -688
- package/dist/view-BE-QqXV6.cjs +0 -1
- package/dist/view-CKY1RqAy.js +0 -1490
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const t = 'html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}button,input,select,textarea{margin:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}ol,ul{padding-inline-start:1em}.ul-card-text__button{background-color:var(--theme);border-radius:3px;border:none;color:#fff;cursor:pointer;font-size:15px;font-weight:500;line-height:18px;padding:10.5px 21px}.ul-card-text__button:disabled,.ul-card-text__button.sprig-button-disabled{background-color:#0000001a;color:#0003}.ul-card-text__button:disabled>svg path,.ul-card-text__button.sprig-button-disabled>svg path{stroke:#0003}.ul-card-text__button.ul-button-inactive{background-color:#fff;color:#5d696f}.ul-card-skip__button{color:#00000080;background:none;border:none;font-size:15px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;cursor:pointer}.ul-card-button-group{align-items:center;display:flex;gap:15px;justify-content:center}.sprig-question-footer-container{align-items:center}.ul-card__button-checkmark{display:flex;align-items:center;gap:8px;padding:8px 16px;border-radius:8px;background-color:var(--theme);color:#fff}.ul-card__button-checkmark:disabled{background-color:var(--theme);opacity:.5;color:#fff}.ul-card__button-checkmark:disabled>svg path{stroke:#fff}.ul-conversational-ui{width:100%;height:100%;display:flex;flex-direction:column;min-height:500px;font-size:15px;position:relative}.conversational-close-btn{position:fixed;top:16px;right:16px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:50%;cursor:pointer;z-index:1000}.conversational-close-btn:hover{background:#ffffff80}.chat-container{flex:1;display:flex;flex-direction:column;align-items:center}.chat-messages{flex:1;padding:80px 20px 360px;display:flex;flex-direction:column;gap:10px;max-width:1000px;width:100%}.chat-message-no-response{font-style:italic;color:#666}.chat-bubble-container{display:flex;flex-direction:row;align-items:flex-start;width:100%;animation:fadeInUp .3s ease-out}.chat-left{align-self:flex-start;width:auto;justify-content:flex-start}.chat-right{align-self:flex-end;width:auto;justify-content:flex-end}.chat-avatar{width:32px;height:32px;border-radius:100%;flex-shrink:0}.chat-avatar-left{margin-right:10px}.chat-avatar-right{margin-left:10px}.chat-bubble{border-radius:20px;word-wrap:break-word;position:relative}.chat-bubble-left{background:#f9f9f8;border-radius:2px 24px 24px;padding:12px 16px;border:1px solid #e2e3e1}.chat-bubble-right{background:#fff;color:#333;border-radius:24px 2px 24px 24px;border:1px solid #cbcbcb}.chat-message-text{font-size:15px;line-height:1.4;margin:0;text-align:left}.chat-bubble-left .chat-message-text{color:#333}.chat-bubble-right .chat-message-text{color:#333;padding:12px 16px}.chat-card-container{padding:0;background:transparent;min-width:400px}.chat-thanks-card{background:transparent;box-shadow:none;text-align:center}.end-of-survey-text{text-align:center;color:#999;font-size:12px;margin-top:8px;font-weight:400}.answered-card{pointer-events:none;opacity:.7;position:relative}.answered-card:after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background:#ffffff4d;pointer-events:none;border-radius:inherit}.answered-card button,.answered-card input,.answered-card textarea,.answered-card select{pointer-events:none}.answered-card:not(.ul-card__consent-legal):not(.ul-card__text-url-prompt) .ul-card-button-group *{display:none}.sprig-question-footer-container{align-items:end;padding:8px 10px}.sprig-question-body{padding:10px 10px 0;overflow:unset}.ul-card-text__button{font-size:13px}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.chat-bubble-container.chat-left.chat-no-avatar .chat-bubble{margin-left:42px}@media (max-width: 768px){.chat-messages{padding:16px}.chat-bubble-left{padding:10px 14px}.chat-right{width:100%}.chat-bubble-right{width:100%;max-width:286px}.chat-bubble-text-only{width:auto;min-width:60px;max-width:286px}.chat-avatar{width:28px;height:28px}.chat-avatar-left{margin-right:8px}.chat-avatar-right{margin-left:8px}.chat-card-container{min-width:0}.chat-card .choice,.chat-message-text{font-size:12px}.chat-bubble-container.chat-left.chat-no-avatar .chat-bubble{margin-left:36px}}.ul-card-vertical__button-wrapper{align-items:end}.ul-card-skip__button{padding:0 16px}.chat-card-container:has(.ul-card__matrix),.chat-card-container:has([class*=matrix]){min-width:600px;max-width:900px}.chat-card-container .ul-card--matrix_container{max-width:100%;overflow-x:auto}.chat-card-container .ul-card--matrix_grid{min-width:100%}@media (max-width: 768px){.sprig-header-label-container,.sprig-header-label,.choice{font-size:12px}.chat-card-container:has(.ul-card__matrix),.chat-card-container:has([class*=matrix]){min-width:0;max-width:100%;width:100%}.chat-card-container .ul-card--matrix_container{overflow-x:auto;-webkit-overflow-scrolling:touch}}.select-label{cursor:pointer;flex:1;overflow-wrap:anywhere;text-align:start}@media (max-width: 768px){.ul-conversational-ui .nps-number{font-size:12px;height:35px}.ul-conversational-ui .ul-card--nps__labels{font-size:12px}}.ul-card-rank__option{text-align:left}@media (max-width: 768px){.ul-card--rank__question-inner-container,.ul-card-rank__labels{font-size:12px}.ul-card-rank__option>span{font-size:12px}.ul-card-rank__option>select{font-size:12px}}.select-button{align-items:center;background-color:transparent;border-radius:8px;border:1px solid #0b2330;box-shadow:0 0 0 2px #c8cccc;cursor:pointer;display:flex;font-size:15px;justify-content:space-between;margin-bottom:8px;padding:4px 8px 4px 16px;width:100%}.select-button:hover{background-color:#f3f3f3}.select-button:active{background-color:#eee}.select-button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-button.select-button-placeholder{color:#b0b5b7}.select-button svg{flex-shrink:0}.select-list{position:relative;height:fit-content;padding:4px 0;z-index:100;background-color:#fff;border:1px solid #E2E3E1;box-shadow:0 16px 24px #0b23300d,0 4px 12px #0b233008;border-radius:8px;overflow-y:scroll;width:100%}.select-option{align-items:center;cursor:pointer;display:flex;font-size:15px;gap:16px;line-height:20px;padding:8px 16px}.select-option:hover{background-color:#f3f3f3}.ul-card-text{margin-top:2px;margin-bottom:3px;display:flex;flex-direction:column;justify-content:center;padding:0;width:100%}.ul-card-text__container{align-items:center;box-sizing:border-box;border-radius:3px;display:flex;justify-content:center;margin-bottom:12px;flex:1 0 100%}.ul-card-text__input--mobile{border:2px solid #e6e6e6;max-height:63px}.ul-card-text__input--desktop{border:1px solid #e6e6e6;max-height:150px}.ul-card-text__input{background:#fff;box-sizing:border-box;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:63px;overflow:auto;padding:8px;resize:none;width:100%;border-radius:3px;line-height:20px;overflow-wrap:break-word}.ul-card-text__input::placeholder{color:#6c6c6e80}.ul-card-text__input:focus{outline:none;background:#fff}.ul-card-text__input--desktop:hover:not(:focus){background-color:#fff}@media (max-width: 768px){.ul-card-text__input{font-size:12px}}.ul-card__text-url-prompt .sprig-question-body{padding:0}.ul-card__text-url-prompt .ul-card-button-group{padding:10px}@keyframes flashingDot{0%{background-color:#262136}50%,to{background-color:#f8f9fa}}.thinking-dots-container{display:flex;justify-content:center;align-items:flex-end;position:relative;width:18px;margin-top:.5em}.thinking-dot{position:relative;width:3px;height:3px;border-radius:5px;background-color:#262136;color:#262136;animation:flashingDot 1s infinite linear alternate;animation-delay:.5s}.thinking-dot:before,.thinking-dot:after{content:"";display:inline-block;position:absolute;top:0;width:3px;height:3px;border-radius:5px;background-color:#262136;color:#262136;animation:flashingDot 1s infinite alternate}.thinking-dot:before{left:-5px;animation-delay:0s}.thinking-dot:after{left:5px;animation-delay:1s}[id^=ul-card-video__player_recorder],[id^=ul-card-video__question_player]{width:100%;width:-moz-available;width:-webkit-fill-available;width:fill-available}.answered-card [id^=ul-card-video__player_recorder] .ul-control-panel{display:none!important}';
|
|
2
|
+
export {
|
|
3
|
+
t as default
|
|
4
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.default='html,body,p,ol,ul,li,dl,dt,dd,blockquote,figure,fieldset,legend,textarea,pre,iframe,hr,h1,h2,h3,h4,h5,h6{margin:0;padding:0}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:400}button,input,select,textarea{margin:0}html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}ol,ul{padding-inline-start:1em}.ul-card-text__button{background-color:var(--theme);border-radius:3px;border:none;color:#fff;cursor:pointer;font-size:15px;font-weight:500;line-height:18px;padding:10.5px 21px}.ul-card-text__button:disabled,.ul-card-text__button.sprig-button-disabled{background-color:#0000001a;color:#0003}.ul-card-text__button:disabled>svg path,.ul-card-text__button.sprig-button-disabled>svg path{stroke:#0003}.ul-card-text__button.ul-button-inactive{background-color:#fff;color:#5d696f}.ul-card-skip__button{color:#00000080;background:none;border:none;font-size:15px;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;cursor:pointer}.ul-card-button-group{align-items:center;display:flex;gap:15px;justify-content:center}.sprig-question-footer-container{align-items:center}.ul-card__button-checkmark{display:flex;align-items:center;gap:8px;padding:8px 16px;border-radius:8px;background-color:var(--theme);color:#fff}.ul-card__button-checkmark:disabled{background-color:var(--theme);opacity:.5;color:#fff}.ul-card__button-checkmark:disabled>svg path{stroke:#fff}.ul-conversational-ui{width:100%;height:100%;display:flex;flex-direction:column;min-height:500px;font-size:15px;position:relative}.conversational-close-btn{position:fixed;top:16px;right:16px;width:32px;height:32px;display:flex;align-items:center;justify-content:center;border-radius:50%;cursor:pointer;z-index:1000}.conversational-close-btn:hover{background:#ffffff80}.chat-container{flex:1;display:flex;flex-direction:column;align-items:center}.chat-messages{flex:1;padding:80px 20px 360px;display:flex;flex-direction:column;gap:10px;max-width:1000px;width:100%}.chat-message-no-response{font-style:italic;color:#666}.chat-bubble-container{display:flex;flex-direction:row;align-items:flex-start;width:100%;animation:fadeInUp .3s ease-out}.chat-left{align-self:flex-start;width:auto;justify-content:flex-start}.chat-right{align-self:flex-end;width:auto;justify-content:flex-end}.chat-avatar{width:32px;height:32px;border-radius:100%;flex-shrink:0}.chat-avatar-left{margin-right:10px}.chat-avatar-right{margin-left:10px}.chat-bubble{border-radius:20px;word-wrap:break-word;position:relative}.chat-bubble-left{background:#f9f9f8;border-radius:2px 24px 24px;padding:12px 16px;border:1px solid #e2e3e1}.chat-bubble-right{background:#fff;color:#333;border-radius:24px 2px 24px 24px;border:1px solid #cbcbcb}.chat-message-text{font-size:15px;line-height:1.4;margin:0;text-align:left}.chat-bubble-left .chat-message-text{color:#333}.chat-bubble-right .chat-message-text{color:#333;padding:12px 16px}.chat-card-container{padding:0;background:transparent;min-width:400px}.chat-thanks-card{background:transparent;box-shadow:none;text-align:center}.end-of-survey-text{text-align:center;color:#999;font-size:12px;margin-top:8px;font-weight:400}.answered-card{pointer-events:none;opacity:.7;position:relative}.answered-card:after{content:"";position:absolute;top:0;left:0;right:0;bottom:0;background:#ffffff4d;pointer-events:none;border-radius:inherit}.answered-card button,.answered-card input,.answered-card textarea,.answered-card select{pointer-events:none}.answered-card:not(.ul-card__consent-legal):not(.ul-card__text-url-prompt) .ul-card-button-group *{display:none}.sprig-question-footer-container{align-items:end;padding:8px 10px}.sprig-question-body{padding:10px 10px 0;overflow:unset}.ul-card-text__button{font-size:13px}@keyframes fadeInUp{0%{opacity:0;transform:translateY(20px)}to{opacity:1;transform:translateY(0)}}.chat-bubble-container.chat-left.chat-no-avatar .chat-bubble{margin-left:42px}@media (max-width: 768px){.chat-messages{padding:16px}.chat-bubble-left{padding:10px 14px}.chat-right{width:100%}.chat-bubble-right{width:100%;max-width:286px}.chat-bubble-text-only{width:auto;min-width:60px;max-width:286px}.chat-avatar{width:28px;height:28px}.chat-avatar-left{margin-right:8px}.chat-avatar-right{margin-left:8px}.chat-card-container{min-width:0}.chat-card .choice,.chat-message-text{font-size:12px}.chat-bubble-container.chat-left.chat-no-avatar .chat-bubble{margin-left:36px}}.ul-card-vertical__button-wrapper{align-items:end}.ul-card-skip__button{padding:0 16px}.chat-card-container:has(.ul-card__matrix),.chat-card-container:has([class*=matrix]){min-width:600px;max-width:900px}.chat-card-container .ul-card--matrix_container{max-width:100%;overflow-x:auto}.chat-card-container .ul-card--matrix_grid{min-width:100%}@media (max-width: 768px){.sprig-header-label-container,.sprig-header-label,.choice{font-size:12px}.chat-card-container:has(.ul-card__matrix),.chat-card-container:has([class*=matrix]){min-width:0;max-width:100%;width:100%}.chat-card-container .ul-card--matrix_container{overflow-x:auto;-webkit-overflow-scrolling:touch}}.select-label{cursor:pointer;flex:1;overflow-wrap:anywhere;text-align:start}@media (max-width: 768px){.ul-conversational-ui .nps-number{font-size:12px;height:35px}.ul-conversational-ui .ul-card--nps__labels{font-size:12px}}.ul-card-rank__option{text-align:left}@media (max-width: 768px){.ul-card--rank__question-inner-container,.ul-card-rank__labels{font-size:12px}.ul-card-rank__option>span{font-size:12px}.ul-card-rank__option>select{font-size:12px}}.select-button{align-items:center;background-color:transparent;border-radius:8px;border:1px solid #0b2330;box-shadow:0 0 0 2px #c8cccc;cursor:pointer;display:flex;font-size:15px;justify-content:space-between;margin-bottom:8px;padding:4px 8px 4px 16px;width:100%}.select-button:hover{background-color:#f3f3f3}.select-button:active{background-color:#eee}.select-button span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select-button.select-button-placeholder{color:#b0b5b7}.select-button svg{flex-shrink:0}.select-list{position:relative;height:fit-content;padding:4px 0;z-index:100;background-color:#fff;border:1px solid #E2E3E1;box-shadow:0 16px 24px #0b23300d,0 4px 12px #0b233008;border-radius:8px;overflow-y:scroll;width:100%}.select-option{align-items:center;cursor:pointer;display:flex;font-size:15px;gap:16px;line-height:20px;padding:8px 16px}.select-option:hover{background-color:#f3f3f3}.ul-card-text{margin-top:2px;margin-bottom:3px;display:flex;flex-direction:column;justify-content:center;padding:0;width:100%}.ul-card-text__container{align-items:center;box-sizing:border-box;border-radius:3px;display:flex;justify-content:center;margin-bottom:12px;flex:1 0 100%}.ul-card-text__input--mobile{border:2px solid #e6e6e6;max-height:63px}.ul-card-text__input--desktop{border:1px solid #e6e6e6;max-height:150px}.ul-card-text__input{background:#fff;box-sizing:border-box;color:#343442;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol;min-height:63px;overflow:auto;padding:8px;resize:none;width:100%;border-radius:3px;line-height:20px;overflow-wrap:break-word}.ul-card-text__input::placeholder{color:#6c6c6e80}.ul-card-text__input:focus{outline:none;background:#fff}.ul-card-text__input--desktop:hover:not(:focus){background-color:#fff}@media (max-width: 768px){.ul-card-text__input{font-size:12px}}.ul-card__text-url-prompt .sprig-question-body{padding:0}.ul-card__text-url-prompt .ul-card-button-group{padding:10px}@keyframes flashingDot{0%{background-color:#262136}50%,to{background-color:#f8f9fa}}.thinking-dots-container{display:flex;justify-content:center;align-items:flex-end;position:relative;width:18px;margin-top:.5em}.thinking-dot{position:relative;width:3px;height:3px;border-radius:5px;background-color:#262136;color:#262136;animation:flashingDot 1s infinite linear alternate;animation-delay:.5s}.thinking-dot:before,.thinking-dot:after{content:"";display:inline-block;position:absolute;top:0;width:3px;height:3px;border-radius:5px;background-color:#262136;color:#262136;animation:flashingDot 1s infinite alternate}.thinking-dot:before{left:-5px;animation-delay:0s}.thinking-dot:after{left:5px;animation-delay:1s}[id^=ul-card-video__player_recorder],[id^=ul-card-video__question_player]{width:100%;width:-moz-available;width:-webkit-fill-available;width:fill-available}.answered-card [id^=ul-card-video__player_recorder] .ul-control-panel{display:none!important}';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./view-DAxlTNxd.cjs"),m=require("./getAttributedUrl-DuHEi0A7.cjs"),V=require("./core-oShYwNGS.cjs"),de=require("./metricsReporter-DC-3J5Sa.cjs"),Te=({properties:t,surveyVideoUrl:s,questionId:r})=>{const n=`ul-card-video__question_player-q${r}`,{apiURL:i,viewDocument:a}=e.useConfig(l=>({apiURL:l.apiURL,viewDocument:l.viewDocument}));return e.u("div",{id:n,ref:l=>{if(l&&l.children.length===0&&!t.properties.hideRecordedPrompt){const c=m.videoPlayer(n,{src:s,type:"application/x-mpegURL"},void 0,t.properties.mediaType===m.RECORDER.MEDIA_TYPE_AUDIO,i,a);l.appendChild(c)}}})},z=({isDisabled:t,onClick:s,children:r})=>e.u(m.Button,{className:"ul-card__button-checkmark",disabled:t,onClick:s,type:"button",children:[e.u("svg",{fill:"none",height:"10",viewBox:"0 0 13 10",width:"13",xmlns:"http://www.w3.org/2000/svg",children:e.u("path",{d:"M11.5 1.5L4.5 8.5L1 5",stroke:"#ffffff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})}),r||"Ok"]}),_e=({className:t,next:s,properties:r,questionId:n,type:i})=>{const{useMobileStyling:a,border:l}=e.useConfig(k=>({useMobileStyling:k.useMobileStyling,border:k.border})),[c,u]=e.h(!1),[h,g]=e.h(""),[o,d]=e.h(!1),f=r==null?void 0:r.collectName,C=(r==null?void 0:r.nameLabelText)||"Full Name",p=(r==null?void 0:r.consentText)||"I agree to the stated conditions",T=(r==null?void 0:r.submitButtonText)||"Submit",w=!!h.trim(),v=c&&(!f||w),_=(k,E=!1)=>{k.preventDefault(),k.stopPropagation();let I=null;if(!E){if(!v)return void d(!0);I={submitted:!0},f&&(I.name=h)}s({value:I,questionId:n,type:i},!!E||v)};return e.u("div",{className:e.cc(t,"ul-card__consent-legal","fade-in-transition"),children:e.u(m.MobileEmbedView,{embeddedType:"pdf",properties:r,children:e.u(m.QuestionBodyFooterContainer,{children:[e.u("div",{className:"sprig-stretch",children:[e.u(m.Option,{allowTextEntry:!1,border:l,error:o&&!c,id:"consent",isRadio:!1,isSelected:c,label:p,onUserInputChanged:({selected:k})=>{k!==c&&u(!c)},useMobileStyling:a}),f&&e.u("input",{"aria-label":C,"aria-placeholder":C,className:e.cc(e.getClasses("ul-consent-legal__name-input",a)),"data-gramm":"false",maxLength:250,name:"name",onBlur:k=>{k.currentTarget.style.borderColor=o&&!w?V.ERROR_BORDER_COLOR:V.DEFAULT_BORDER_COLOR},onFocus:k=>{k.currentTarget.style.borderColor=o&&!w?V.ERROR_BORDER_COLOR:l},onInput:k=>{k.preventDefault(),k.stopPropagation(),g(k.currentTarget.value)},placeholder:C,style:o&&!w?{borderColor:V.ERROR_BORDER_COLOR}:{},tabIndex:0,value:h})]}),e.u("div",{className:"ul-card__button-wrapper ul-card-vertical__button-wrapper",children:[e.u(z,{isDisabled:!v,onClick:k=>_(new SubmitEvent(k.type)),children:e.getButtonText({buttonText:T})}),r.required===!1&&e.u("button",{className:"ul-card-skip__button",onClick:k=>_(new SubmitEvent(k.type),!0),children:e.getSkipButtonText(r)})]})]})})},n)},Se=()=>{const{destroy:t,forceBrandedLogo:s}=e.useConfig(r=>({destroy:r.destroy,forceBrandedLogo:r.forceBrandedLogo}));return e.p(()=>{setTimeout(()=>{t(V.APP_ID)},s?4e3:2e3)},[t,s]),e.u("div",{className:"end-of-survey-text",children:"End of survey"})},Re=({activeValue:t,border:s,icon:r,enableCspTrustedTypes:n,isPressed:i,range:a,scaleLabelType:l,selectedValue:c,setSelectedValue:u,setActiveValue:h,setIsPressed:g,useMobileStyling:o,value:d,viewDocument:f})=>{const C=`option-${d}`,p=l==="number",T=l==="star",w=l==="smiley",v=p&&d===t||d===c,[_,k]=(()=>{const S=T&&c!==null&&d<=c;return T&&d<=t||w&&d===t||S||d===t||d===c?[s,i||S||d===c?1:.3]:["",1]})(),E=e.F(()=>{const S={borderColor:v?_:"",fillOpacity:v?"":k,zIndex:v?3:"auto",color:c===d?"#fff":""};return p?{...S,backgroundColor:c===d?_:""}:{...S,color:T||w||c===d?_:""}},[v,_,k,c,d,p,T,w]),I=e.F(()=>V.getHtml((({icon:S,scaleLabelType:y,value:R,selectedValue:b})=>{if(y==="smiley"&&R===b){let N=0;return S.replace(/black/g,()=>++N==1?"black":"white")}return S})({icon:r,scaleLabelType:l,value:d,selectedValue:c}),n),[n,r,l,c,d]);return e.u("button",{"aria-label":p?void 0:String(d),className:(()=>{switch(l){case"star":return e.cc(e.getClasses("likert-star",o),e.getClasses(`likert-star-${d}`,o));case"smiley":return e.cc(e.getClasses("likert-smiley",o),e.getClasses(`likert-smiley-${d}`,o));default:return d===a?e.cc(e.getClasses("likert-number",o),e.getClasses(`likert-number-${d}`,o),e.getClasses("likert-last-option",o)):e.cc(e.getClasses("likert-number",o),e.getClasses(`likert-number-${d}`,o))}})(),dangerouslySetInnerHTML:{__html:I},id:C,onClick:S=>{S.preventDefault(),S.stopPropagation(),u(d)},onKeyDown:S=>{var b,N;const y=f.querySelectorAll(`.likert-${l??"number"}`),R=d-1;S.key==="ArrowRight"?(b=y[R+1])==null||b.focus():S.key==="ArrowLeft"?(N=y[R-1])==null||N.focus():S.key!=="Enter"&&S.key!==" "||(S.preventDefault(),S.stopPropagation(),u(d))},onPointerDown:()=>g(!0),onPointerEnter:()=>h(d),onPointerLeave:()=>{h(-1),g(!1)},style:E,tabIndex:0})},Ne=({className:t,labels:s,next:r,properties:n,questionId:i,type:a})=>{const{border:l,useMobileStyling:c,viewDocument:u,enableCspTrustedTypes:h}=e.useConfig(y=>({border:y.border,useMobileStyling:y.useMobileStyling,viewDocument:y.viewDocument,enableCspTrustedTypes:y.enableCspTrustedTypes})),[g,o]=e.h(-1),[d,f]=e.h(!1),[C,p]=e.h(null),T=s&&s.left,w=s&&s.right;let v;const{range:_,scaleLabelType:k,ratingIcons:E}=n;_&&(v=Number(_));const I=v||5,S=y=>{var R,b;switch(k){case"star":return(R=E[0])==null?void 0:R.svg;case"smiley":return(b=E[y])==null?void 0:b.svg;default:return String(y+1)}};return e.u("form",{className:e.cc(t,"ul-card--likert","fade-in-transition"),children:e.u(m.MobileEmbedView,{properties:n,children:[e.u(m.QuestionBodyWrapper,{children:[e.u("div",{"aria-label":`Rating (1 - ${I})`,className:"ul-card--likert__numbers",role:"radiogroup",children:[...Array(I)].map((y,R)=>{const b=R+1;return e.u(Re,{activeValue:g,border:l,enableCspTrustedTypes:h,icon:S(R),isPressed:d,range:I,scaleLabelType:k,selectedValue:C,setActiveValue:o,setIsPressed:f,setSelectedValue:p,useMobileStyling:c,value:b,viewDocument:u},R)})}),e.u("div",{className:"ul-card--likert__labels",children:[e.u("span",{children:T}),e.u("span",{children:w})]})]}),e.u(m.QuestionBodyFooterContainer,{children:e.u(z,{isDisabled:C===null&&n.required,onClick:()=>r({value:C,questionId:i,type:a},!0),children:e.getButtonText(n)})})]})},i)},De=({columns:t,onSelect:s,options:r,selectedOptions:n})=>{const i=e._([]),{border:a,useMobileStyling:l}=e.useConfig(d=>({border:d.border,useMobileStyling:d.useMobileStyling})),c=r.findIndex(d=>n[d.id]===null),[u,h]=e.h(c),g=e.T((d,f)=>{s(d,f);const C=u+1,p=r[C];p&&n[p.id]===null&&h(C)},[s,r,n,u]),o=e.T((d,f)=>{const C=u===d;return e.u(e.Accordion,{animate:!0,header:f.label,isOpen:C,onClick:()=>{var p;return h(C&&!((p=window.UserLeap)!=null&&p.isMobileSDK)?-1:d)},ref:p=>{p&&(i.current[d]=p)},showHeaderCheck:n[f.id]!==null,children:e.u("div",{style:{paddingTop:"12px"},children:t.map(p=>e.u(m.Option,{allowTextEntry:!1,ariaLabel:`${f.label}-${p.label}`,border:a,error:!1,id:`${f.id}-${p.value}`,isRadio:!0,isSelected:n[f.id]===p.value,label:p.label,onUserInputChanged:()=>g(f.id,p.value),useMobileStyling:l},p.label))})},f.id)},[a,t,u,g,n,l]);return e.u("div",{children:r.map((d,f)=>o(f,d))})},Ie=({className:t,next:s,options:r,properties:n,questionId:i,type:a,onSubmitButtonClick:l})=>{const c=n.matrixColumn,u=n.required,h=C=>{C.preventDefault(),C.stopPropagation(),s({value:o,questionId:i,type:a},!0),l&&l()},g=r.reduce((C,p)=>(C[p.id]=null,C),{}),[o,d]=e.h(g);return e.u("form",{className:e.cc(t,"ul-card__matrix","fade-in-transition"),id:"text-form",onSubmit:h,children:e.u(m.MobileEmbedView,{properties:n,children:[e.u(m.QuestionBodyWrapper,{children:e.u(De,{columns:c,onSelect:(C,p)=>{d(T=>({...T,[C]:p}))},options:r,selectedOptions:o})}),e.u(m.QuestionBodyFooterContainer,{children:e.u(z,{isDisabled:(f=o,u&&Object.values(f).every(C=>C==null)),onClick:()=>h(new SubmitEvent("submit")),children:e.getButtonText(n)})})]})},i);var f},pe=({className:t,onSubmit:s,options:r=[],properties:n,questionId:i,type:a,showIndividualSubmit:l=!1,onSubmitButtonClick:c})=>{const{border:u,useMobileStyling:h}=e.useConfig(b=>({border:b.border,useMobileStyling:b.useMobileStyling})),g=r.reduce((b,N)=>(b[N.id]={isSelected:!1},b),{}),[o,d]=e.h(g),f=a==="multiplechoice",C=n.required,p=r.find(b=>{var N;return(N=b.optionProperties)==null?void 0:N.noneOfTheAbove}),T=b=>Object.entries(b).some(([N,O])=>{var $;const A=r.find(j=>`${j.id}`===N),U=O.userText===void 0||O.userText.trim()==="";return(($=A==null?void 0:A.optionProperties)==null?void 0:$.allowsTextEntry)&&U&&O.isSelected}),w=b=>Object.values(b).filter(N=>N.isSelected).length,v=n.minSelect&&n.minSelect>0&&n.maxSelectMode===m.MaxSelectModes.Range&&w(o)<n.minSelect&&(C||w(o)>0),_=b=>T(b)||C&&!w(b)||!(N=>{const{minSelect:O=0,maxSelect:A=1/0,maxSelectMode:U}=n,$=w(N);switch(U){case m.MaxSelectModes.Maximum:return $<=A;case m.MaxSelectModes.Range:return $===0||$>=O;default:return!0}})(b),k=Object.entries(o).some(([b,N])=>{var O,A;return N.isSelected&&((A=(O=r.find(U=>`${U.id}`===b))==null?void 0:O.optionProperties)==null?void 0:A.allowsTextEntry)}),E=l&&(!f||k),I=b=>{R(b.id,b.selected,b.userText,b.noneOfTheAbove)},S=b=>{var N;return(n==null?void 0:n.maxSelectMode)!==m.MaxSelectModes.Unlimited&&w(o)===(n==null?void 0:n.maxSelect)&&!((N=o[b])!=null&&N.isSelected)},y=()=>{s(o,!0),c&&c()},R=(b,N,O,A)=>{const U=Object.assign({},o);if((f||A)&&N)for(const $ of Object.values(U))$.isSelected=!1,delete $.userText;else p&&!A&&o[p.id].isSelected&&(U[p.id].isSelected=!1);U[b]={isSelected:N,userText:O},d(U)};return e.u("form",{className:e.cc(t,"ul-card--multiple","fade-in-transition"),id:"text-form",onSubmit:y,children:e.u(m.MobileEmbedView,{properties:n,children:[e.u(m.QuestionBodyWrapper,{children:[n.isDropdown?e.u(m.Select,{disabledOptions:r.filter(b=>S(b.id)),dropdownFooter:v?e.u("div",{className:"ul-card__min-select-counter",style:{marginLeft:"16px"},children:[w(o),"/",n.minSelect]}):void 0,isMultiSelect:!f,multiselectText:n.dropdownMultiselectedText??"choices selected",onChange:b=>{const N={...o};for(const O of r)b.includes(O)?N[O.id].isSelected=!0:N[O.id].isSelected=!1;d(N)},options:r,placeholderText:n.dropdownPlaceholderText??(f?"Select choice":"Select choice(s)"),value:r.filter(b=>o[b.id].isSelected)}):e.u("div",{className:e.cc(e.getClasses("ul-card__choices",h)),role:f?"radiogroup":"group",children:[r.map(({id:b,label:N,value:O,optionProperties:A})=>{var Q,Z;const U=`${b}`,{allowsTextEntry:$,noneOfTheAbove:j}={allowsTextEntry:!1,noneOfTheAbove:!1,...A};return e.u(m.Option,{allowTextEntry:$,border:u,disabled:S(U),error:(F=o,T(F)),id:U,isRadio:f,isSelected:!!((Q=o[U])!=null&&Q.isSelected),label:N,noneOfTheAbove:j,onUserInputChanged:I,promptText:"Please specify",text:(Z=o[b])==null?void 0:Z.userText,useMobileStyling:h,value:O},U);var F}),!!v&&e.u("div",{className:"ul-card__min-select-counter",children:[w(o),"/",n.minSelect]})]}),E&&e.u(m.LongformSubmitButton,{handleSubmit:y,isSubmitDisabled:_(o)})]}),e.u(m.QuestionBodyFooterContainer,{children:e.u(z,{isDisabled:_(o),onClick:y,children:e.getButtonText(n)})})]})},i)},we=t=>{const{questionId:s,type:r,next:n,options:i}=t;return e.u(pe,{...t,onSubmit:(a,l)=>{const c=Object.entries(a).find(([,d])=>d.isSelected)||[void 0,void 0],[u,h]=c,g=i.find(d=>`${d.id}`===u),o=h!=null&&h.userText?{[u]:{userText:h.userText}}:null;n({value:g&&u?{[u]:g.value}:{},secondaryValue:o,questionId:s,type:r},l)}})},Ee=t=>{const{questionId:s,type:r,next:n}=t;return e.u(pe,{...t,onSubmit:(i,a)=>{const l=Object.entries(i).reduce((u,[h,g])=>(u[h]=g.isSelected,u),{}),c=Object.entries(i).reduce((u,[h,g])=>{if(!g.userText)return u;const o=u||{};return o[h]={userText:g.userText},o},null);n({value:l,secondaryValue:c,questionId:s,type:r},a)}})},Pe=({className:t,labels:s,properties:r,next:n,questionId:i,type:a})=>{const[l,c]=e.h(null),{border:u,useMobileStyling:h,viewDocument:g}=e.useConfig(f=>({border:f.border,useMobileStyling:f.useMobileStyling,viewDocument:f.viewDocument})),o=s&&s.left,d=s&&s.right;return e.u("form",{className:e.cc(t,"ul-card--nps","fade-in-transition"),children:e.u(m.MobileEmbedView,{properties:r,children:[e.u(m.QuestionBodyWrapper,{children:[e.u("div",{className:"ul-card--nps__numbers",children:[...Array(11)].map((f,C)=>e.u("button",{className:e.cc(e.getClasses("nps-number",h),e.getClasses(`nps-number-${C}`,h)),id:`option-${C}`,onClick:p=>{p.preventDefault(),p.stopPropagation(),c(C)},onKeyDown:p=>{var w,v;const T=g.querySelectorAll("button.nps-number");p.key==="ArrowRight"?(w=T[C+1])==null||w.focus():p.key==="ArrowLeft"?(v=T[C-1])==null||v.focus():p.key!=="Enter"&&p.key!==" "||(p.preventDefault(),p.stopPropagation(),c(C))},onPointerDown:p=>{p.currentTarget.style.zIndex="2",p.currentTarget.style.borderColor=u},onPointerLeave:p=>{p.currentTarget.style.zIndex="auto",p.currentTarget.style.borderColor=V.DEFAULT_BORDER_COLOR},style:l===C?{backgroundColor:u,color:"#fff"}:void 0,tabIndex:0,children:C},C))}),e.u("div",{className:"ul-card--nps__labels",children:[e.u("span",{children:o}),e.u("span",{children:d})]})]}),e.u(m.QuestionBodyFooterContainer,{children:e.u(z,{isDisabled:l===null&&r.required,onClick:()=>n({value:l,questionId:i,type:a},!0),children:e.getButtonText(r)})})]})},i)},qe=({className:t,next:s,properties:r,questionId:n,type:i,onSubmitButtonClick:a})=>{const{border:l,useMobileStyling:c,update:u}=e.useConfig(T=>({border:T.border,useMobileStyling:T.useMobileStyling,update:T.update})),[h,g]=e.h(""),o=e._(null),d=h.trim(),f=r.required===!0&&!d,C=m.useAutoSize(o,()=>u()),p=r&&r.openTextPlaceholder?r.openTextPlaceholder:"";return e.u("form",{className:e.cc(t,"ul-card-text","fade-in-transition"),id:"text-form",children:e.u(m.MobileEmbedView,{properties:r,children:e.u("div",{className:"ul-card-text",children:[e.u(m.QuestionBodyWrapper,{children:[e.u("div",{className:"ul-card-text__container",children:e.u("textarea",{"aria-describedby":"ul-caption","aria-labelledby":"ul-question","aria-multiline":"true","aria-placeholder":p,className:e.cc(e.getClasses("ul-card-text__input",c)),"data-gramm":"false",maxLength:5e3,name:"text",onBlur:T=>{T.currentTarget.style.borderColor=V.DEFAULT_BORDER_COLOR},onChange:T=>{const{value:w}=T.currentTarget;C(),T.preventDefault(),T.stopPropagation(),g(w)},onFocus:T=>{T.currentTarget.style.borderColor=l},placeholder:p,ref:o,role:"textbox",tabIndex:0})}),r.footerHtml&&e.u(m.Html,{className:"footer",html:r.footerHtml})]}),e.u(m.QuestionBodyFooterContainer,{children:e.u(z,{isDisabled:f,onClick:T=>{T.preventDefault(),T.stopPropagation();const w=r.required!==!0||d.length>0;s({value:h,questionId:n,type:i},w),a&&a()},children:e.getButtonText(r)})})]})})},n)},Be=({className:t,labels:s,next:r,properties:n,questionId:i,type:a,onSubmitButtonClick:l,options:c})=>{const u=e._(null),h=e._(0),g=e._(0),o=e._(null),d=e._(!1),f=e._([]),[C,p]=e.h(()=>(n==null?void 0:n.required)===!0),[T,w]=e.h(()=>c.map(x=>({...x,rank:null}))),v=e.F(()=>Array.from({length:c.length},(x,P)=>P+1),[c.length]),{useMobileStyling:_,isPreview:k,headers:E}=e.useConfig(x=>({useMobileStyling:x.useMobileStyling,isPreview:x.isPreview,headers:x.headers})),I=(E==null?void 0:E["userleap-platform"])==="android",S=_&&!k&&!I,y=!S&&!I,R=(x,P)=>{w(q=>{const D=parseInt(P),M=q.map(B=>({...B}));M.some(B=>B.rank==null)&&M.forEach((B,W)=>B.rank=W+1);const H=M.findIndex(B=>B.id===x);if(H===-1)return q;const L=M[H].rank;return D<L?M.forEach(B=>{B.id!==x&&B.rank>=D&&B.rank<L&&(B.rank=B.rank+1)}):D>L&&M.forEach(B=>{B.id!==x&&B.rank>L&&B.rank<=D&&(B.rank=B.rank-1)}),M[H].rank=D,M.sort((B,W)=>B.rank-W.rank),j(),M})},b=(x,P)=>{for(let q=0;q<f.current.length;q++){const D=f.current[q];if(!D||D===o.current)continue;const M=D.getBoundingClientRect();if(x>=M.left&&x<=M.right&&P>=M.top&&P<=M.bottom)return{element:D,index:q}}return null},N=x=>P=>{if(!S)return;P.preventDefault(),P.stopPropagation(),d.current=!0,u.current=x;const q=P.touches[0];h.current=q.clientY,g.current=q.clientY;const D=P.currentTarget.closest(".ul-card-rank__option");D&&(o.current=D,D.classList.add("is-dragging"))},O=x=>{if(!S||!d.current||u.current===null)return;x.preventDefault(),x.stopPropagation();const P=x.touches[0];g.current=P.clientY;const q=g.current-h.current;o.current&&(o.current.style.transform=`translateY(${q}px)`,o.current.style.zIndex="1000"),f.current.forEach(M=>{M&&M!==o.current&&M.classList.remove("is-drop-target")});const D=b(P.clientX,P.clientY);D&&D.element.classList.add("is-drop-target")},A=x=>{if(!S||!d.current||u.current===null)return;x.preventDefault(),x.stopPropagation();const P=x.changedTouches[0],q=b(P.clientX,P.clientY);o.current&&(o.current.style.transform="",o.current.style.zIndex="",o.current.classList.remove("is-dragging")),f.current.forEach(D=>{D&&D.classList.remove("is-drop-target")}),q&&q.index!==u.current&&U(u.current,q.index),u.current=null,o.current=null,d.current=!1},U=(x,P)=>{w(q=>{const D=q.map(H=>({...H})),[M]=D.splice(x,1);return D.splice(P,0,M),D.forEach((H,L)=>{H.rank=L+1}),j(),D})},$=x=>{const P={};x.reduce((q,D)=>(q[D.id]=D.rank,q),P),r({value:P,questionId:i,type:a},!0)},j=()=>{p(!1)},{left:F,right:Q}=s,Z=c.length,K=x=>{x.preventDefault(),x.currentTarget.classList.add("is-drop-target")},ke=x=>{x.currentTarget.classList.remove("is-drop-target")},xe=x=>{u.current=null,x.currentTarget.classList.remove("is-dragging")};return e.u("form",{className:e.cc(t,"ul-card-rank","fade-in-transition"),onSubmit:x=>{x.preventDefault(),$(T),l&&l()},children:e.u(m.MobileEmbedView,{properties:n,children:I?e.u(m.QuestionBodyWrapper,{children:e.u("div",{className:"ul-card--rank__question-inner-container",children:[e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:["1 - ",F]})}),e.u("ol",{className:"ul-card-rank__list",children:T.map(({id:x,label:P,rank:q})=>e.u("li",{className:"ul-card-rank__option",children:[e.u("select",{"aria-label":`Rank for ${P}`,className:e.cc("ul-card-rank__select",q==null&&"ul-card-rank__select--placeholder"),name:`rank[${x}]`,onChange:D=>R(x,D.currentTarget.value),value:q??"",children:[q==null&&e.u("option",{className:"ul-card-rank__select-option",disabled:!0,value:"",children:"-"}),v.map(D=>e.u("option",{className:"ul-card-rank__select-option",value:D,children:D},`${D}-${i}`))]}),e.u("span",{children:P})]},x))}),e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:[Z," - ",Q]})})]})}):e.u(e.g,{children:[e.u(m.QuestionBodyWrapper,{children:e.u("div",{className:"ul-card--rank__question-inner-container",children:[e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:["1 - ",F]})}),e.u("ol",{className:"ul-card-rank__list",onDragOver:I?void 0:x=>{x.preventDefault(),x.dataTransfer&&(x.dataTransfer.dropEffect="move")},children:T.map(({id:x,label:P,rank:q},D)=>{return e.u("li",{className:"ul-card-rank__option",draggable:!!y||void 0,onDragEnd:y?xe:void 0,onDragEnter:y?K:void 0,onDragLeave:y?ke:void 0,onDragStart:y?(H=D,L=>{u.current=H,L.dataTransfer&&(L.dataTransfer.effectAllowed="move",L.dataTransfer.setData("text/plain",String(H)),L.currentTarget.classList.add("is-dragging"))}):void 0,onDrop:y?(M=D,L=>{var W,ae;L.preventDefault(),L.currentTarget.classList.remove("is-drop-target");const B=u.current;u.current=null,(ae=(W=L.currentTarget.closest(".ul-card-rank__list"))==null?void 0:W.querySelector(".is-dragging"))==null||ae.classList.remove("is-dragging"),B!=null&&B!==M&&U(B,M)}):void 0,ref:L=>f.current[D]=L,children:[e.u("select",{"aria-label":`Rank for ${P}`,className:e.cc("ul-card-rank__select",q==null&&"ul-card-rank__select--placeholder"),name:`rank[${x}]`,onChange:L=>R(x,L.currentTarget.value),value:q??"",children:[q==null&&e.u("option",{className:"ul-card-rank__select-option",disabled:!0,value:"",children:"-"}),v.map(L=>e.u("option",{className:"ul-card-rank__select-option",value:L,children:L},L))]}),e.u("span",{children:P}),!I&&e.u("button",{"aria-label":`Drag ${P} to reorder`,className:"ul-card-rank__drag-btn",onTouchEnd:S?A:void 0,onTouchMove:S?O:void 0,onTouchStart:S?N(D):void 0,title:"Drag to reorder",type:"button",children:e.u("svg",{fill:"none",height:"17",viewBox:"0 0 16 17",width:"16",xmlns:"http://www.w3.org/2000/svg",children:e.u("path",{d:"M5.75 11.625C6.37132 11.625 6.875 12.1287 6.875 12.75C6.875 13.3713 6.37132 13.875 5.75 13.875C5.12868 13.875 4.625 13.3713 4.625 12.75C4.625 12.1287 5.12868 11.625 5.75 11.625ZM10.25 11.625C10.8713 11.625 11.375 12.1287 11.375 12.75C11.375 13.3713 10.8713 13.875 10.25 13.875C9.62868 13.875 9.125 13.3713 9.125 12.75C9.125 12.1287 9.62868 11.625 10.25 11.625ZM5.75 7.375C6.37132 7.375 6.875 7.87868 6.875 8.5C6.875 9.12132 6.37132 9.625 5.75 9.625C5.12868 9.625 4.625 9.12132 4.625 8.5C4.625 7.87868 5.12868 7.375 5.75 7.375ZM10.25 7.375C10.8713 7.375 11.375 7.87868 11.375 8.5C11.375 9.12132 10.8713 9.625 10.25 9.625C9.62868 9.625 9.125 9.12132 9.125 8.5C9.125 7.87868 9.62868 7.375 10.25 7.375ZM5.75 3.125C6.37132 3.125 6.875 3.62868 6.875 4.25C6.875 4.87132 6.37132 5.375 5.75 5.375C5.12868 5.375 4.625 4.87132 4.625 4.25C4.625 3.62868 5.12868 3.125 5.75 3.125ZM10.25 3.125C10.8713 3.125 11.375 3.62868 11.375 4.25C11.375 4.87132 10.8713 5.375 10.25 5.375C9.62868 5.375 9.125 4.87132 9.125 4.25C9.125 3.62868 9.62868 3.125 10.25 3.125Z",fill:"currentColor"})})})]},x);var M,H})}),e.u("div",{className:"ul-card-rank__labels",children:e.u("span",{children:[Z," - ",Q]})})]})}),e.u(m.QuestionBodyFooterContainer,{children:e.u("div",{className:"ul-card__button-wrapper",children:e.u(m.Button,{disabled:C,children:e.getButtonText(n)})})})]})})},i)},te=1,me=2,he=3,X=t=>t.type==="av_permission",oe=t=>t.type==="screen_permission",ge=(t,s)=>t===void 0?te:t?((r,n)=>!(X(n)?n.permissionDescriptors:[]).includes("camera")||r.getVideoTracks().length>0)(t,s)?he:te:me,le={avStream:null,currentPage:null,mediaRecordingUids:null,nextQuestion:()=>{},passthroughData:void 0,recordingMediaTypes:void 0,screenPermissionRequested:!1,type:void 0},G=e.create(t=>({...le,reset:()=>{t(le)},updatePage:s=>{t(s)}}));function re({currentPage:t,pages:s}){const{avStream:r,recordingMediaTypes:n,updatePage:i}=G.getState(),{recorderEventEmitter:a}=e.useConfig.getState();a.emit("av.permission",{"permission.descriptors":t.permissionDescriptors,"stream.ready":(l,c)=>{if(r===l)return;let u=t;if(l&&!t.permissionDescriptors.includes("camera")){const h=s.indexOf(t),g=c!=null&&c.active?h+2:h+1;c!=null&&c.active&&n&&a.emit("begin.recording",{"recording.media.types":n,"start.recording.callback":o=>i({mediaRecordingUids:o})}),u=s[g]}i({currentPage:u,avStream:l})}})}function ne({status:t}){const{nextQuestion:s,passthroughData:r,mediaRecordingUids:n,reset:i}=G.getState(),{recorderEventEmitter:a,handleUploadUpdate:l,index:c}=e.useConfig.getState(),u={value:{taskStatus:t},type:"recordedtask",questionId:(r==null?void 0:r.questionId)||1};r&&a.emit("finish.task",{"begin.callback":h=>{l({mediaRecordingUid:h,isSubmitted:!0,progressPct:0,isComplete:!1})},"progress.callback":(h,g)=>{l({mediaRecordingUid:h,progressPct:g.detail,isSubmitted:!1,isComplete:!1})},"upload.callback":h=>{h&&l({mediaRecordingUid:h,isComplete:!0,isSubmitted:!0,progressPct:100})},"passthrough.data":r,"current.index":c,"task.response":u,"task.complete.callback":h=>{u.value.taskDurationMillisecond=h,n&&(u.value.mediaRecordingUids=n),i(),s(u)}})}function se({pages:t,setIsRequestingPermission:s}){const{recorderEventEmitter:r,eventEmitFn:n}=e.useConfig.getState(),{updatePage:i,currentPage:a,recordingMediaTypes:l,screenPermissionRequested:c}=G.getState();if(!a)return;const u=t.indexOf(a);switch(a.type){case"av_permission":{const h=c?u+2:u+1;return c&&l&&r.emit("begin.recording",{"recording.media.types":l,"start.recording.callback":g=>{i({mediaRecordingUids:g})}}),void i({currentPage:t[h]})}case"screen_permission":return void r.emit("screen.permission",{"screen.permission.requested":s,"stream.ready.callback":(h,g)=>{const o=g?t[u+1]:a;g&&l&&r.emit("begin.recording",{"recording.media.types":l,"start.recording.callback":d=>{i({captureStream:g,mediaRecordingUids:d})}}),i({currentPage:o,screenPermissionRequested:!0,captureStream:g})}});case"start_task":return n("recorded.task.start"),r.emit("recorded.task.start"),r.emit("start.task"),void i({currentPage:t[u+1],screenPermissionRequested:!0});case"complete_task":return}}const ve="ul-permission-graphics-container",be="ul-permission-body",ye=e.cc(ve,"ul_recorded-task-inset-spacing"),J=e.cc("ul-horizontal-button-container","ul-horizontal-button-container-left"),fe=({richTextBody:t})=>e.u(m.Html,{className:"ul-rich-text-body",html:t,id:"ul-task-detail-container"}),ee=({required:t,skipButtonText:s,bottom:r=!1})=>t?null:e.u(m.Button,{className:e.cc(r&&"ul-skip-button-below","ul-button-inactive"),onClick:ne.bind(null,{status:"abandoned"}),children:s||"Skip"}),ie=t=>{const{avStream:s,captureStream:r,recordingMediaTypes:n,updatePage:i}=G.getState(),a=(n==null?void 0:n.includes("audio"))||(n==null?void 0:n.includes("video"));e.p(()=>{const l=setInterval(()=>{a&&s&&!s.active?i({avStream:null,currentPage:t[0]}):r&&r.active||i({captureStream:void 0,currentPage:t[a?1:0]})},1e3);return()=>clearInterval(l)},[s,r,a,t,n,i])},Me=({content:t,pages:s,required:r})=>{const{buttonText:n,skipButtonText:i,taskDetail:a}=t;return ie(s),e.u("div",{className:"ul-task-page",children:[a&&e.u(fe,{richTextBody:a}),e.u("div",{className:J,children:[e.u(m.Button,{onClick:se.bind(null,{pages:s}),children:n}),e.u(ee,{required:r,skipButtonText:i})]})]},"start-task")},Le=({content:t,pages:s,properties:r})=>{const{buttonText:n,skipButtonText:i}=t;return ie(s),e.u("div",{className:"ul-task-page",children:[t.taskDetail&&e.u(fe,{richTextBody:t.taskDetail}),e.u(m.MobileEmbedView,{properties:r,children:e.u("div",{className:J,children:[e.u(m.Button,{className:"ul-complete-task-button",onClick:ne.bind(null,{status:"completed"}),children:n}),e.u(m.Button,{className:e.cc("ul-button-inactive"),onClick:ne.bind(null,{status:"given.up"}),children:i})]})})]},"complete-task")},Oe=({content:t,pages:s,required:r})=>{const{buttonText:n,skipButtonText:i}=t,[a]=e.useConfig(u=>[u.tabTitle]),[l,c]=e.h(!1);return e.u("div",{children:[e.u("div",{className:ye,children:[e.u("p",{style:{marginTop:"auto"},children:t.selectTabText}),e.u("div",{className:"ul-select-tab-container",children:e.u("p",{className:be,children:a})})]}),e.u("div",{className:r?"":J,children:[e.u(m.Button,{disabled:l,onClick:se.bind(null,{pages:s,setIsRequestingPermission:c}),children:n}),e.u(ee,{required:r,skipButtonText:i})]})]})},Ue=({content:t})=>e.u(m.Html,{className:e.cc(ve,"ul_permission_svg_container","ul_recorded-task-inset-spacing","ul-center-horizontally"),html:t.svg},"ul-permission-request-graphic"),Ae=({content:t,pages:s,required:r})=>{const{permissionDeniedHeadline:n,permissionDeniedBody:i,skipButtonText:a,tryAgainButtonText:l}=t,c=X(s[0])?s[0]:null;return e.p(()=>{const u=setInterval(()=>{c!==null&&re({currentPage:c,pages:s})},1e3);return()=>clearInterval(u)},[c,s]),c?e.u("div",{children:[e.u("div",{className:ye,children:e.u("p",{className:"ul-av-permission-denied-paragraph",children:[e.u("span",{className:"ul-av-permission-denied-headline",children:n}),e.u("span",{className:be,children:i})]})}),e.u("div",{className:J,children:[e.u(m.Button,{onClick:re.bind(null,{currentPage:c,pages:s}),children:l}),e.u(ee,{required:r,skipButtonText:a})]})]}):null},$e=({stream:t})=>e.u("video",{autoPlay:!0,className:e.cc("ul_recorded-task-inset-spacing"),id:"ul-record-task-video-preview",muted:!0,ref:s=>{s&&(s.srcObject=t||null)}}),Qe=({content:t,pages:s,required:r})=>{const{skipButtonText:n}=t,{avStream:i}=G.getState();return ie(s),e.u("div",{children:[e.u($e,{stream:i}),e.u("div",{className:"ul-vertical-button-container-center",children:[e.u(m.Button,{onClick:se.bind(null,{pages:s}),children:t.buttonText}),e.u(ee,{bottom:!0,required:r,skipButtonText:n})]})]})},He=({properties:t})=>{const{pages:s,required:r}=t,{avStream:n,currentPage:i}=G.getState();if(i===void 0)return null;switch(i==null?void 0:i.type){case"av_permission":{const a=ge(n,i);return a===te?e.u(Ue,{content:i}):a===me?e.u(Ae,{content:i,pages:s,required:r}):e.u(Qe,{content:i,pages:s,required:r})}case"screen_permission":return e.u(Oe,{content:i,pages:s,required:r});case"start_task":return e.u(Me,{content:i,pages:s,required:r});case"complete_task":return e.u(Le,{content:i,pages:s,properties:t});default:return null}},Fe=({className:t,properties:s,next:r,questionId:n})=>{const i=e.useConfig(),{surveyId:a,responseGroupUid:l,userId:c}=i,u=G(),{screenPermissionRequested:h}=u,g=G(p=>p.avStream);let o=G(p=>p.currentPage);o||(o=function({pages:p,userId:T,responseGroupUid:w,surveyId:v,questionId:_,next:k}){const{updatePage:E}=G.getState(),{eventEmitFn:I,recorderEventEmitter:S}=e.useConfig.getState(),y={questionId:_,surveyId:v,visitorId:T,responseGroupUid:w};let R=0;S.emit("recorded.task.permission.screen"),I("recorded.task.permission.screen"),S.emit("permission.status",{"permission.status.callback":(N,O,A,U)=>{const $=p[R],{type:j}=$,F=["screen"];if(X($)){const{permissionDescriptors:Q}=$,Z=Q==null?void 0:Q.includes("microphone"),K=Q==null?void 0:Q.includes("camera");Z&&F.push("audio"),K&&F.push("video"),(N!=null&&N.active&&!K||N!=null&&N.active&&O)&&R++}oe(p[R])&&A&&(R++,S.emit("begin.recording",{"recording.media.types":F,"start.recording.callback":Q=>E({mediaRecordingUids:Q})})),E({currentPage:p[R],avStream:N,screenPermissionRequested:A,nextQuestion:k,type:j,passthroughData:y,recordingMediaTypes:F,captureStream:U})}});const b=p[R];return b.type==="av_permission"&&re({currentPage:b,pages:p}),b}({questionId:n,surveyId:a,next:p=>{r(p,!0)},pages:s.pages,responseGroupUid:l,userId:c}));let d=o.headline,f=o.captionText;const C=ge(g,o);return oe(o)&&h&&(d=o.permissionDeniedHeadline,f=o.permissionDeniedCaptionText),X(o)&&C===he&&(d=o.permissionGrantedHeadline,f=o.permissionGrantedCaptionText),e.u("div",{className:e.cc(t,"ul-center-horizontally","fade-in-transition"),children:[e.u(m.Header,{isRequired:s==null?void 0:s.required,message:d,properties:{captionText:f}}),e.u(m.QuestionBodyWrapper,{children:e.u(He,{properties:s})})]})},Ve=({className:t,next:s,properties:r,questionId:n,type:i})=>{const{visitorAttributes:a,isLongFormSurvey:l}=e.useConfig(g=>({visitorAttributes:g.visitorAttributes,isLongFormSurvey:de.isLongFormSurvey(g.studyType)})),c=(g,o=!1)=>{s({value:o?{skipped:!0}:void 0,questionId:n,type:i},!0)},u=m.getAttributedUrl(r&&r.buttonUrl,a),h=l&&r.promptActionType===m.PromptActionTypeEnum.NO_BUTTON;return e.u("div",{className:e.cc(t,"ul-card__text-url-prompt","fade-in-transition"),children:e.u(m.MobileEmbedView,{properties:r,children:!h&&e.u("div",{children:e.u("div",{className:"ul-card-button-group",children:[e.u("a",{className:"ul-card-text__button ul-card__text-url-prompt-button",href:u,id:"ul-card-text__button",onClick:c,onKeyPress:g=>{g.key!=="Enter"&&g.key!==" "||s({value:void 0,questionId:n,type:i},!0)},rel:"noreferrer",role:u?"link":"button",tabIndex:0,target:"_blank",children:e.getButtonText(r)}),r.required===!1&&e.u("button",{className:"ul-card-skip__button",onClick:g=>c(0,!0),children:e.getSkipButtonText(r)})]})})})},n)},Ge=({className:t,questionId:s})=>{const{border:r,destroy:n,endCard:i,forceBrandedLogo:a}=e.useConfig(u=>({border:u.border,destroy:u.destroy,endCard:u.endCard,forceBrandedLogo:u.forceBrandedLogo}));e.p(()=>{setTimeout(()=>{n(V.APP_ID)},a?4e3:2e3)},[n,a]);const l=i&&i.subheader?e.u("p",{className:"ul-caption",children:i.subheader}):null,c=i&&i.headline?i.headline:"";return e.u("div",{className:e.cc(t,"ul-card--thanks","fade-in-transition"),children:e.u("div",{children:e.u("div",{className:"ul-card--thanks-content",children:[e.u("div",{className:"ul-thanks-check",children:e.u("svg",{"aria-labelledby":"title",fill:"none",height:"99",viewBox:"0 0 81 99",width:"81",xmlns:"http://www.w3.org/2000/svg",children:[e.u("path",{clipRule:"evenodd",d:"M40.5 77C60.9345 77 77.5 60.4345 77.5 40C77.5 19.5655 60.9345 3 40.5 3C20.0655 3 3.5 19.5655 3.5 40C3.5 60.4345 20.0655 77 40.5 77ZM80.5 40C80.5 62.0914 62.5914 80 40.5 80C18.4086 80 0.5 62.0914 0.5 40C0.5 17.9086 18.4086 0 40.5 0C62.5914 0 80.5 17.9086 80.5 40Z",fill:r,fillRule:"evenodd"}),e.u("path",{clipRule:"evenodd",d:"M55.025 22.9046C55.6299 23.4705 55.6616 24.4198 55.0956 25.0247C54.8724 25.2634 54.6109 25.5285 54.3157 25.8277C52.2547 27.9168 48.5549 31.667 44.8135 39.6658C43.2818 42.9406 42.0864 45.8386 41.0823 48.2729C40.6539 49.3116 40.2603 50.2659 39.8902 51.129C39.287 52.5359 38.7248 53.7508 38.1744 54.625C37.8997 55.0613 37.5806 55.4905 37.2017 55.8245C36.8201 56.1607 36.2613 56.5 35.5457 56.5C34.6742 56.5 34.0892 55.9692 33.7774 55.6083C33.4502 55.2296 33.1752 54.7511 32.9396 54.301C32.7305 53.9013 32.5088 53.4367 32.2797 52.9565C32.2429 52.8794 32.2059 52.8019 32.1688 52.7243C31.8942 52.1499 31.5959 51.534 31.2537 50.8868C29.8886 48.305 27.8539 45.2878 24.2343 43.1382C23.522 42.7152 23.2875 41.7949 23.7105 41.0826C24.1335 40.3703 25.0539 40.1358 25.7662 40.5588C30.0556 43.1062 32.4149 46.6647 33.9058 49.4845C34.2776 50.1876 34.5973 50.8487 34.8753 51.4302C34.9147 51.5124 34.9529 51.5926 34.9902 51.6707C35.2222 52.1567 35.4164 52.5637 35.5978 52.9102C35.6151 52.9434 35.6321 52.9754 35.6485 53.0061C36.0565 52.3531 36.5341 51.3434 37.133 49.9468C37.4781 49.1418 37.8572 48.2229 38.2761 47.2074C39.2886 44.7532 40.5339 41.7347 42.0961 38.3948C46.0591 29.9221 50.0641 25.8648 52.1535 23.7482C52.4423 23.4556 52.6944 23.2002 52.9048 22.9753C53.4708 22.3703 54.42 22.3387 55.025 22.9046ZM35.1994 53.5892C35.1994 53.5892 35.2 53.5888 35.2012 53.5879C35.2 53.5889 35.1994 53.5893 35.1994 53.5892ZM36.0666 53.6682C36.0732 53.674 36.0765 53.6775 36.0765 53.6777C36.0765 53.678 36.0732 53.6751 36.0666 53.6682Z",fill:r,fillRule:"evenodd"}),e.u("path",{d:"M69.5 97C69.5 98.1046 56.2924 99 40 99C23.7076 99 10.5 98.1046 10.5 97C10.5 95.8954 23.7076 95 40 95C56.2924 95 69.5 95.8954 69.5 97Z",fill:"black",fillOpacity:"0.2"})]})}),e.u(m.Header,{message:c}),l]})})},s)},je=()=>e.u("div",{className:"thinking-dots-container",children:e.u("div",{className:"thinking-dot"})}),Ze=({className:t})=>{const{uploadProgress:s}=e.useConfig(a=>({uploadProgress:a.uploadProgress}));let r,n;Object.values(s).filter(a=>a.isSubmitted).length>1?(r="Your responses are processing",n="Please keep this tab open until your responses are fully processed."):(r="Your response is processing",n="Please keep this tab open until your response is fully processed.");const i=Math.round(Math.min(99,...Object.values(s).filter(a=>a.isSubmitted).map(a=>a.progressPct||0)));return e.u("div",{className:e.cc(t,"ul-card--uploading","fade-in-transition"),children:[e.u("div",{"aria-busy":"true","aria-label":"Processing...","aria-live":"polite",className:"ul-loading-spinner-container",role:"progressbar",children:e.u("div",{className:"ul-loading-spinner",children:[e.u("div",{className:"first"}),e.u("div",{className:"second"}),e.u("div",{className:"third"}),e.u("div",{className:"fourth"})]})}),e.u(m.Header,{message:`${r} (${i}% complete)`}),e.u("p",{className:"ul-caption",children:n})]})},ue=0,ce=1,ze=({className:t,next:s,properties:r,questionId:n,type:i})=>{const a=`ul-card-video__player_recorder-q${n}`,{apiURL:l,envId:c,handleUploadUpdate:u,headers:h,responseGroupUid:g,surveyId:o,viewDocument:d,visitorId:f}=e.useConfig(y=>({apiURL:y.apiURL,envId:y.envId,handleUploadUpdate:y.handleUploadUpdate,headers:y.headers,responseGroupUid:y.responseGroupUid,surveyId:y.surveyId,viewDocument:y.viewDocument,visitorId:y.userId})),[C,p]=e.h(!1),[T,w]=e.h(null),[v,_]=e.h(null),[k,E]=e.h(ue),I=(y,R)=>{y===m.RECORDER.UPLOAD_STARTED?(w(R[m.RECORDER.UPLOAD_ID]),_(R[m.RECORDER.MEDIA_RECORDING_UID]),p(!0)):y===m.RECORDER.DELETE?(w(null),_(null),p(!1)):y===m.RECORDER.UPLOAD_PROGRESS?isNaN(R[m.RECORDER.UPLOAD_PROGRESS_PCT])?u({mediaRecordingUid:R[m.RECORDER.MEDIA_RECORDING_UID],isComplete:!0}):u({mediaRecordingUid:R[m.RECORDER.MEDIA_RECORDING_UID],progressPct:R[m.RECORDER.UPLOAD_PROGRESS_PCT]}):y===m.RECORDER.UPLOAD_FINISHED&&u({mediaRecordingUid:R[m.RECORDER.MEDIA_RECORDING_UID],isComplete:!0})},S=y=>{y.preventDefault(),y.stopPropagation(),document.getElementById(a)&&m.stopRecording(a),T&&v?(u({mediaRecordingUid:v,isSubmitted:!0}),s({value:{mediaRecordingUid:v},questionId:n,type:i},!0)):s({value:null,questionId:n,type:i},!0)};return e.u("form",{className:e.cc(t,"ul-card--video","fade-in-transition"),id:"ul-video-interview-form",children:[e.u(m.QuestionBodyWrapper,{children:[e.u("div",{id:"ul-question-player-container",style:{display:k===ue?"":"none"},children:e.u(m.MobileEmbedView,{properties:r,children:e.u("button",{className:"ul-video-btn ul-record-response-btn",onClick:y=>{y.preventDefault(),y.stopPropagation(),document.getElementById(a)&&m.pauseQuestionPlayer(a),E(ce)}})})}),e.u("div",{style:{display:k===ce?"block":"none"},children:e.u("div",{id:"ul-recorder-player-container",ref:y=>{if(y&&y.children.length===0){const R=m.videoRecorderPlayer(a,{surveyId:o,responseGroupUid:g,questionId:n,visitorId:f,envId:c},l,I,void 0,{...h,"x-ul-video-recorder-origin":"sdk"},r.mediaType===m.RECORDER.MEDIA_TYPE_AUDIO,d);y.appendChild(R)}}})})]}),e.u(m.QuestionBodyFooterContainer,{children:[e.u(z,{isDisabled:!!r.required&&!C,onClick:S,children:e.getButtonText(r)}),e.u("button",{className:"ul-card-text__button ul-button-inactive ul-card-skip__button",id:"ul-card-video__skip_button",onClick:S,style:{...r.required?{display:"none"}:{},...C?{display:"none"}:{}},children:e.getSkipButtonText(r)})]})]})},Ce=t=>t.type==="thanks"||t.type==="uploading",We=({card:t,avatars:s,isThinking:r,isCurrentQuestion:n,currentQuestionBubbleRef:i})=>{const a=(l=>"properties"in l.props&&l.props.properties&&"questionHtml"in l.props.properties&&l.props.properties.questionHtml?{content:l.props.properties.questionHtml,isHtml:!0}:"message"in l.props?{content:l.props.message,isHtml:!1}:{content:"Question",isHtml:!1})(t);return e.u(Y,{avatars:s,isLeft:!0,message:{id:`question-${t.name}`,type:"question",content:a.content},ref:n?i:null,children:r?e.u(je,{}):e.u(e.g,{children:[a.isHtml?e.u(m.Html,{className:"chat-message-text",html:a.content}):e.u("div",{className:"chat-message-text",children:a.content}),t.type==="videovoice"&&e.u(Te,{properties:t.props,questionId:t.name,surveyVideoUrl:t.props.properties.videoUrl})]})})},Ye=({card:t,avatars:s})=>{const r=(n=>{if(!("properties"in n.props)||!n.props.properties||typeof n.props.properties!="object")return null;const i=n.props.properties,a=[{key:"captionHtml",isHtml:!0},{key:"captionText",isHtml:!1},{key:"richTextBody",isHtml:!0},{key:"body",isHtml:!1}];for(const{key:l,isHtml:c}of a){const u=i[l];if(typeof u!="string")continue;const h=u.trim();if(h){if(c&&!h.replaceAll(/<[^>]*>/g,"").trim())continue;return{content:h,isHtml:c}}}return null})(t);return r?e.u(Y,{avatars:s,hideAvatar:!0,isLeft:!0,message:{id:`caption-${t.name}`,type:"question",content:r.content},children:r.isHtml?e.u(m.Html,{className:"chat-message-text",html:r.content}):e.u("div",{className:"chat-message-text",children:r.content})}):null},Ke=({card:t,userResponse:s,avatars:r})=>{const n=((i,a)=>{if(i.type==="open"&&a&&typeof a=="object"&&"value"in a)return a.value})(t,s);return e.u("div",{className:"chat-bubble-container chat-right",children:[e.u("div",{className:"chat-bubble chat-bubble-right chat-bubble-text-only",children:e.u("div",{className:"chat-message-text",children:n||e.u("div",{className:"chat-message-no-response",children:"No response"})})}),e.u("img",{alt:"User Avatar",className:"chat-avatar chat-avatar-right",srcSet:`${r.respondentAvatar["1x"]} 1x, ${r.respondentAvatar["2x"]} 2x`})]})},Xe=({card:t,avatars:s,isCurrentQuestion:r,currentQuestionBubbleRef:n})=>{const{endCard:i}=e.useConfig(a=>({endCard:a.endCard}));return e.u(e.g,{children:[e.u(Y,{avatars:s,isLeft:!0,message:{id:`thanks-${t.name}`,type:"question",content:(i==null?void 0:i.headline)??"Great! Thank you for your participation."},ref:r?n:null}),(i==null?void 0:i.subheader)&&e.u(Y,{avatars:s,hideAvatar:!0,isLeft:!0,message:{id:`caption-${t.name}`,type:"question",content:i.subheader}}),e.u(Se,{})]})},Je=({card:t,cardIndex:s,index:r,avatars:n,cardResponses:i,questionThinkingStates:a,startingQuestionIdx:l,currentQuestionBubbleRef:c,handleCardResponse:u})=>{const h=s===r,g=s<r,o=Ce(t);if(o)return e.u(Xe,{avatars:n,card:t,currentQuestionBubbleRef:c,isCurrentQuestion:h});const d=`${t.name}`,f=i.get(d),C=t.type==="open",p=a.get(d),T=s>(l??0)&&t.type!=="thanks"&&t.type!=="uploading"&&(p===!0||p===void 0);return e.u(e.wn.Fragment,{children:[e.u(We,{avatars:n,card:t,currentQuestionBubbleRef:c,isCurrentQuestion:h,isThinking:T}),!T&&e.u(Ye,{avatars:n,card:t}),g&&C?e.u(Ke,{avatars:n,card:t,userResponse:f}):(!g||!C)&&!T&&e.u(Y,{avatars:n,isLeft:!1,message:{id:`card-${t.name}`,type:"card",content:""},children:e.u("div",{className:"chat-card-container",children:e.u(tt,{card:t,className:o?"chat-thanks-card":"chat-card",isAnswered:g,next:h?u:()=>{}})})})]},`question-card-${t.name}`)},Y=e.wn.forwardRef(({message:t,isLeft:s=!1,children:r,avatars:n,hideAvatar:i=!1},a)=>{const l=s?"chat-bubble-left":"chat-bubble-right";return e.u("div",{className:`chat-bubble-container ${s?"chat-left":"chat-right"}${s&&i?" chat-no-avatar":""}`,ref:a,children:[s&&!i&&e.u("img",{alt:"AI Avatar",className:"chat-avatar chat-avatar-left",srcSet:`${n.agentAvatar["1x"]} 1x, ${n.agentAvatar["2x"]} 2x`}),e.u("div",{className:`chat-bubble ${l}`,children:r||e.u("div",{className:"chat-message-text",children:t.content})}),!s&&!i&&e.u("img",{alt:"User Avatar",className:"chat-avatar chat-avatar-right",srcSet:`${n.respondentAvatar["1x"]} 1x, ${n.respondentAvatar["2x"]} 2x`})]})});Y.displayName="ChatBubble";const et=()=>{const t=e.useConfig(r=>r.close),s=e.F(()=>()=>t(V.APP_ID),[t]);return e.u("div",{"aria-label":"Close button",className:"conversational-close-btn",onClick:s,onKeyPress:r=>{r.key==="Enter"&&s()},role:"button",tabIndex:0,children:e.u("svg",{fill:"none",height:"16px",viewBox:"0 0 13 13",width:"16px",xmlns:"http://www.w3.org/2000/svg",children:e.u("path",{d:"M2.54964 1.78369L1.78369 2.54964L5.73405 6.5L1.78369 10.4504L2.54964 11.2163L6.5 7.26595L10.4504 11.2163L11.2163 10.4504L7.26595 6.5L11.2163 2.54964L10.4504 1.78369L6.5 5.73405L2.54964 1.78369Z",fill:"#262136"})})})},tt=({card:t,next:s,className:r="",isAnswered:n=!1})=>{const i={className:n?`${r} answered-card`:r,next:n?()=>{}:s,questionId:t.name,type:t.type,isAnswered:n};switch(t.type){case"consentlegal":return e.u(_e,{...i,...t.props});case"likert":return e.u(Ne,{...i,...t.props});case"matrix":return e.u(Ie,{...i,...t.props});case"multiplechoice":return e.u(we,{...i,...t.props});case"multipleselect":return e.u(Ee,{...i,...t.props});case"nps":return e.u(Pe,{...i,...t.props});case"open":return e.u(qe,{...i,...t.props});case"rankorder":return e.u(Be,{...i,...t.props});case"recordedtask":return e.u(Fe,{...i,...t.props});case"texturlprompt":return e.u(Ve,{...i,...t.props});case"thanks":return e.u(Ge,{...i,...t.props});case"uploading":return e.u(Ze,{...i,...t.props});case"videovoice":return e.u(ze,{...i,...t.props});default:return null}};exports.default=({cards:t,next:s,previousResponses:r})=>{const{cardResponses:n,setCardResponse:i}=(()=>{const[v,_]=e.h(new Map);return{cardResponses:v,setCardResponse:e.T((k,E)=>{_(I=>new Map(I).set(k,E))},[])}})(),{index:a,isLongFormSurvey:l,avatars:c,startingQuestionIdx:u,viewDocument:h}=e.useConfig(v=>({index:v.index,isLongFormSurvey:de.isLongFormSurvey(v.studyType),avatars:v.avatars,startingQuestionIdx:v.startingQuestionIdx,viewDocument:v.viewDocument})),{currentQuestionBubbleRef:g,scrollToCurrentQuestion:o}=(({viewDocument:v})=>{const _=e._(null),k=e.T(()=>{const E=v.querySelector(".ul-card-main-content");if(_.current&&E&&E instanceof HTMLElement){const I=_.current.offsetTop-E.offsetTop-16;E.scrollTo({top:Math.max(0,I),behavior:"smooth"})}},[]);return{currentQuestionBubbleRef:_,scrollToCurrentQuestion:k}})({viewDocument:h}),d=((v,_,k)=>{const[E,I]=e.h(new Map);return e.p(()=>{if(v.length>0&&_<v.length){const S=v[_],y=`${S.name}`;if(_<=(k??0)||Ce(S))return void I(b=>new Map(b).set(y,!1));I(b=>new Map(b).set(y,!0));const R=setTimeout(()=>{I(b=>new Map(b).set(y,!1))},1e3);return()=>clearTimeout(R)}},[_,v,k]),E})(t,a,u),f=((v,_)=>{const[k,E]=e.h(new Set([0]));return e.p(()=>{E(I=>new Set(I).add(v))},[v]),e.p(()=>{const I=_??0;I>0&&E(S=>{const y=new Set(S);for(let R=0;R<=I;R++)y.add(R);return y})},[_]),k})(a,u),C=e.F(()=>({...r,...e.buildReadableResponseMap(t.map((v,_)=>{var k,E;return{...v,value:_<a?((k=n.get(`${v.name}`))==null?void 0:k.value)??null:null,secondaryValue:_<a?((E=n.get(`${v.name}`))==null?void 0:E.secondaryValue)??null:null}}))}),[r,n,t,a]),p=e.pipeReadableResponsesIntoCards(t,C);e.p(()=>{requestAnimationFrame(()=>{o()})},[a,o,d]);const T=e.T((v,_)=>{if(!_)return;const k=p[a];if(!k)return;const E=`${k.name}`;i(E,v);const I={...v,questionText:e.getProcessedQuestionText(k)};s([I])},[p,a,s,i]),w=p.map((v,_)=>({card:v,cardIndex:_})).filter(({cardIndex:v})=>f.has(v));return e.u("div",{className:"conversational-ui ul-conversational-ui","data-testid":"ui-container",children:[!l&&e.u(et,{}),e.u("div",{className:"chat-container",children:e.u("div",{className:"chat-messages",children:w.map(({card:v,cardIndex:_})=>e.u(Je,{avatars:c,card:v,cardIndex:_,cardResponses:n,currentQuestionBubbleRef:g,handleCardResponse:T,index:a,questionThinkingStates:d,startingQuestionIdx:u},`question-card-${v.name}`))})})]})};
|