Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bucketco/tracking-sdk

Package Overview
Dependencies
Maintainers
4
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bucketco/tracking-sdk - npm Package Compare versions

Comparing version 2.1.5 to 2.1.6

2

dist/bucket-tracking-sdk.node.js

@@ -1,1 +0,1 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.bucket=t():e.bucket=t()}(global,(()=>(()=>{"use strict";var e={268:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(81),r=n.n(o),i=n(645),a=n.n(i)()(r());a.push([e.id,".button {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n position: relative;\n white-space: nowrap;\n height: 2rem;\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n gap: 0.5em;\n justify-content: center;\n border: none;\n cursor: pointer;\n font-family: var(--bucket-feedback-dialog-font-family);\n font-size: 12px;\n font-weight: 500;\n box-shadow:\n 0 1px 2px 0 rgba(0, 0, 0, 0.06),\n 0 1px 1px 0 rgba(0, 0, 0, 0.01);\n border-radius: 6px;\n border-radius: var(--bucket-feedback-dialog-border-radius, 6px);\n transition-duration: 200ms;\n transition-property: background-color, border-color, color, opacity,\n box-shadow, transform;\n}\n.button.primary {\n background-color: white;\n background-color: var(\n --bucket-feedback-dialog-primary-button-background-color,\n white\n );\n color: #1e1f24;\n color: var(--bucket-feedback-dialog-primary-button-color, #1e1f24);\n border: 1px solid\n #d8d9df;\n border: 1px solid\n var(--bucket-feedback-dialog-primary-border-color, #d8d9df);\n }\n.button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n border-color: #d8d9df;\n border-color: var(--bucket-feedback-dialog-primary-border-color, #d8d9df);\n\n transition-duration: 200ms;\n transition-property: background-color, border-color, color, opacity,\n box-shadow, transform;\n }\n.button:focus {\n outline: none;\n border-color: #787c91;\n border-color: var(\n --bucket-feedback-dialog-input-focus-border-color,\n #787c91\n );\n }\n",""]);const s=a},622:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(81),r=n.n(o),i=n(645),a=n.n(i)()(r());a.push([e.id,"@keyframes scale {\n from {\n transform: scale(0.9);\n }\n to {\n transform: scale(1);\n }\n}\n\n@keyframes floatUp {\n from {\n transform: translateY(15%);\n }\n to {\n transform: translateY(0%);\n }\n}\n\n@keyframes floatDown {\n from {\n transform: translateY(-15%);\n }\n to {\n transform: translateY(0%);\n }\n}\n\n@keyframes fade {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n.dialog {\n position: fixed;\n width: 210px;\n padding: 16px 22px 10px;\n font-size: 1rem;\n font-size: var(--bucket-feedback-dialog-font-size, 1rem);\n font-family: InterVariable,\n Inter,\n system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif,\n Open Sans,\n sans-serif;\n font-family: var(\n --bucket-feedback-dialog-font-family,\n InterVariable,\n Inter,\n system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif,\n Open Sans,\n sans-serif\n );\n color: #1e1f24;\n color: var(--bucket-feedback-dialog-color, #1e1f24);\n border: 1px solid;\n border-color: #d8d9df;\n border-color: var(--bucket-feedback-dialog-border, #d8d9df);\n border-radius: 6px;\n border-radius: var(--bucket-feedback-dialog-border-radius, 6px);\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),\n 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n box-shadow: var(\n --bucket-feedback-dialog-box-shadow,\n 0 10px 15px -3px rgba(0, 0, 0, 0.1),\n 0 4px 6px -2px rgba(0, 0, 0, 0.05)\n );\n background-color: #fff;\n background-color: var(--bucket-feedback-dialog-background-color, #fff);\n z-index: 2147410000;\n}\n\n.dialog:not(.modal) {\n margin: 0;\n margin: initial;\n top: auto;\n top: initial;\n right: auto;\n right: initial;\n left: auto;\n left: initial;\n bottom: auto;\n bottom: initial;\n }\n\n.arrow {\n position: absolute;\n width: 8px;\n height: 8px;\n background-color: #fff;\n background-color: var(--bucket-feedback-dialog-background-color, #fff);\n box-shadow: #d8d9df -1px -1px 1px 0px;\n box-shadow: var(--bucket-feedback-dialog-border, #d8d9df) -1px -1px 1px 0px;\n transform: rotate(45deg);\n}\n\n.arrow.bottom {\n box-shadow: #d8d9df -1px -1px 1px 0px;\n box-shadow: var(--bucket-feedback-dialog-border, #d8d9df) -1px -1px 1px 0px;\n }\n\n.arrow.top {\n box-shadow: #d8d9df 1px 1px 1px 0px;\n box-shadow: var(--bucket-feedback-dialog-border, #d8d9df) 1px 1px 1px 0px;\n }\n\n.arrow.left {\n box-shadow: #d8d9df 1px -1px 1px 0px;\n box-shadow: var(--bucket-feedback-dialog-border, #d8d9df) 1px -1px 1px 0px;\n }\n\n.arrow.right {\n box-shadow: #d8d9df -1px 1px 1px 0px;\n box-shadow: var(--bucket-feedback-dialog-border, #d8d9df) -1px 1px 1px 0px;\n }\n\n.close {\n position: absolute;\n top: 6px;\n right: 6px;\n\n width: 28px;\n height: 28px;\n\n padding: 0;\n margin: 0;\n background: none;\n border: none;\n\n cursor: pointer;\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n color: #1e1f24;\n\n color: var(--bucket-feedback-dialog-color, #1e1f24);\n}\n\n.close svg {\n position: absolute;\n }\n\n.plug {\n font-size: 0.75em;\n text-align: center;\n margin-top: 7px;\n width: 100%;\n}\n\n.plug a {\n opacity: 0.5;\n color: #1e1f24;\n color: var(--bucket-feedback-dialog-color, #1e1f24);\n -webkit-text-decoration: none;\n text-decoration: none;\n\n transition: opacity 200ms;\n}\n\n.plug a:hover {\n opacity: 0.7;\n}\n\n/* Modal */\n\n.dialog.modal {\n margin: auto;\n margin-top: 4rem;\n}\n\n.dialog.modal[open] {\n animation: /* easeOutQuint */\n scale 200ms cubic-bezier(0.22, 1, 0.36, 1),\n fade 200ms cubic-bezier(0.22, 1, 0.36, 1);\n }\n\n.dialog.modal[open]::backdrop {\n animation: fade 200ms cubic-bezier(0.22, 1, 0.36, 1);\n }\n\n/* Anchored */\n\n.dialog.anchored {\n position: absolute;\n}\n\n.dialog.anchored[open] {\n animation: /* easeOutQuint */\n scale 200ms cubic-bezier(0.22, 1, 0.36, 1),\n fade 200ms cubic-bezier(0.22, 1, 0.36, 1);\n }\n\n.dialog.anchored.bottom {\n transform-origin: top center;\n }\n\n.dialog.anchored.top {\n transform-origin: bottom center;\n }\n\n.dialog.anchored.left {\n transform-origin: right center;\n }\n\n.dialog.anchored.right {\n transform-origin: left center;\n }\n\n/* Unanchored */\n\n.dialog.unanchored.unanchored-bottom-left[open],\n .dialog.unanchored.unanchored-bottom-right[open] {\n animation: /* easeOutQuint */\n floatUp 300ms cubic-bezier(0.22, 1, 0.36, 1),\n fade 300ms cubic-bezier(0.22, 1, 0.36, 1);\n }\n\n.dialog.unanchored.unanchored-top-left[open],\n .dialog.unanchored.unanchored-top-right[open] {\n animation: /* easeOutQuint */\n floatDown 300ms cubic-bezier(0.22, 1, 0.36, 1),\n fade 300ms cubic-bezier(0.22, 1, 0.36, 1);\n }\n",""]);const s=a},621:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(81),r=n.n(o),i=n(645),a=n.n(i)()(r());a.push([e.id,".container {\n overflow-y: hidden;\n transition: max-height 400ms cubic-bezier(0.65, 0, 0.35, 1);\n}\n\n.form {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 10px;\n overflow-y: hidden;\n max-height: 400px;\n transition: opacity 400ms cubic-bezier(0.65, 0, 0.35, 1);\n}\n\n.form-control {\n display: flex;\n flex-direction: column;\n width: 100%;\n gap: 8px;\n border: none;\n padding: 0;\n margin: 0;\n\n font-size: 12px;\n color: #787c91;\n color: var(--bucket-feedback-dialog-secondary-color, #787c91);\n}\n\n.form-expanded-content {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 10px;\n transition: opacity 400ms cubic-bezier(0.65, 0, 0.35, 1);\n\n opacity: 0;\n position: absolute;\n top: 0;\n left: 0;\n}\n\n.title {\n color: #1e1f24;\n color: var(--bucket-feedback-dialog-color, #1e1f24);\n font-size: 15px;\n font-weight: 400;\n line-height: 115%;\n text-wrap: balance;\n max-width: calc(100% - 20px);\n margin-bottom: 6px;\n line-height: 1.3;\n}\n\n.dimmed {\n opacity: 0.5;\n}\n\n.textarea {\n background-color: transparent;\n border: 1px solid;\n border-color: #d8d9df;\n border-color: var(--bucket-feedback-dialog-input-border-color, #d8d9df);\n padding: 0.5rem 0.75rem;\n border-radius: 6px;\n border-radius: var(--bucket-feedback-dialog-border-radius, 6px);\n transition: border-color 0.2s ease-in-out;\n font-family: InterVariable,\n Inter,\n system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif,\n Open Sans,\n sans-serif;\n font-family: var(\n --bucket-feedback-dialog-font-family,\n InterVariable,\n Inter,\n system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif,\n Open Sans,\n sans-serif\n );\n line-height: 1.3;\n resize: none;\n\n color: #1e1f24;\n\n color: var(--bucket-feedback-dialog-color, #1e1f24);\n font-size: 13px;\n}\n\n.textarea::-moz-placeholder {\n color: #1e1f24;\n color: var(--bucket-feedback-dialog-color, #1e1f24);\n opacity: 0.36;\n }\n\n.textarea::placeholder {\n color: #1e1f24;\n color: var(--bucket-feedback-dialog-color, #1e1f24);\n opacity: 0.36;\n }\n\n.textarea:focus {\n outline: none;\n border-color: #787c91;\n border-color: var(\n --bucket-feedback-dialog-input-focus-border-color,\n #787c91\n );\n }\n\n.score-status-container {\n position: relative;\n padding-bottom: 6px;\n height: 14px;\n}\n\n.score-status-container > .score-status {\n display: flex;\n align-items: center;\n\n position: absolute;\n top: 0;\n left: 0;\n\n opacity: 0;\n transition: opacity 200ms ease-in-out;\n }\n\n.error {\n margin: 0;\n color: #e53e3e;\n color: var(--bucket-feedback-dialog-error-color, #e53e3e);\n font-size: 0.8125em;\n font-weight: 500;\n}\n\n.submitted {\n display: flex;\n flex-direction: column;\n transition: opacity 400ms cubic-bezier(0.65, 0, 0.35, 1);\n\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n pointer-events: none;\n width: calc(100% - 56px);\n\n padding: 0px 28px;\n}\n\n.submitted .submitted-check {\n background: #fff;\n background: var(--bucket-feedback-dialog-submitted-check-color, #fff);\n color: #38a169;\n color: var(\n --bucket-feedback-dialog-submitted-check-background-color,\n #38a169\n );\n height: 24px;\n width: 24px;\n display: block;\n border-radius: 50%;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n\n margin: 16px auto 8px;\n }\n\n.submitted .text {\n margin: auto auto 16px;\n text-align: center;\n color: #1e1f24;\n color: var(--bucket-feedback-dialog-color, #1e1f24);\n font-size: 1rem;\n font-size: var(--bucket-feedback-dialog-font-size, 1rem);\n font-weight: 400;\n line-height: 130%;\n\n flex-grow: 1;\n max-width: 160px;\n }\n\n.submitted > .plug {\n flex-grow: 0;\n }\n",""]);const s=a},341:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(81),r=n.n(o),i=n(645),a=n.n(i)()(r());a.push([e.id,"\n .radial-progress > circle {\n stroke: #1e1f24;\n stroke: var(--bucket-feedback-dialog-color, #1e1f24);\n opacity: 0.2;\n }\n",""]);const s=a},59:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(81),r=n.n(o),i=n(645),a=n.n(i)()(r());a.push([e.id,".star-rating {\n display: flex;\n flex-direction: column;\n}\n\n.star-rating-icons {\n display: flex;\n width: 0;\n}\n\n.star-rating-icons > input {\n border: 0px;\n clip: rect(0px, 0px, 0px, 0px);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0px;\n overflow: hidden;\n white-space: nowrap;\n position: absolute;\n }\n\n.star-rating-icons > .button {\n border: 1px solid;\n border-color: #d8d9df;\n border-color: var(--bucket-feedback-dialog-input-border-color, #d8d9df);\n\n padding: 0px 7px;\n }\n\n.star-rating-icons > .button:not(:first-of-type) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n\n.star-rating-icons > .button:not(:last-of-type) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n margin-right: -1px;\n }\n\n.star-rating-icons > .button + .button-tooltip {\n pointer-events: none;\n opacity: 0;\n\n background: #000;\n\n background: var(--bucket-feedback-dialog-tooltip-background-color, #000);\n color: #fff;\n color: var(--bucket-feedback-dialog-tooltip-color, #fff);\n padding: 6px 8px;\n border-radius: 4px;\n font-size: 13px;\n }\n\n.star-rating-icons > .button:hover + .button-tooltip {\n opacity: 1;\n }\n\n.star-rating-icons > .button > svg {\n transition: transform 200ms ease-in-out;\n }\n\n.button-tooltip-arrow {\n position: absolute;\n width: 10px;\n height: 10px;\n background-color: #000;\n background-color: var(\n --bucket-feedback-dialog-tooltip-background-color,\n #000\n );\n transform: rotate(45deg);\n}\n",""]);const s=a},650:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var o=n(81),r=n.n(o),i=n(645),a=n.n(i),s=n(268),c=n(622),d=n(621),l=n(341),u=n(59),p=a()(r());p.i(s.Z),p.i(c.Z),p.i(d.Z),p.i(l.Z),p.i(u.Z),p.push([e.id,"\n",""]);const f=p},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,r,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(o)for(var s=0;s<this.length;s++){var c=this[s][0];null!=c&&(a[c]=!0)}for(var d=0;d<e.length;d++){var l=[].concat(e[d]);o&&a[l[0]]||(void 0!==i&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=i),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),r&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=r):l[4]="".concat(r)),t.push(l))}},t}},81:e=>{e.exports=function(e){return e[1]}},913:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSE_REALTIME_HOST=t.TRACKING_HOST=void 0,t.TRACKING_HOST="https://tracking.bucket.co",t.SSE_REALTIME_HOST="https://livemessaging.bucket.co"},592:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDefaultFeedbackPromptHandler=void 0,t.createDefaultFeedbackPromptHandler=(e={})=>(t,n)=>{n.openFeedbackForm(e)}},250:function(e,t,n){var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.Button=void 0;const r=n(108);t.Button=e=>{var{variant:t="primary",children:n}=e,i=o(e,["variant","children"]);const a=["button",t].join(" ");return(0,r.h)("button",Object.assign({class:a},i),n)}},254:function(e,t,n){var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FeedbackDialog=void 0;const i=n(108),a=n(718),s=n(330),c=n(564),d=n(11),l=n(436),u=n(545),p=n(891),f=r(n(650)),b=n(942);t.FeedbackDialog=({key:e,title:t=s.DEFAULT_TRANSLATIONS.DefaultQuestionLabel,position:n,translations:r=s.DEFAULT_TRANSLATIONS,openWithCommentVisible:h=!1,onClose:g,onDismiss:m,onSubmit:v,onScoreSubmit:y})=>{var k;const C=(0,a.useRef)(null),w="POPOVER"===n.type?n.anchor:null,{refs:x,floatingStyles:S,middlewareData:O,placement:I}=(0,l.useFloating)({elements:{reference:w},transform:!1,whileElementsMounted:l.autoUpdate,middleware:[(0,l.shift)(),(0,l.offset)(8),(0,l.arrow)({element:C})]});let j={};if("DIALOG"===n.type)switch(n.placement){case"top-left":j={top:"1rem",left:"1rem"};break;case"top-right":j={top:"1rem",right:"1rem"};break;case"bottom-left":j={bottom:"1rem",left:"1rem"};break;case"bottom-right":j={bottom:"1rem",right:"1rem"}}const{x:_,y:P}=null!==(k=O.arrow)&&void 0!==k?k:{},M={left:null!=_?`${_}px`:"",top:null!=P?`${P}px`:"",right:"",bottom:"",[{top:"bottom",right:"left",bottom:"top",left:"right"}[I.split("-")[0]]||"bottom"]:"-4px"},L=(0,a.useCallback)((()=>{const e=x.floating.current;null==e||e.close(),Z.stop(),null==g||g()}),[g]),D=(0,a.useCallback)((()=>{L(),null==m||m()}),[L,m]),[E,F]=(0,a.useState)(void 0),[R,T]=(0,a.useState)("idle"),A=(0,a.useCallback)((e=>o(void 0,void 0,void 0,(function*(){yield v(Object.assign(Object.assign({},e),{feedbackId:E})),Z.startWithDuration(3e3)}))),[E,v]),N=(0,a.useCallback)((e=>o(void 0,void 0,void 0,(function*(){if(void 0!==y){T("submitting");const t=yield y(Object.assign(Object.assign({},e),{feedbackId:E}));F(t.feedbackId),T("submitted")}}))),[E,v]),Z=(0,c.useTimer)({enabled:"DIALOG"===n.type,initialDuration:2e4,onEnd:L});return(0,a.useEffect)((()=>{if("MODAL"===n.type||"DIALOG"===n.type)return;const e=e=>{"Escape"==e.key&&D()},t=e=>{e.target instanceof Element&&e.target.closest(`#${u.feedbackContainerId}`)||D()},o=new MutationObserver((e=>{null!==n.anchor&&e.forEach((e=>{Array.from(e.removedNodes).some((e=>e===n.anchor||e.contains(n.anchor)))&&L()}))}));return window.addEventListener("mousedown",t),window.addEventListener("keydown",e),o.observe(document.body,{subtree:!0,childList:!0}),()=>{window.removeEventListener("mousedown",t),window.removeEventListener("keydown",e),o.disconnect()}}),[n.type,L]),(0,i.h)(i.Fragment,null,(0,i.h)("style",{dangerouslySetInnerHTML:{__html:f.default}}),(0,i.h)("dialog",{ref:x.setFloating,class:["dialog","MODAL"===n.type?"modal":"POPOVER"===n.type?"anchored":`unanchored unanchored-${n.placement}`,I].join(" "),style:w?S:j},(0,i.h)(p.FeedbackForm,{t:Object.assign(Object.assign({},s.DEFAULT_TRANSLATIONS),r),key:e,question:t,openWithCommentVisible:h,onSubmit:A,onScoreSubmit:N,scoreState:R,onInteraction:Z.stop}),(0,i.h)("button",{onClick:D,class:"close"},!Z.stopped&&Z.elapsedFraction>0&&(0,i.h)(b.RadialProgress,{diameter:28,progress:1-Z.elapsedFraction}),(0,i.h)(d.Close,null)),w&&(0,i.h)("div",{ref:C,class:["arrow",I].join(" "),style:M})))}},891:function(e,t,n){var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.FeedbackForm=void 0;const r=n(108),i=n(718),a=n(529),s=n(620),c=n(250),d=n(75),l=n(643);t.FeedbackForm=({question:e,scoreState:t,openWithCommentVisible:n,onInteraction:a,onSubmit:p,onScoreSubmit:f,t:b})=>{const[h,g]=(0,i.useState)(!1),[m,v]=(0,i.useState)("idle"),[y,k]=(0,i.useState)(),[C,w]=(0,i.useState)(!0),x=(0,i.useRef)(null),S=(0,i.useRef)(null),O=(0,i.useRef)(null),I=(0,i.useRef)(null),j=(0,i.useRef)(null),_=(0,i.useCallback)((()=>{null!==x.current&&null!==O.current&&null!==I.current&&(x.current.style.maxHeight=O.current.clientHeight+"px",I.current.style.position="absolute",I.current.style.opacity="0",I.current.style.pointerEvents="none")}),[x,O,I]),P=(0,i.useCallback)((()=>{null!==x.current&&null!==O.current&&null!==I.current&&(x.current.style.maxHeight=O.current.clientHeight+I.current.clientHeight+10+"px",I.current.style.position="relative",I.current.style.opacity="1",I.current.style.pointerEvents="all")}),[x,O,I]),M=(0,i.useCallback)((()=>{null!==x.current&&null!==S.current&&null!==j.current&&(S.current.style.opacity="0",S.current.style.pointerEvents="none",x.current.style.maxHeight=j.current.clientHeight+"px",setTimeout((()=>{j.current.style.position="relative",j.current.style.opacity="1",j.current.style.pointerEvents="all",w(!1)}),410))}),[S,x,j]);return(0,i.useEffect)((()=>{"submitted"===m?M():n||h?P():_()}),[_,P,M,n,h,m]),(0,r.h)("div",{ref:x,class:"container"},(0,r.h)("div",{ref:j,class:"submitted"},(0,r.h)("div",{className:"submitted-check"},(0,r.h)(s.CheckCircle,{width:24,height:24})),(0,r.h)("p",{className:"text"},b.SuccessMessage),(0,r.h)(d.Plug,null)),C&&(0,r.h)("form",{ref:S,onSubmit:t=>o(void 0,void 0,void 0,(function*(){t.preventDefault();const n=Object.assign(Object.assign({},function(e){var t,n;const o=new FormData(e);return{score:Number(null===(t=o.get("score"))||void 0===t?void 0:t.toString()),comment:((null===(n=o.get("comment"))||void 0===n?void 0:n.toString())||"").trim()}}(t.target)),{question:e});if(n.score){k("");try{v("submitting"),yield p(n),v("submitted")}catch(e){v("idle"),e instanceof Error?k(e.message):k("string"==typeof e?e:"Couldn't submit feedback. Please try again.")}}})),method:"dialog",class:"form",onFocus:a,onFocusCapture:a,onClick:a,style:{opacity:1}},(0,r.h)("div",{ref:O,role:"group",class:"form-control","aria-labelledby":"bucket-feedback-score-label"},(0,r.h)("div",{id:"bucket-feedback-score-label",class:"title"},e),(0,r.h)(l.StarRating,{t:b,name:"score",onChange:t=>o(void 0,void 0,void 0,(function*(){g(!0),yield f({question:e,score:Number(t.currentTarget.value)})}))}),(0,r.h)(u,{t:b,scoreState:t})),(0,r.h)("div",{ref:I,class:"form-expanded-content"},(0,r.h)("div",{class:"form-control"},(0,r.h)("textarea",{id:"bucket-feedback-comment-label",class:"textarea",name:"comment",placeholder:b.QuestionPlaceholder,rows:4})),y&&(0,r.h)("p",{class:"error"},y),(0,r.h)(c.Button,{type:"submit",disabled:!h||"submitting"===m||"submitting"===t},b.SendButton),(0,r.h)(d.Plug,null))))};const u=({t:e,scoreState:t})=>{const[n,o]=(0,i.useState)(!1),[s,c]=(0,i.useState)(!1);(0,i.useEffect)((()=>{if("idle"===t)return void o(!1);if("submitted"===t)return o(!1),void c(!0);const e=setTimeout((()=>{o(!0)}),400);return()=>clearTimeout(e)}),[t]);const d="idle"===t||"submitting"===t&&!s&&!n,l="submitted"!==t&&!s&&n,u="submitted"===t||s;return(0,r.h)("div",{className:"score-status-container"},(0,r.h)("span",{className:"score-status",style:{opacity:d?1:0}},e.ScoreStatusDescription),(0,r.h)("div",{className:"score-status",style:{opacity:l?1:0}},e.ScoreStatusLoading),(0,r.h)("span",{className:"score-status",style:{opacity:u?1:0}},(0,r.h)(a.Check,{width:14,height:14,style:{marginRight:3}})," ",e.ScoreStatusReceived))}},75:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Plug=void 0;const o=n(108),r=n(655);t.Plug=()=>(0,o.h)("footer",{class:"plug"},(0,o.h)("a",{href:"https://bucket.co",target:"_blank"},"Powered by ",(0,o.h)(r.Logo,null)," Bucket"))},942:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RadialProgress=void 0;const o=n(108);t.RadialProgress=({diameter:e,progress:t})=>{const n=e/2-2,r=2*Math.PI*n,i=r*t;return(0,o.h)("svg",{className:"radial-progress",width:e,height:e},(0,o.h)("circle",{fill:"transparent",cx:n+2,cy:n+2,r:n,"stroke-width":2,"stroke-dasharray":r,"stroke-dashoffset":i,transform:`rotate(-90) translate(-${2*n+4} 0)`}))}},643:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StarRating=void 0;const o=n(108),r=n(718),i=n(421),a=n(671),s=n(60),c=n(873),d=n(514),l=n(436),u=[{color:"var(--bucket-feedback-dialog-rating-1-color, #dd6b20)",bg:"var(--bucket-feedback-dialog-rating-1-background-color, #fbd38d)",icon:(0,o.h)(c.VeryDissatisfied,null),getLabel:e=>e.ScoreVeryDissatisfiedLabel,value:1},{color:"var(--bucket-feedback-dialog-rating-2-color, #ed8936)",bg:"var(--bucket-feedback-dialog-rating-2-background-color, #feebc8)",icon:(0,o.h)(i.Dissatisfied,null),getLabel:e=>e.ScoreDissatisfiedLabel,value:2},{color:"var(--bucket-feedback-dialog-rating-3-color, #787c91)",bg:"var(--bucket-feedback-dialog-rating-3-background-color, #e9e9ed)",icon:(0,o.h)(a.Neutral,null),getLabel:e=>e.ScoreNeutralLabel,value:3},{color:"var(--bucket-feedback-dialog-rating-4-color, #48bb78)",bg:"var(--bucket-feedback-dialog-rating-4-background-color, #c6f6d5)",icon:(0,o.h)(s.Satisfied,null),getLabel:e=>e.ScoreSatisfiedLabel,value:4},{color:"var(--bucket-feedback-dialog-rating-5-color, #38a169)",bg:"var(--bucket-feedback-dialog-rating-5-background-color, #9ae6b4)",icon:(0,o.h)(d.VerySatisfied,null),getLabel:e=>e.ScoreVerySatisfiedLabel,value:5}];t.StarRating=({t:e,name:t,selectedValue:n,onChange:r})=>(0,o.h)("div",{class:"star-rating"},(0,o.h)("style",null,u.map((({bg:e,color:t},n)=>`\n .star-rating-icons > input:nth-of-type(${n+1}):checked + .button {\n border-color: ${t};\n }\n\n .star-rating-icons > input:nth-of-type(${n+1}):checked + .button > div {\n background-color: ${e};\n }\n\n .star-rating-icons > input:nth-of-type(${n+1}):checked ~ input:nth-of-type(${n+2}) + .button {\n border-left-color: ${t};\n }\n `))),(0,o.h)("div",{class:"star-rating-icons"},u.map((i=>(0,o.h)(p,{isSelected:i.value===n,name:t,onChange:r,score:i,t:e})))));const p=({isSelected:e,name:t,onChange:n,score:i,t:a})=>{var s,c;const d=(0,r.useRef)(null),{refs:u,floatingStyles:p,middlewareData:f}=(0,l.useFloating)({placement:"top",middleware:[(0,l.offset)(4),(0,l.arrow)({element:d})]});return(0,o.h)(o.Fragment,null,(0,o.h)("input",{id:`bucket-feedback-score-${i.value}`,type:"radio",name:t,value:i.value,defaultChecked:e,onChange:n}),(0,o.h)("label",{ref:u.setReference,for:`bucket-feedback-score-${i.value}`,class:"button",style:{color:i.color},"aria-label":i.getLabel(a)},(0,o.h)("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:.2,zIndex:1}}),(0,o.h)("span",{style:{zIndex:2,display:"flex",alignItems:"center"}},i.icon)),(0,o.h)("div",{ref:u.setFloating,class:"button-tooltip",style:p},i.getLabel(a),(0,o.h)("div",{ref:d,class:"button-tooltip-arrow",style:{left:null!=(null===(s=f.arrow)||void 0===s?void 0:s.x)?`${f.arrow.x}px`:"",top:null!=(null===(c=f.arrow)||void 0===c?void 0:c.y)?`${f.arrow.y}px`:""}})))}},330:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_TRANSLATIONS=void 0,t.DEFAULT_TRANSLATIONS={DefaultQuestionLabel:"How satisfied are you with this feature?",QuestionPlaceholder:"Write a comment",ScoreStatusDescription:"Pick a score and leave a comment",ScoreStatusLoading:"Saving score, please wait...",ScoreStatusReceived:"Score has been received!",ScoreVeryDissatisfiedLabel:"Very dissatisfied (1/5)",ScoreDissatisfiedLabel:"Dissatisfied (2/5)",ScoreNeutralLabel:"Neutral (3/5)",ScoreSatisfiedLabel:"Satisfied (4/5)",ScoreVerySatisfiedLabel:"Very satisfied (5/5)",SuccessMessage:"Feedback received, thank you!",SendButton:"Send feedback"}},545:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagatedEvents=t.feedbackContainerId=void 0,t.feedbackContainerId="bucket-feedback-dialog-container",t.propagatedEvents=["animationcancel","animationend","animationiteration","animationstart","afterscriptexecute","auxclick","beforescriptexecute","blur","click","compositionend","compositionstart","compositionupdate","contextmenu","copy","cut","dblclick","DOMActivate","DOMMouseScroll","error","focusin","focusout","focus","fullscreenchange","fullscreenerror","gesturechange","gestureend","gesturestart","gotpointercapture","keydown","keypress","keyup","lostpointercapture","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","mousewheel","paste","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup","scroll","select","touchcancel","touchend","touchmove","touchstart","transitioncancel","transitionend","transitionrun","transitionstart","wheel"]},564:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useTimer=void 0;const o=n(718);t.useTimer=({initialDuration:e,enabled:t,onEnd:n})=>{const[r,i]=(0,o.useState)(!t),[a,s]=(0,o.useState)(e),[c,d]=(0,o.useState)(Date.now()),[l,u]=(0,o.useState)(Date.now());(0,o.useEffect)((()=>{if(r)return;const e=setInterval((()=>{u(Date.now()),Date.now()>=c+a&&(clearTimeout(e),i(!0),n())}),25);return()=>{clearTimeout(e)}}),[r]);const p=(0,o.useCallback)((()=>{i(!0)}),[]),f=(0,o.useCallback)((e=>{d(Date.now()),s(e),i(!1)}),[]);return{duration:a,elapsedFraction:(r?0:l-c)/a,startTime:c,endTime:c+a,stopped:r,startWithDuration:f,stop:p}}},529:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Check=void 0;const o=n(108);t.Check=e=>(0,o.h)("svg",Object.assign({height:"24px",width:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,o.h)("path",{fill:"currentColor",d:"m10 15.17l9.193-9.191l1.414 1.414l-10.606 10.606l-6.364-6.364l1.414-1.414l4.95 4.95Z"}))},620:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CheckCircle=void 0;const o=n(108);t.CheckCircle=e=>(0,o.h)("svg",Object.assign({width:"24px",height:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,o.h)("path",{fill:"currentColor",d:"M12 24C5.3724 24 0 18.6276 0 12C0 5.3724 5.3724 0 12 0C18.6276 0 24 5.3724 24 12C24 18.6276 18.6276 24 12 24ZM10.8036 16.8L19.2876 8.3148L17.5908 6.618L10.8036 13.4064L7.4088 10.0116L5.712 11.7084L10.8036 16.8Z"}))},11:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Close=void 0;const o=n(108);t.Close=e=>(0,o.h)("svg",Object.assign({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,o.h)("path",{d:"M12.0007 10.5865L16.9504 5.63672L18.3646 7.05093L13.4149 12.0007L18.3646 16.9504L16.9504 18.3646L12.0007 13.4149L7.05093 18.3646L5.63672 16.9504L10.5865 12.0007L5.63672 7.05093L7.05093 5.63672L12.0007 10.5865Z",fill:"currentColor"}))},421:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Dissatisfied=void 0;const o=n(108);t.Dissatisfied=e=>(0,o.h)("svg",Object.assign({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,o.h)("path",{d:"M12 22C6.477 22 2 17.523 2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 17.523 17.523 22 12 22ZM12 20C14.1217 20 16.1566 19.1571 17.6569 17.6569C19.1571 16.1566 20 14.1217 20 12C20 9.87827 19.1571 7.84344 17.6569 6.34315C16.1566 4.84285 14.1217 4 12 4C9.87827 4 7.84344 4.84285 6.34315 6.34315C4.84285 7.84344 4 9.87827 4 12C4 14.1217 4.84285 16.1566 6.34315 17.6569C7.84344 19.1571 9.87827 20 12 20Z",fill:"currentColor"}),(0,o.h)("path",{d:"M12 15C13.1835 15 14.2712 15.4113 15.1279 16.0991C15.4665 16.3709 15.4398 16.8738 15.1187 17.166C14.8962 17.3685 14.5788 17.4225 14.2915 17.3332C13.605 17.1198 12.8259 17 12 17C11.1741 17 10.3949 17.1205 9.70841 17.3331C9.42116 17.422 9.104 17.3677 8.88161 17.1653C8.56025 16.8728 8.53318 16.3695 8.87206 16.0976C9.2087 15.8274 9.57986 15.6014 9.97666 15.426C10.6139 15.1442 11.3032 14.9991 12 15ZM8.5 10C8.89783 10 9.27936 10.158 9.56066 10.4393C9.84197 10.7206 10 11.1022 10 11.5C10 11.8978 9.84197 12.2794 9.56066 12.5607C9.27936 12.842 8.89783 13 8.5 13C8.10218 13 7.72065 12.842 7.43934 12.5607C7.15804 12.2794 7 11.8978 7 11.5C7 11.1022 7.15804 10.7206 7.43934 10.4393C7.72065 10.158 8.10218 10 8.5 10ZM15.5 10C15.8978 10 16.2794 10.158 16.5607 10.4393C16.842 10.7206 17 11.1022 17 11.5C17 11.8978 16.842 12.2794 16.5607 12.5607C16.2794 12.842 15.8978 13 15.5 13C15.1022 13 14.7206 12.842 14.4393 12.5607C14.158 12.2794 14 11.8978 14 11.5C14 11.1022 14.158 10.7206 14.4393 10.4393C14.7206 10.158 15.1022 10 15.5 10Z",fill:"currentColor"}))},655:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0;const o=n(108);t.Logo=e=>(0,o.h)("svg",Object.assign({width:"10px",height:"10px",viewBox:"0 0 300 316",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,o.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M149.608 33.1691C114.541 33.1691 88.1957 34.0727 68.6978 35.2674C45.9877 36.6589 31.2447 53.6165 32.7413 77.1477C33.9788 96.6049 36.0938 122.855 39.6451 157.89C44.0755 201.599 48.0467 231.615 51.1923 251.815C53.8983 269.193 66.5685 280.724 83.8252 281.651C99.4409 282.49 120.822 283.137 149.608 283.137C178.991 283.137 200.659 282.463 216.355 281.599C232.793 280.694 244.886 269.593 247.467 252.738C249.007 242.679 250.794 230.104 252.816 214.471C254.076 204.729 255.427 193.799 256.866 181.551C257.741 174.108 258.648 166.178 259.588 157.731C263.785 119.994 266.075 92.6244 267.274 72.9772C268.564 51.838 255.492 36.9197 234.632 35.5304C214.779 34.208 187.208 33.1691 149.608 33.1691ZM66.7035 2.65939C86.9741 1.41736 113.994 0.5 149.608 0.5C187.792 0.5 216.098 1.55452 236.8 2.93336C275.829 5.53288 302.222 36.1432 299.852 74.9692C298.613 95.2768 296.268 123.202 292.026 161.346C287.025 206.312 282.898 236.995 279.729 257.688C274.896 289.249 250.57 312.434 218.147 314.218C201.752 315.121 179.476 315.806 149.608 315.806C120.346 315.806 98.3726 315.149 82.0761 314.273C49.1273 312.503 23.9794 289.192 18.9427 256.846C15.6873 235.941 11.6471 205.329 7.17277 161.187C3.58873 125.829 1.43655 99.164 0.168272 79.2232C-2.42412 38.4637 25.1723 5.20409 66.7035 2.65939Z",fill:"currentColor"}),(0,o.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M150.869 165.962C150.29 165.209 149.718 164.45 149.156 163.684C144.318 157.097 140.113 150.016 136.63 142.531C132.143 132.889 136.224 124.122 143.367 120.398C151.531 116.142 162.346 120.398 166.226 128.738C169.442 135.653 173.494 142.1 178.25 147.949C193.08 166.186 214.765 178.615 239.375 181.302C242.678 181.662 246.035 181.848 249.434 181.848C251.936 181.848 254.415 181.747 256.866 181.551C260.357 181.848 256.071 214.471 252.816 214.471C251.692 214.501 250.565 214.517 249.434 214.517C245.891 214.517 242.383 214.368 238.915 214.078C203.102 211.075 171.603 192.885 150.869 165.962Z",fill:"currentColor"}))},671:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Neutral=void 0;const o=n(108);t.Neutral=e=>(0,o.h)("svg",Object.assign({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,o.h)("path",{d:"M12 22C6.477 22 2 17.523 2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 17.523 17.523 22 12 22ZM12 20C14.1217 20 16.1566 19.1571 17.6569 17.6569C19.1571 16.1566 20 14.1217 20 12C20 9.87827 19.1571 7.84344 17.6569 6.34315C16.1566 4.84285 14.1217 4 12 4C9.87827 4 7.84344 4.84285 6.34315 6.34315C4.84285 7.84344 4 9.87827 4 12C4 14.1217 4.84285 16.1566 6.34315 17.6569C7.84344 19.1571 9.87827 20 12 20ZM8 15C8 14.4477 8.44771 14 9 14H15C15.5523 14 16 14.4477 16 15V15C16 15.5523 15.5523 16 15 16H9C8.44771 16 8 15.5523 8 15V15ZM8 11C7.60217 11 7.22064 10.842 6.93934 10.5607C6.65803 10.2794 6.5 9.89782 6.5 9.5C6.5 9.10217 6.65803 8.72064 6.93934 8.43934C7.22064 8.15803 7.60217 8 8 8C8.39782 8 8.77935 8.15803 9.06066 8.43934C9.34196 8.72064 9.5 9.10217 9.5 9.5C9.5 9.89782 9.34196 10.2794 9.06066 10.5607C8.77935 10.842 8.39782 11 8 11ZM16 11C15.6022 11 15.2206 10.842 14.9393 10.5607C14.658 10.2794 14.5 9.89782 14.5 9.5C14.5 9.10217 14.658 8.72064 14.9393 8.43934C15.2206 8.15803 15.6022 8 16 8C16.3978 8 16.7794 8.15803 17.0607 8.43934C17.342 8.72064 17.5 9.10217 17.5 9.5C17.5 9.89782 17.342 10.2794 17.0607 10.5607C16.7794 10.842 16.3978 11 16 11Z",fill:"currentColor"}))},60:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Satisfied=void 0;const o=n(108);t.Satisfied=e=>(0,o.h)("svg",Object.assign({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,o.h)("path",{d:"M12 22C6.477 22 2 17.523 2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 17.523 17.523 22 12 22ZM12 20C14.1217 20 16.1566 19.1571 17.6569 17.6569C19.1571 16.1566 20 14.1217 20 12C20 9.87827 19.1571 7.84344 17.6569 6.34315C16.1566 4.84285 14.1217 4 12 4C9.87827 4 7.84344 4.84285 6.34315 6.34315C4.84285 7.84344 4 9.87827 4 12C4 14.1217 4.84285 16.1566 6.34315 17.6569C7.84344 19.1571 9.87827 20 12 20ZM8 11C7.60217 11 7.22064 10.842 6.93934 10.5607C6.65803 10.2794 6.5 9.89782 6.5 9.5C6.5 9.10217 6.65803 8.72064 6.93934 8.43934C7.22064 8.15803 7.60217 8 8 8C8.39782 8 8.77935 8.15803 9.06066 8.43934C9.34196 8.72064 9.5 9.10217 9.5 9.5C9.5 9.89782 9.34196 10.2794 9.06066 10.5607C8.77935 10.842 8.39782 11 8 11ZM16 11C15.6022 11 15.2206 10.842 14.9393 10.5607C14.658 10.2794 14.5 9.89782 14.5 9.5C14.5 9.10217 14.658 8.72064 14.9393 8.43934C15.2206 8.15803 15.6022 8 16 8C16.3978 8 16.7794 8.15803 17.0607 8.43934C17.342 8.72064 17.5 9.10217 17.5 9.5C17.5 9.89782 17.342 10.2794 17.0607 10.5607C16.7794 10.842 16.3978 11 16 11Z",fill:"currentColor"}),(0,o.h)("path",{d:"M7.79862 15.4322C8.85269 16.5065 10.4964 17.4971 11.9993 17.4971C13.5011 17.4971 15.1701 16.5079 16.2097 15.4351C16.5083 15.1269 16.4581 14.6416 16.1408 14.3528C15.9042 14.1375 15.5656 14.0777 15.2972 14.2517C14.5161 14.7578 13.4271 15.7002 11.9993 15.7002C10.5688 15.7002 9.47831 14.7549 8.69694 14.2486C8.43116 14.0764 8.09564 14.1353 7.86141 14.3485C7.5435 14.6378 7.49757 15.1254 7.79862 15.4322Z",fill:"currentColor"}))},873:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VeryDissatisfied=void 0;const o=n(108);t.VeryDissatisfied=e=>(0,o.h)("svg",Object.assign({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,o.h)("path",{d:"M12 22C6.477 22 2 17.523 2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 17.523 17.523 22 12 22ZM12 20C14.1217 20 16.1566 19.1571 17.6569 17.6569C19.1571 16.1566 20 14.1217 20 12C20 9.87827 19.1571 7.84344 17.6569 6.34315C16.1566 4.84285 14.1217 4 12 4C9.87827 4 7.84344 4.84285 6.34315 6.34315C4.84285 7.84344 4 9.87827 4 12C4 14.1217 4.84285 16.1566 6.34315 17.6569C7.84344 19.1571 9.87827 20 12 20ZM8 17C7.44771 17 6.98992 16.5479 7.09965 16.0066C7.29346 15.0506 7.76447 14.1645 8.46447 13.4645C9.40215 12.5268 10.6739 12 12 12C13.3261 12 14.5979 12.5268 15.5355 13.4645C16.2355 14.1645 16.7065 15.0506 16.9003 16.0066C17.0101 16.5479 16.5523 17 16 17V17C15.4477 17 15.0156 16.5403 14.8349 16.0184C14.6877 15.5934 14.4454 15.2028 14.1213 14.8787C13.5587 14.3161 12.7956 14 12 14C11.2043 14 10.4413 14.3161 9.87868 14.8787C9.55459 15.2028 9.31232 15.5934 9.16513 16.0184C8.98442 16.5403 8.55228 17 8 17V17ZM8 11C7.60217 11 7.22064 10.842 6.93934 10.5607C6.65803 10.2794 6.5 9.89782 6.5 9.5C6.5 9.10217 6.65803 8.72064 6.93934 8.43934C7.22064 8.15803 7.60217 8 8 8C8.39782 8 8.77935 8.15803 9.06066 8.43934C9.34196 8.72064 9.5 9.10217 9.5 9.5C9.5 9.89782 9.34196 10.2794 9.06066 10.5607C8.77935 10.842 8.39782 11 8 11ZM16 11C15.6022 11 15.2206 10.842 14.9393 10.5607C14.658 10.2794 14.5 9.89782 14.5 9.5C14.5 9.10217 14.658 8.72064 14.9393 8.43934C15.2206 8.15803 15.6022 8 16 8C16.3978 8 16.7794 8.15803 17.0607 8.43934C17.342 8.72064 17.5 9.10217 17.5 9.5C17.5 9.89782 17.342 10.2794 17.0607 10.5607C16.7794 10.842 16.3978 11 16 11Z",fill:"currentColor"}))},514:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VerySatisfied=void 0;const o=n(108);t.VerySatisfied=e=>(0,o.h)("svg",Object.assign({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,o.h)("path",{d:"M12 2C17.523 2 22 6.477 22 12C22 17.523 17.523 22 12 22C6.477 22 2 17.523 2 12C2 6.477 6.477 2 12 2ZM12 4C9.87827 4 7.84344 4.84285 6.34315 6.34315C4.84285 7.84344 4 9.87827 4 12C4 14.1217 4.84285 16.1566 6.34315 17.6569C7.84344 19.1571 9.87827 20 12 20C14.1217 20 16.1566 19.1571 17.6569 17.6569C19.1571 16.1566 20 14.1217 20 12C20 9.87827 19.1571 7.84344 17.6569 6.34315C16.1566 4.84285 14.1217 4 12 4ZM12 12C14 12 15.667 12.333 17 13C17 14.3261 16.4732 15.5979 15.5355 16.5355C14.5979 17.4732 13.3261 18 12 18C10.6739 18 9.40215 17.4732 8.46447 16.5355C7.52678 15.5979 7 14.3261 7 13C8.333 12.333 10 12 12 12ZM8.5 7C9.07633 6.99988 9.63499 7.19889 10.0815 7.56335C10.5279 7.9278 10.8347 8.43532 10.95 9H6.05C6.16526 8.43532 6.47209 7.9278 6.91855 7.56335C7.36501 7.19889 7.92367 6.99988 8.5 7ZM15.5 7C16.0763 6.99988 16.635 7.19889 17.0814 7.56335C17.5279 7.9278 17.8347 8.43532 17.95 9H13.05C13.1653 8.43532 13.4721 7.9278 13.9185 7.56335C14.365 7.19889 14.9237 6.99988 15.5 7Z",fill:"currentColor"}))},495:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.openFeedbackForm=void 0;const o=n(108),r=n(545),i=n(254),a={type:"DIALOG",placement:"bottom-right"};function s(e){e.stopPropagation()}t.openFeedbackForm=function(e){const t=function(){let e=document.querySelector(`#${r.feedbackContainerId}`);if(!e){e=document.createElement("div"),e.attachShadow({mode:"open"}),e.style.all="initial",e.id=r.feedbackContainerId,document.body.appendChild(e);for(const t of r.propagatedEvents)e.addEventListener(t,s)}return e.shadowRoot}(),n=e.position||a;if("POPOVER"===n.type){if(!n.anchor)return void console.warn("[Bucket]","Unable to open popover. Anchor must be a defined DOM-element");if(!document.body.contains(n.anchor))return void console.warn("[Bucket]","Unable to open popover. Anchor must be an attached DOM-element")}(0,o.render)((0,o.h)(i.FeedbackDialog,Object.assign(Object.assign({},e),{position:n})),t);const c=t.querySelector("dialog");c&&!c.hasAttribute("open")&&c["MODAL"===n.type?"showModal":"show"]()}},128:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.arrow=void 0;const o=n(882);t.arrow=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(i=n,{}.hasOwnProperty.call(i,"current"))?null!=n.current?(0,o.arrow)({element:n.current,padding:r}).fn(t):{}:n?(0,o.arrow)({element:n,padding:r}).fn(t):{};var i}})},436:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.size=t.shift=t.platform=t.offset=t.limitShift=t.inline=t.hide=t.getOverflowAncestors=t.flip=t.detectOverflow=t.computePosition=t.autoUpdate=t.autoPlacement=t.useFloating=t.arrow=void 0;var o=n(128);Object.defineProperty(t,"arrow",{enumerable:!0,get:function(){return o.arrow}});var r=n(610);Object.defineProperty(t,"useFloating",{enumerable:!0,get:function(){return r.useFloating}});var i=n(882);Object.defineProperty(t,"autoPlacement",{enumerable:!0,get:function(){return i.autoPlacement}}),Object.defineProperty(t,"autoUpdate",{enumerable:!0,get:function(){return i.autoUpdate}}),Object.defineProperty(t,"computePosition",{enumerable:!0,get:function(){return i.computePosition}}),Object.defineProperty(t,"detectOverflow",{enumerable:!0,get:function(){return i.detectOverflow}}),Object.defineProperty(t,"flip",{enumerable:!0,get:function(){return i.flip}}),Object.defineProperty(t,"getOverflowAncestors",{enumerable:!0,get:function(){return i.getOverflowAncestors}}),Object.defineProperty(t,"hide",{enumerable:!0,get:function(){return i.hide}}),Object.defineProperty(t,"inline",{enumerable:!0,get:function(){return i.inline}}),Object.defineProperty(t,"limitShift",{enumerable:!0,get:function(){return i.limitShift}}),Object.defineProperty(t,"offset",{enumerable:!0,get:function(){return i.offset}}),Object.defineProperty(t,"platform",{enumerable:!0,get:function(){return i.platform}}),Object.defineProperty(t,"shift",{enumerable:!0,get:function(){return i.shift}}),Object.defineProperty(t,"size",{enumerable:!0,get:function(){return i.size}})},610:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useFloating=void 0;const o=n(882),r=n(718),i=n(41),a=n(686),s=n(874),c=n(23);t.useFloating=function(e={}){const{placement:t="bottom",strategy:n="absolute",middleware:d=[],platform:l,elements:{reference:u,floating:p}={},transform:f=!0,whileElementsMounted:b,open:h}=e,[g,m]=(0,r.useState)({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,y]=(0,r.useState)(d);(0,i.deepEqual)(v,d)||y(d);const[k,C]=(0,r.useState)(null),[w,x]=(0,r.useState)(null),S=(0,r.useCallback)((e=>{e!=_.current&&(_.current=e,C(e))}),[C]),O=(0,r.useCallback)((e=>{e!==P.current&&(P.current=e,x(e))}),[x]),I=u||k,j=p||w,_=(0,r.useRef)(null),P=(0,r.useRef)(null),M=(0,r.useRef)(g),L=(0,c.useLatestRef)(b),D=(0,c.useLatestRef)(l),E=(0,r.useCallback)((()=>{if(!_.current||!P.current)return;const e={placement:t,strategy:n,middleware:v};D.current&&(e.platform=D.current),(0,o.computePosition)(_.current,P.current,e).then((e=>{const t=Object.assign(Object.assign({},e),{isPositioned:!0});F.current&&!(0,i.deepEqual)(M.current,t)&&(M.current=t,m(t))}))}),[v,t,n,D]);(0,r.useLayoutEffect)((()=>{!1===h&&M.current.isPositioned&&(M.current.isPositioned=!1,m((e=>Object.assign(Object.assign({},e),{isPositioned:!1}))))}),[h]);const F=(0,r.useRef)(!1);(0,r.useLayoutEffect)((()=>(F.current=!0,()=>{F.current=!1})),[]),(0,r.useLayoutEffect)((()=>{if(I&&(_.current=I),j&&(P.current=j),I&&j)return L.current?L.current(I,j,E):E()}),[I,j,E,L]);const R=(0,r.useMemo)((()=>({reference:_,floating:P,setReference:S,setFloating:O})),[S,O]),T=(0,r.useMemo)((()=>({reference:I,floating:j})),[I,j]),A=(0,r.useMemo)((()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=(0,s.roundByDPR)(T.floating,g.x),o=(0,s.roundByDPR)(T.floating,g.y);return f?Object.assign(Object.assign(Object.assign({},e),{transform:`translate(${t}px, ${o}px)`}),(0,a.getDPR)(T.floating)>=1.5&&{willChange:"transform"}):{position:n,left:t,top:o}}),[n,f,T.floating,g.x,g.y]);return(0,r.useMemo)((()=>Object.assign(Object.assign({},g),{update:E,refs:R,elements:T,floatingStyles:A})),[g,E,R,T,A])}},41:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deepEqual=void 0,t.deepEqual=function e(t,n){if(t===n)return!0;if(typeof t!=typeof n)return!1;if("function"==typeof t&&t.toString()===n.toString())return!0;let o,r,i;if(t&&n&&"object"==typeof t){if(Array.isArray(t)){if(o=t.length,o!=n.length)return!1;for(r=o;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(i=Object.keys(t),o=i.length,o!==Object.keys(n).length)return!1;for(r=o;0!=r--;)if(!{}.hasOwnProperty.call(n,i[r]))return!1;for(r=o;0!=r--;){const o=i[r];if(!("_owner"===o&&t.$$typeof||e(t[o],n[o])))return!1}return!0}return t!=t&&n!=n}},686:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getDPR=void 0,t.getDPR=function(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}},874:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.roundByDPR=void 0;const o=n(686);t.roundByDPR=function(e,t){const n=(0,o.getDPR)(e);return Math.round(t*n)/n}},23:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useLatestRef=void 0;const o=n(718);t.useLatestRef=function(e){const t=(0,o.useRef)(e);return(0,o.useLayoutEffect)((()=>{t.current=e})),t}},607:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=o(n(519));let i=null;i||(i=(0,r.default)()),t.default=i},519:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return r(t,e),t},a=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const c=s(n(31)),d=n(754),l=n(147),u=n(913),p=n(592),f=i(n(495)),b=n(861),h=n(236);function g(e,t){return a(this,void 0,void 0,(function*(){return(0,c.default)(e,{method:"post",headers:{"Content-Type":"application/json","Bucket-Sdk-Version":l.version},body:JSON.stringify(t)})}))}const m="undefined"!=typeof window&&window.innerWidth<768;t.default=function(){let e,t,n,o,r,i,s,c=!1,l=u.TRACKING_HOST,v=u.SSE_REALTIME_HOST,y=!d.isForNode,k=!1,C=!d.isForNode;function w(){return`${l}/${e}`}function x(){e||I("Tracking key is not set, please call init() first")}function S(){return t||I("User is not set, please call user() first or provide userId as argument"),t}function O(e,...t){c&&console.log("[Bucket]",e,...t)}function I(e,...t){throw c&&console.error("[Bucket]",e,...t),new Error(e)}function j(e){return y?S():(e||I("No userId provided and persistUser is disabled"),e)}function _({feedbackId:e,featureId:t,question:n,score:o,userId:r,companyId:i,comment:s,promptId:c,promptedQuestion:d}){return a(this,void 0,void 0,(function*(){x(),t||I("No featureId provided"),o||s||I("Either 'score' or 'comment' must be provided"),r=j(r);const a={feedbackId:e,userId:r,featureId:t,score:o,companyId:i,comment:s,promptId:c,question:n,promptedQuestion:d},l=yield g(`${w()}/feedback`,a);return O("sent feedback",l),l}))}function P(e){return a(this,void 0,void 0,(function*(){if(x(),d.isForNode&&I("Feedback prompting is not supported in Node.js environment"),k&&I("Feedback prompting already initialized. Use reset() first."),m)!function(e,...t){console.warn("[Bucket]",e,...t)}("Feedback prompting is not supported on mobile devices");else{e=j(e),k=!0;try{const t=yield g(`${w()}/feedback/prompting-init`,{userId:e});O("feedback prompting status sent",t);const d=yield t.json();return d.success&&d.channel?(O("feedback prompting enabled"),n=(0,h.openAblySSEChannel)(`${w()}/feedback/prompting-auth`,e,d.channel,(t=>function(e,t){const n=(0,b.parsePromptMessage)(t);n?(0,b.processPromptMessage)(e,n,((t,c,d)=>a(this,void 0,void 0,(function*(){yield M({promptId:n.promptId,featureId:n.featureId,promptedQuestion:n.question,event:"received",userId:e}),yield function(e,t,n){return a(this,void 0,void 0,(function*(){let c;if(r!==e)return void O("feedback prompt not shown, received for another user",e,t);yield M({promptId:t.promptId,featureId:t.featureId,promptedQuestion:t.question,event:"shown",userId:e});const d=o=>a(this,void 0,void 0,(function*(){if(!o)return yield M({promptId:t.promptId,featureId:t.featureId,event:"dismissed",userId:e,promptedQuestion:t.question}),void n();const r=yield _({feedbackId:c,featureId:t.featureId,userId:e,companyId:o.companyId,score:o.score,comment:o.comment,promptId:t.promptId,question:o.question,promptedQuestion:t.question});return n(),yield r.json()})),l={reply:d,openFeedbackForm:e=>{f.openFeedbackForm(Object.assign({key:t.featureId,title:t.question,onScoreSubmit:e=>a(this,void 0,void 0,(function*(){const t=yield d(e);return c=t.feedbackId,{feedbackId:t.feedbackId}})),onSubmit:t=>a(this,void 0,void 0,(function*(){var n;yield d(t),null===(n=e.onAfterSubmit)||void 0===n||n.call(e,t)})),onDismiss:()=>d(null),position:i,translations:s},e))}};null==o||o(t,l)}))}(t,c,d)}))))||O("feedback prompt not shown, it was either expired or already processed",t):I("invalid feedback prompt message received",t)}(e,t)),{debug:c,sseHost:v}),r=e,O("feedback prompting connection established"),t):(O("feedback prompting not enabled"),t)}finally{k=!!n}}}))}function M(e){return a(this,void 0,void 0,(function*(){x(),e.promptId||I("No promptId provided"),e.event||I("No event provided");const t={action:e.event,featureId:e.featureId,promptId:e.promptId,userId:e.userId,promptedQuestion:e.promptedQuestion},n=yield g(`${w()}/feedback/prompt-events`,t);return O("sent prompt event",n),n}))}function L(){t=void 0,r=void 0,k=!1,n&&((0,h.closeAblySSEChannel)(n),O("feedback prompting connection closed"),n=void 0)}return O("Instance created"),{init:function(t,n={}){var r,a,u,f,b,h,g,m,k,w,x,S,j,_,P;L(),t||I("Tracking key was not provided"),e=t,n.debug&&(c=n.debug),n.host&&(l=n.host),n.sseHost&&(v=n.sseHost),(null===(a=null===(r=n.feedback)||void 0===r?void 0:r.ui)||void 0===a?void 0:a.position)&&(i=null===(f=null===(u=n.feedback)||void 0===u?void 0:u.ui)||void 0===f?void 0:f.position),(null===(h=null===(b=n.feedback)||void 0===b?void 0:b.ui)||void 0===h?void 0:h.translations)&&(s=null===(m=null===(g=n.feedback)||void 0===g?void 0:g.ui)||void 0===m?void 0:m.translations),void 0!==n.persistUser&&(y=n.persistUser),void 0!==(null===(k=n.feedback)||void 0===k?void 0:k.enableLiveFeedback)&&(C=n.feedback.enableLiveFeedback),void 0!==(null===(w=n.feedback)||void 0===w?void 0:w.enableLiveSatisfaction)&&(C=n.feedback.enableLiveSatisfaction),C&&d.isForNode&&I("Feedback prompting is not supported in Node.js environment"),C&&!y&&I("Feedback prompting is not supported when persistUser is disabled"),o=null!==(_=null!==(S=null===(x=n.feedback)||void 0===x?void 0:x.liveFeedbackHandler)&&void 0!==S?S:null===(j=n.feedback)||void 0===j?void 0:j.liveSatisfactionHandler)&&void 0!==_?_:(0,p.createDefaultFeedbackPromptHandler)(null===(P=n.feedback)||void 0===P?void 0:P.ui),O(`initialized with key "${e}" and options`,n)},reset:L,user:function(e,n,o){return a(this,void 0,void 0,(function*(){x(),e||I("No userId provided"),y&&(t&&t!==e&&L(),t=e,C&&!k&&(yield P(e)));const r={userId:e,attributes:n,context:o},i=yield g(`${w()}/user`,r);return O("sent user",i),i}))},company:function(e,t,n,o){return a(this,void 0,void 0,(function*(){x(),e||I("No companyId provided");const r={userId:n=j(n),companyId:e,context:o};t&&(r.attributes=t);const i=yield g(`${w()}/company`,r);return O("sent company",i),i}))},track:function(e,t,n,o,r){return a(this,void 0,void 0,(function*(){x(),e||I("No eventName provided");const i={userId:n=j(n),event:e,companyId:o,context:r};t&&(i.attributes=t);const a=yield g(`${w()}/event`,i);return O("sent event",a),a}))},feedback:_,requestFeedback:function(e){d.isForNode&&I("requestFeedback can only be called in the browser"),e.featureId||I("No featureId provided"),y?e.userId=S():e.userId||I("No userId provided and persistUser is disabled"),setTimeout((()=>{var t,n;f.openFeedbackForm({key:e.featureId,title:e.title,position:null!==(t=e.position)&&void 0!==t?t:i,translations:null!==(n=e.translations)&&void 0!==n?n:s,openWithCommentVisible:e.openWithCommentVisible,onClose:e.onClose,onDismiss:e.onDismiss,onScoreSubmit:t=>a(this,void 0,void 0,(function*(){const n=yield _(Object.assign({featureId:e.featureId,userId:e.userId,companyId:e.companyId},t));return{feedbackId:(yield n.json()).feedbackId}})),onSubmit:t=>a(this,void 0,void 0,(function*(){var n;yield _(Object.assign({featureId:e.featureId,userId:e.userId,companyId:e.companyId},t)),null===(n=e.onAfterSubmit)||void 0===n||n.call(e,t)}))})}),1)},initLiveSatisfaction:P,initLiveFeedback:P}}},417:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.checkPromptMessageCompleted=t.markPromptMessageCompleted=void 0;const r=o(n(734));t.markPromptMessageCompleted=(e,t,n)=>{r.default.set(`bucket-prompt-${e}`,t,{expires:n})},t.checkPromptMessageCompleted=(e,t)=>r.default.get(`bucket-prompt-${e}`)===t},861:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.processPromptMessage=t.parsePromptMessage=void 0;const o=n(417);t.parsePromptMessage=e=>"string"==typeof(null==e?void 0:e.question)&&e.question.length&&"number"==typeof e.showAfter&&"number"==typeof e.showBefore&&"string"==typeof e.promptId&&e.promptId.length&&"string"==typeof e.featureId&&e.featureId.length?{question:e.question,showAfter:new Date(e.showAfter),showBefore:new Date(e.showBefore),promptId:e.promptId,featureId:e.featureId}:void 0,t.processPromptMessage=(e,t,n)=>{const r=new Date,i=()=>{(0,o.markPromptMessageCompleted)(e,t.promptId,t.showBefore)};return!((0,o.checkPromptMessageCompleted)(e,t.promptId)||r>t.showBefore||(r<t.showAfter?(setTimeout((()=>{n(e,t,i)}),t.showAfter.getTime()-r.getTime()),0):(n(e,t,i),0)))}},236:function(e,t,n){var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.closeAblySSEChannel=t.openAblySSEChannel=t.AblySSEChannel=void 0;const i=r(n(31)),a=n(913);class s{constructor(e,t,n,o,r,i){var a;this.userId=e,this.channel=t,this.ablyAuthUrl=n,this.sseHost=o,this.messageHandler=r,this.isOpen=!1,this.eventSource=null,this.retryInterval=null,this.debug=null!==(a=null==i?void 0:i.debug)&&void 0!==a&&a}log(e,...t){this.debug&&console.log("[SSE]",e,...t)}warn(e,...t){console.warn("[SSE]",e,...t)}err(e,...t){throw this.debug&&console.error("[SSE]",e,...t),new Error(e)}refreshTokenRequest(){return o(this,void 0,void 0,(function*(){const e=yield(0,i.default)(`${this.ablyAuthUrl}?userId=${encodeURIComponent(this.userId)}`,{method:"get",headers:{"Content-Type":"application/json"}});if(e.ok){const t=yield e.json();if(t.success){delete t.success;const e=t;return this.log("obtained new token request",e),e}}this.err("server did not release a token request",e)}))}refreshToken(){return o(this,void 0,void 0,(function*(){const e=yield this.refreshTokenRequest(),t=yield(0,i.default)(`${this.sseHost}/keys/${encodeURIComponent(e.keyName)}/requestToken`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok){const e=yield t.json();return this.log("obtained new token",e),e}this.err("server did not release a token",t)}))}onError(e){var t;return o(this,void 0,void 0,(function*(){if(e instanceof MessageEvent){let t;try{const n=JSON.parse(e.data);t=(null==n?void 0:n.code)&&Number(n.code)}catch(t){this.warn("received unparseable error message",t,e)}t&&t>=40140&&t<=40149&&this.log("event source token expired, refresh required")}else{const n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.readyState;2===n?this.log("event source connection closed",e):1===n?this.warn("event source connection failed to open",e):this.warn("event source unexpected error occured",e)}this.disconnect()}))}onMessage(e){let t;try{if(e.data){const n=JSON.parse(e.data);n.data&&(t=JSON.parse(n.data))}}catch(t){return void this.warn("received unparseable message",t,e)}if(t){this.log("received message",t);try{this.messageHandler(t)}catch(e){this.warn("failed to handle message",e,t)}}else this.warn("received invalid message",e)}onOpen(e){this.log("event source connection opened",e)}connect(){return o(this,void 0,void 0,(function*(){if(this.isOpen)this.warn("channel connection already open");else{this.isOpen=!0;try{const e=yield this.refreshToken();this.eventSource=new EventSource(`${this.sseHost}/sse?v=1.2&accessToken=${encodeURIComponent(e.token)}&channels=${encodeURIComponent(this.channel)}&rewind=1`),this.eventSource.addEventListener("error",(e=>this.onError(e))),this.eventSource.addEventListener("open",(e=>this.onOpen(e))),this.eventSource.addEventListener("message",(e=>this.onMessage(e))),this.log("channel connection opened")}finally{this.isOpen=!!this.eventSource}}}))}disconnect(){this.isOpen?(this.eventSource&&(this.eventSource.close(),this.eventSource=null,this.log("channel connection closed")),this.isOpen=!1):this.warn("channel connection already closed")}open(e){var t,n;const r=null!==(t=null==e?void 0:e.retryInterval)&&void 0!==t?t:3e4,i=null!==(n=null==e?void 0:e.retryCount)&&void 0!==n?n:3;let a=i;const s=()=>o(this,void 0,void 0,(function*(){try{yield this.connect(),a=i}catch(e){a>0?this.warn(`failed to connect, ${a} retries remaining`,e):this.warn("failed to connect, no retries remaining",e)}}));s(),this.retryInterval=setInterval((()=>{if(!this.isOpen&&this.retryInterval){if(a<=0)return clearInterval(this.retryInterval),void(this.retryInterval=null);a--,s()}}),r)}close(){this.retryInterval&&(clearInterval(this.retryInterval),this.retryInterval=null),this.disconnect()}isActive(){return!!this.retryInterval}isConnected(){return this.isOpen}}t.AblySSEChannel=s,t.openAblySSEChannel=function(e,t,n,o,r){const i=new s(t,n,e,(null==r?void 0:r.sseHost)||a.SSE_REALTIME_HOST,o,{debug:null==r?void 0:r.debug});return i.open(),i},t.closeAblySSEChannel=function(e){e.close()}},882:e=>{e.exports=require("@floating-ui/dom")},31:e=>{e.exports=require("cross-fetch")},754:e=>{e.exports=require("is-bundling-for-browser-or-node")},734:e=>{e.exports=require("js-cookie")},108:e=>{e.exports=require("preact")},718:e=>{e.exports=require("preact/hooks")},147:e=>{e.exports=JSON.parse('{"name":"@bucketco/tracking-sdk","version":"2.1.5","license":"MIT","private":false,"repository":{"type":"git","url":"https://github.com/bucketco/bucket-tracking-sdk.git"},"scripts":{"dev":"vite","start":"vite","build":"tsc --project tsconfig.build.json && webpack","test":"vitest -c vite.config.js","test:e2e":"yarn build && vitest run -c vite.e2e.config.js && playwright test","test:ci":"vitest run -c vite.config.js --reporter=junit --outputFile=junit.xml && vitest run -c vite.e2e.config.js && CI=true playwright test","coverage":"vitest run --coverage","lint":"eslint .","lint:ci":"eslint --output-file eslint-report.json --format json .","prettier":"prettier --check .","format":"yarn lint --fix && yarn prettier --write","preversion":"yarn lint && yarn prettier && yarn vitest run -c vite.config.js && yarn build"},"files":["dist"],"main":"./dist/bucket-tracking-sdk.node.js","browser":"./dist/bucket-tracking-sdk.browser.js","types":"./dist/types/src/index.d.ts","devDependencies":{"@babel/core":"^7.22.9","@eslint/js":"^8.47.0","@playwright/test":"^1.37.1","@preact/preset-vite":"^2.5.0","@types/js-cookie":"^3.0.3","@types/node":"^20.4.4","@types/webpack":"^5.28.2","@types/webpack-node-externals":"^3.0.0","@typescript-eslint/eslint-plugin":"^6.4.0","@typescript-eslint/parser":"^6.4.0","@vitest/coverage-v8":"^0.34.3","c8":"^8.0.1","css-loader":"^6.8.1","eslint":"^8.47.0","eslint-config-prettier":"^9.0.0","eslint-import-resolver-typescript":"^3.6.0","eslint-plugin-import":"^2.28.1","eslint-plugin-simple-import-sort":"^10.0.0","eslint-plugin-unused-imports":"^3.0.0","flush-promises":"^1.0.2","globals":"^13.21.0","http-server":"^14.1.1","jsdom":"^22.1.0","nock":"^13.3.3","postcss":"^8.4.31","postcss-loader":"^7.3.3","postcss-nesting":"^12.0.1","postcss-preset-env":"^9.1.0","prettier":"^3.0.2","style-loader":"^3.3.3","ts-loader":"^9.4.4","ts-node":"^10.9.1","typescript":"^5.1.6","vite":"^4.4.9","vite-plugin-dts":"^3.5.2","vitest":"^0.33.0","webpack":"^5.88.2","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"@floating-ui/dom":"^1.4.5","cross-fetch":"^4.0.0","is-bundling-for-browser-or-node":"^1.1.1","js-cookie":"^3.0.5","preact":"^10.16.0"}}')}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={id:o,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o=n(607);return o.default})()));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.bucket=t():e.bucket=t()}(global,(()=>(()=>{"use strict";var e={268:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(81),r=n.n(o),i=n(645),a=n.n(i)()(r());a.push([e.id,".button {\n -webkit-appearance: none;\n -moz-appearance: none;\n appearance: none;\n display: inline-flex;\n justify-content: center;\n align-items: center;\n -webkit-user-select: none;\n -moz-user-select: none;\n user-select: none;\n position: relative;\n white-space: nowrap;\n height: 2rem;\n padding-left: 0.75rem;\n padding-right: 0.75rem;\n gap: 0.5em;\n justify-content: center;\n border: none;\n cursor: pointer;\n font-family: var(--bucket-feedback-dialog-font-family);\n font-size: 12px;\n font-weight: 500;\n box-shadow:\n 0 1px 2px 0 rgba(0, 0, 0, 0.06),\n 0 1px 1px 0 rgba(0, 0, 0, 0.01);\n border-radius: 6px;\n border-radius: var(--bucket-feedback-dialog-border-radius, 6px);\n transition-duration: 200ms;\n transition-property: background-color, border-color, color, opacity,\n box-shadow, transform;\n}\n.button.primary {\n background-color: white;\n background-color: var(\n --bucket-feedback-dialog-primary-button-background-color,\n white\n );\n color: #1e1f24;\n color: var(--bucket-feedback-dialog-primary-button-color, #1e1f24);\n border: 1px solid\n #d8d9df;\n border: 1px solid\n var(--bucket-feedback-dialog-primary-border-color, #d8d9df);\n }\n.button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n border-color: #d8d9df;\n border-color: var(--bucket-feedback-dialog-primary-border-color, #d8d9df);\n\n transition-duration: 200ms;\n transition-property: background-color, border-color, color, opacity,\n box-shadow, transform;\n }\n.button:focus {\n outline: none;\n border-color: #787c91;\n border-color: var(\n --bucket-feedback-dialog-input-focus-border-color,\n #787c91\n );\n }\n",""]);const s=a},622:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(81),r=n.n(o),i=n(645),a=n.n(i)()(r());a.push([e.id,"@keyframes scale {\n from {\n transform: scale(0.9);\n }\n to {\n transform: scale(1);\n }\n}\n\n@keyframes floatUp {\n from {\n transform: translateY(15%);\n }\n to {\n transform: translateY(0%);\n }\n}\n\n@keyframes floatDown {\n from {\n transform: translateY(-15%);\n }\n to {\n transform: translateY(0%);\n }\n}\n\n@keyframes fade {\n from {\n opacity: 0;\n }\n to {\n opacity: 1;\n }\n}\n\n.dialog {\n position: fixed;\n width: 210px;\n padding: 16px 22px 10px;\n font-size: 1rem;\n font-size: var(--bucket-feedback-dialog-font-size, 1rem);\n font-family: InterVariable,\n Inter,\n system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif,\n Open Sans,\n sans-serif;\n font-family: var(\n --bucket-feedback-dialog-font-family,\n InterVariable,\n Inter,\n system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif,\n Open Sans,\n sans-serif\n );\n color: #1e1f24;\n color: var(--bucket-feedback-dialog-color, #1e1f24);\n border: 1px solid;\n border-color: #d8d9df;\n border-color: var(--bucket-feedback-dialog-border, #d8d9df);\n border-radius: 6px;\n border-radius: var(--bucket-feedback-dialog-border-radius, 6px);\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),\n 0 4px 6px -2px rgba(0, 0, 0, 0.05);\n box-shadow: var(\n --bucket-feedback-dialog-box-shadow,\n 0 10px 15px -3px rgba(0, 0, 0, 0.1),\n 0 4px 6px -2px rgba(0, 0, 0, 0.05)\n );\n background-color: #fff;\n background-color: var(--bucket-feedback-dialog-background-color, #fff);\n z-index: 2147410000;\n}\n\n.dialog:not(.modal) {\n margin: 0;\n margin: initial;\n top: auto;\n top: initial;\n right: auto;\n right: initial;\n left: auto;\n left: initial;\n bottom: auto;\n bottom: initial;\n }\n\n.arrow {\n position: absolute;\n width: 8px;\n height: 8px;\n background-color: #fff;\n background-color: var(--bucket-feedback-dialog-background-color, #fff);\n box-shadow: #d8d9df -1px -1px 1px 0px;\n box-shadow: var(--bucket-feedback-dialog-border, #d8d9df) -1px -1px 1px 0px;\n transform: rotate(45deg);\n}\n\n.arrow.bottom {\n box-shadow: #d8d9df -1px -1px 1px 0px;\n box-shadow: var(--bucket-feedback-dialog-border, #d8d9df) -1px -1px 1px 0px;\n }\n\n.arrow.top {\n box-shadow: #d8d9df 1px 1px 1px 0px;\n box-shadow: var(--bucket-feedback-dialog-border, #d8d9df) 1px 1px 1px 0px;\n }\n\n.arrow.left {\n box-shadow: #d8d9df 1px -1px 1px 0px;\n box-shadow: var(--bucket-feedback-dialog-border, #d8d9df) 1px -1px 1px 0px;\n }\n\n.arrow.right {\n box-shadow: #d8d9df -1px 1px 1px 0px;\n box-shadow: var(--bucket-feedback-dialog-border, #d8d9df) -1px 1px 1px 0px;\n }\n\n.close {\n position: absolute;\n top: 6px;\n right: 6px;\n\n width: 28px;\n height: 28px;\n\n padding: 0;\n margin: 0;\n background: none;\n border: none;\n\n cursor: pointer;\n\n display: flex;\n justify-content: center;\n align-items: center;\n\n color: #1e1f24;\n\n color: var(--bucket-feedback-dialog-color, #1e1f24);\n}\n\n.close svg {\n position: absolute;\n }\n\n.plug {\n font-size: 0.75em;\n text-align: center;\n margin-top: 7px;\n width: 100%;\n}\n\n.plug a {\n opacity: 0.5;\n color: #1e1f24;\n color: var(--bucket-feedback-dialog-color, #1e1f24);\n -webkit-text-decoration: none;\n text-decoration: none;\n\n transition: opacity 200ms;\n}\n\n.plug a:hover {\n opacity: 0.7;\n}\n\n/* Modal */\n\n.dialog.modal {\n margin: auto;\n margin-top: 4rem;\n}\n\n.dialog.modal[open] {\n animation: /* easeOutQuint */\n scale 200ms cubic-bezier(0.22, 1, 0.36, 1),\n fade 200ms cubic-bezier(0.22, 1, 0.36, 1);\n }\n\n.dialog.modal[open]::backdrop {\n animation: fade 200ms cubic-bezier(0.22, 1, 0.36, 1);\n }\n\n/* Anchored */\n\n.dialog.anchored {\n position: absolute;\n}\n\n.dialog.anchored[open] {\n animation: /* easeOutQuint */\n scale 200ms cubic-bezier(0.22, 1, 0.36, 1),\n fade 200ms cubic-bezier(0.22, 1, 0.36, 1);\n }\n\n.dialog.anchored.bottom {\n transform-origin: top center;\n }\n\n.dialog.anchored.top {\n transform-origin: bottom center;\n }\n\n.dialog.anchored.left {\n transform-origin: right center;\n }\n\n.dialog.anchored.right {\n transform-origin: left center;\n }\n\n/* Unanchored */\n\n.dialog.unanchored.unanchored-bottom-left[open],\n .dialog.unanchored.unanchored-bottom-right[open] {\n animation: /* easeOutQuint */\n floatUp 300ms cubic-bezier(0.22, 1, 0.36, 1),\n fade 300ms cubic-bezier(0.22, 1, 0.36, 1);\n }\n\n.dialog.unanchored.unanchored-top-left[open],\n .dialog.unanchored.unanchored-top-right[open] {\n animation: /* easeOutQuint */\n floatDown 300ms cubic-bezier(0.22, 1, 0.36, 1),\n fade 300ms cubic-bezier(0.22, 1, 0.36, 1);\n }\n",""]);const s=a},621:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(81),r=n.n(o),i=n(645),a=n.n(i)()(r());a.push([e.id,".container {\n overflow-y: hidden;\n transition: max-height 400ms cubic-bezier(0.65, 0, 0.35, 1);\n}\n\n.form {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 10px;\n overflow-y: hidden;\n max-height: 400px;\n transition: opacity 400ms cubic-bezier(0.65, 0, 0.35, 1);\n}\n\n.form-control {\n display: flex;\n flex-direction: column;\n width: 100%;\n gap: 8px;\n border: none;\n padding: 0;\n margin: 0;\n\n font-size: 12px;\n color: #787c91;\n color: var(--bucket-feedback-dialog-secondary-color, #787c91);\n}\n\n.form-expanded-content {\n width: 100%;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 10px;\n transition: opacity 400ms cubic-bezier(0.65, 0, 0.35, 1);\n\n opacity: 0;\n position: absolute;\n top: 0;\n left: 0;\n}\n\n.title {\n color: #1e1f24;\n color: var(--bucket-feedback-dialog-color, #1e1f24);\n font-size: 15px;\n font-weight: 400;\n line-height: 115%;\n text-wrap: balance;\n max-width: calc(100% - 20px);\n margin-bottom: 6px;\n line-height: 1.3;\n}\n\n.dimmed {\n opacity: 0.5;\n}\n\n.textarea {\n background-color: transparent;\n border: 1px solid;\n border-color: #d8d9df;\n border-color: var(--bucket-feedback-dialog-input-border-color, #d8d9df);\n padding: 0.5rem 0.75rem;\n border-radius: 6px;\n border-radius: var(--bucket-feedback-dialog-border-radius, 6px);\n transition: border-color 0.2s ease-in-out;\n font-family: InterVariable,\n Inter,\n system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif,\n Open Sans,\n sans-serif;\n font-family: var(\n --bucket-feedback-dialog-font-family,\n InterVariable,\n Inter,\n system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif,\n Open Sans,\n sans-serif\n );\n line-height: 1.3;\n resize: none;\n\n color: #1e1f24;\n\n color: var(--bucket-feedback-dialog-color, #1e1f24);\n font-size: 13px;\n}\n\n.textarea::-moz-placeholder {\n color: #1e1f24;\n color: var(--bucket-feedback-dialog-color, #1e1f24);\n opacity: 0.36;\n }\n\n.textarea::placeholder {\n color: #1e1f24;\n color: var(--bucket-feedback-dialog-color, #1e1f24);\n opacity: 0.36;\n }\n\n.textarea:focus {\n outline: none;\n border-color: #787c91;\n border-color: var(\n --bucket-feedback-dialog-input-focus-border-color,\n #787c91\n );\n }\n\n.score-status-container {\n position: relative;\n padding-bottom: 6px;\n height: 14px;\n}\n\n.score-status-container > .score-status {\n display: flex;\n align-items: center;\n\n position: absolute;\n top: 0;\n left: 0;\n\n opacity: 0;\n transition: opacity 200ms ease-in-out;\n }\n\n.error {\n margin: 0;\n color: #e53e3e;\n color: var(--bucket-feedback-dialog-error-color, #e53e3e);\n font-size: 0.8125em;\n font-weight: 500;\n}\n\n.submitted {\n display: flex;\n flex-direction: column;\n transition: opacity 400ms cubic-bezier(0.65, 0, 0.35, 1);\n\n position: absolute;\n top: 0;\n left: 0;\n opacity: 0;\n pointer-events: none;\n width: calc(100% - 56px);\n\n padding: 0px 28px;\n}\n\n.submitted .submitted-check {\n background: #fff;\n background: var(--bucket-feedback-dialog-submitted-check-color, #fff);\n color: #38a169;\n color: var(\n --bucket-feedback-dialog-submitted-check-background-color,\n #38a169\n );\n height: 24px;\n width: 24px;\n display: block;\n border-radius: 50%;\n flex-shrink: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n\n margin: 16px auto 8px;\n }\n\n.submitted .text {\n margin: auto auto 16px;\n text-align: center;\n color: #1e1f24;\n color: var(--bucket-feedback-dialog-color, #1e1f24);\n font-size: 1rem;\n font-size: var(--bucket-feedback-dialog-font-size, 1rem);\n font-weight: 400;\n line-height: 130%;\n\n flex-grow: 1;\n max-width: 160px;\n }\n\n.submitted > .plug {\n flex-grow: 0;\n }\n",""]);const s=a},341:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(81),r=n.n(o),i=n(645),a=n.n(i)()(r());a.push([e.id,"\n .radial-progress > circle {\n stroke: #1e1f24;\n stroke: var(--bucket-feedback-dialog-color, #1e1f24);\n opacity: 0.2;\n }\n",""]);const s=a},59:(e,t,n)=>{n.d(t,{Z:()=>s});var o=n(81),r=n.n(o),i=n(645),a=n.n(i)()(r());a.push([e.id,".star-rating {\n display: flex;\n flex-direction: column;\n}\n\n.star-rating-icons {\n display: flex;\n width: 0;\n}\n\n.star-rating-icons > input {\n border: 0px;\n clip: rect(0px, 0px, 0px, 0px);\n height: 1px;\n width: 1px;\n margin: -1px;\n padding: 0px;\n overflow: hidden;\n white-space: nowrap;\n position: absolute;\n }\n\n.star-rating-icons > .button {\n border: 1px solid;\n border-color: #d8d9df;\n border-color: var(--bucket-feedback-dialog-input-border-color, #d8d9df);\n\n padding: 0px 7px;\n }\n\n.star-rating-icons > .button:not(:first-of-type) {\n border-top-left-radius: 0;\n border-bottom-left-radius: 0;\n }\n\n.star-rating-icons > .button:not(:last-of-type) {\n border-top-right-radius: 0;\n border-bottom-right-radius: 0;\n margin-right: -1px;\n }\n\n.star-rating-icons > .button + .button-tooltip {\n pointer-events: none;\n opacity: 0;\n\n background: #000;\n\n background: var(--bucket-feedback-dialog-tooltip-background-color, #000);\n color: #fff;\n color: var(--bucket-feedback-dialog-tooltip-color, #fff);\n padding: 6px 8px;\n border-radius: 4px;\n font-size: 13px;\n }\n\n.star-rating-icons > .button:hover + .button-tooltip {\n opacity: 1;\n }\n\n.star-rating-icons > .button > svg {\n transition: transform 200ms ease-in-out;\n }\n\n.button-tooltip-arrow {\n position: absolute;\n width: 10px;\n height: 10px;\n background-color: #000;\n background-color: var(\n --bucket-feedback-dialog-tooltip-background-color,\n #000\n );\n transform: rotate(45deg);\n}\n",""]);const s=a},650:(e,t,n)=>{n.r(t),n.d(t,{default:()=>f});var o=n(81),r=n.n(o),i=n(645),a=n.n(i),s=n(268),c=n(622),d=n(621),l=n(341),u=n(59),p=a()(r());p.i(s.Z),p.i(c.Z),p.i(d.Z),p.i(l.Z),p.i(u.Z),p.push([e.id,"\n",""]);const f=p},645:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var n="",o=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),o&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),o&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n})).join("")},t.i=function(e,n,o,r,i){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(o)for(var s=0;s<this.length;s++){var c=this[s][0];null!=c&&(a[c]=!0)}for(var d=0;d<e.length;d++){var l=[].concat(e[d]);o&&a[l[0]]||(void 0!==i&&(void 0===l[5]||(l[1]="@layer".concat(l[5].length>0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=i),n&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=n):l[2]=n),r&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=r):l[4]="".concat(r)),t.push(l))}},t}},81:e=>{e.exports=function(e){return e[1]}},913:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SSE_REALTIME_HOST=t.TRACKING_HOST=void 0,t.TRACKING_HOST="https://tracking.bucket.co",t.SSE_REALTIME_HOST="https://livemessaging.bucket.co"},592:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.createDefaultFeedbackPromptHandler=void 0,t.createDefaultFeedbackPromptHandler=(e={})=>(t,n)=>{n.openFeedbackForm(e)}},250:function(e,t,n){var o=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};Object.defineProperty(t,"__esModule",{value:!0}),t.Button=void 0;const r=n(108);t.Button=e=>{var{variant:t="primary",children:n}=e,i=o(e,["variant","children"]);const a=["button",t].join(" ");return(0,r.h)("button",Object.assign({class:a},i),n)}},254:function(e,t,n){var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.FeedbackDialog=void 0;const i=n(108),a=n(718),s=n(330),c=n(564),d=n(11),l=n(436),u=n(545),p=n(891),f=r(n(650)),b=n(942);t.FeedbackDialog=({key:e,title:t=s.DEFAULT_TRANSLATIONS.DefaultQuestionLabel,position:n,translations:r=s.DEFAULT_TRANSLATIONS,openWithCommentVisible:h=!1,onClose:g,onDismiss:m,onSubmit:v,onScoreSubmit:y})=>{var k;const C=(0,a.useRef)(null),w="POPOVER"===n.type?n.anchor:null,{refs:x,floatingStyles:S,middlewareData:O,placement:I}=(0,l.useFloating)({elements:{reference:w},transform:!1,whileElementsMounted:l.autoUpdate,middleware:[(0,l.shift)(),(0,l.offset)(8),(0,l.arrow)({element:C})]});let j={};if("DIALOG"===n.type)switch(n.placement){case"top-left":j={top:"1rem",left:"1rem"};break;case"top-right":j={top:"1rem",right:"1rem"};break;case"bottom-left":j={bottom:"1rem",left:"1rem"};break;case"bottom-right":j={bottom:"1rem",right:"1rem"}}const{x:_,y:P}=null!==(k=O.arrow)&&void 0!==k?k:{},M={left:null!=_?`${_}px`:"",top:null!=P?`${P}px`:"",right:"",bottom:"",[{top:"bottom",right:"left",bottom:"top",left:"right"}[I.split("-")[0]]||"bottom"]:"-4px"},L=(0,a.useCallback)((()=>{const e=x.floating.current;null==e||e.close(),Z.stop(),null==g||g()}),[g]),D=(0,a.useCallback)((()=>{L(),null==m||m()}),[L,m]),[E,F]=(0,a.useState)(void 0),[R,T]=(0,a.useState)("idle"),A=(0,a.useCallback)((e=>o(void 0,void 0,void 0,(function*(){yield v(Object.assign(Object.assign({},e),{feedbackId:E})),Z.startWithDuration(3e3)}))),[E,v]),N=(0,a.useCallback)((e=>o(void 0,void 0,void 0,(function*(){if(void 0!==y){T("submitting");const t=yield y(Object.assign(Object.assign({},e),{feedbackId:E}));F(t.feedbackId),T("submitted")}}))),[E,v]),Z=(0,c.useTimer)({enabled:"DIALOG"===n.type,initialDuration:2e4,onEnd:L});return(0,a.useEffect)((()=>{if("MODAL"===n.type||"DIALOG"===n.type)return;const e=e=>{"Escape"==e.key&&D()},t=e=>{e.target instanceof Element&&e.target.closest(`#${u.feedbackContainerId}`)||D()},o=new MutationObserver((e=>{null!==n.anchor&&e.forEach((e=>{Array.from(e.removedNodes).some((e=>e===n.anchor||e.contains(n.anchor)))&&L()}))}));return window.addEventListener("mousedown",t),window.addEventListener("keydown",e),o.observe(document.body,{subtree:!0,childList:!0}),()=>{window.removeEventListener("mousedown",t),window.removeEventListener("keydown",e),o.disconnect()}}),[n.type,L]),(0,i.h)(i.Fragment,null,(0,i.h)("style",{dangerouslySetInnerHTML:{__html:f.default}}),(0,i.h)("dialog",{ref:x.setFloating,class:["dialog","MODAL"===n.type?"modal":"POPOVER"===n.type?"anchored":`unanchored unanchored-${n.placement}`,I].join(" "),style:w?S:j},(0,i.h)(p.FeedbackForm,{t:Object.assign(Object.assign({},s.DEFAULT_TRANSLATIONS),r),key:e,question:t,openWithCommentVisible:h,onSubmit:A,onScoreSubmit:N,scoreState:R,onInteraction:Z.stop}),(0,i.h)("button",{onClick:D,class:"close"},!Z.stopped&&Z.elapsedFraction>0&&(0,i.h)(b.RadialProgress,{diameter:28,progress:1-Z.elapsedFraction}),(0,i.h)(d.Close,null)),w&&(0,i.h)("div",{ref:C,class:["arrow",I].join(" "),style:M})))}},891:function(e,t,n){var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.FeedbackForm=void 0;const r=n(108),i=n(718),a=n(529),s=n(620),c=n(250),d=n(75),l=n(643);t.FeedbackForm=({question:e,scoreState:t,openWithCommentVisible:n,onInteraction:a,onSubmit:p,onScoreSubmit:f,t:b})=>{const[h,g]=(0,i.useState)(!1),[m,v]=(0,i.useState)("idle"),[y,k]=(0,i.useState)(),[C,w]=(0,i.useState)(!0),x=(0,i.useRef)(null),S=(0,i.useRef)(null),O=(0,i.useRef)(null),I=(0,i.useRef)(null),j=(0,i.useRef)(null),_=(0,i.useCallback)((()=>{null!==x.current&&null!==O.current&&null!==I.current&&(x.current.style.maxHeight=O.current.clientHeight+"px",I.current.style.position="absolute",I.current.style.opacity="0",I.current.style.pointerEvents="none")}),[x,O,I]),P=(0,i.useCallback)((()=>{null!==x.current&&null!==O.current&&null!==I.current&&(x.current.style.maxHeight=O.current.clientHeight+I.current.clientHeight+10+"px",I.current.style.position="relative",I.current.style.opacity="1",I.current.style.pointerEvents="all")}),[x,O,I]),M=(0,i.useCallback)((()=>{null!==x.current&&null!==S.current&&null!==j.current&&(S.current.style.opacity="0",S.current.style.pointerEvents="none",x.current.style.maxHeight=j.current.clientHeight+"px",setTimeout((()=>{j.current.style.position="relative",j.current.style.opacity="1",j.current.style.pointerEvents="all",w(!1)}),410))}),[S,x,j]);return(0,i.useEffect)((()=>{"submitted"===m?M():n||h?P():_()}),[_,P,M,n,h,m]),(0,r.h)("div",{ref:x,class:"container"},(0,r.h)("div",{ref:j,class:"submitted"},(0,r.h)("div",{className:"submitted-check"},(0,r.h)(s.CheckCircle,{width:24,height:24})),(0,r.h)("p",{className:"text"},b.SuccessMessage),(0,r.h)(d.Plug,null)),C&&(0,r.h)("form",{ref:S,onSubmit:t=>o(void 0,void 0,void 0,(function*(){t.preventDefault();const n=Object.assign(Object.assign({},function(e){var t,n;const o=new FormData(e);return{score:Number(null===(t=o.get("score"))||void 0===t?void 0:t.toString()),comment:((null===(n=o.get("comment"))||void 0===n?void 0:n.toString())||"").trim()}}(t.target)),{question:e});if(n.score){k("");try{v("submitting"),yield p(n),v("submitted")}catch(e){v("idle"),e instanceof Error?k(e.message):k("string"==typeof e?e:"Couldn't submit feedback. Please try again.")}}})),method:"dialog",class:"form",onFocus:a,onFocusCapture:a,onClick:a,style:{opacity:1}},(0,r.h)("div",{ref:O,role:"group",class:"form-control","aria-labelledby":"bucket-feedback-score-label"},(0,r.h)("div",{id:"bucket-feedback-score-label",class:"title"},e),(0,r.h)(l.StarRating,{t:b,name:"score",onChange:t=>o(void 0,void 0,void 0,(function*(){g(!0),yield f({question:e,score:Number(t.currentTarget.value)})}))}),(0,r.h)(u,{t:b,scoreState:t})),(0,r.h)("div",{ref:I,class:"form-expanded-content"},(0,r.h)("div",{class:"form-control"},(0,r.h)("textarea",{id:"bucket-feedback-comment-label",class:"textarea",name:"comment",placeholder:b.QuestionPlaceholder,rows:4})),y&&(0,r.h)("p",{class:"error"},y),(0,r.h)(c.Button,{type:"submit",disabled:!h||"submitting"===m||"submitting"===t},b.SendButton),(0,r.h)(d.Plug,null))))};const u=({t:e,scoreState:t})=>{const[n,o]=(0,i.useState)(!1),[s,c]=(0,i.useState)(!1);(0,i.useEffect)((()=>{if("idle"===t)return void o(!1);if("submitted"===t)return o(!1),void c(!0);const e=setTimeout((()=>{o(!0)}),400);return()=>clearTimeout(e)}),[t]);const d="idle"===t||"submitting"===t&&!s&&!n,l="submitted"!==t&&!s&&n,u="submitted"===t||s;return(0,r.h)("div",{className:"score-status-container"},(0,r.h)("span",{className:"score-status",style:{opacity:d?1:0}},e.ScoreStatusDescription),(0,r.h)("div",{className:"score-status",style:{opacity:l?1:0}},e.ScoreStatusLoading),(0,r.h)("span",{className:"score-status",style:{opacity:u?1:0}},(0,r.h)(a.Check,{width:14,height:14,style:{marginRight:3}})," ",e.ScoreStatusReceived))}},75:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Plug=void 0;const o=n(108),r=n(655);t.Plug=()=>(0,o.h)("footer",{class:"plug"},(0,o.h)("a",{href:"https://bucket.co",target:"_blank"},"Powered by ",(0,o.h)(r.Logo,null)," Bucket"))},942:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.RadialProgress=void 0;const o=n(108);t.RadialProgress=({diameter:e,progress:t})=>{const n=e/2-2,r=2*Math.PI*n,i=r*t;return(0,o.h)("svg",{className:"radial-progress",width:e,height:e},(0,o.h)("circle",{fill:"transparent",cx:n+2,cy:n+2,r:n,"stroke-width":2,"stroke-dasharray":r,"stroke-dashoffset":i,transform:`rotate(-90) translate(-${2*n+4} 0)`}))}},643:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StarRating=void 0;const o=n(108),r=n(718),i=n(421),a=n(671),s=n(60),c=n(873),d=n(514),l=n(436),u=[{color:"var(--bucket-feedback-dialog-rating-1-color, #dd6b20)",bg:"var(--bucket-feedback-dialog-rating-1-background-color, #fbd38d)",icon:(0,o.h)(c.VeryDissatisfied,null),getLabel:e=>e.ScoreVeryDissatisfiedLabel,value:1},{color:"var(--bucket-feedback-dialog-rating-2-color, #ed8936)",bg:"var(--bucket-feedback-dialog-rating-2-background-color, #feebc8)",icon:(0,o.h)(i.Dissatisfied,null),getLabel:e=>e.ScoreDissatisfiedLabel,value:2},{color:"var(--bucket-feedback-dialog-rating-3-color, #787c91)",bg:"var(--bucket-feedback-dialog-rating-3-background-color, #e9e9ed)",icon:(0,o.h)(a.Neutral,null),getLabel:e=>e.ScoreNeutralLabel,value:3},{color:"var(--bucket-feedback-dialog-rating-4-color, #48bb78)",bg:"var(--bucket-feedback-dialog-rating-4-background-color, #c6f6d5)",icon:(0,o.h)(s.Satisfied,null),getLabel:e=>e.ScoreSatisfiedLabel,value:4},{color:"var(--bucket-feedback-dialog-rating-5-color, #38a169)",bg:"var(--bucket-feedback-dialog-rating-5-background-color, #9ae6b4)",icon:(0,o.h)(d.VerySatisfied,null),getLabel:e=>e.ScoreVerySatisfiedLabel,value:5}];t.StarRating=({t:e,name:t,selectedValue:n,onChange:r})=>(0,o.h)("div",{class:"star-rating"},(0,o.h)("style",null,u.map((({bg:e,color:t},n)=>`\n .star-rating-icons > input:nth-of-type(${n+1}):checked + .button {\n border-color: ${t};\n }\n\n .star-rating-icons > input:nth-of-type(${n+1}):checked + .button > div {\n background-color: ${e};\n }\n\n .star-rating-icons > input:nth-of-type(${n+1}):checked ~ input:nth-of-type(${n+2}) + .button {\n border-left-color: ${t};\n }\n `))),(0,o.h)("div",{class:"star-rating-icons"},u.map((i=>(0,o.h)(p,{isSelected:i.value===n,name:t,onChange:r,score:i,t:e})))));const p=({isSelected:e,name:t,onChange:n,score:i,t:a})=>{var s,c;const d=(0,r.useRef)(null),{refs:u,floatingStyles:p,middlewareData:f}=(0,l.useFloating)({placement:"top",middleware:[(0,l.offset)(4),(0,l.arrow)({element:d})]});return(0,o.h)(o.Fragment,null,(0,o.h)("input",{id:`bucket-feedback-score-${i.value}`,type:"radio",name:t,value:i.value,defaultChecked:e,onChange:n}),(0,o.h)("label",{ref:u.setReference,for:`bucket-feedback-score-${i.value}`,class:"button",style:{color:i.color},"aria-label":i.getLabel(a)},(0,o.h)("div",{style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",opacity:.2,zIndex:1}}),(0,o.h)("span",{style:{zIndex:2,display:"flex",alignItems:"center"}},i.icon)),(0,o.h)("div",{ref:u.setFloating,class:"button-tooltip",style:p},i.getLabel(a),(0,o.h)("div",{ref:d,class:"button-tooltip-arrow",style:{left:null!=(null===(s=f.arrow)||void 0===s?void 0:s.x)?`${f.arrow.x}px`:"",top:null!=(null===(c=f.arrow)||void 0===c?void 0:c.y)?`${f.arrow.y}px`:""}})))}},330:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_TRANSLATIONS=void 0,t.DEFAULT_TRANSLATIONS={DefaultQuestionLabel:"How satisfied are you with this feature?",QuestionPlaceholder:"Write a comment",ScoreStatusDescription:"Pick a score and leave a comment",ScoreStatusLoading:"Saving score, please wait...",ScoreStatusReceived:"Score has been received!",ScoreVeryDissatisfiedLabel:"Very dissatisfied (1/5)",ScoreDissatisfiedLabel:"Dissatisfied (2/5)",ScoreNeutralLabel:"Neutral (3/5)",ScoreSatisfiedLabel:"Satisfied (4/5)",ScoreVerySatisfiedLabel:"Very satisfied (5/5)",SuccessMessage:"Feedback received, thank you!",SendButton:"Send feedback"}},545:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.propagatedEvents=t.feedbackContainerId=void 0,t.feedbackContainerId="bucket-feedback-dialog-container",t.propagatedEvents=["animationcancel","animationend","animationiteration","animationstart","afterscriptexecute","auxclick","beforescriptexecute","blur","click","compositionend","compositionstart","compositionupdate","contextmenu","copy","cut","dblclick","DOMActivate","DOMMouseScroll","error","focusin","focusout","focus","fullscreenchange","fullscreenerror","gesturechange","gestureend","gesturestart","gotpointercapture","keydown","keypress","keyup","lostpointercapture","mousedown","mouseenter","mouseleave","mousemove","mouseout","mouseover","mouseup","mousewheel","paste","pointercancel","pointerdown","pointerenter","pointerleave","pointermove","pointerout","pointerover","pointerup","scroll","select","touchcancel","touchend","touchmove","touchstart","transitioncancel","transitionend","transitionrun","transitionstart","wheel"]},564:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useTimer=void 0;const o=n(718);t.useTimer=({initialDuration:e,enabled:t,onEnd:n})=>{const[r,i]=(0,o.useState)(!t),[a,s]=(0,o.useState)(e),[c,d]=(0,o.useState)(Date.now()),[l,u]=(0,o.useState)(Date.now());(0,o.useEffect)((()=>{if(r)return;const e=setInterval((()=>{u(Date.now()),Date.now()>=c+a&&(clearTimeout(e),i(!0),n())}),25);return()=>{clearTimeout(e)}}),[r]);const p=(0,o.useCallback)((()=>{i(!0)}),[]),f=(0,o.useCallback)((e=>{d(Date.now()),s(e),i(!1)}),[]);return{duration:a,elapsedFraction:(r?0:l-c)/a,startTime:c,endTime:c+a,stopped:r,startWithDuration:f,stop:p}}},529:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Check=void 0;const o=n(108);t.Check=e=>(0,o.h)("svg",Object.assign({height:"24px",width:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,o.h)("path",{fill:"currentColor",d:"m10 15.17l9.193-9.191l1.414 1.414l-10.606 10.606l-6.364-6.364l1.414-1.414l4.95 4.95Z"}))},620:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CheckCircle=void 0;const o=n(108);t.CheckCircle=e=>(0,o.h)("svg",Object.assign({width:"24px",height:"24px",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},e),(0,o.h)("path",{fill:"currentColor",d:"M12 24C5.3724 24 0 18.6276 0 12C0 5.3724 5.3724 0 12 0C18.6276 0 24 5.3724 24 12C24 18.6276 18.6276 24 12 24ZM10.8036 16.8L19.2876 8.3148L17.5908 6.618L10.8036 13.4064L7.4088 10.0116L5.712 11.7084L10.8036 16.8Z"}))},11:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Close=void 0;const o=n(108);t.Close=e=>(0,o.h)("svg",Object.assign({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,o.h)("path",{d:"M12.0007 10.5865L16.9504 5.63672L18.3646 7.05093L13.4149 12.0007L18.3646 16.9504L16.9504 18.3646L12.0007 13.4149L7.05093 18.3646L5.63672 16.9504L10.5865 12.0007L5.63672 7.05093L7.05093 5.63672L12.0007 10.5865Z",fill:"currentColor"}))},421:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Dissatisfied=void 0;const o=n(108);t.Dissatisfied=e=>(0,o.h)("svg",Object.assign({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,o.h)("path",{d:"M12 22C6.477 22 2 17.523 2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 17.523 17.523 22 12 22ZM12 20C14.1217 20 16.1566 19.1571 17.6569 17.6569C19.1571 16.1566 20 14.1217 20 12C20 9.87827 19.1571 7.84344 17.6569 6.34315C16.1566 4.84285 14.1217 4 12 4C9.87827 4 7.84344 4.84285 6.34315 6.34315C4.84285 7.84344 4 9.87827 4 12C4 14.1217 4.84285 16.1566 6.34315 17.6569C7.84344 19.1571 9.87827 20 12 20Z",fill:"currentColor"}),(0,o.h)("path",{d:"M12 15C13.1835 15 14.2712 15.4113 15.1279 16.0991C15.4665 16.3709 15.4398 16.8738 15.1187 17.166C14.8962 17.3685 14.5788 17.4225 14.2915 17.3332C13.605 17.1198 12.8259 17 12 17C11.1741 17 10.3949 17.1205 9.70841 17.3331C9.42116 17.422 9.104 17.3677 8.88161 17.1653C8.56025 16.8728 8.53318 16.3695 8.87206 16.0976C9.2087 15.8274 9.57986 15.6014 9.97666 15.426C10.6139 15.1442 11.3032 14.9991 12 15ZM8.5 10C8.89783 10 9.27936 10.158 9.56066 10.4393C9.84197 10.7206 10 11.1022 10 11.5C10 11.8978 9.84197 12.2794 9.56066 12.5607C9.27936 12.842 8.89783 13 8.5 13C8.10218 13 7.72065 12.842 7.43934 12.5607C7.15804 12.2794 7 11.8978 7 11.5C7 11.1022 7.15804 10.7206 7.43934 10.4393C7.72065 10.158 8.10218 10 8.5 10ZM15.5 10C15.8978 10 16.2794 10.158 16.5607 10.4393C16.842 10.7206 17 11.1022 17 11.5C17 11.8978 16.842 12.2794 16.5607 12.5607C16.2794 12.842 15.8978 13 15.5 13C15.1022 13 14.7206 12.842 14.4393 12.5607C14.158 12.2794 14 11.8978 14 11.5C14 11.1022 14.158 10.7206 14.4393 10.4393C14.7206 10.158 15.1022 10 15.5 10Z",fill:"currentColor"}))},655:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Logo=void 0;const o=n(108);t.Logo=e=>(0,o.h)("svg",Object.assign({width:"10px",height:"10px",viewBox:"0 0 300 316",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,o.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M149.608 33.1691C114.541 33.1691 88.1957 34.0727 68.6978 35.2674C45.9877 36.6589 31.2447 53.6165 32.7413 77.1477C33.9788 96.6049 36.0938 122.855 39.6451 157.89C44.0755 201.599 48.0467 231.615 51.1923 251.815C53.8983 269.193 66.5685 280.724 83.8252 281.651C99.4409 282.49 120.822 283.137 149.608 283.137C178.991 283.137 200.659 282.463 216.355 281.599C232.793 280.694 244.886 269.593 247.467 252.738C249.007 242.679 250.794 230.104 252.816 214.471C254.076 204.729 255.427 193.799 256.866 181.551C257.741 174.108 258.648 166.178 259.588 157.731C263.785 119.994 266.075 92.6244 267.274 72.9772C268.564 51.838 255.492 36.9197 234.632 35.5304C214.779 34.208 187.208 33.1691 149.608 33.1691ZM66.7035 2.65939C86.9741 1.41736 113.994 0.5 149.608 0.5C187.792 0.5 216.098 1.55452 236.8 2.93336C275.829 5.53288 302.222 36.1432 299.852 74.9692C298.613 95.2768 296.268 123.202 292.026 161.346C287.025 206.312 282.898 236.995 279.729 257.688C274.896 289.249 250.57 312.434 218.147 314.218C201.752 315.121 179.476 315.806 149.608 315.806C120.346 315.806 98.3726 315.149 82.0761 314.273C49.1273 312.503 23.9794 289.192 18.9427 256.846C15.6873 235.941 11.6471 205.329 7.17277 161.187C3.58873 125.829 1.43655 99.164 0.168272 79.2232C-2.42412 38.4637 25.1723 5.20409 66.7035 2.65939Z",fill:"currentColor"}),(0,o.h)("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M150.869 165.962C150.29 165.209 149.718 164.45 149.156 163.684C144.318 157.097 140.113 150.016 136.63 142.531C132.143 132.889 136.224 124.122 143.367 120.398C151.531 116.142 162.346 120.398 166.226 128.738C169.442 135.653 173.494 142.1 178.25 147.949C193.08 166.186 214.765 178.615 239.375 181.302C242.678 181.662 246.035 181.848 249.434 181.848C251.936 181.848 254.415 181.747 256.866 181.551C260.357 181.848 256.071 214.471 252.816 214.471C251.692 214.501 250.565 214.517 249.434 214.517C245.891 214.517 242.383 214.368 238.915 214.078C203.102 211.075 171.603 192.885 150.869 165.962Z",fill:"currentColor"}))},671:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Neutral=void 0;const o=n(108);t.Neutral=e=>(0,o.h)("svg",Object.assign({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,o.h)("path",{d:"M12 22C6.477 22 2 17.523 2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 17.523 17.523 22 12 22ZM12 20C14.1217 20 16.1566 19.1571 17.6569 17.6569C19.1571 16.1566 20 14.1217 20 12C20 9.87827 19.1571 7.84344 17.6569 6.34315C16.1566 4.84285 14.1217 4 12 4C9.87827 4 7.84344 4.84285 6.34315 6.34315C4.84285 7.84344 4 9.87827 4 12C4 14.1217 4.84285 16.1566 6.34315 17.6569C7.84344 19.1571 9.87827 20 12 20ZM8 15C8 14.4477 8.44771 14 9 14H15C15.5523 14 16 14.4477 16 15V15C16 15.5523 15.5523 16 15 16H9C8.44771 16 8 15.5523 8 15V15ZM8 11C7.60217 11 7.22064 10.842 6.93934 10.5607C6.65803 10.2794 6.5 9.89782 6.5 9.5C6.5 9.10217 6.65803 8.72064 6.93934 8.43934C7.22064 8.15803 7.60217 8 8 8C8.39782 8 8.77935 8.15803 9.06066 8.43934C9.34196 8.72064 9.5 9.10217 9.5 9.5C9.5 9.89782 9.34196 10.2794 9.06066 10.5607C8.77935 10.842 8.39782 11 8 11ZM16 11C15.6022 11 15.2206 10.842 14.9393 10.5607C14.658 10.2794 14.5 9.89782 14.5 9.5C14.5 9.10217 14.658 8.72064 14.9393 8.43934C15.2206 8.15803 15.6022 8 16 8C16.3978 8 16.7794 8.15803 17.0607 8.43934C17.342 8.72064 17.5 9.10217 17.5 9.5C17.5 9.89782 17.342 10.2794 17.0607 10.5607C16.7794 10.842 16.3978 11 16 11Z",fill:"currentColor"}))},60:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Satisfied=void 0;const o=n(108);t.Satisfied=e=>(0,o.h)("svg",Object.assign({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,o.h)("path",{d:"M12 22C6.477 22 2 17.523 2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 17.523 17.523 22 12 22ZM12 20C14.1217 20 16.1566 19.1571 17.6569 17.6569C19.1571 16.1566 20 14.1217 20 12C20 9.87827 19.1571 7.84344 17.6569 6.34315C16.1566 4.84285 14.1217 4 12 4C9.87827 4 7.84344 4.84285 6.34315 6.34315C4.84285 7.84344 4 9.87827 4 12C4 14.1217 4.84285 16.1566 6.34315 17.6569C7.84344 19.1571 9.87827 20 12 20ZM8 11C7.60217 11 7.22064 10.842 6.93934 10.5607C6.65803 10.2794 6.5 9.89782 6.5 9.5C6.5 9.10217 6.65803 8.72064 6.93934 8.43934C7.22064 8.15803 7.60217 8 8 8C8.39782 8 8.77935 8.15803 9.06066 8.43934C9.34196 8.72064 9.5 9.10217 9.5 9.5C9.5 9.89782 9.34196 10.2794 9.06066 10.5607C8.77935 10.842 8.39782 11 8 11ZM16 11C15.6022 11 15.2206 10.842 14.9393 10.5607C14.658 10.2794 14.5 9.89782 14.5 9.5C14.5 9.10217 14.658 8.72064 14.9393 8.43934C15.2206 8.15803 15.6022 8 16 8C16.3978 8 16.7794 8.15803 17.0607 8.43934C17.342 8.72064 17.5 9.10217 17.5 9.5C17.5 9.89782 17.342 10.2794 17.0607 10.5607C16.7794 10.842 16.3978 11 16 11Z",fill:"currentColor"}),(0,o.h)("path",{d:"M7.79862 15.4322C8.85269 16.5065 10.4964 17.4971 11.9993 17.4971C13.5011 17.4971 15.1701 16.5079 16.2097 15.4351C16.5083 15.1269 16.4581 14.6416 16.1408 14.3528C15.9042 14.1375 15.5656 14.0777 15.2972 14.2517C14.5161 14.7578 13.4271 15.7002 11.9993 15.7002C10.5688 15.7002 9.47831 14.7549 8.69694 14.2486C8.43116 14.0764 8.09564 14.1353 7.86141 14.3485C7.5435 14.6378 7.49757 15.1254 7.79862 15.4322Z",fill:"currentColor"}))},873:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VeryDissatisfied=void 0;const o=n(108);t.VeryDissatisfied=e=>(0,o.h)("svg",Object.assign({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,o.h)("path",{d:"M12 22C6.477 22 2 17.523 2 12C2 6.477 6.477 2 12 2C17.523 2 22 6.477 22 12C22 17.523 17.523 22 12 22ZM12 20C14.1217 20 16.1566 19.1571 17.6569 17.6569C19.1571 16.1566 20 14.1217 20 12C20 9.87827 19.1571 7.84344 17.6569 6.34315C16.1566 4.84285 14.1217 4 12 4C9.87827 4 7.84344 4.84285 6.34315 6.34315C4.84285 7.84344 4 9.87827 4 12C4 14.1217 4.84285 16.1566 6.34315 17.6569C7.84344 19.1571 9.87827 20 12 20ZM8 17C7.44771 17 6.98992 16.5479 7.09965 16.0066C7.29346 15.0506 7.76447 14.1645 8.46447 13.4645C9.40215 12.5268 10.6739 12 12 12C13.3261 12 14.5979 12.5268 15.5355 13.4645C16.2355 14.1645 16.7065 15.0506 16.9003 16.0066C17.0101 16.5479 16.5523 17 16 17V17C15.4477 17 15.0156 16.5403 14.8349 16.0184C14.6877 15.5934 14.4454 15.2028 14.1213 14.8787C13.5587 14.3161 12.7956 14 12 14C11.2043 14 10.4413 14.3161 9.87868 14.8787C9.55459 15.2028 9.31232 15.5934 9.16513 16.0184C8.98442 16.5403 8.55228 17 8 17V17ZM8 11C7.60217 11 7.22064 10.842 6.93934 10.5607C6.65803 10.2794 6.5 9.89782 6.5 9.5C6.5 9.10217 6.65803 8.72064 6.93934 8.43934C7.22064 8.15803 7.60217 8 8 8C8.39782 8 8.77935 8.15803 9.06066 8.43934C9.34196 8.72064 9.5 9.10217 9.5 9.5C9.5 9.89782 9.34196 10.2794 9.06066 10.5607C8.77935 10.842 8.39782 11 8 11ZM16 11C15.6022 11 15.2206 10.842 14.9393 10.5607C14.658 10.2794 14.5 9.89782 14.5 9.5C14.5 9.10217 14.658 8.72064 14.9393 8.43934C15.2206 8.15803 15.6022 8 16 8C16.3978 8 16.7794 8.15803 17.0607 8.43934C17.342 8.72064 17.5 9.10217 17.5 9.5C17.5 9.89782 17.342 10.2794 17.0607 10.5607C16.7794 10.842 16.3978 11 16 11Z",fill:"currentColor"}))},514:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.VerySatisfied=void 0;const o=n(108);t.VerySatisfied=e=>(0,o.h)("svg",Object.assign({width:"22",height:"22",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e),(0,o.h)("path",{d:"M12 2C17.523 2 22 6.477 22 12C22 17.523 17.523 22 12 22C6.477 22 2 17.523 2 12C2 6.477 6.477 2 12 2ZM12 4C9.87827 4 7.84344 4.84285 6.34315 6.34315C4.84285 7.84344 4 9.87827 4 12C4 14.1217 4.84285 16.1566 6.34315 17.6569C7.84344 19.1571 9.87827 20 12 20C14.1217 20 16.1566 19.1571 17.6569 17.6569C19.1571 16.1566 20 14.1217 20 12C20 9.87827 19.1571 7.84344 17.6569 6.34315C16.1566 4.84285 14.1217 4 12 4ZM12 12C14 12 15.667 12.333 17 13C17 14.3261 16.4732 15.5979 15.5355 16.5355C14.5979 17.4732 13.3261 18 12 18C10.6739 18 9.40215 17.4732 8.46447 16.5355C7.52678 15.5979 7 14.3261 7 13C8.333 12.333 10 12 12 12ZM8.5 7C9.07633 6.99988 9.63499 7.19889 10.0815 7.56335C10.5279 7.9278 10.8347 8.43532 10.95 9H6.05C6.16526 8.43532 6.47209 7.9278 6.91855 7.56335C7.36501 7.19889 7.92367 6.99988 8.5 7ZM15.5 7C16.0763 6.99988 16.635 7.19889 17.0814 7.56335C17.5279 7.9278 17.8347 8.43532 17.95 9H13.05C13.1653 8.43532 13.4721 7.9278 13.9185 7.56335C14.365 7.19889 14.9237 6.99988 15.5 7Z",fill:"currentColor"}))},495:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.openFeedbackForm=void 0;const o=n(108),r=n(545),i=n(254),a={type:"DIALOG",placement:"bottom-right"};function s(e){e.stopPropagation()}t.openFeedbackForm=function(e){const t=function(){let e=document.querySelector(`#${r.feedbackContainerId}`);if(!e){e=document.createElement("div"),e.attachShadow({mode:"open"}),e.style.all="initial",e.id=r.feedbackContainerId,document.body.appendChild(e);for(const t of r.propagatedEvents)e.addEventListener(t,s)}return e.shadowRoot}(),n=e.position||a;if("POPOVER"===n.type){if(!n.anchor)return void console.warn("[Bucket]","Unable to open popover. Anchor must be a defined DOM-element");if(!document.body.contains(n.anchor))return void console.warn("[Bucket]","Unable to open popover. Anchor must be an attached DOM-element")}(0,o.render)((0,o.h)(i.FeedbackDialog,Object.assign(Object.assign({},e),{position:n})),t);const c=t.querySelector("dialog");c&&!c.hasAttribute("open")&&c["MODAL"===n.type?"showModal":"show"]()}},128:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.arrow=void 0;const o=n(882);t.arrow=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(i=n,{}.hasOwnProperty.call(i,"current"))?null!=n.current?(0,o.arrow)({element:n.current,padding:r}).fn(t):{}:n?(0,o.arrow)({element:n,padding:r}).fn(t):{};var i}})},436:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.size=t.shift=t.platform=t.offset=t.limitShift=t.inline=t.hide=t.getOverflowAncestors=t.flip=t.detectOverflow=t.computePosition=t.autoUpdate=t.autoPlacement=t.useFloating=t.arrow=void 0;var o=n(128);Object.defineProperty(t,"arrow",{enumerable:!0,get:function(){return o.arrow}});var r=n(610);Object.defineProperty(t,"useFloating",{enumerable:!0,get:function(){return r.useFloating}});var i=n(882);Object.defineProperty(t,"autoPlacement",{enumerable:!0,get:function(){return i.autoPlacement}}),Object.defineProperty(t,"autoUpdate",{enumerable:!0,get:function(){return i.autoUpdate}}),Object.defineProperty(t,"computePosition",{enumerable:!0,get:function(){return i.computePosition}}),Object.defineProperty(t,"detectOverflow",{enumerable:!0,get:function(){return i.detectOverflow}}),Object.defineProperty(t,"flip",{enumerable:!0,get:function(){return i.flip}}),Object.defineProperty(t,"getOverflowAncestors",{enumerable:!0,get:function(){return i.getOverflowAncestors}}),Object.defineProperty(t,"hide",{enumerable:!0,get:function(){return i.hide}}),Object.defineProperty(t,"inline",{enumerable:!0,get:function(){return i.inline}}),Object.defineProperty(t,"limitShift",{enumerable:!0,get:function(){return i.limitShift}}),Object.defineProperty(t,"offset",{enumerable:!0,get:function(){return i.offset}}),Object.defineProperty(t,"platform",{enumerable:!0,get:function(){return i.platform}}),Object.defineProperty(t,"shift",{enumerable:!0,get:function(){return i.shift}}),Object.defineProperty(t,"size",{enumerable:!0,get:function(){return i.size}})},610:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useFloating=void 0;const o=n(882),r=n(718),i=n(41),a=n(686),s=n(874),c=n(23);t.useFloating=function(e={}){const{placement:t="bottom",strategy:n="absolute",middleware:d=[],platform:l,elements:{reference:u,floating:p}={},transform:f=!0,whileElementsMounted:b,open:h}=e,[g,m]=(0,r.useState)({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[v,y]=(0,r.useState)(d);(0,i.deepEqual)(v,d)||y(d);const[k,C]=(0,r.useState)(null),[w,x]=(0,r.useState)(null),S=(0,r.useCallback)((e=>{e!=_.current&&(_.current=e,C(e))}),[C]),O=(0,r.useCallback)((e=>{e!==P.current&&(P.current=e,x(e))}),[x]),I=u||k,j=p||w,_=(0,r.useRef)(null),P=(0,r.useRef)(null),M=(0,r.useRef)(g),L=(0,c.useLatestRef)(b),D=(0,c.useLatestRef)(l),E=(0,r.useCallback)((()=>{if(!_.current||!P.current)return;const e={placement:t,strategy:n,middleware:v};D.current&&(e.platform=D.current),(0,o.computePosition)(_.current,P.current,e).then((e=>{const t=Object.assign(Object.assign({},e),{isPositioned:!0});F.current&&!(0,i.deepEqual)(M.current,t)&&(M.current=t,m(t))}))}),[v,t,n,D]);(0,r.useLayoutEffect)((()=>{!1===h&&M.current.isPositioned&&(M.current.isPositioned=!1,m((e=>Object.assign(Object.assign({},e),{isPositioned:!1}))))}),[h]);const F=(0,r.useRef)(!1);(0,r.useLayoutEffect)((()=>(F.current=!0,()=>{F.current=!1})),[]),(0,r.useLayoutEffect)((()=>{if(I&&(_.current=I),j&&(P.current=j),I&&j)return L.current?L.current(I,j,E):E()}),[I,j,E,L]);const R=(0,r.useMemo)((()=>({reference:_,floating:P,setReference:S,setFloating:O})),[S,O]),T=(0,r.useMemo)((()=>({reference:I,floating:j})),[I,j]),A=(0,r.useMemo)((()=>{const e={position:n,left:0,top:0};if(!T.floating)return e;const t=(0,s.roundByDPR)(T.floating,g.x),o=(0,s.roundByDPR)(T.floating,g.y);return f?Object.assign(Object.assign(Object.assign({},e),{transform:`translate(${t}px, ${o}px)`}),(0,a.getDPR)(T.floating)>=1.5&&{willChange:"transform"}):{position:n,left:t,top:o}}),[n,f,T.floating,g.x,g.y]);return(0,r.useMemo)((()=>Object.assign(Object.assign({},g),{update:E,refs:R,elements:T,floatingStyles:A})),[g,E,R,T,A])}},41:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.deepEqual=void 0,t.deepEqual=function e(t,n){if(t===n)return!0;if(typeof t!=typeof n)return!1;if("function"==typeof t&&t.toString()===n.toString())return!0;let o,r,i;if(t&&n&&"object"==typeof t){if(Array.isArray(t)){if(o=t.length,o!=n.length)return!1;for(r=o;0!=r--;)if(!e(t[r],n[r]))return!1;return!0}if(i=Object.keys(t),o=i.length,o!==Object.keys(n).length)return!1;for(r=o;0!=r--;)if(!{}.hasOwnProperty.call(n,i[r]))return!1;for(r=o;0!=r--;){const o=i[r];if(!("_owner"===o&&t.$$typeof||e(t[o],n[o])))return!1}return!0}return t!=t&&n!=n}},686:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getDPR=void 0,t.getDPR=function(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}},874:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.roundByDPR=void 0;const o=n(686);t.roundByDPR=function(e,t){const n=(0,o.getDPR)(e);return Math.round(t*n)/n}},23:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useLatestRef=void 0;const o=n(718);t.useLatestRef=function(e){const t=(0,o.useRef)(e);return(0,o.useLayoutEffect)((()=>{t.current=e})),t}},607:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const r=o(n(519));let i=null;i||(i=(0,r.default)()),t.default=i},519:function(e,t,n){var o=this&&this.__createBinding||(Object.create?function(e,t,n,o){void 0===o&&(o=n);var r=Object.getOwnPropertyDescriptor(t,n);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,o,r)}:function(e,t,n,o){void 0===o&&(o=n),e[o]=t[n]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&o(t,e,n);return r(t,e),t},a=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});const c=s(n(31)),d=n(754),l=n(147),u=n(913),p=n(592),f=i(n(495)),b=n(861),h=n(236);function g(e,t){return a(this,void 0,void 0,(function*(){return(0,c.default)(e,{method:"post",headers:{"Content-Type":"application/json","Bucket-Sdk-Version":l.version},body:JSON.stringify(t)})}))}const m="undefined"!=typeof window&&window.innerWidth<768;t.default=function(){let e,t,n,o,r,i,s,c=!1,l=u.TRACKING_HOST,v=u.SSE_REALTIME_HOST,y=!d.isForNode,k=!1,C=!d.isForNode;function w(){return`${l}/${e}`}function x(){e||I("Tracking key is not set, please call init() first")}function S(){return t||I("User is not set, please call user() first or provide userId as argument"),t}function O(e,...t){c&&console.log("[Bucket]",e,...t)}function I(e,...t){throw c&&console.error("[Bucket]",e,...t),new Error(e)}function j(e){return y?S():(e||I("No userId provided and persistUser is disabled"),e)}function _({feedbackId:e,featureId:t,question:n,score:o,userId:r,companyId:i,comment:s,promptId:c,promptedQuestion:d,source:l}){return a(this,void 0,void 0,(function*(){x(),t||I("No featureId provided"),o||s||I("Either 'score' or 'comment' must be provided"),r=j(r);const a={feedbackId:e,userId:r,featureId:t,score:o,companyId:i,comment:s,promptId:c,question:n,promptedQuestion:d,source:null!=l?l:"sdk"},u=yield g(`${w()}/feedback`,a);return O("sent feedback",u),u}))}function P(e){return a(this,void 0,void 0,(function*(){if(x(),d.isForNode&&I("Feedback prompting is not supported in Node.js environment"),k&&I("Feedback prompting already initialized. Use reset() first."),m)!function(e,...t){console.warn("[Bucket]",e,...t)}("Feedback prompting is not supported on mobile devices");else{e=j(e),k=!0;try{const t=yield g(`${w()}/feedback/prompting-init`,{userId:e});O("feedback prompting status sent",t);const d=yield t.json();return d.success&&d.channel?(O("feedback prompting enabled"),n=(0,h.openAblySSEChannel)(`${w()}/feedback/prompting-auth`,e,d.channel,(t=>function(e,t){const n=(0,b.parsePromptMessage)(t);n?(0,b.processPromptMessage)(e,n,((t,c,d)=>a(this,void 0,void 0,(function*(){yield M({promptId:n.promptId,featureId:n.featureId,promptedQuestion:n.question,event:"received",userId:e}),yield function(e,t,n){return a(this,void 0,void 0,(function*(){let c;if(r!==e)return void O("feedback prompt not shown, received for another user",e,t);yield M({promptId:t.promptId,featureId:t.featureId,promptedQuestion:t.question,event:"shown",userId:e});const d=o=>a(this,void 0,void 0,(function*(){if(!o)return yield M({promptId:t.promptId,featureId:t.featureId,event:"dismissed",userId:e,promptedQuestion:t.question}),void n();const r=yield _({feedbackId:c,featureId:t.featureId,userId:e,companyId:o.companyId,score:o.score,comment:o.comment,promptId:t.promptId,question:o.question,promptedQuestion:t.question,source:"prompt"});return n(),yield r.json()})),l={reply:d,openFeedbackForm:e=>{f.openFeedbackForm(Object.assign({key:t.featureId,title:t.question,onScoreSubmit:e=>a(this,void 0,void 0,(function*(){const t=yield d(e);return c=t.feedbackId,{feedbackId:t.feedbackId}})),onSubmit:t=>a(this,void 0,void 0,(function*(){var n;yield d(t),null===(n=e.onAfterSubmit)||void 0===n||n.call(e,t)})),onDismiss:()=>d(null),position:i,translations:s},e))}};null==o||o(t,l)}))}(t,c,d)}))))||O("feedback prompt not shown, it was either expired or already processed",t):I("invalid feedback prompt message received",t)}(e,t)),{debug:c,sseHost:v}),r=e,O("feedback prompting connection established"),t):(O("feedback prompting not enabled"),t)}finally{k=!!n}}}))}function M(e){return a(this,void 0,void 0,(function*(){x(),e.promptId||I("No promptId provided"),e.event||I("No event provided");const t={action:e.event,featureId:e.featureId,promptId:e.promptId,userId:e.userId,promptedQuestion:e.promptedQuestion},n=yield g(`${w()}/feedback/prompt-events`,t);return O("sent prompt event",n),n}))}function L(){t=void 0,r=void 0,k=!1,n&&((0,h.closeAblySSEChannel)(n),O("feedback prompting connection closed"),n=void 0)}return O("Instance created"),{init:function(t,n={}){var r,a,u,f,b,h,g,m,k,w,x,S,j,_,P;L(),t||I("Tracking key was not provided"),e=t,n.debug&&(c=n.debug),n.host&&(l=n.host),n.sseHost&&(v=n.sseHost),(null===(a=null===(r=n.feedback)||void 0===r?void 0:r.ui)||void 0===a?void 0:a.position)&&(i=null===(f=null===(u=n.feedback)||void 0===u?void 0:u.ui)||void 0===f?void 0:f.position),(null===(h=null===(b=n.feedback)||void 0===b?void 0:b.ui)||void 0===h?void 0:h.translations)&&(s=null===(m=null===(g=n.feedback)||void 0===g?void 0:g.ui)||void 0===m?void 0:m.translations),void 0!==n.persistUser&&(y=n.persistUser),void 0!==(null===(k=n.feedback)||void 0===k?void 0:k.enableLiveFeedback)&&(C=n.feedback.enableLiveFeedback),void 0!==(null===(w=n.feedback)||void 0===w?void 0:w.enableLiveSatisfaction)&&(C=n.feedback.enableLiveSatisfaction),C&&d.isForNode&&I("Feedback prompting is not supported in Node.js environment"),C&&!y&&I("Feedback prompting is not supported when persistUser is disabled"),o=null!==(_=null!==(S=null===(x=n.feedback)||void 0===x?void 0:x.liveFeedbackHandler)&&void 0!==S?S:null===(j=n.feedback)||void 0===j?void 0:j.liveSatisfactionHandler)&&void 0!==_?_:(0,p.createDefaultFeedbackPromptHandler)(null===(P=n.feedback)||void 0===P?void 0:P.ui),O(`initialized with key "${e}" and options`,n)},reset:L,user:function(e,n,o){return a(this,void 0,void 0,(function*(){x(),e||I("No userId provided"),y&&(t&&t!==e&&L(),t=e,C&&!k&&(yield P(e)));const r={userId:e,attributes:n,context:o},i=yield g(`${w()}/user`,r);return O("sent user",i),i}))},company:function(e,t,n,o){return a(this,void 0,void 0,(function*(){x(),e||I("No companyId provided");const r={userId:n=j(n),companyId:e,context:o};t&&(r.attributes=t);const i=yield g(`${w()}/company`,r);return O("sent company",i),i}))},track:function(e,t,n,o,r){return a(this,void 0,void 0,(function*(){x(),e||I("No eventName provided");const i={userId:n=j(n),event:e,companyId:o,context:r};t&&(i.attributes=t);const a=yield g(`${w()}/event`,i);return O("sent event",a),a}))},feedback:_,requestFeedback:function(e){d.isForNode&&I("requestFeedback can only be called in the browser"),e.featureId||I("No featureId provided"),y?e.userId=S():e.userId||I("No userId provided and persistUser is disabled"),setTimeout((()=>{var t,n;f.openFeedbackForm({key:e.featureId,title:e.title,position:null!==(t=e.position)&&void 0!==t?t:i,translations:null!==(n=e.translations)&&void 0!==n?n:s,openWithCommentVisible:e.openWithCommentVisible,onClose:e.onClose,onDismiss:e.onDismiss,onScoreSubmit:t=>a(this,void 0,void 0,(function*(){const n=yield _(Object.assign({featureId:e.featureId,userId:e.userId,companyId:e.companyId,source:"widget"},t));return{feedbackId:(yield n.json()).feedbackId}})),onSubmit:t=>a(this,void 0,void 0,(function*(){var n;yield _(Object.assign({featureId:e.featureId,userId:e.userId,companyId:e.companyId,source:"widget"},t)),null===(n=e.onAfterSubmit)||void 0===n||n.call(e,t)}))})}),1)},initLiveSatisfaction:P,initLiveFeedback:P}}},417:function(e,t,n){var o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.checkPromptMessageCompleted=t.markPromptMessageCompleted=void 0;const r=o(n(734));t.markPromptMessageCompleted=(e,t,n)=>{r.default.set(`bucket-prompt-${e}`,t,{expires:n})},t.checkPromptMessageCompleted=(e,t)=>r.default.get(`bucket-prompt-${e}`)===t},861:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.processPromptMessage=t.parsePromptMessage=void 0;const o=n(417);t.parsePromptMessage=e=>"string"==typeof(null==e?void 0:e.question)&&e.question.length&&"number"==typeof e.showAfter&&"number"==typeof e.showBefore&&"string"==typeof e.promptId&&e.promptId.length&&"string"==typeof e.featureId&&e.featureId.length?{question:e.question,showAfter:new Date(e.showAfter),showBefore:new Date(e.showBefore),promptId:e.promptId,featureId:e.featureId}:void 0,t.processPromptMessage=(e,t,n)=>{const r=new Date,i=()=>{(0,o.markPromptMessageCompleted)(e,t.promptId,t.showBefore)};return!((0,o.checkPromptMessageCompleted)(e,t.promptId)||r>t.showBefore||(r<t.showAfter?(setTimeout((()=>{n(e,t,i)}),t.showAfter.getTime()-r.getTime()),0):(n(e,t,i),0)))}},236:function(e,t,n){var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))((function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((o=o.apply(e,t||[])).next())}))},r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.closeAblySSEChannel=t.openAblySSEChannel=t.AblySSEChannel=void 0;const i=r(n(31)),a=n(913);class s{constructor(e,t,n,o,r,i){var a;this.userId=e,this.channel=t,this.ablyAuthUrl=n,this.sseHost=o,this.messageHandler=r,this.isOpen=!1,this.eventSource=null,this.retryInterval=null,this.debug=null!==(a=null==i?void 0:i.debug)&&void 0!==a&&a}log(e,...t){this.debug&&console.log("[SSE]",e,...t)}warn(e,...t){console.warn("[SSE]",e,...t)}err(e,...t){throw this.debug&&console.error("[SSE]",e,...t),new Error(e)}refreshTokenRequest(){return o(this,void 0,void 0,(function*(){const e=yield(0,i.default)(`${this.ablyAuthUrl}?userId=${encodeURIComponent(this.userId)}`,{method:"get",headers:{"Content-Type":"application/json"}});if(e.ok){const t=yield e.json();if(t.success){delete t.success;const e=t;return this.log("obtained new token request",e),e}}this.err("server did not release a token request",e)}))}refreshToken(){return o(this,void 0,void 0,(function*(){const e=yield this.refreshTokenRequest(),t=yield(0,i.default)(`${this.sseHost}/keys/${encodeURIComponent(e.keyName)}/requestToken`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(t.ok){const e=yield t.json();return this.log("obtained new token",e),e}this.err("server did not release a token",t)}))}onError(e){var t;return o(this,void 0,void 0,(function*(){if(e instanceof MessageEvent){let t;try{const n=JSON.parse(e.data);t=(null==n?void 0:n.code)&&Number(n.code)}catch(t){this.warn("received unparseable error message",t,e)}t&&t>=40140&&t<=40149&&this.log("event source token expired, refresh required")}else{const n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.readyState;2===n?this.log("event source connection closed",e):1===n?this.warn("event source connection failed to open",e):this.warn("event source unexpected error occured",e)}this.disconnect()}))}onMessage(e){let t;try{if(e.data){const n=JSON.parse(e.data);n.data&&(t=JSON.parse(n.data))}}catch(t){return void this.warn("received unparseable message",t,e)}if(t){this.log("received message",t);try{this.messageHandler(t)}catch(e){this.warn("failed to handle message",e,t)}}else this.warn("received invalid message",e)}onOpen(e){this.log("event source connection opened",e)}connect(){return o(this,void 0,void 0,(function*(){if(this.isOpen)this.warn("channel connection already open");else{this.isOpen=!0;try{const e=yield this.refreshToken();this.eventSource=new EventSource(`${this.sseHost}/sse?v=1.2&accessToken=${encodeURIComponent(e.token)}&channels=${encodeURIComponent(this.channel)}&rewind=1`),this.eventSource.addEventListener("error",(e=>this.onError(e))),this.eventSource.addEventListener("open",(e=>this.onOpen(e))),this.eventSource.addEventListener("message",(e=>this.onMessage(e))),this.log("channel connection opened")}finally{this.isOpen=!!this.eventSource}}}))}disconnect(){this.isOpen?(this.eventSource&&(this.eventSource.close(),this.eventSource=null,this.log("channel connection closed")),this.isOpen=!1):this.warn("channel connection already closed")}open(e){var t,n;const r=null!==(t=null==e?void 0:e.retryInterval)&&void 0!==t?t:3e4,i=null!==(n=null==e?void 0:e.retryCount)&&void 0!==n?n:3;let a=i;const s=()=>o(this,void 0,void 0,(function*(){try{yield this.connect(),a=i}catch(e){a>0?this.warn(`failed to connect, ${a} retries remaining`,e):this.warn("failed to connect, no retries remaining",e)}}));s(),this.retryInterval=setInterval((()=>{if(!this.isOpen&&this.retryInterval){if(a<=0)return clearInterval(this.retryInterval),void(this.retryInterval=null);a--,s()}}),r)}close(){this.retryInterval&&(clearInterval(this.retryInterval),this.retryInterval=null),this.disconnect()}isActive(){return!!this.retryInterval}isConnected(){return this.isOpen}}t.AblySSEChannel=s,t.openAblySSEChannel=function(e,t,n,o,r){const i=new s(t,n,e,(null==r?void 0:r.sseHost)||a.SSE_REALTIME_HOST,o,{debug:null==r?void 0:r.debug});return i.open(),i},t.closeAblySSEChannel=function(e){e.close()}},882:e=>{e.exports=require("@floating-ui/dom")},31:e=>{e.exports=require("cross-fetch")},754:e=>{e.exports=require("is-bundling-for-browser-or-node")},734:e=>{e.exports=require("js-cookie")},108:e=>{e.exports=require("preact")},718:e=>{e.exports=require("preact/hooks")},147:e=>{e.exports=JSON.parse('{"name":"@bucketco/tracking-sdk","version":"2.1.6","license":"MIT","private":false,"repository":{"type":"git","url":"https://github.com/bucketco/bucket-tracking-sdk.git"},"scripts":{"dev":"vite","start":"vite","build":"tsc --project tsconfig.build.json && webpack","test":"vitest -c vite.config.js","test:e2e":"yarn build && vitest run -c vite.e2e.config.js && playwright test","test:ci":"vitest run -c vite.config.js --reporter=junit --outputFile=junit.xml && vitest run -c vite.e2e.config.js && CI=true playwright test","coverage":"vitest run --coverage","lint":"eslint .","lint:ci":"eslint --output-file eslint-report.json --format json .","prettier":"prettier --check .","format":"yarn lint --fix && yarn prettier --write","preversion":"yarn lint && yarn prettier && yarn vitest run -c vite.config.js && yarn build"},"files":["dist"],"main":"./dist/bucket-tracking-sdk.node.js","browser":"./dist/bucket-tracking-sdk.browser.js","types":"./dist/types/src/index.d.ts","devDependencies":{"@babel/core":"^7.22.9","@eslint/js":"^8.47.0","@playwright/test":"^1.37.1","@preact/preset-vite":"^2.5.0","@types/js-cookie":"^3.0.3","@types/node":"^20.4.4","@types/webpack":"^5.28.2","@types/webpack-node-externals":"^3.0.0","@typescript-eslint/eslint-plugin":"^6.4.0","@typescript-eslint/parser":"^6.4.0","@vitest/coverage-v8":"^0.34.3","c8":"^8.0.1","css-loader":"^6.8.1","eslint":"^8.47.0","eslint-config-prettier":"^9.0.0","eslint-import-resolver-typescript":"^3.6.0","eslint-plugin-import":"^2.28.1","eslint-plugin-simple-import-sort":"^10.0.0","eslint-plugin-unused-imports":"^3.0.0","flush-promises":"^1.0.2","globals":"^13.21.0","http-server":"^14.1.1","jsdom":"^22.1.0","nock":"^13.3.3","postcss":"^8.4.31","postcss-loader":"^7.3.3","postcss-nesting":"^12.0.1","postcss-preset-env":"^9.1.0","prettier":"^3.0.2","style-loader":"^3.3.3","ts-loader":"^9.4.4","ts-node":"^10.9.1","typescript":"^5.1.6","vite":"^4.4.9","vite-plugin-dts":"^3.5.2","vitest":"^0.33.0","webpack":"^5.88.2","webpack-cli":"^5.1.4","webpack-node-externals":"^3.0.0"},"dependencies":{"@floating-ui/dom":"^1.4.5","cross-fetch":"^4.0.0","is-bundling-for-browser-or-node":"^1.1.1","js-cookie":"^3.0.5","preact":"^10.16.0"}}')}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var i=t[o]={id:o,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o=n(607);return o.default})()));
{
"name": "@bucketco/tracking-sdk",
"version": "2.1.5",
"version": "2.1.6",
"license": "MIT",

@@ -5,0 +5,0 @@ "private": false,

@@ -210,3 +210,3 @@ "use strict";

}
function feedback({ feedbackId, featureId, question, score, userId, companyId, comment, promptId, promptedQuestion, }) {
function feedback({ feedbackId, featureId, question, score, userId, companyId, comment, promptId, promptedQuestion, source, }) {
return __awaiter(this, void 0, void 0, function* () {

@@ -229,2 +229,3 @@ checkKey();

promptedQuestion,
source: source !== null && source !== void 0 ? source : "sdk",
};

@@ -334,2 +335,3 @@ const res = yield request(`${getUrl()}/feedback`, payload);

promptedQuestion: message.question,
source: "prompt",
});

@@ -401,3 +403,3 @@ completionHandler();

onScoreSubmit: (data) => __awaiter(this, void 0, void 0, function* () {
const res = yield feedback(Object.assign({ featureId: options.featureId, userId: options.userId, companyId: options.companyId }, data));
const res = yield feedback(Object.assign({ featureId: options.featureId, userId: options.userId, companyId: options.companyId, source: "widget" }, data));
const json = yield res.json();

@@ -409,3 +411,3 @@ return { feedbackId: json.feedbackId };

// Default onSubmit handler
yield feedback(Object.assign({ featureId: options.featureId, userId: options.userId, companyId: options.companyId }, data));
yield feedback(Object.assign({ featureId: options.featureId, userId: options.userId, companyId: options.companyId, source: "widget" }, data));
(_c = options.onAfterSubmit) === null || _c === void 0 ? void 0 : _c.call(options, data);

@@ -412,0 +414,0 @@ }),

@@ -15,3 +15,3 @@ declare const _default: {

} | null | undefined, userId?: string | undefined, companyId?: string | undefined, context?: import("./types").Context | undefined) => Promise<Response>;
feedback: ({ feedbackId, featureId, question, score, userId, companyId, comment, promptId, promptedQuestion, }: import("./types").Feedback) => Promise<Response>;
feedback: ({ feedbackId, featureId, question, score, userId, companyId, comment, promptId, promptedQuestion, source, }: import("./types").Feedback) => Promise<Response>;
requestFeedback: (options: import("./types").RequestFeedbackOptions) => void;

@@ -18,0 +18,0 @@ initLiveSatisfaction: (userId?: string | undefined) => Promise<Response | undefined>;

@@ -8,3 +8,3 @@ import type { Company, Context, Feedback, Key, Options, RequestFeedbackOptions, TrackedEvent, User } from "./types";

track: (eventName: TrackedEvent["event"], attributes?: TrackedEvent["attributes"] | null, userId?: Company["userId"], companyId?: Company["companyId"], context?: Context) => Promise<Response>;
feedback: ({ feedbackId, featureId, question, score, userId, companyId, comment, promptId, promptedQuestion, }: Feedback) => Promise<Response>;
feedback: ({ feedbackId, featureId, question, score, userId, companyId, comment, promptId, promptedQuestion, source, }: Feedback) => Promise<Response>;
requestFeedback: (options: RequestFeedbackOptions) => void;

@@ -11,0 +11,0 @@ initLiveSatisfaction: (userId?: User["userId"]) => Promise<Response | undefined>;

@@ -118,2 +118,9 @@ import { FeedbackPosition, FeedbackSubmission, FeedbackTranslations, OpenFeedbackFormOptions } from "./feedback/types";

promptId?: FeedbackPrompt["promptId"];
/**
* Source of the feedback, depending on how the user was asked
* - `prompt` - Feedback submitted by a Live Satisfaction prompt
* - `widget` - Feedback submitted via `requestFeedback`
* - `sdk` - Feedback submitted via `feedback`
*/
source?: "prompt" | "sdk" | "widget";
};

@@ -120,0 +127,0 @@ export type FeedbackPrompt = {

{
"name": "@bucketco/tracking-sdk",
"version": "2.1.5",
"version": "2.1.6",
"license": "MIT",

@@ -5,0 +5,0 @@ "private": false,

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc