@khvavuong/ezchat 1.1.18 → 1.1.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,17 +1,17 @@
1
1
  (function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("style");e.appendChild(document.createTextNode(`.chat-messages-container{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden;padding:0;display:flex;flex-direction:column;box-sizing:border-box;transform:translateZ(0);-webkit-transform:translateZ(0);will-change:scroll-position;background-attachment:fixed;background-size:cover;background-repeat:no-repeat;background-position:center;scroll-behavior:auto!important}.chat-popup-window--fullscreen .chat-messages-container{-webkit-overflow-scrolling:touch;overscroll-behavior:contain;max-height:calc(100% - 105px)}.chat-popup-window--mobile .chat-messages-container{flex:1;min-height:0;max-height:100%}.chat-messages-container:before,.chat-messages-container:after{content:"";flex-shrink:0}.chat-messages-container:before{height:20px}.chat-messages-container:after{height:20px}.chat-messages-container>*{margin-left:24px;margin-right:24px}.chat-message{margin-bottom:12px;display:flex;justify-content:flex-end;flex-shrink:0}.chat-message.bot{justify-content:flex-start}.feedback-button{background:transparent;border:none;width:16px;height:16px;cursor:pointer;display:flex;align-items:center;justify-content:center;box-sizing:border-box}.feedback-button:hover{transform:scale(1.1)}.feedback-button:active{transform:scale(.95)}.chat-messages-container::-webkit-scrollbar{width:2px}.chat-messages-container::-webkit-scrollbar-track{background:transparent}.chat-messages-container::-webkit-scrollbar-thumb{background:#1aaf74}.chat-messages-container::-webkit-scrollbar-thumb:hover{background:#1aaf74}.message-popup{position:absolute;top:-40px;right:0;background:#fff;border-radius:8px;box-shadow:0 2px 8px #00000026;padding:8px;display:flex;gap:8px;border:1px solid #e0e0e0}.message-popup-button{background:none;border:none;cursor:pointer;padding:4px;border-radius:4px;display:flex;align-items:center;justify-content:center}.message-popup-button:hover{background:#f0f0f0}.chat-message-edit-textarea{flex:1;padding:8px;width:30vw;border-radius:8px;border:0px;font-size:16px;font-weight:500;font-family:inherit;background:transparent;outline:none;resize:none;min-height:60px;max-height:200px;overflow:auto}.chat-message-edit-textarea::-webkit-scrollbar{display:none}.message-edit-button{background:transparent;font-weight:400;color:#000;font-size:16px;padding:8px 12px;border-radius:8px;border:none;cursor:pointer;transition:background-color .2s ease}.message-edit-button:hover,.message-edit-button:active{background:#1aaf7433}.message-cancel-button{background:transparent;font-weight:400;color:#767676;font-size:16px;padding:8px 12px;border-radius:8px;border:none;cursor:pointer;transition:background-color .2s ease}.message-cancel-button:hover,.message-cancel-button:active{background:#1aaf7433}.survey-message{background:#fff;border-radius:24px;box-shadow:0 2px 8px #00000014;padding:16px;max-width:70vh}.survey-options{display:flex;flex-direction:column;gap:12px;align-items:flex-start}.survey-option{border:1px solid #51D6A1;border-radius:24px;padding:12px 16px;background:none;font-size:16px;cursor:grab;text-align:left;user-select:none;transition:all .2s ease}.survey-option:active{cursor:grabbing}.survey-option:hover:not(.dragging){cursor:grabbing;background:#eafaf3}.survey-option:active,.survey-option.dragging{opacity:.4;transform:scale(.95);cursor:grabbing}.survey-option.hovered{background:#d4f5ed;transform:translateY(5px)}.survey-option.multi-selected.selected{background:#1aaf741a}.survey-submit-button{background:transparent;font-weight:400;color:#1aaf74;font-size:16px;padding:8px 12px;border-radius:4px;border:none;cursor:pointer;transition:background-color .2s ease}.survey-submit-button:hover{background:#1aaf741a}.survey-submit-button:active{background:#1aaf7433}.survey-cancel-button{background:transparent;font-weight:400;color:#767676;font-size:16px;padding:8px 12px;border-radius:4px;border:none;cursor:pointer;transition:background-color .2s ease}.survey-cancel-button:hover{background:#1aaf741a}.survey-cancel-button:active{background:#1aaf7433}.survey-input{width:100%;padding:12px 16px;border-radius:12px;font-size:14px;font-weight:500;background:#efefef;border:0px solid #fff;box-sizing:border-box}.survey-input::placeholder{color:#1113154d}.survey-input:focus{border:1px solid #1AAF74;outline:none}.survey-tooltip{text-align:left;position:absolute;right:0;left:auto;background:#fff;color:#333;border:1px solid #ddd;border-radius:4px;padding:8px 12px;font-size:13px;min-width:280px;max-width:90vw;box-shadow:0 2px 8px #00000014;white-space:normal;overflow-wrap:break-word;word-break:break-word;z-index:10}.chat-input-container{padding:15px;background:#fff;border-top:1px solid #e0e0e0;display:flex;gap:10px;flex-shrink:0;box-sizing:border-box}.chat-input-field{padding:15px 12px;width:100%;background:#efefef;border:1px solid #EFEFEF;border-radius:100px;outline:none;font-size:16px;font-weight:500;box-sizing:border-box;font-family:Manrope,Arial,sans-serif;overflow-y:auto;-webkit-overflow-scrolling:touch;scrollbar-width:none;-ms-overflow-style:none;transition:height .12s ease}.chat-input-field:focus{border:1px solid #1AAF74;background:#efefef}.chat-input-field::-webkit-scrollbar{width:0;height:0}.chat-input-container.is-maxed .chat-input-field{border-radius:28px;transition:border-radius .12s ease}.chat-input-button{padding:10px 20px;background:#1677ff;color:#fff;border:none;border-radius:20px;cursor:pointer;font-weight:500}.chat-input-floating-box .chat-input-container{background:transparent;box-shadow:none;width:100%;padding:0;border-top:none;gap:0}.chat-input-floating-box .chat-input-field{background:#efefef;border-radius:100px;width:100%;box-shadow:none;padding:15px 24px}.chat-input-field::-webkit-scrollbar{display:none}.chat-popup-button{position:absolute;bottom:12px;right:12px;width:60px;height:60px;border-radius:50%;background:#fff;border:none;color:#fff;font-size:24px;cursor:pointer;box-shadow:0 4px 12px #00000026;z-index:1000;display:flex;align-items:center;justify-content:center}.chat-popup-button:hover{transform:scale(1.1)}.chat-popup-window{position:absolute;top:0;left:0;width:100%;height:100%;background:#fff;border-radius:12px;box-shadow:0 8px 32px #0000001a;z-index:999;display:flex;flex-direction:column;overflow:hidden;transform:scale(.85);opacity:0;transition:opacity .25s;transform-origin:right bottom}.chat-popup-window:not(.chat-popup-window--fullscreen):not(.chat-popup-window--mobile)>div:last-child{flex:1;overflow:hidden;display:flex;flex-direction:column}.chat-popup-window--open{transform:scale(1);opacity:1;transition:transform .35s cubic-bezier(.4,0,.2,1),opacity .25s}.chat-popup-window--fullscreen:not(.chat-popup-window--open),.chat-popup-window--mobile:not(.chat-popup-window--open){transition:opacity .25s!important}.chat-popup-window--fullscreen{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:none;max-height:none;border-radius:12px;z-index:9999;background:#fff;display:flex;flex-direction:column}.chat-popup-window--fullscreen .chat-input-floating-box{top:50%;bottom:auto;left:50%;transform:translate(-50%,-50%);width:60%;max-width:70%;gap:16px;display:flex;flex-direction:column;align-items:center}.chat-popup-window--fullscreen .chat-input-floating-box--with-messages{top:auto;bottom:24px;transform:translate(-50%);width:95%;max-width:95%}.chat-popup-window--mobile{inset:0!important;width:100%!important;height:100%!important;max-width:none;max-height:none;border-radius:12px;z-index:9999;background:#fff;display:flex;flex-direction:column}.chat-popup-window--mobile>div:last-child{flex:1;overflow:hidden;display:flex;flex-direction:column}.chat-popup-window,.chat-popup-window--fullscreen,.chat-popup-window--mobile{background-image:url("data:image/svg+xml,%3csvg%20width='702'%20height='333'%20viewBox='0%200%20702%20333'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='702'%20height='332.5'%20transform='translate(0%200.5)'%20fill='%23F9F9F9'/%3e%3cmask%20id='mask0_2126_250272'%20style='mask-type:alpha'%20maskUnits='userSpaceOnUse'%20x='0'%20y='0'%20width='702'%20height='333'%3e%3crect%20y='0.5'%20width='702'%20height='332.5'%20fill='%23F9F9F9'/%3e%3c/mask%3e%3cg%20mask='url(%23mask0_2126_250272)'%3e%3cg%20opacity='0.4'%20filter='url(%23filter0_f_2126_250272)'%3e%3cellipse%20cx='217.889'%20cy='89.4345'%20rx='92.9028'%20ry='132.599'%20fill='url(%23paint0_linear_2126_250272)'/%3e%3cellipse%20cx='267.576'%20cy='251.281'%20rx='94.725'%20ry='141.383'%20fill='url(%23paint1_linear_2126_250272)'/%3e%3cellipse%20cx='198.685'%20cy='149.02'%20rx='145.472'%20ry='113.673'%20fill='url(%23paint2_linear_2126_250272)'/%3e%3cellipse%20cx='502.354'%20cy='219.212'%20rx='76.572'%20ry='89.1293'%20fill='url(%23paint3_linear_2126_250272)'/%3e%3cellipse%20cx='329.854'%20cy='242.986'%20rx='90.3027'%20ry='136.639'%20fill='url(%23paint4_linear_2126_250272)'/%3e%3c/g%3e%3c/g%3e%3cdefs%3e%3cfilter%20id='filter0_f_2126_250272'%20x='-152.057'%20y='-248.434'%20width='936.253'%20height='846.368'%20filterUnits='userSpaceOnUse'%20color-interpolation-filters='sRGB'%3e%3cfeFlood%20flood-opacity='0'%20result='BackgroundImageFix'/%3e%3cfeBlend%20mode='normal'%20in='SourceGraphic'%20in2='BackgroundImageFix'%20result='shape'/%3e%3cfeGaussianBlur%20stdDeviation='102.635'%20result='effect1_foregroundBlur_2126_250272'/%3e%3c/filter%3e%3clinearGradient%20id='paint0_linear_2126_250272'%20x1='124.986'%20y1='89.4345'%20x2='310.792'%20y2='89.4345'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231AAF74'/%3e%3cstop%20offset='1'%20stop-color='%231AAF74'%20stop-opacity='0.7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint1_linear_2126_250272'%20x1='172.851'%20y1='251.281'%20x2='362.301'%20y2='251.281'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231AAF74'/%3e%3cstop%20offset='1'%20stop-color='%231AAF74'%20stop-opacity='0.7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint2_linear_2126_250272'%20x1='53.2129'%20y1='149.02'%20x2='344.158'%20y2='149.02'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%23F8FF99'/%3e%3cstop%20offset='1'%20stop-color='%23F8FF99'%20stop-opacity='0.7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint3_linear_2126_250272'%20x1='425.782'%20y1='219.212'%20x2='578.926'%20y2='219.212'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231AAF74'/%3e%3cstop%20offset='1'%20stop-color='%231AAF74'%20stop-opacity='0.7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='paint4_linear_2126_250272'%20x1='239.552'%20y1='242.986'%20x2='420.157'%20y2='242.986'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20stop-color='%231AAF74'/%3e%3cstop%20offset='1'%20stop-color='%231AAF74'%20stop-opacity='0.7'/%3e%3c/linearGradient%3e%3c/defs%3e%3c/svg%3e");background-size:cover;background-repeat:no-repeat;background-position:center}.chat-popup-header{display:flex;align-items:center;justify-content:space-between;height:50px;padding:0 16px;background:#fff;color:#fff;font-weight:700;font-size:18px;flex-shrink:0;box-sizing:border-box}.chat-popup-title{flex:1;text-align:center;font-weight:700;font-size:24px;display:flex;justify-content:center;align-items:center}.chat-input-floating-box{position:absolute;left:50%;transform:translate(-50%);background:transparent;border-radius:24px;padding:0;z-index:10;width:60%;max-width:70%;display:flex;flex-direction:column;align-items:center;gap:28px;justify-content:flex-start}.chat-popup-action-buttons{display:flex;justify-content:center;align-items:center;gap:16px;width:100%;flex-wrap:wrap;background:transparent!important;box-shadow:none;border:none;padding:0;margin:0;position:static}.modal-backdrop{position:absolute;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:20;display:flex;align-items:center;justify-content:center}.modal-button-delete{border:1px solid #EFEFEF;border-radius:24px;padding:12px;cursor:pointer;transition:background .2s,color .2s;font-family:Manrope,sans-serif}.modal-button-delete:hover{background:#f5f5f5;color:#1aaf74}.chat-popup-input{width:100%;padding:8px;border:1px solid #1AAF74;border-radius:4px;box-sizing:border-box;outline:none;transition:border-color .2s}.chat-popup-input:focus{border-color:#1aaf74}.sidebar-overlay{position:absolute;top:0;left:0;width:100%;height:100%;background:#1e1e1e40;z-index:9;opacity:0;pointer-events:none;transition:opacity .2s}.sidebar-overlay--open{opacity:1;pointer-events:auto}.sidebar{position:absolute;top:0;left:0;width:420px;height:100%;background:#fff;box-shadow:2px 0 8px #00000014;z-index:10;padding:12px;transition:transform .35s cubic-bezier(.4,0,.2,1),opacity .25s;border-radius:12px;transform:translate(-100%);opacity:0;pointer-events:none}.sidebar--open{transform:translate(0);opacity:1;pointer-events:auto}.sidebar--fullscreen{position:static!important;width:320px!important;height:100%;box-shadow:none!important;transform:none!important;opacity:1!important;pointer-events:auto!important;border-top-right-radius:0!important}.sidebar-header{width:100%;display:flex;align-items:center;font-weight:700;font-size:24px;text-align:center;justify-content:left}.sidebar-section{display:flex;align-items:center;cursor:pointer;border-radius:8px;padding:8px;margin-top:18px;transition:background .2s}.sidebar-header-actions{margin-left:auto;display:flex;gap:8px;align-items:center}.sidebar-section--no-padding{margin-top:0!important}.sidebar-section:hover,.sidebar-section:focus{background:#f5f5f5}.sidebar-section .sidebar-section-icon{width:24px;height:24px;margin-right:8px}.sidebar-section .sidebar-section-title{font-weight:600;font-size:16px;user-select:none}.sidebar-conversation-row{display:flex;justify-content:space-between;align-items:center;margin-top:16px;border-radius:16px;padding:8px}.sidebar-conversation-action{display:flex;align-items:center;cursor:pointer;border-radius:8px;padding:8px;transition:background .2s}.sidebar-conversation-action:hover,.sidebar-conversation-action:focus{background:#f5f5f5}.sidebar-search-box{margin-top:8px;padding:12px;background:#f5f5f5;border-radius:8px;display:flex;align-items:center}.sidebar-search-box input{border:none;outline:none;background:transparent;width:100%;font-size:16px;font-weight:500}.sidebar-search-box input::placeholder{color:#1113154d;opacity:1}.sidebar-menu-row{display:flex;justify-content:space-between;align-items:center;cursor:pointer;border-radius:8px;padding:8px;transition:background .2s}.sidebar-menu-row:hover,.sidebar-menu-row:focus{background:#f5f5f5}.sidebar-popover{position:absolute;top:32px;right:0;background:#efefef;border:1px solid #858B934D;border-radius:12px;box-shadow:0 2px 8px #00000014;z-index:100;min-width:170px;padding:8px 0}.sidebar-popover-item{font-size:14px;padding:8px 16px;cursor:pointer;display:flex;align-items:center;gap:8px;transition:background .2s;color:#1a1d1f}.sidebar-popover-item:hover{background:#f5f5f5}.sidebar-menu-dot{opacity:0;pointer-events:none;transition:opacity .15s}.sidebar-menu-row:hover .sidebar-menu-dot,.sidebar-menu-row:focus .sidebar-menu-dot{opacity:1;pointer-events:auto}.sidebar-conversation-list{max-height:100%;overflow-y:auto}.sidebar-conversation-list::-webkit-scrollbar{width:2px}.sidebar-conversation-list::-webkit-scrollbar-track{background:transparent}.sidebar-conversation-list::-webkit-scrollbar-thumb{background:#1aaf74}.sidebar-conversation-list::-webkit-scrollbar-thumb:hover{background:#1aaf74}.sider-bar-input{width:100%;padding:8px;border:1px solid #1AAF74;border-radius:4px;box-sizing:border-box;outline:none;transition:border-color .2s}.sider-bar-input:focus{border-color:#1aaf74}.chat-action-btn{background:#1aaf741a;border:1px solid #1AAF744D;color:#1a1d1f;border-radius:24px;padding:8px 12px;font-size:14px;font-weight:400;cursor:pointer;transition:background .2s;outline:none;margin:0 8px}.chat-action-btn:hover{background:#d2f1e0}.header-steps{display:flex;justify-content:space-between;align-items:center;padding:12px 24px;border-bottom:1px solid #e0e0e0;background:#fff;position:sticky;top:0;height:28px;z-index:10;gap:16px}.header-steps-title{font-weight:700;font-size:18px;color:#1a1d1f;flex-shrink:0}.header-steps-container{display:flex;gap:0px;align-items:center;flex-shrink:0}.header-step{width:28px;height:28px;border-radius:50%;background:#f4f4f499;color:#000;border:2px solid #EFEFEF;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:700;transition:background-color .2s ease,color .2s ease}.header-step.active{background:#1aaf74;border:2px solid #1AAF74;color:#fff}.header-step-line{width:16px;height:2px;background:#858b934d;margin:0 4px;border-radius:1px;flex-shrink:0}.header-step-tooltip{position:absolute;top:36px;left:50%;transform:translate(-50%);background:#fff;color:#1a1d1f;padding:6px 12px;border-radius:6px;box-shadow:0 2px 8px #0000001f;white-space:nowrap;font-size:13px}.wave-svg{position:absolute;top:-6px;left:0;width:100%;height:6px;opacity:0;pointer-events:none;transition:opacity .05s linear}.wave-svg.active{opacity:1}`)),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
- (function(Te,xe){typeof exports=="object"&&typeof module!="undefined"?xe(exports):typeof define=="function"&&define.amd?define(["exports"],xe):(Te=typeof globalThis!="undefined"?globalThis:Te||self,xe(Te.EzChat={}))})(this,(function(Te){"use strict";var t2=Object.defineProperty,n2=Object.defineProperties;var s2=Object.getOwnPropertyDescriptors;var ds=Object.getOwnPropertySymbols;var i2=Object.prototype.hasOwnProperty,o2=Object.prototype.propertyIsEnumerable;var In=(Te,xe,Pe)=>xe in Te?t2(Te,xe,{enumerable:!0,configurable:!0,writable:!0,value:Pe}):Te[xe]=Pe,j=(Te,xe)=>{for(var Pe in xe||(xe={}))i2.call(xe,Pe)&&In(Te,Pe,xe[Pe]);if(ds)for(var Pe of ds(xe))o2.call(xe,Pe)&&In(Te,Pe,xe[Pe]);return Te},oe=(Te,xe)=>n2(Te,s2(xe));var Ce=(Te,xe,Pe)=>In(Te,typeof xe!="symbol"?xe+"":xe,Pe);var v=(Te,xe,Pe)=>new Promise((et,Ct)=>{var mt=Ye=>{try{Ze(Pe.next(Ye))}catch(vt){Ct(vt)}},jt=Ye=>{try{Ze(Pe.throw(Ye))}catch(vt){Ct(vt)}},Ze=Ye=>Ye.done?et(Ye.value):Promise.resolve(Ye.value).then(mt,jt);Ze((Pe=Pe.apply(Te,xe)).next())});const Pe=(t,e)=>t===e,et=Symbol("solid-proxy"),Ct=Symbol("solid-track"),mt={equals:Pe};let jt=En;const Ze=1,Ye=2,vt={owned:null,cleanups:null,context:null,owner:null};var _e=null;let dn=null,us=null,Me=null,Le=null,tt=null,zt=0;function Vt(t,e){const n=Me,s=_e,i=t.length===0,o=e===void 0?s:e,r=i?vt:{owned:null,cleanups:null,context:o?o.context:null,owner:o},c=i?t:()=>t(()=>Je(()=>Dt(r)));_e=r,Me=null;try{return wt(c,!0)}finally{Me=n,_e=s}}function L(t,e){e=e?Object.assign({},mt,e):mt;const n={value:t,observers:null,observerSlots:null,comparator:e.equals||void 0},s=i=>(typeof i=="function"&&(i=i(n.value)),Mn(n,i));return[kn.bind(n),s]}function fe(t,e,n){const s=fn(t,e,!1,Ze);Pt(s)}function nt(t,e,n){jt=ws;const s=fn(t,e,!1,Ze);s.user=!0,tt?tt.push(s):Pt(s)}function st(t,e,n){n=n?Object.assign({},mt,n):mt;const s=fn(t,e,!0,0);return s.observers=null,s.observerSlots=null,s.comparator=n.equals||void 0,Pt(s),kn.bind(s)}function hs(t){return wt(t,!1)}function Je(t){if(Me===null)return t();const e=Me;Me=null;try{return t()}finally{Me=e}}function fs(t,e,n){const s=Array.isArray(t);let i;return o=>{let r;if(s){r=Array(t.length);for(let a=0;a<t.length;a++)r[a]=t[a]()}else r=t();const c=Je(()=>e(r,i,o));return i=r,c}}function Rt(t){nt(()=>Je(t))}function un(t){return _e===null||(_e.cleanups===null?_e.cleanups=[t]:_e.cleanups.push(t)),t}function hn(){return Me}function gs(t,e){const n=Symbol("context");return{id:n,Provider:bs(n),defaultValue:t}}function ps(t){let e;return _e&&_e.context&&(e=_e.context[t.id])!==void 0?e:t.defaultValue}function Cs(t){const e=st(t),n=st(()=>gn(e()));return n.toArray=()=>{const s=n();return Array.isArray(s)?s:s!=null?[s]:[]},n}function kn(){if(this.sources&&this.state)if(this.state===Ze)Pt(this);else{const t=Le;Le=null,wt(()=>qt(this),!1),Le=t}if(Me){const t=this.observers?this.observers.length:0;Me.sources?(Me.sources.push(this),Me.sourceSlots.push(t)):(Me.sources=[this],Me.sourceSlots=[t]),this.observers?(this.observers.push(Me),this.observerSlots.push(Me.sources.length-1)):(this.observers=[Me],this.observerSlots=[Me.sources.length-1])}return this.value}function Mn(t,e,n){let s=t.value;return(!t.comparator||!t.comparator(s,e))&&(t.value=e,t.observers&&t.observers.length&&wt(()=>{for(let i=0;i<t.observers.length;i+=1){const o=t.observers[i],r=dn&&dn.running;r&&dn.disposed.has(o),(r?!o.tState:!o.state)&&(o.pure?Le.push(o):tt.push(o),o.observers&&Tn(o)),r||(o.state=Ze)}if(Le.length>1e6)throw Le=[],new Error},!1)),e}function Pt(t){if(!t.fn)return;Dt(t);const e=zt;ms(t,t.value,e)}function ms(t,e,n){let s;const i=_e,o=Me;Me=_e=t;try{s=t.fn(e)}catch(r){return t.pure&&(t.state=Ze,t.owned&&t.owned.forEach(Dt),t.owned=null),t.updatedAt=n+1,$n(r)}finally{Me=o,_e=i}(!t.updatedAt||t.updatedAt<=n)&&(t.updatedAt!=null&&"observers"in t?Mn(t,s):t.value=s,t.updatedAt=n)}function fn(t,e,n,s=Ze,i){const o={fn:t,state:s,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:e,owner:_e,context:_e?_e.context:null,pure:n};return _e===null||_e!==vt&&(_e.owned?_e.owned.push(o):_e.owned=[o]),o}function Wt(t){if(t.state===0)return;if(t.state===Ye)return qt(t);if(t.suspense&&Je(t.suspense.inFallback))return t.suspense.effects.push(t);const e=[t];for(;(t=t.owner)&&(!t.updatedAt||t.updatedAt<zt);)t.state&&e.push(t);for(let n=e.length-1;n>=0;n--)if(t=e[n],t.state===Ze)Pt(t);else if(t.state===Ye){const s=Le;Le=null,wt(()=>qt(t,e[0]),!1),Le=s}}function wt(t,e){if(Le)return t();let n=!1;e||(Le=[]),tt?n=!0:tt=[],zt++;try{const s=t();return vs(n),s}catch(s){n||(tt=null),Le=null,$n(s)}}function vs(t){if(Le&&(En(Le),Le=null),t)return;const e=tt;tt=null,e.length&&wt(()=>jt(e),!1)}function En(t){for(let e=0;e<t.length;e++)Wt(t[e])}function ws(t){let e,n=0;for(e=0;e<t.length;e++){const s=t[e];s.user?t[n++]=s:Wt(s)}for(e=0;e<n;e++)Wt(t[e])}function qt(t,e){t.state=0;for(let n=0;n<t.sources.length;n+=1){const s=t.sources[n];if(s.sources){const i=s.state;i===Ze?s!==e&&(!s.updatedAt||s.updatedAt<zt)&&Wt(s):i===Ye&&qt(s,e)}}}function Tn(t){for(let e=0;e<t.observers.length;e+=1){const n=t.observers[e];n.state||(n.state=Ye,n.pure?Le.push(n):tt.push(n),n.observers&&Tn(n))}}function Dt(t){let e;if(t.sources)for(;t.sources.length;){const n=t.sources.pop(),s=t.sourceSlots.pop(),i=n.observers;if(i&&i.length){const o=i.pop(),r=n.observerSlots.pop();s<i.length&&(o.sourceSlots[r]=s,i[s]=o,n.observerSlots[s]=r)}}if(t.tOwned){for(e=t.tOwned.length-1;e>=0;e--)Dt(t.tOwned[e]);delete t.tOwned}if(t.owned){for(e=t.owned.length-1;e>=0;e--)Dt(t.owned[e]);t.owned=null}if(t.cleanups){for(e=t.cleanups.length-1;e>=0;e--)t.cleanups[e]();t.cleanups=null}t.state=0}function ys(t){return t instanceof Error?t:new Error(typeof t=="string"?t:"Unknown error",{cause:t})}function $n(t,e=_e){throw ys(t)}function gn(t){if(typeof t=="function"&&!t.length)return gn(t());if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++){const s=gn(t[n]);Array.isArray(s)?e.push.apply(e,s):e.push(s)}return e}return t}function bs(t,e){return function(s){let i;return fe(()=>i=Je(()=>(_e.context=oe(j({},_e.context),{[t]:s.value}),Cs(()=>s.children))),void 0),i}}const _s=Symbol("fallback");function Rn(t){for(let e=0;e<t.length;e++)t[e]()}function Ss(t,e,n={}){let s=[],i=[],o=[],r=0,c=e.length>1?[]:null;return un(()=>Rn(o)),()=>{let a=t()||[],d=a.length,u,f;return a[Ct],Je(()=>{let V,U,F,J,H,E,b,y,q;if(d===0)r!==0&&(Rn(o),o=[],s=[],i=[],r=0,c&&(c=[])),n.fallback&&(s=[_s],i[0]=Vt(h=>(o[0]=h,n.fallback())),r=1);else if(r===0){for(i=new Array(d),f=0;f<d;f++)s[f]=a[f],i[f]=Vt(N);r=d}else{for(F=new Array(d),J=new Array(d),c&&(H=new Array(d)),E=0,b=Math.min(r,d);E<b&&s[E]===a[E];E++);for(b=r-1,y=d-1;b>=E&&y>=E&&s[b]===a[y];b--,y--)F[y]=i[b],J[y]=o[b],c&&(H[y]=c[b]);for(V=new Map,U=new Array(y+1),f=y;f>=E;f--)q=a[f],u=V.get(q),U[f]=u===void 0?-1:u,V.set(q,f);for(u=E;u<=b;u++)q=s[u],f=V.get(q),f!==void 0&&f!==-1?(F[f]=i[u],J[f]=o[u],c&&(H[f]=c[u]),f=U[f],V.set(q,f)):o[u]();for(f=E;f<d;f++)f in F?(i[f]=F[f],o[f]=J[f],c&&(c[f]=H[f],c[f](f))):i[f]=Vt(N);i=i.slice(0,r=d),s=a.slice(0)}return i});function N(V){if(o[f]=V,c){const[U,F]=L(f);return c[f]=F,e(a[f],U)}return e(a[f])}}}function ae(t,e){return Je(()=>t(e||{}))}const As=t=>`Stale read from <${t}>.`;function ut(t){const e="fallback"in t&&{fallback:()=>t.fallback};return st(Ss(()=>t.each,t.children,e||void 0))}function Qe(t){const e=t.keyed,n=st(()=>t.when,void 0,void 0),s=e?n:st(n,void 0,{equals:(i,o)=>!i==!o});return st(()=>{const i=s();if(i){const o=t.children;return typeof o=="function"&&o.length>0?Je(()=>o(e?i:()=>{if(!Je(s))throw As("Show");return n()})):o}return t.fallback},void 0,void 0)}const te=t=>st(()=>t());function xs(t,e,n){let s=n.length,i=e.length,o=s,r=0,c=0,a=e[i-1].nextSibling,d=null;for(;r<i||c<o;){if(e[r]===n[c]){r++,c++;continue}for(;e[i-1]===n[o-1];)i--,o--;if(i===r){const u=o<s?c?n[c-1].nextSibling:n[o-c]:a;for(;c<o;)t.insertBefore(n[c++],u)}else if(o===c)for(;r<i;)(!d||!d.has(e[r]))&&e[r].remove(),r++;else if(e[r]===n[o-1]&&n[c]===e[i-1]){const u=e[--i].nextSibling;t.insertBefore(n[c++],e[r++].nextSibling),t.insertBefore(n[--o],u),e[i]=n[o]}else{if(!d){d=new Map;let f=c;for(;f<o;)d.set(n[f],f++)}const u=d.get(e[r]);if(u!=null)if(c<u&&u<o){let f=r,N=1,V;for(;++f<i&&f<o&&!((V=d.get(e[f]))==null||V!==u+N);)N++;if(N>u-c){const U=e[r];for(;c<u;)t.insertBefore(n[c++],U)}else t.replaceChild(n[c++],e[r++])}else r++;else e[r++].remove()}}}const Pn="_$DX_DELEGATE";function Is(t,e,n,s={}){let i;return Vt(o=>{i=o,e===document?t():k(e,t(),e.firstChild?null:void 0,n)},s.owner),()=>{i(),e.textContent=""}}function O(t,e,n,s){let i;const o=()=>{const c=document.createElement("template");return c.innerHTML=t,c.content.firstChild},r=()=>(i||(i=o())).cloneNode(!0);return r.cloneNode=r,r}function yt(t,e=window.document){const n=e[Pn]||(e[Pn]=new Set);for(let s=0,i=t.length;s<i;s++){const o=t[s];n.has(o)||(n.add(o),e.addEventListener(o,ks))}}function ce(t,e,n){n==null?t.removeAttribute(e):t.setAttribute(e,n)}function it(t,e){e==null?t.removeAttribute("class"):t.className=e}function Zt(t,e,n,s){Array.isArray(n)?(t[`$$${e}`]=n[0],t[`$$${e}Data`]=n[1]):t[`$$${e}`]=n}function pn(t,e,n){if(!e)return n?ce(t,"style"):e;const s=t.style;if(typeof e=="string")return s.cssText=e;typeof n=="string"&&(s.cssText=n=void 0),n||(n={}),e||(e={});let i,o;for(o in n)e[o]==null&&s.removeProperty(o),delete n[o];for(o in e)i=e[o],i!==n[o]&&(s.setProperty(o,i),n[o]=i);return n}function l(t,e,n){n!=null?t.style.setProperty(e,n):t.style.removeProperty(e)}function Yt(t,e,n){return Je(()=>t(e,n))}function k(t,e,n,s){if(n!==void 0&&!s&&(s=[]),typeof e!="function")return Xt(t,e,s,n);fe(i=>Xt(t,e(),i,n),s)}function ks(t){let e=t.target;const n=`$$${t.type}`,s=t.target,i=t.currentTarget,o=a=>Object.defineProperty(t,"target",{configurable:!0,value:a}),r=()=>{const a=e[n];if(a&&!e.disabled){const d=e[`${n}Data`];if(d!==void 0?a.call(e,d,t):a.call(e,t),t.cancelBubble)return}return e.host&&typeof e.host!="string"&&!e.host._$host&&e.contains(t.target)&&o(e.host),!0},c=()=>{for(;r()&&(e=e._$host||e.parentNode||e.host););};if(Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return e||document}}),t.composedPath){const a=t.composedPath();o(a[0]);for(let d=0;d<a.length-2&&(e=a[d],!!r());d++){if(e._$host){e=e._$host,c();break}if(e.parentNode===i)break}}else c();o(s)}function Xt(t,e,n,s,i){for(;typeof n=="function";)n=n();if(e===n)return n;const o=typeof e,r=s!==void 0;if(t=r&&n[0]&&n[0].parentNode||t,o==="string"||o==="number"){if(o==="number"&&(e=e.toString(),e===n))return n;if(r){let c=n[0];c&&c.nodeType===3?c.data!==e&&(c.data=e):c=document.createTextNode(e),n=bt(t,n,s,c)}else n!==""&&typeof n=="string"?n=t.firstChild.data=e:n=t.textContent=e}else if(e==null||o==="boolean")n=bt(t,n,s);else{if(o==="function")return fe(()=>{let c=e();for(;typeof c=="function";)c=c();n=Xt(t,c,n,s)}),()=>n;if(Array.isArray(e)){const c=[],a=n&&Array.isArray(n);if(Cn(c,e,n,i))return fe(()=>n=Xt(t,c,n,s,!0)),()=>n;if(c.length===0){if(n=bt(t,n,s),r)return n}else a?n.length===0?Dn(t,c,s):xs(t,n,c):(n&&bt(t),Dn(t,c));n=c}else if(e.nodeType){if(Array.isArray(n)){if(r)return n=bt(t,n,s,e);bt(t,n,null,e)}else n==null||n===""||!t.firstChild?t.appendChild(e):t.replaceChild(e,t.firstChild);n=e}}return n}function Cn(t,e,n,s){let i=!1;for(let o=0,r=e.length;o<r;o++){let c=e[o],a=n&&n[t.length],d;if(!(c==null||c===!0||c===!1))if((d=typeof c)=="object"&&c.nodeType)t.push(c);else if(Array.isArray(c))i=Cn(t,c,a)||i;else if(d==="function")if(s){for(;typeof c=="function";)c=c();i=Cn(t,Array.isArray(c)?c:[c],Array.isArray(a)?a:[a])||i}else t.push(c),i=!0;else{const u=String(c);a&&a.nodeType===3&&a.data===u?t.push(a):t.push(document.createTextNode(u))}}return i}function Dn(t,e,n=null){for(let s=0,i=e.length;s<i;s++)t.insertBefore(e[s],n)}function bt(t,e,n,s){if(n===void 0)return t.textContent="";const i=s||document.createTextNode("");if(e.length){let o=!1;for(let r=e.length-1;r>=0;r--){const c=e[r];if(i!==c){const a=c.parentNode===t;!o&&!r?a?t.replaceChild(i,c):t.insertBefore(i,n):a&&c.remove()}else o=!0}}else t.insertBefore(i,n);return[i]}const mn="data:image/svg+xml,%3csvg%20width='44'%20height='40'%20viewBox='0%200%2044%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M36.4826%2032.6733C35.865%2033.1908%2035.1941%2033.6282%2034.4904%2033.957L33.74%2034.2621L29.7612%2035.8775C27.1272%2036.125%2024.4866%2036.253%2021.8465%2036.2542C21.235%2036.2549%2020.6236%2036.2482%2020.0127%2036.2348V33.2478L36.4826%2032.6733Z'%20fill='%239EACBA'/%3e%3cpath%20d='M0.438355%2018.8047C0.245806%2020.9769%200.245812%2023.1226%200.438355%2025.2946C0.535045%2025.9265%200.94889%2026.5048%201.4516%2026.8841C2.21046%2027.3799%202.95285%2027.8531%203.87299%2027.9711C4.74581%2027.9246%205.47724%2026.84%205.59973%2026.0356C5.89635%2023.3667%205.89636%2020.7328%205.59973%2018.0638C5.47724%2017.2593%204.74582%2016.1747%203.873%2016.1282C2.95286%2016.2462%202.21046%2016.7194%201.45161%2017.2152C0.948896%2017.5945%200.535045%2018.1729%200.438355%2018.8047Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M43.0616%2018.8047C43.2541%2020.9769%2043.2541%2023.1226%2043.0616%2025.2946C42.9649%2025.9265%2042.551%2026.5048%2042.0483%2026.8841C41.2895%2027.3799%2040.5471%2027.8531%2039.6269%2027.9711C38.7541%2027.9246%2038.0227%2026.84%2037.9002%2026.0356C37.6036%2023.3667%2037.6036%2020.7328%2037.9002%2018.0638C38.0227%2017.2593%2038.7541%2016.1747%2039.6269%2016.1282C40.5471%2016.2462%2041.2895%2016.7194%2042.0483%2017.2152C42.551%2017.5945%2042.9649%2018.1729%2043.0616%2018.8047Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M25.8389%208.85439H21.8867V7.22803H21.9359C22.2919%207.22803%2022.6365%207.24805%2022.9641%207.28506C24.6208%207.47311%2025.8389%208.10461%2025.8389%208.85439Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M22.9637%208.85422V11.641H20.9072V3.74219H21.8863V8.85422H22.9637Z'%20fill='%23171A3B'/%3e%3cpath%20d='M25.8393%208.85439C25.8393%209.60419%2024.6212%2010.2357%2022.9645%2010.4237C22.6369%2010.4607%2022.2923%2010.4808%2021.9362%2010.4808C21.5801%2010.4808%2021.2356%2010.4607%2020.908%2010.4237C19.2513%2010.2357%2018.0332%209.60419%2018.0332%208.85439C18.0332%208.104%2019.2513%207.47311%2020.908%207.28506C21.2204%207.24987%2021.5486%207.22985%2021.8871%207.22803V8.85439H25.8393Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M21.8871%208.85499V35.245H21.8465C21.235%2035.2456%2020.6235%2035.2389%2020.0127%2035.2256C17.1712%2035.1637%2014.331%2034.9538%2011.5017%2034.5856C7.74793%2034.0979%204.29685%2030.281%203.74784%2026.4459C3.32624%2023.5019%203.32624%2020.598%203.74784%2017.6541C4.29684%2013.819%207.74793%2010.0021%2011.5017%209.5144C14.9401%209.06731%2018.393%208.85317%2021.8465%208.85499H21.8871Z'%20fill='%23E7E9EB'/%3e%3cpath%20d='M40.114%2026.4452C39.7718%2028.7455%2038.3748%2031.0864%2036.4821%2032.6728C35.8646%2033.1902%2035.1936%2033.6276%2034.49%2033.9564C34.2437%2034.0716%2033.9931%2034.1736%2033.7396%2034.2615C33.2888%2034.4168%2032.8272%2034.5272%2032.3601%2034.5848C28.8781%2035.0149%2025.3827%2035.2406%2021.8867%2035.2442V8.85425C25.3821%208.85789%2028.8787%209.08355%2032.3601%209.51366C36.1382%209.98014%2039.5516%2013.8729%2040.114%2017.6533C40.5489%2020.5785%2040.5489%2023.5206%2040.114%2026.4452Z'%20fill='%23D1D3D4'/%3e%3cpath%20d='M27.1787%2013.3372C28.7256%2013.4409%2030.2804%2013.5888%2031.834%2013.7805C33.5282%2013.9898%2035.5612%2016.263%2035.8623%2018.2854C36.2336%2020.7829%2036.2336%2023.3159%2035.8623%2025.8127C35.6791%2027.0417%2034.8396%2028.4416%2033.7217%2029.3782C33.3772%2029.6675%2033.0233%2029.8974%2032.6709%2030.0618C32.5593%2030.1145%2032.4464%2030.1603%2032.3359%2030.1985C32.1609%2030.259%2031.9925%2030.2992%2031.835%2030.3186C28.467%2030.7347%2025.0907%2030.9456%2021.7998%2030.9456C21.2369%2030.9456%2020.667%2030.9391%2020.1064%2030.927C17.3961%2030.8675%2014.6875%2030.6643%2012.0566%2030.3215C11.6382%2030.2669%2011.1776%2030.0829%2010.7197%2029.7961L27.1787%2013.3372ZM21.7988%2013.1536C22.397%2013.1536%2022.9986%2013.1605%2023.6016%2013.175H23.6006C24.7855%2013.2017%2025.9795%2013.2559%2027.1777%2013.3372L10.7188%2029.7961C10.3196%2029.5462%209.92292%2029.2179%209.55957%2028.8303C9.2952%2028.5484%209.05604%2028.2435%208.84863%2027.927V27.926C8.40193%2027.2445%208.10127%2026.5082%208.00488%2025.8352C7.82534%2024.5778%207.73289%2023.3374%207.73047%2022.0969C7.72805%2020.825%207.8205%2019.5531%208.00488%2018.2629C8.14621%2017.2772%208.72802%2016.1571%209.56152%2015.2678C10.341%2014.4363%2011.2736%2013.8785%2012.0566%2013.7766C13.5174%2013.5867%2014.9995%2013.4403%2016.4912%2013.3372C18.2497%2013.2152%2020.0239%2013.1536%2021.7988%2013.1536Z'%20fill='%2333383F'/%3e%3cpath%20d='M21.8877%200.164557V4.90412C21.5382%204.90412%2021.207%204.8289%2020.9086%204.69301C20.0878%204.32054%2019.5176%203.49371%2019.5176%202.53403C19.5176%201.22554%2020.5786%200.164557%2021.8877%200.164557Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M29.7612%2035.877L20.0127%2039.8352V36.2343C20.6236%2036.2476%2021.235%2036.2543%2021.8465%2036.2537C24.4866%2036.2525%2027.1272%2036.1245%2029.7612%2035.877Z'%20fill='%23D1D3D4'/%3e%3cpath%20d='M24.2562%202.53403C24.2562%203.45488%2023.7309%204.2532%2022.9641%204.64569C22.6414%204.8107%2022.275%204.90411%2021.8867%204.90411V0.164551C23.1952%200.164551%2024.2562%201.22553%2024.2562%202.53403Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M22.9641%204.646V7.28541C22.6365%207.24841%2022.2919%207.22839%2021.9359%207.22839H21.8867V4.90441C22.275%204.90441%2022.6414%204.811%2022.9641%204.646Z'%20fill='%2301052B'/%3e%3cpath%20d='M15.4282%2025.5157C14.6141%2025.6903%2014.1949%2025.6903%2013.3808%2025.5157C12.8325%2025.2805%2012.4157%2024.7097%2012.2918%2024.124C12.0811%2022.4009%2012.0811%2020.7336%2012.2918%2019.0104C12.4157%2018.4248%2012.8325%2017.854%2013.3808%2017.6188C14.1949%2017.4441%2014.6141%2017.4441%2015.4282%2017.6188C15.9765%2017.854%2016.3933%2018.4248%2016.5173%2019.0104C16.7279%2020.7336%2016.7279%2022.4009%2016.5173%2024.124C16.3933%2024.7097%2015.9765%2025.2805%2015.4282%2025.5157Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M29.4946%2025.5157C28.6805%2025.6903%2028.2613%2025.6903%2027.4472%2025.5157C26.8989%2025.2805%2026.4821%2024.7097%2026.3582%2024.124C26.1475%2022.4009%2026.1475%2020.7336%2026.3582%2019.0104C26.4821%2018.4248%2026.8989%2017.854%2027.4472%2017.6188C28.2613%2017.4441%2028.6805%2017.4441%2029.4946%2017.6188C30.0429%2017.854%2030.4597%2018.4248%2030.5837%2019.0104C30.7943%2020.7336%2030.7943%2022.4009%2030.5837%2024.124C30.4597%2024.7097%2030.0429%2025.2805%2029.4946%2025.5157Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M18.9688%2024.187H23.91C24.2911%2024.187%2024.6004%2024.5023%2024.6004%2024.8906V24.9011C24.6004%2026.6789%2023.184%2028.1222%2021.4394%2028.1222C19.6948%2028.1222%2018.2783%2026.6789%2018.2783%2024.9011V24.8906C18.2783%2024.5023%2018.5877%2024.187%2018.9688%2024.187Z'%20fill='%2351D6A1'/%3e%3c/svg%3e",Ms="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='28'%20height='28'%20rx='14'%20fill='%23EFEFEF'/%3e%3cpath%20d='M20.667%209.83325L7.33366%209.83325'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M16.5%2014L7.33333%2014'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M11.5%2018.1667H7.33333'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",Es="data:image/svg+xml,%3csvg%20width='29'%20height='28'%20viewBox='0%200%2029%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.5977%2016.0232C11.8613%2015.7596%2012.2882%2015.7596%2012.5518%2016.0232C12.8152%2016.2868%2012.8153%2016.7137%2012.5518%2016.9773L7.87109%2021.658H11.1221C11.4949%2021.658%2011.7969%2021.9609%2011.7969%2022.3337C11.7967%2022.7064%2011.4948%2023.0085%2011.1221%2023.0085H6.24121C5.86853%2023.0085%205.56658%2022.7064%205.56641%2022.3337V17.4529C5.56641%2017.0801%205.86842%2016.7771%206.24121%2016.7771C6.614%2016.7771%206.91602%2017.0801%206.91602%2017.4529V20.7039L11.5977%2016.0232ZM22.9082%204.99194C23.2808%204.99212%2023.583%205.29406%2023.583%205.66675V10.5476C23.583%2010.9203%2023.2808%2011.2222%2022.9082%2011.2224C22.5354%2011.2224%2022.2324%2010.9204%2022.2324%2010.5476V7.29663L17.5518%2011.9773C17.2882%2012.2408%2016.8613%2012.2407%2016.5977%2011.9773C16.3341%2011.7137%2016.3341%2011.2868%2016.5977%2011.0232L21.2783%206.34155H18.0273C17.6546%206.34155%2017.3516%206.03954%2017.3516%205.66675C17.3516%205.29396%2017.6546%204.99194%2018.0273%204.99194H22.9082Z'%20fill='%23858B93'%20stroke='%23858B93'%20stroke-width='0.1'/%3e%3c/svg%3e",Ts="data:image/svg+xml,%3csvg%20width='29'%20height='28'%20viewBox='0%200%2029%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.0737%2015.8249C12.4464%2015.8249%2012.7493%2016.127%2012.7495%2016.4997V21.3805C12.7495%2021.7533%2012.4465%2022.0563%2012.0737%2022.0563C11.7011%2022.0561%2011.3989%2021.7532%2011.3989%2021.3805V18.1296L6.71826%2022.8102C6.45466%2023.0738%206.02679%2023.0738%205.76318%2022.8102C5.49996%2022.5466%205.49985%2022.1196%205.76318%2021.8561L10.4438%2017.1755H7.19287C6.82019%2017.1753%206.51807%2016.8724%206.51807%2016.4997C6.51824%2016.1271%206.82029%2015.825%207.19287%2015.8249H12.0737ZM22.4302%205.18913C22.6937%204.9258%2023.1207%204.92591%2023.3843%205.18913C23.6479%205.45274%2023.6479%205.88061%2023.3843%206.14421L18.7046%2010.8249H21.9546C22.3273%2010.8249%2022.6302%2011.127%2022.6304%2011.4997C22.6304%2011.8725%2022.3274%2012.1755%2021.9546%2012.1755H17.0737C16.7011%2012.1753%2016.3989%2011.8724%2016.3989%2011.4997V6.61882C16.3991%206.24624%2016.7012%205.94419%2017.0737%205.94402C17.4464%205.94402%2017.7494%206.24613%2017.7495%206.61882V9.8698L22.4302%205.18913Z'%20fill='%23858B93'%20stroke='%23858B93'%20stroke-width='0.1'/%3e%3c/svg%3e",Bn="data:image/svg+xml,%3csvg%20width='34'%20height='34'%20viewBox='0%200%2034%2034'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.2391%208.55011C9.85199%208.16298%209.22434%208.16298%208.83722%208.55011C8.45009%208.93723%208.45009%209.56488%208.83722%209.95201L15.885%2016.9998L8.83728%2024.0476C8.45016%2024.4347%208.45016%2025.0624%208.83728%2025.4495C9.22441%2025.8366%209.85206%2025.8366%2010.2392%2025.4495L17.2869%2018.4017L24.3346%2025.4494C24.7217%2025.8365%2025.3494%2025.8365%2025.7365%2025.4494C26.1236%2025.0623%2026.1236%2024.4346%2025.7365%2024.0475L18.6888%2016.9998L25.7366%209.95207C26.1237%209.56495%2026.1237%208.9373%2025.7366%208.55017C25.3495%208.16305%2024.7218%208.16305%2024.3347%208.55017L17.2869%2015.5979L10.2391%208.55011Z'%20fill='%23858B93'/%3e%3c/svg%3e",$s="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.9912%202.92969C11.4392%202.92969%2010.9912%203.37769%2010.9912%203.92969V10.9297H3.99121C3.43921%2010.9297%202.99121%2011.3777%202.99121%2011.9297C2.99121%2012.4817%203.43921%2012.9297%203.99121%2012.9297H10.9912V19.9297C10.9912%2020.4817%2011.4392%2020.9297%2011.9912%2020.9297C12.5432%2020.9297%2012.9912%2020.4817%2012.9912%2019.9297V12.9297H19.9912C20.5432%2012.9297%2020.9912%2012.4817%2020.9912%2011.9297C20.9912%2011.3777%2020.5432%2010.9297%2019.9912%2010.9297H12.9912V3.92969C12.9912%203.37769%2012.5432%202.92969%2011.9912%202.92969Z'%20fill='%23858B93'/%3e%3c/svg%3e",Rs="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='32'%20height='32'%20rx='16'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.6464%2010.3132C15.8417%2010.1179%2016.1583%2010.1179%2016.3536%2010.3132L20.3536%2014.3132C20.5488%2014.5085%2020.5488%2014.825%2020.3536%2015.0203C20.1583%2015.2156%2019.8417%2015.2156%2019.6464%2015.0203L16.5%2011.8739L16.5%2021.3334C16.5%2021.6096%2016.2761%2021.8334%2016%2021.8334C15.7239%2021.8334%2015.5%2021.6096%2015.5%2021.3334L15.5%2011.8739L12.3536%2015.0203C12.1583%2015.2156%2011.8417%2015.2156%2011.6464%2015.0203C11.4512%2014.825%2011.4512%2014.5085%2011.6464%2014.3132L15.6464%2010.3132Z'%20fill='%23858B93'/%3e%3c/svg%3e",Ps="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='28'%20height='28'%20rx='14'%20fill='%231AAF74'%20fill-opacity='0.1'/%3e%3cpath%20d='M20.667%209.83325L7.33366%209.83325'%20stroke='%231AAF74'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M16.5%2014L7.33333%2014'%20stroke='%231AAF74'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M11.5%2018.1667H7.33333'%20stroke='%231AAF74'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",Ds="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='12'%20cy='6.5'%20r='4'%20stroke='%23858B93'%20stroke-width='1.3'/%3e%3cellipse%20cx='12'%20cy='17.5'%20rx='7'%20ry='4'%20stroke='%23858B93'%20stroke-width='1.3'/%3e%3c/svg%3e",Bs="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2012.5C2%207.78595%202%205.42893%203.46447%203.96447C4.92893%202.5%207.28595%202.5%2012%202.5C16.714%202.5%2019.0711%202.5%2020.5355%203.96447C22%205.42893%2022%207.78595%2022%2012.5C22%2017.214%2022%2019.5711%2020.5355%2021.0355C19.0711%2022.5%2016.714%2022.5%2012%2022.5C7.28595%2022.5%204.92893%2022.5%203.46447%2021.0355C2%2019.5711%202%2017.214%202%2012.5Z'%20stroke='%23858B93'%20stroke-width='1.3'/%3e%3cpath%20d='M7%2014.5L8.79689%2012.3437C9.50894%2011.4893%209.86496%2011.062%2010.3333%2011.062C10.8017%2011.062%2011.1577%2011.4893%2011.8698%2012.3437L12.1302%2012.6563C12.8423%2013.5107%2013.1983%2013.938%2013.6667%2013.938C14.135%2013.938%2014.4911%2013.5107%2015.2031%2012.6563L17%2010.5'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",Hs="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M22%2011V12.5C22%2017.214%2022%2019.5711%2020.5355%2021.0355C19.0711%2022.5%2016.714%2022.5%2012%2022.5C7.28595%2022.5%204.92893%2022.5%203.46447%2021.0355C2%2019.5711%202%2017.214%202%2012.5C2%207.78595%202%205.42893%203.46447%203.96447C4.92893%202.5%207.28595%202.5%2012%202.5H13.5'%20stroke='%23858B93'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cpath%20d='M16.652%203.95506L17.3009%203.30624C18.3759%202.23125%2020.1188%202.23125%2021.1938%203.30624C22.2687%204.38124%2022.2687%206.12415%2021.1938%207.19914L20.5449%207.84795M16.652%203.95506C16.652%203.95506%2016.7331%205.33379%2017.9497%206.55032C19.1662%207.76685%2020.5449%207.84795%2020.5449%207.84795M16.652%203.95506L10.6872%209.91993C10.2832%2010.3239%2010.0812%2010.5259%209.90743%2010.7487C9.70249%2011.0114%209.52679%2011.2957%209.38344%2011.5965C9.26191%2011.8515%209.17157%2012.1225%208.99089%2012.6646L8.41242%2014.4M20.5449%207.84795L14.5801%2013.8128C14.1761%2014.2168%2013.9741%2014.4188%2013.7513%2014.5926C13.4886%2014.7975%2013.2043%2014.9732%2012.9035%2015.1166C12.6485%2015.2381%2012.3775%2015.3284%2011.8354%2015.5091L10.1%2016.0876M10.1%2016.0876L8.97709%2016.4619C8.71035%2016.5508%208.41626%2016.4814%208.21744%2016.2826C8.01862%2016.0837%207.9492%2015.7897%208.03811%2015.5229L8.41242%2014.4M10.1%2016.0876L8.41242%2014.4'%20stroke='%23858B93'%20stroke-width='1.5'/%3e%3c/svg%3e",Ls="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9.58366%202.79175C5.55658%202.79175%202.29199%206.05634%202.29199%2010.0834C2.29199%2014.1105%205.55658%2017.3751%209.58366%2017.3751C13.6107%2017.3751%2016.8753%2014.1105%2016.8753%2010.0834C16.8753%206.05634%2013.6107%202.79175%209.58366%202.79175ZM1.04199%2010.0834C1.04199%205.36598%204.86623%201.54175%209.58366%201.54175C14.3011%201.54175%2018.1253%205.36598%2018.1253%2010.0834C18.1253%2012.2172%2017.3429%2014.1682%2016.0494%2015.6653L18.7756%2018.3915C19.0197%2018.6356%2019.0197%2019.0313%2018.7756%2019.2754C18.5315%2019.5194%2018.1358%2019.5194%2017.8917%2019.2754L15.1655%2016.5491C13.6684%2017.8427%2011.7174%2018.6251%209.58366%2018.6251C4.86623%2018.6251%201.04199%2014.8008%201.04199%2010.0834Z'%20fill='%23858B93'/%3e%3c/svg%3e",Os="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17%2012.5C17%2011.3954%2017.8954%2010.5%2019%2010.5C20.1046%2010.5%2021%2011.3954%2021%2012.5C21%2013.6046%2020.1046%2014.5%2019%2014.5C17.8954%2014.5%2017%2013.6046%2017%2012.5Z'%20fill='%23858B93'/%3e%3cpath%20d='M10%2012.5C10%2011.3954%2010.8954%2010.5%2012%2010.5C13.1046%2010.5%2014%2011.3954%2014%2012.5C14%2013.6046%2013.1046%2014.5%2012%2014.5C10.8954%2014.5%2010%2013.6046%2010%2012.5Z'%20fill='%23858B93'/%3e%3cpath%20d='M3%2012.5C3%2011.3954%203.89543%2010.5%205%2010.5C6.10457%2010.5%207%2011.3954%207%2012.5C7%2013.6046%206.10457%2014.5%205%2014.5C3.89543%2014.5%203%2013.6046%203%2012.5Z'%20fill='%23858B93'/%3e%3c/svg%3e",Fs="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7%208.5C7%205.73858%209.23858%203.5%2012%203.5C14.7614%203.5%2017%205.73858%2017%208.5V11.5C17%2014.2614%2014.7614%2016.5%2012%2016.5C9.23858%2016.5%207%2014.2614%207%2011.5V8.5Z'%20stroke='%23858B93'%20stroke-width='1.5'/%3e%3cpath%20d='M11%208.5H13'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M10%2011.5L14%2011.5'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M20%2010.5V11.5C20%2015.9183%2016.4183%2019.5%2012%2019.5C7.58172%2019.5%204%2015.9183%204%2011.5V10.5'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M12%2019.5V22.5'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",Hn="data:image/svg+xml,%3csvg%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.25%202.49258C13.5179%201.2247%2015.5735%201.2247%2016.8414%202.49258C18.1093%203.76046%2018.1093%205.8161%2016.8414%207.08398L10.5131%2013.4123C10.1564%2013.769%209.9386%2013.9869%209.69583%2014.1762C9.40981%2014.3993%209.10033%2014.5906%208.77287%2014.7466C8.49494%2014.8791%208.20269%2014.9765%207.72413%2015.136L5.49692%2015.8784L4.9622%2016.0566C4.48358%2016.2162%203.95589%2016.0916%203.59915%2015.7349C3.2424%2015.3781%203.11783%2014.8504%203.27737%2014.3718L4.19801%2011.6099C4.3575%2011.1313%204.4549%2010.8391%204.58736%2010.5611C4.74342%2010.2337%204.93469%209.9242%205.15778%209.63817C5.34714%209.3954%205.56498%209.17759%205.92169%208.82091L12.25%202.49258ZM5.46809%2014.5704L4.76362%2013.8659L5.37064%2012.0449C5.54737%2011.5147%205.62037%2011.2991%205.71577%2011.0989C5.83276%2010.8534%205.97616%2010.6214%206.14342%2010.4069C6.27979%2010.2321%206.43997%2010.0704%206.83516%209.67521L11.7443%204.76607C11.9469%205.27439%2012.2898%205.88791%2012.8679%206.46606C13.4461%207.04422%2014.0596%207.38707%2014.5679%207.5897L9.65879%2012.4988C9.2636%2012.894%209.1019%2013.0542%208.92706%2013.1906C8.71262%2013.3578%208.4806%2013.5012%208.2351%2013.6182C8.03493%2013.7136%207.81935%2013.7866%207.28915%2013.9634L5.46809%2014.5704ZM15.564%206.59368C15.4608%206.57102%2015.3317%206.53694%2015.1851%206.48604C14.7817%206.34611%2014.2511%206.08149%2013.7518%205.58218C13.2525%205.08287%2012.9879%204.5523%2012.848%204.14895C12.7971%204.00226%2012.763%203.87323%2012.7403%203.77004L13.1339%203.37647C13.9136%202.59674%2015.1778%202.59674%2015.9575%203.37647C16.7373%204.15619%2016.7373%205.42038%2015.9575%206.2001L15.564%206.59368ZM3.209%2018.8333C3.209%2018.4882%203.48882%2018.2083%203.834%2018.2083H17.1673V19.4583H3.834C3.48882%2019.4583%203.209%2019.1785%203.209%2018.8333Z'%20fill='%23858B93'/%3e%3c/svg%3e",Ln="data:image/svg+xml,%3csvg%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.4994%202.79166C9.68396%202.79166%208.9886%203.31251%208.7309%204.0416C8.61587%204.36705%208.2588%204.53763%207.93335%204.4226C7.6079%204.30757%207.43733%203.95049%207.55235%203.62504C7.98105%202.41215%209.13775%201.54166%2010.4994%201.54166C11.861%201.54166%2013.0177%202.41215%2013.4464%203.62504C13.5614%203.95049%2013.3908%204.30757%2013.0654%204.4226C12.74%204.53763%2012.3829%204.36705%2012.2678%204.0416C12.0101%203.31251%2011.3148%202.79166%2010.4994%202.79166Z'%20fill='%23858B93'/%3e%3cpath%20d='M2.79102%205.49999C2.79102%205.15481%203.07084%204.87499%203.41602%204.87499H17.5828C17.9279%204.87499%2018.2078%205.15481%2018.2078%205.49999C18.2078%205.84517%2017.9279%206.12499%2017.5828%206.12499H3.41602C3.07084%206.12499%202.79102%205.84517%202.79102%205.49999Z'%20fill='%23858B93'/%3e%3cpath%20d='M5.42859%207.54175C5.40563%207.19733%205.10781%206.93675%204.7634%206.95971C4.41898%206.98267%204.15839%207.28048%204.18135%207.6249L4.56756%2013.418C4.63881%2014.487%204.69636%2015.3504%204.83134%2016.028C4.97167%2016.7324%205.21035%2017.3208%205.70335%2017.782C6.19634%2018.2432%206.7993%2018.4422%207.51151%2018.5354C8.19654%2018.625%209.06191%2018.625%2010.1332%2018.625H10.8656C11.9369%2018.625%2012.8023%2018.625%2013.4873%2018.5354C14.1995%2018.4422%2014.8025%2018.2432%2015.2955%2017.782C15.7885%2017.3208%2016.0272%2016.7324%2016.1675%2016.028C16.3025%2015.3504%2016.36%2014.487%2016.4313%2013.418L16.8175%207.6249C16.8404%207.28048%2016.5798%206.98267%2016.2354%206.95971C15.891%206.93675%2015.5932%207.19733%2015.5702%207.54175L15.187%2013.291C15.1121%2014.4142%2015.0587%2015.1957%2014.9416%2015.7837C14.828%2016.3541%2014.6693%2016.656%2014.4415%2016.8692C14.2137%2017.0824%2013.9019%2017.2205%2013.3252%2017.296C12.7307%2017.3737%2011.9474%2017.375%2010.8216%2017.375H10.1772C9.05148%2017.375%208.26814%2017.3737%207.67364%2017.296C7.09697%2017.2205%206.78517%2017.0824%206.55733%2016.8692C6.32948%2016.656%206.17087%2016.3541%206.05725%2015.7837C5.94011%2015.1957%205.88675%2014.4142%205.81187%2013.291L5.42859%207.54175Z'%20fill='%23858B93'/%3e%3cpath%20d='M8.3539%209.04476C8.69736%209.01041%209.00364%209.261%209.03799%209.60447L9.45465%2013.7711C9.489%2014.1146%209.23841%2014.4209%208.89494%2014.4552C8.55148%2014.4896%208.2452%2014.239%208.21086%2013.8955L7.79419%209.72885C7.75984%209.38538%208.01043%209.0791%208.3539%209.04476Z'%20fill='%23858B93'/%3e%3cpath%20d='M13.2047%209.72885C13.239%209.38538%2012.9884%209.0791%2012.6449%209.04476C12.3015%209.01041%2011.9952%209.261%2011.9609%209.60447L11.5442%2013.7711C11.5098%2014.1146%2011.7604%2014.4209%2012.1039%2014.4552C12.4474%2014.4896%2012.7536%2014.239%2012.788%2013.8955L13.2047%209.72885Z'%20fill='%23858B93'/%3e%3c/svg%3e",Ns="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='32'%20height='32'%20rx='16'%20fill='white'/%3e%3cpath%20d='M16%2022.6666L16%209.33331M16%209.33331L21%2014.3333M16%209.33331L11%2014.3333'%20stroke='%231AAF74'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Us="data:image/svg+xml,%3csvg%20width='17'%20height='17'%20viewBox='0%200%2017%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2361_172518)'%3e%3cpath%20d='M15.6005%2011.6509C15.9284%2011.2327%2016.0856%2010.7843%2016.0656%2010.3226C16.0455%209.81401%2015.818%209.41585%2015.6306%209.1716C15.8481%208.62956%2015.9317%207.77636%2015.2057%207.11388C14.6737%206.62873%2013.7703%206.41125%2012.5189%206.47147C11.639%206.51162%2010.9029%206.67557%2010.8728%206.68226H10.8694C10.7021%206.71238%2010.5248%206.74918%2010.3441%206.78933C10.3307%206.57519%2010.3675%206.0432%2010.7623%204.84537C11.2308%203.42003%2011.204%202.32927%2010.6754%201.59987C10.1199%200.833663%209.23328%200.773438%208.9723%200.773438C8.72136%200.773438%208.49049%200.87716%208.32655%201.06787C7.95515%201.49949%207.99865%202.29581%208.04549%202.66386C7.60384%203.8483%206.36586%206.75253%205.3186%207.55888C5.29852%207.57227%205.2818%207.589%205.26507%207.60572C4.95724%207.93028%204.7498%208.28159%204.60927%208.58941C4.41187%208.48235%204.18769%208.42212%203.94679%208.42212H1.9058C1.13625%208.42212%200.513916%209.0478%200.513916%209.81401V15.2511C0.513916%2016.0206%201.1396%2016.6429%201.9058%2016.6429H3.94679C4.24457%2016.6429%204.52228%2016.5493%204.7498%2016.3887L5.53608%2016.4823C5.65653%2016.4991%207.7979%2016.7701%209.99614%2016.7266C10.3943%2016.7567%2010.769%2016.7734%2011.117%2016.7734C11.7159%2016.7734%2012.2379%2016.7266%2012.6728%2016.6329C13.6967%2016.4154%2014.396%2015.9805%2014.7506%2015.3414C15.0217%2014.8529%2015.0217%2014.3677%2014.9782%2014.0599C15.644%2013.4577%2015.7611%2012.7918%2015.7377%2012.3234C15.7243%2012.0524%2015.6641%2011.8215%2015.6005%2011.6509ZM1.9058%2015.7396C1.63479%2015.7396%201.4173%2015.5187%201.4173%2015.2511V9.81066C1.4173%209.53964%201.63813%209.32216%201.9058%209.32216H3.94679C4.21781%209.32216%204.43529%209.54299%204.43529%209.81066V15.2477C4.43529%2015.5187%204.21446%2015.7362%203.94679%2015.7362H1.9058V15.7396ZM14.7439%2011.2594C14.6034%2011.4066%2014.5767%2011.6308%2014.6837%2011.8048C14.6837%2011.8082%2014.8209%2012.0424%2014.8376%2012.3636C14.8611%2012.8019%2014.6503%2013.19%2014.2086%2013.5212C14.0513%2013.6417%2013.9878%2013.8491%2014.0547%2014.0365C14.0547%2014.0399%2014.1986%2014.4815%2013.9644%2014.8997C13.7402%2015.3013%2013.2416%2015.589%2012.4855%2015.7496C11.8799%2015.8801%2011.0568%2015.9035%2010.0463%2015.8232C10.0329%2015.8232%2010.0162%2015.8232%209.99949%2015.8232C7.84809%2015.87%205.67326%2015.589%205.64984%2015.5856H5.6465L5.30856%2015.5455C5.32864%2015.4518%205.33868%2015.3514%205.33868%2015.2511V9.81066C5.33868%209.66679%205.31525%209.52626%205.2751%209.39577C5.33533%209.1716%205.50262%208.67306%205.89744%208.24813C7.39974%207.057%208.86858%203.0386%208.93215%202.86461C8.95892%202.79435%208.96561%202.71739%208.95223%202.64044C8.89535%202.2657%208.91542%201.80731%208.99572%201.67013C9.17305%201.67348%209.65152%201.72367%209.93926%202.12183C10.2805%202.5936%2010.2672%203.43676%209.89911%204.55428C9.337%206.25734%209.29016%207.15403%209.73516%207.54885C9.95599%207.74625%2010.2504%207.75629%2010.4646%207.67933C10.6687%207.63249%2010.8627%207.59234%2011.0467%207.56223C11.0601%207.55888%2011.0769%207.55554%2011.0902%207.55219C12.1174%207.32802%2013.9577%207.19084%2014.5967%207.77302C15.1388%208.26821%2014.754%208.924%2014.7105%208.99427C14.5867%209.18163%2014.6235%209.42588%2014.7908%209.57645C14.7941%209.57979%2015.1455%209.91104%2015.1622%2010.356C15.1756%2010.6538%2015.035%2010.9583%2014.7439%2011.2594Z'%20fill='%23858B93'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2361_172518'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='translate(0.290527%200.773438)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",js="data:image/svg+xml,%3csvg%20width='17'%20height='17'%20viewBox='0%200%2017%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2361_172521)'%3e%3cpath%20d='M0.980564%205.89598C0.652667%206.31422%200.495411%206.76256%200.515487%207.2243C0.535562%207.73287%200.763082%208.13103%200.950451%208.37528C0.732968%208.91731%200.649323%209.77051%201.37538%2010.433C1.90737%2010.9181%202.81076%2011.1356%204.06212%2011.0754C4.94209%2011.0353%205.67818%2010.8713%205.70829%2010.8646H5.71164C5.87893%2010.8345%206.05626%2010.7977%206.23694%2010.7575C6.25033%2010.9717%206.21352%2011.5037%205.81871%2012.7015C5.35028%2014.1268%205.37705%2015.2176%205.9057%2015.947C6.46112%2016.7132%207.34777%2016.7734%207.60875%2016.7734C7.85969%2016.7734%208.09056%2016.6697%208.25451%2016.479C8.6259%2016.0474%208.5824%2015.2511%208.53556%2014.883C8.97722%2013.6986%2010.2152%2010.7943%2011.2625%209.98799C11.2825%209.97461%2011.2993%209.95788%2011.316%209.94115C11.6238%209.6166%2011.8313%209.26528%2011.9718%208.95746C12.1692%209.06453%2012.3934%209.12475%2012.6343%209.12475H14.6753C15.4448%209.12475%2016.0671%208.49907%2016.0671%207.73287V2.29581C16.0671%201.52626%2015.4415%200.903928%2014.6753%200.903928H12.6343C12.3365%200.903928%2012.0588%200.997612%2011.8313%201.15821L11.045%201.06453C10.9245%201.0478%208.78316%200.776784%206.58491%200.820281C6.18675%200.790168%205.81201%200.773438%205.46404%200.773438C4.86513%200.773438%204.34317%200.82028%203.90821%200.913965C2.88437%201.13145%202.18508%201.56641%201.83042%202.20547C1.5594%202.69397%201.5594%203.17913%201.6029%203.48695C0.937067%204.0892%200.819963%204.75504%200.843384%205.22346C0.856767%205.49447%200.916992%205.72534%200.980564%205.89598ZM14.6753%201.80732C14.9463%201.80732%2015.1638%202.02814%2015.1638%202.29581V7.73621C15.1638%208.00723%2014.9429%208.22471%2014.6753%208.22471H12.6343C12.3632%208.22471%2012.1458%208.00389%2012.1458%207.73621V2.29916C12.1458%202.02814%2012.3666%201.81066%2012.6343%201.81066H14.6753V1.80732ZM1.83711%206.28745C1.97764%206.14023%202.0044%205.91606%201.89734%205.74207C1.89734%205.73872%201.76015%205.50451%201.74343%205.18331C1.72%204.745%201.93079%204.35688%202.37245%204.02563C2.52971%203.90518%202.59328%203.69774%202.52636%203.51037C2.52636%203.50702%202.38249%203.06537%202.6167%202.64713C2.84087%202.24562%203.33941%201.95788%204.09558%201.79728C4.70118%201.66679%205.52427%201.64337%206.53473%201.72367C6.54811%201.72367%206.56484%201.72367%206.58157%201.72367C8.73297%201.67683%2010.9078%201.95788%2010.9312%201.96123H10.9346L11.2725%202.00138C11.2524%202.09506%2011.2424%202.19544%2011.2424%202.29581V7.73621C11.2424%207.88009%2011.2658%208.02061%2011.306%208.1511C11.2457%208.37528%2011.0784%208.87381%2010.6836%209.29874C9.18132%2010.4899%207.71248%2014.5083%207.6489%2014.6823C7.62214%2014.7525%207.61545%2014.8295%207.62883%2014.9064C7.68571%2015.2812%207.66563%2015.7396%207.58533%2015.8767C7.408%2015.8734%206.92954%2015.8232%206.64179%2015.425C6.30051%2014.9533%206.3139%2014.1101%206.68194%2012.9926C7.24405%2011.2895%207.29089%2010.3928%206.84589%209.99803C6.62506%209.80062%206.33063%209.79059%206.11649%209.86754C5.91239%209.91438%205.71833%209.95453%205.53431%209.98465C5.52092%209.98799%205.50419%209.99134%205.49081%209.99468C4.46363%2010.2189%202.62339%2010.356%201.98433%209.77386C1.4423%209.27867%201.82707%208.62287%201.87057%208.55261C1.99437%208.36524%201.95756%208.12099%201.79027%207.97043C1.78692%207.96708%201.4356%207.63584%201.41887%207.19084C1.40549%206.89305%201.54602%206.58858%201.83711%206.28745Z'%20fill='%23858B93'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2361_172521'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='matrix(-1%200%200%20-1%2016.2905%2016.7734)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",zs="data:image/svg+xml,%3csvg%20width='16'%20height='17'%20viewBox='0%200%2016%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2361_92626)'%3e%3cpath%20d='M15.3092%2011.4575C15.6371%2011.0393%2015.7944%2010.591%2015.7743%2010.1292C15.7542%209.62065%2015.5267%209.22249%2015.3393%208.97824C15.5568%208.4362%2015.6405%207.58301%2014.9144%206.92052C14.3824%206.43537%2013.479%206.21789%2012.2277%206.27811C11.3477%206.31826%2010.6116%206.48221%2010.5815%206.4889H10.5782C10.4109%206.51902%2010.2335%206.55582%2010.0529%206.59597C10.0395%206.38183%2010.0763%205.84984%2010.4711%204.65201C10.9395%203.22667%2010.9127%202.13591%2010.3841%201.40651C9.82868%200.640304%208.94202%200.580078%208.68104%200.580078C8.4301%200.580078%208.19923%200.6838%208.03529%200.874516C7.66389%201.30613%207.70739%202.10245%207.75423%202.4705C7.31258%203.65494%206.0746%206.55917%205.02734%207.36552C5.00726%207.37891%204.99054%207.39564%204.97381%207.41237C4.66599%207.73692%204.45854%208.08823%204.31801%208.39605C4.12061%208.28899%203.89643%208.22876%203.65553%208.22876H1.61454C0.84499%208.22876%200.222656%208.85444%200.222656%209.62065V15.0577C0.222656%2015.8273%200.848336%2016.4496%201.61454%2016.4496H3.65553C3.95331%2016.4496%204.23102%2016.3559%204.45854%2016.1953L5.24482%2016.289C5.36527%2016.3057%207.50664%2016.5767%209.70488%2016.5332C10.103%2016.5633%2010.4778%2016.5801%2010.8258%2016.5801C11.4247%2016.5801%2011.9466%2016.5332%2012.3816%2016.4396C13.4054%2016.2221%2014.1047%2015.7871%2014.4594%2015.148C14.7304%2014.6595%2014.7304%2014.1744%2014.6869%2013.8666C15.3527%2013.2643%2015.4698%2012.5985%2015.4464%2012.1301C15.433%2011.859%2015.3728%2011.6282%2015.3092%2011.4575ZM1.61454%2015.5462C1.34353%2015.5462%201.12604%2015.3254%201.12604%2015.0577V9.6173C1.12604%209.34628%201.34687%209.1288%201.61454%209.1288H3.65553C3.92655%209.1288%204.14403%209.34963%204.14403%209.6173V15.0544C4.14403%2015.3254%203.9232%2015.5429%203.65553%2015.5429H1.61454V15.5462ZM14.4527%2011.0661C14.3122%2011.2133%2014.2854%2011.4375%2014.3925%2011.6114C14.3925%2011.6148%2014.5296%2011.849%2014.5464%2012.1702C14.5698%2012.6085%2014.359%2012.9966%2013.9173%2013.3279C13.7601%2013.4483%2013.6965%2013.6558%2013.7634%2013.8431C13.7634%2013.8465%2013.9073%2014.2881%2013.6731%2014.7064C13.4489%2015.1079%2012.9504%2015.3956%2012.1942%2015.5562C11.5886%2015.6867%2010.7655%2015.7101%209.75507%2015.6298C9.74169%2015.6298%209.72496%2015.6298%209.70823%2015.6298C7.55683%2015.6767%205.382%2015.3956%205.35858%2015.3923H5.35524L5.0173%2015.3521C5.03738%2015.2585%205.04742%2015.1581%205.04742%2015.0577V9.6173C5.04742%209.47343%205.02399%209.3329%204.98384%209.20241C5.04407%208.97824%205.21136%208.4797%205.60618%208.05477C7.10848%206.86364%208.57732%202.84524%208.64089%202.67125C8.66766%202.60099%208.67435%202.52403%208.66097%202.44708C8.60409%202.07234%208.62416%201.61396%208.70446%201.47677C8.88179%201.48012%209.36026%201.53031%209.648%201.92847C9.98928%202.40024%209.9759%203.2434%209.60785%204.36092C9.04574%206.06398%208.9989%206.96067%209.4439%207.35549C9.66473%207.55289%209.95917%207.56293%2010.1733%207.48597C10.3774%207.43913%2010.5715%207.39898%2010.7555%207.36887C10.7689%207.36552%2010.7856%207.36218%2010.799%207.35883C11.8262%207.13466%2013.6664%206.99748%2014.3055%207.57966C14.8475%208.07485%2014.4627%208.73064%2014.4192%208.80091C14.2954%208.98828%2014.3322%209.23252%2014.4995%209.38309C14.5029%209.38644%2014.8542%209.71768%2014.8709%2010.1627C14.8843%2010.4605%2014.7438%2010.7649%2014.4527%2011.0661Z'%20fill='%231AAF74'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2361_92626'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='translate(0%200.580078)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Vs="data:image/svg+xml,%3csvg%20width='17'%20height='17'%20viewBox='0%200%2017%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2361_214893)'%3e%3cpath%20d='M0.784519%205.70262C0.456622%206.12086%200.299366%206.5692%200.319442%207.03094C0.339517%207.53951%200.567037%207.93767%200.754406%208.18192C0.536923%208.72395%200.453278%209.57715%201.17933%2010.2396C1.71133%2010.7248%202.61472%2010.9423%203.86607%2010.882C4.74604%2010.8419%205.48213%2010.6779%205.51225%2010.6713H5.51559C5.68289%2010.6411%205.86022%2010.6043%206.0409%2010.5642C6.05428%2010.7783%206.01748%2011.3103%205.62266%2012.5081C5.15424%2013.9335%205.18101%2015.0242%205.70965%2015.7536C6.26507%2016.5199%207.15173%2016.5801%207.41271%2016.5801C7.66365%2016.5801%207.89452%2016.4764%208.05846%2016.2856C8.42986%2015.854%208.38636%2015.0577%208.33952%2014.6897C8.78117%2013.5052%2010.0191%2010.601%2011.0664%209.79463C11.0865%209.78125%2011.1032%209.76452%2011.1199%209.74779C11.4278%209.42324%2011.6352%209.07192%2011.7757%208.7641C11.9731%208.87117%2012.1973%208.9314%2012.4382%208.9314H14.4792C15.2488%208.9314%2015.8711%208.30572%2015.8711%207.53951V2.10245C15.8711%201.3329%2015.2454%200.710568%2014.4792%200.710568H12.4382C12.1404%200.710568%2011.8627%200.804253%2011.6352%200.964854L10.8489%200.87117C10.7285%200.854441%208.58711%200.583425%206.38887%200.626922C5.99071%200.596808%205.61597%200.580078%205.268%200.580078C4.66909%200.580078%204.14713%200.626921%203.71216%200.720606C2.68832%200.938087%201.98904%201.37305%201.63437%202.01212C1.36336%202.50061%201.36336%202.98577%201.40685%203.29359C0.741022%203.89585%200.623918%204.56168%200.647339%205.0301C0.660722%205.30112%200.720947%205.53198%200.784519%205.70262ZM14.4792%201.61396C14.7502%201.61396%2014.9677%201.83478%2014.9677%202.10245V7.54286C14.9677%207.81387%2014.7469%208.03135%2014.4792%208.03135H12.4382C12.1672%208.03135%2011.9497%207.81053%2011.9497%207.54286V2.1058C11.9497%201.83478%2012.1706%201.6173%2012.4382%201.6173H14.4792V1.61396ZM1.64106%206.09409C1.78159%205.94687%201.80836%205.7227%201.70129%205.54871C1.70129%205.54536%201.56411%205.31115%201.54738%204.98995C1.52396%204.55164%201.73475%204.16352%202.1764%203.83227C2.33366%203.71182%202.39723%203.50438%202.33032%203.31701C2.33032%203.31366%202.18644%202.87201%202.42066%202.45377C2.64483%202.05227%203.14336%201.76452%203.89953%201.60392C4.50514%201.47343%205.32822%201.45001%206.33868%201.53031C6.35206%201.53031%206.36879%201.53031%206.38552%201.53031C8.53692%201.48347%2010.7117%201.76452%2010.7352%201.76787H10.7385L11.0764%201.80802C11.0564%201.9017%2011.0463%202.00208%2011.0463%202.10245V7.54286C11.0463%207.68673%2011.0698%207.82726%2011.1099%207.95774C11.0497%208.18192%2010.8824%208.68046%2010.4876%209.10538C8.98527%2010.2965%207.51643%2014.3149%207.45286%2014.4889C7.42609%2014.5592%207.4194%2014.6361%207.43278%2014.7131C7.48966%2015.0878%207.46959%2015.5462%207.38929%2015.6834C7.21196%2015.68%206.73349%2015.6298%206.44575%2015.2317C6.10447%2014.7599%206.11785%2013.9168%206.4859%2012.7992C7.04801%2011.0962%207.09485%2010.1995%206.64985%209.80467C6.42902%209.60726%206.13458%209.59723%205.92045%209.67418C5.71635%209.72102%205.52229%209.76117%205.33826%209.79129C5.32488%209.79463%205.30815%209.79798%205.29477%209.80132C4.26758%2010.0255%202.42735%2010.1627%201.78828%209.5805C1.24625%209.08531%201.63103%208.42951%201.67452%208.35925C1.79832%208.17188%201.76152%207.92763%201.59422%207.77707C1.59088%207.77372%201.23956%207.44248%201.22283%206.99748C1.20945%206.69969%201.34997%206.39522%201.64106%206.09409Z'%20fill='%23F34859'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2361_214893'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='matrix(-1%200%200%20-1%2016.0938%2016.5801)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Ws="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M22%2012.123C22%2017.6459%2017.5228%2022.123%2012%2022.123C6.47715%2022.123%202%2017.6459%202%2012.123C2%206.6002%206.47715%202.12305%2012%202.12305C17.5228%202.12305%2022%206.6002%2022%2012.123ZM16.0303%209.09272C16.3232%209.38561%2016.3232%209.86048%2016.0303%2010.1534L11.0303%2015.1534C10.7374%2015.4463%2010.2626%2015.4463%209.96967%2015.1534L7.96967%2013.1534C7.67678%2012.8605%207.67678%2012.3856%207.96967%2012.0927C8.26256%2011.7998%208.73744%2011.7998%209.03033%2012.0927L10.5%2013.5624L14.9697%209.09272C15.2626%208.79982%2015.7374%208.79982%2016.0303%209.09272Z'%20fill='%231AAF74'/%3e%3c/svg%3e",qs="data:image/svg+xml,%3csvg%20width='21'%20height='20'%20viewBox='0%200%2021%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.2904%2014.791C10.6355%2014.791%2010.9154%2014.5112%2010.9154%2014.166V9.16602C10.9154%208.82084%2010.6355%208.54102%2010.2904%208.54102C9.94519%208.54102%209.66537%208.82084%209.66537%209.16602V14.166C9.66537%2014.5112%209.94519%2014.791%2010.2904%2014.791Z'%20fill='%23858B93'/%3e%3cpath%20d='M10.2904%205.83268C10.7506%205.83268%2011.1237%206.20578%2011.1237%206.66602C11.1237%207.12625%2010.7506%207.49935%2010.2904%207.49935C9.83013%207.49935%209.45703%207.12625%209.45703%206.66602C9.45703%206.20578%209.83013%205.83268%2010.2904%205.83268Z'%20fill='%23858B93'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1.33203%209.99935C1.33203%205.0518%205.34281%201.04102%2010.2904%201.04102C15.2379%201.04102%2019.2487%205.0518%2019.2487%209.99935C19.2487%2014.9469%2015.2379%2018.9577%2010.2904%2018.9577C5.34281%2018.9577%201.33203%2014.9469%201.33203%209.99935ZM10.2904%202.29102C6.03317%202.29102%202.58203%205.74215%202.58203%209.99935C2.58203%2014.2565%206.03317%2017.7077%2010.2904%2017.7077C14.5476%2017.7077%2017.9987%2014.2565%2017.9987%209.99935C17.9987%205.74215%2014.5476%202.29102%2010.2904%202.29102Z'%20fill='%23858B93'/%3e%3c/svg%3e",Zs="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.291%205.83301C17.291%206.17819%2017.0112%206.45801%2016.666%206.45801L3.33268%206.45801C2.9875%206.45801%202.70768%206.17819%202.70768%205.83301C2.70768%205.48783%202.9875%205.20801%203.33268%205.20801L16.666%205.20801C17.0112%205.20801%2017.291%205.48783%2017.291%205.83301Z'%20fill='%23858B93'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.291%2010C17.291%2010.3452%2017.0112%2010.625%2016.666%2010.625L3.33268%2010.625C2.9875%2010.625%202.70768%2010.3452%202.70768%2010C2.70768%209.65482%202.9875%209.375%203.33268%209.375L16.666%209.375C17.0112%209.375%2017.291%209.65482%2017.291%2010Z'%20fill='%23858B93'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.291%2014.167C17.291%2014.5122%2017.0112%2014.792%2016.666%2014.792L3.33268%2014.792C2.9875%2014.792%202.70768%2014.5122%202.70768%2014.167C2.70768%2013.8218%202.9875%2013.542%203.33268%2013.542L16.666%2013.542C17.0112%2013.542%2017.291%2013.8218%2017.291%2014.167Z'%20fill='%23858B93'/%3e%3c/svg%3e";var Ys=O("<div class=survey-message>"),Xs=O("<div style=margin-bottom:12px;text-align:left><div style=font-weight:500;font-size:14px>"),Qs=O("<div style=font-weight:400;font-size:12px;margin-top:4px>"),Gs=O("<div class=survey-message><div style=text-align:center;padding:24px>Biểu mẫu khảo sát"),Ks=O("<div class=survey-tooltip>"),Js=O("<button tabindex=-1 style=margin-left:8px;margin-top:6px><img alt=tooltip>"),ei=O("<div class=survey-message><div style=flex-direction:column;align-items:flex-start><div style=align-items:center;margin-bottom:8px><span style=font-weight:600;font-size:16px;text-align:left></span></div><div style=font-weight:400;font-size:12px;margin-bottom:16px></div></div><div style=justify-content:flex-end;margin-top:16px>"),ti=O("<div>"),ni=O("<span style=margin-right:4px>-"),si=O("<div class=survey-inputs>"),ii=O("<div style=margin-bottom:12px><div style=font-weight:500;margin-bottom:4px;text-align:left></div><input class=survey-input type=text>"),oi=O("<div class=survey-options>"),ri=O("<button type=button style=justify-content:space-between;align-items:center><span>"),ai=O("<img style=margin-right:10px>"),ci=O("<img style=margin-left:16px>"),li=O("<button class=survey-cancel-button>Hủy"),di=O("<button class=survey-submit-button>Gửi đáp án");const ui=t=>{var Z,K,M,S;const[e,n]=L(null),[s,i]=L(null),[o,r]=L(t.selectedIndexes||[]),[c,a]=L(Array((t.options||[]).length).fill("")),[d,u]=L(t.options||[]),[f,N]=L(!1),V=(M=(K=(Z=t.contents)==null?void 0:Z.find(C=>{var m;return(m=C.metadata)==null?void 0:m.description}))==null?void 0:K.metadata)==null?void 0:M.description,U=(S=t.multiSelect)!=null?S:!1,F=()=>{var C;return(C=t.isInputMode)!=null?C:!1},J=()=>t.type||"choice";let H;const E=(C,m)=>{!t.isEditing&&t.canSubmit===!1||m.button===0&&t.isDragDrop&&(m.preventDefault(),n(C))},b=C=>{if(e()===null||!H)return;const m=H.getBoundingClientRect();if(!(C.clientX>=m.left&&C.clientX<=m.right&&C.clientY>=m.top&&C.clientY<=m.bottom))return;const I=H.querySelectorAll(".survey-option");for(let P=0;P<I.length;P++){const D=I[P].getBoundingClientRect();if(C.clientX>=D.left&&C.clientX<=D.right&&C.clientY>=D.top&&C.clientY<=D.bottom&&P!==e()){i(P);return}}},y=C=>{if(e()===null||!H)return;const m=H.getBoundingClientRect();if(C.clientX>=m.left&&C.clientX<=m.right&&C.clientY>=m.top&&C.clientY<=m.bottom&&s()!==null){const I=[...d()],P=I[e()];I[e()]=I[s()],I[s()]=P,u(I)}n(null),i(null)},q=C=>{!t.isEditing&&t.canSubmit===!1||t.isDragDrop||r(U?m=>m.includes(C)?m.filter(w=>w!==C):[...m,C]:m=>m.includes(C)?[]:[C])},h=(C,m)=>{a(w=>{const I=[...w];return I[C]=m,I})},z=()=>{if(t.onSubmit){const C=t.msgId||"";if(F()){const m=c().filter(w=>w.trim()!=="");t.onSubmit(m,"input",C)}else if(t.isDragDrop)t.onSubmit(d(),"ordered",C);else if(U){const m=d().filter((w,I)=>o().includes(I));t.onSubmit(m,"selected",C)}else{const m=d()[o()[0]];t.onSubmit([m],"selected",C)}}};return Rt(()=>(document.addEventListener("mousemove",b),document.addEventListener("mouseup",y),()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",y)})),nt(()=>{u(t.options||[])}),nt(fs(()=>t.isEditing,C=>{C&&(r(t.selectedIndexes||[]),a(Array((t.options||[]).length).fill("").map((m,w)=>{var I;return t.fields&&((I=t.fields[w])==null?void 0:I.value)!==void 0?t.fields[w].value:""})),u(t.options||[]))})),J()==="normal"?(()=>{var C=Ys();return k(C,ae(ut,{get each(){return t.contents||[]},children:m=>(()=>{var w=Xs(),I=w.firstChild;return l(I,"color","#1A1D1F"),k(I,()=>m.content),k(w,(()=>{var P=te(()=>{var _;return!!((_=m.metadata)!=null&&_.description)});return()=>P()&&(()=>{var _=Qs();return l(_,"color","#858B93"),k(_,()=>m.metadata.description),_})()})(),null),w})()})),C})():J()==="form"?(()=>{var C=Gs(),m=C.firstChild;return l(m,"color","#858B93"),C})():(()=>{var C=ei(),m=C.firstChild,w=m.firstChild,I=w.firstChild,P=w.nextSibling,_=m.nextSibling;return l(m,"display","flex"),l(w,"display","flex"),l(I,"color","#1A1D1F"),k(I,(()=>{var D=te(()=>!!F());return()=>D()?"Nhập đáp án":t.question||"Chọn đáp án"})()),k(w,ae(Qe,{when:V,get children(){var D=Js(),Q=D.firstChild;return D.addEventListener("mouseleave",()=>N(!1)),D.addEventListener("mouseenter",()=>N(!0)),l(D,"background","none"),l(D,"border","none"),l(D,"cursor","pointer"),l(D,"position","relative"),ce(Q,"src",qs),l(Q,"width","20px"),l(Q,"height","20px"),k(D,ae(Qe,{get when(){return f()},get children(){var me=Ks();return k(me,ae(ut,{get each(){return(V||"Bạn có thể kéo thả để sắp xếp thứ tự đáp án ưu tiên A, B, C, D").split(/-\s*/).filter(ve=>ve.trim()!=="")},children:(ve,ue)=>(()=>{var re=ti();return k(re,(()=>{var ne=te(()=>ue()>0);return()=>ne()&&ni()})(),null),k(re,()=>ve.trim(),null),re})()})),me}}),null),D}}),null),l(P,"color","#858B93"),k(P,(()=>{var D=te(()=>!!F());return()=>D()?"Vui lòng nhập đầy đủ thông tin vào các trường bên dưới.":t.isDragDrop?"Bạn có thể kéo thả để sắp xếp thứ tự đáp án ưu tiên A, B, C, D":U?"Bạn có thể chọn nhiều đáp án hoặc nhập trực tiếp A, B, C, D theo thứ tự đáp án":"Bạn có thể chọn 1 đáp án hoặc nhập trực tiếp A, B, C, D"})()),k(C,(()=>{var D=te(()=>!!F());return()=>D()?(()=>{var Q=si();return k(Q,ae(ut,{get each(){return d()},children:(me,ve)=>(()=>{var ue=ii(),re=ue.firstChild,ne=re.nextSibling;return l(re,"color","#1A1D1F"),k(re,me),ne.$$input=T=>h(ve(),T.currentTarget.value),l(ne,"color","#1A1D1F"),fe(T=>{var G=t.placeholders?t.placeholders[ve()]:me,Ae=!t.isEditing&&t.canSubmit===!1;return G!==T.e&&ce(ne,"placeholder",T.e=G),Ae!==T.t&&(ne.disabled=T.t=Ae),T},{e:void 0,t:void 0}),fe(()=>ne.value=c()[ve()]),ue})()})),Q})():(()=>{var Q=oi(),me=H;return typeof me=="function"?Yt(me,Q):H=Q,k(Q,ae(ut,{get each(){return d()},children:(ve,ue)=>(()=>{var re=ri(),ne=re.firstChild;return re.$$click=()=>q(ue()),re.$$mousedown=T=>E(ue(),T),k(re,(()=>{var T=te(()=>!!t.isDragDrop);return()=>T()&&(()=>{var G=ai();return ce(G,"src",Zs),l(G,"width","20px"),l(G,"height","20px"),G})()})(),ne),l(ne,"color","#1A1D1F"),k(ne,ve),k(re,(()=>{var T=te(()=>!!(!t.isDragDrop&&o().includes(ue())));return()=>T()&&(()=>{var G=ci();return ce(G,"src",Ws),l(G,"width","20px"),l(G,"height","20px"),G})()})(),null),fe(T=>{var G=`survey-option${U?" multi-selected":""} ${e()===ue()?"dragging":""} ${s()===ue()?"hovered":""} ${!t.isDragDrop&&o().includes(ue())?"selected":""}`,Ae=j({display:"flex",width:U?"100%":"auto"},t.isDragDrop?{}:{cursor:"pointer"});return G!==T.e&&it(re,T.e=G),T.t=pn(re,Ae,T.t),T},{e:void 0,t:void 0}),re})()})),Q})()})(),_),l(_,"display","flex"),k(_,(()=>{var D=te(()=>!!t.isEditing);return()=>D()&&(()=>{var Q=li();return Zt(Q,"click",t.onCancelEdit),Q})()})(),null),k(_,(()=>{var D=te(()=>!!(t.canSubmit||t.isEditing));return()=>D()&&(()=>{var Q=di();return Q.$$click=z,Q})()})(),null),C})()};yt(["input","mousedown","click"]);var hi=O("<div style=text-align:center;font-weight:600;user-select:none;white-space:pre-line>Hôm nay thị trường khiến bạn <br>quan tâm điều gì?"),fi=O("<div class=chat-messages-container style=scroll-behavior:auto>"),gi=O("<div style=margin-bottom:8px>"),pi=O("<div class=message-popup><button class=message-popup-button><img></button><button class=message-popup-button><img>"),Ci=O('<div style=border-radius:24px;font-weight:500;font-size:16px;max-width:70%;word-break:break-word;white-space:pre-line;text-align:left;cursor:pointer><form style=flex-direction:column;align-items:flex-end><textarea class=chat-message-edit-textarea placeholder="Nhập vào tin nhắn..."rows=3 autofocus></textarea><div style=margin-top:8px><button class=message-cancel-button type=button>Hủy</button><button class=message-edit-button type=submit>Lưu'),mi=O("<div style=border-radius:24px;font-weight:500;font-size:16px;max-width:70%;word-break:break-word;white-space:pre-line;text-align:left;cursor:pointer>"),vi=O("<div style=font-size:12px;margin-top:12px;user-select:none;font-weight:400>"),wi=O('<div class="chat-message bot"style=margin-left:24px><div>'),yi=O("<div style=flex-direction:column;align-items:flex-start;margin-bottom:8px><div><div style=border-radius:24px;font-weight:500;font-size:16px;max-width:70%;word-break:break-word;white-space:pre-line;text-align:left>"),bi=O("<div style=margin-left:16px><button class=feedback-button><img></button><button class=feedback-button><img>");function _i(t){let e;const[n,s]=L(null),[i,o]=L({}),[r,c]=L(null),[a,d]=L(null),[u,f]=L(null),[N,V]=L(null),[U,F]=L("");function J(y){var z,Z;const q=t.messages[t.messages.length-1];return!((q.type==="survey"||q.type==="choice"||q.type==="form")&&!((Z=(z=t.submittedMessages)==null?void 0:z.has(q.id))!=null&&Z)&&q.id!==y)}const H=y=>{r()&&(clearTimeout(r()),c(null)),s(Number(y))},E=()=>{c(setTimeout(()=>s(null),300))},b=()=>{var y;return t.isFullScreen?t.messages.length>0?"100px":`${((y=t.inputHeight)!=null?y:0)+24}px`:(t.isMobile,t.messages.length>0?"10px":"0px")};return nt(()=>{if(!e)return;const y=()=>{a()&&clearTimeout(a()),d(setTimeout(()=>{var q;e.scrollTop===0&&((q=t.onLoadMoreMessages)==null||q.call(t)),d(null)},0))};e.addEventListener("scroll",y),un(()=>{e.removeEventListener("scroll",y),a()&&clearTimeout(a())})}),(()=>{var y=fi(),q=e;return typeof q=="function"?Yt(q,y):e=y,k(y,ae(Qe,{get when(){return te(()=>t.messages.length===0)()&&!t.isFullScreen},get children(){var h=hi();return l(h,"color","#1A1D1F"),fe(z=>l(h,"font-size",t.isMobile?"20px":"24px")),h}}),null),k(y,ae(ut,{get each(){return t.messages},children:(h,z)=>{const Z=z()===t.messages.length-1;return h.type==="normal"&&Array.isArray(h.contents)?ae(ut,{get each(){return h.contents},children:K=>(()=>{var M=gi();return M.addEventListener("mouseleave",()=>h.sender==="user"&&V(null)),M.addEventListener("mouseenter",()=>h.sender==="user"&&V(h.id)),M.$$click=()=>f(u()===h.id?null:h.id),l(M,"display","flex"),l(M,"position","relative"),k(M,(()=>{var S=te(()=>h.sender==="user"&&N()===h.id);return()=>S()&&(()=>{var C=pi(),m=C.firstChild,w=m.firstChild,I=m.nextSibling,P=I.firstChild;return m.addEventListener("mouseleave",_=>_.currentTarget.style.background="none"),m.addEventListener("mouseenter",_=>_.currentTarget.style.background="#f0f0f0"),m.$$click=_=>{var me,ve,ue,re;_.stopPropagation();const D=z(),Q=t.messages[D-1];if(!J(h.id)){alert("Hoàn thành câu hỏi theo mẫu trước khi chỉnh sửa");return}h.type==="normal"&&(Q&&Q.sender==="bot"&&Q.type==="normal"?(F(""),(me=t.setEditingMsgIdUser)==null||me.call(t,h.id),(ve=t.setEditingMsgIdBot)==null||ve.call(t,null)):Q&&Q.sender==="bot"&&(Q.type==="survey"||Q.type==="choice"||Q.type==="form")&&((ue=t.setEditingMsgIdBot)==null||ue.call(t,Q.id),(re=t.setEditingMsgIdUser)==null||re.call(t,h.id),F("")))},ce(w,"src",Hn),l(w,"width","16px"),l(w,"height","16px"),I.addEventListener("mouseleave",_=>_.currentTarget.style.background="none"),I.addEventListener("mouseenter",_=>_.currentTarget.style.background="#f0f0f0"),I.$$click=_=>{_.stopPropagation(),console.log("Delete message:",h.id)},ce(P,"src",Ln),l(P,"width","16px"),l(P,"height","16px"),C})()})(),null),k(M,(()=>{var S=te(()=>h.sender==="user"&&h.type==="normal"&&t.editingMsgIdUser===h.id&&!t.editingMsgIdBot);return()=>S()?(()=>{var C=Ci(),m=C.firstChild,w=m.firstChild,I=w.nextSibling,P=I.firstChild;return l(C,"background","#1AAF741A"),l(C,"color","#000"),l(C,"padding","10px 16px"),m.addEventListener("submit",_=>{var D,Q;_.preventDefault(),U().trim()&&((D=t.onUpdateSurvey)==null||D.call(t,[U()],"input",h.id),(Q=t.setEditingMsgIdUser)==null||Q.call(t,null))}),l(m,"width","100%"),l(m,"display","flex"),w.$$input=_=>F(_.currentTarget.value),l(I,"display","flex"),l(I,"gap","4px"),P.$$click=()=>{var _;return(_=t.setEditingMsgIdUser)==null?void 0:_.call(t,null)},fe(()=>w.value=U()),C})():(()=>{var C=mi();return l(C,"color","#000"),l(C,"padding","10px 16px"),k(C,()=>K.content,null),k(C,(()=>{var m=te(()=>!!(h.sender==="user"&&h.sentAt&&u()===h.id));return()=>m()&&(()=>{var w=vi();return l(w,"color","#858B93"),k(w,()=>new Date(h.sentAt).toLocaleString("vi-VN",{hour:"2-digit",minute:"2-digit"})),w})()})(),null),fe(m=>l(C,"background",h.sender==="user"?"#1AAF741A":"#fff")),C})()})(),null),fe(S=>{var C=`chat-message ${h.sender}`,m=h.id,w=h.sender==="bot"?"24px":"0px",I=h.sender==="user"?"24px":"0px",P=h.sender==="user"?"flex-end":"flex-start";return C!==S.e&&it(M,S.e=C),m!==S.t&&ce(M,"data-message-id",S.t=m),w!==S.a&&l(M,"margin-left",S.a=w),I!==S.o&&l(M,"margin-right",S.o=I),P!==S.i&&l(M,"justify-content",S.i=P),S},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),M})()}):h.type==="survey"||h.type==="choice"||h.type==="form"?(()=>{var K=wi(),M=K.firstChild;return k(M,ae(ui,{get msgId(){return h.id},get question(){return h.question},get options(){return h.options},get selectedIndexes(){return h.selectedIndexes},get fields(){return h.fields},get contents(){return h.contents},get multiSelect(){var S;return te(()=>h.multiSelect!==void 0)()?h.multiSelect:(S=t.surveyOptions)==null?void 0:S.multiSelect},get isInputMode(){var S;return te(()=>h.isInputMode!==void 0)()?h.isInputMode:(S=t.surveyOptions)==null?void 0:S.isInputMode},get isFormType(){return h.isFormType},get isNormalType(){return h.isNormalType},get isDragDrop(){return h.isDragDrop},get isEditing(){return t.editingMsgIdBot===h.id},onCancelEdit:()=>{var S,C;(S=t.setEditingMsgIdBot)==null||S.call(t,null),(C=t.setEditingMsgIdUser)==null||C.call(t,null)},onSubmit:(S,C,m)=>{var w,I,P,_;t.editingMsgIdUser?((w=t.onUpdateSurvey)==null||w.call(t,S,C,t.editingMsgIdUser),(I=t.setEditingMsgIdBot)==null||I.call(t,null),(P=t.setEditingMsgIdUser)==null||P.call(t,null)):(_=t.onSubmit)==null||_.call(t,S,C,m)},get canSubmit(){var S;return Z&&(!((S=t.submittedMessages)!=null&&S.has(h.id))||t.editingMsgIdBot===h.id)},get placeholders(){return h.placeholders}})),fe(()=>ce(K,"data-message-id",h.id)),K})():(()=>{var K=yi(),M=K.firstChild,S=M.firstChild;return l(K,"display","flex"),M.addEventListener("mouseleave",()=>E()),M.addEventListener("mouseenter",()=>h.sender==="bot"&&H(h.id)),l(M,"position","relative"),l(M,"width","100%"),l(S,"color","#000"),l(S,"padding","10px 16px"),k(S,()=>h.text),k(K,(()=>{var C=te(()=>h.sender==="bot");return()=>C()&&(()=>{var m=bi(),w=m.firstChild,I=w.firstChild,P=w.nextSibling,_=P.firstChild;return m.addEventListener("mouseleave",()=>E()),m.addEventListener("mouseenter",()=>H(h.id)),l(m,"display","flex"),l(m,"gap","8px"),l(m,"height","16px"),l(m,"transition","opacity 0.2s"),w.$$click=()=>o(D=>oe(j({},D),{[h.id]:"like"})),P.$$click=()=>o(D=>oe(j({},D),{[h.id]:"dislike"})),fe(D=>{var Q=n()===Number(h.id)?1:0,me=n()===Number(h.id)?"visible":"hidden",ve=n()===Number(h.id)?"auto":"none",ue=i()[Number(h.id)]==="like"?zs:Us,re=i()[Number(h.id)]==="dislike"?Vs:js;return Q!==D.e&&l(m,"opacity",D.e=Q),me!==D.t&&l(m,"visibility",D.t=me),ve!==D.a&&l(m,"pointer-events",D.a=ve),ue!==D.o&&ce(I,"src",D.o=ue),re!==D.i&&ce(_,"src",D.i=re),D},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),m})()})(),null),fe(C=>{var m=h.id,w=`chat-message ${h.sender}`,I=h.id,P=h.sender==="user"?"#1AAF741A":"#fff";return m!==C.e&&ce(K,"data-message-id",C.e=m),w!==C.t&&it(M,C.t=w),I!==C.a&&ce(M,"data-message-id",C.a=I),P!==C.o&&l(S,"background",C.o=P),C},{e:void 0,t:void 0,a:void 0,o:void 0}),K})()}}),null),fe(h=>{var z=t.messages.length===0?"center":"flex-start",Z=b(),K=t.isLoadingMessages?"hidden":"visible";return z!==h.e&&l(y,"justify-content",h.e=z),Z!==h.t&&l(y,"padding-bottom",h.t=Z),K!==h.a&&l(y,"visibility",h.a=K),h},{e:void 0,t:void 0,a:void 0}),y})()}yt(["click","input"]);var Si=O('<div class=chat-input-container><div style=min-width:0><img><textarea placeholder="Hỏi bất kỳ điều gì..."class=chat-input-field rows=1 style=padding-left:56px></textarea><div><img style=margin-top:4px><img>');function On(t){let e;const[s,i]=L(!1);function o(){var u,f;if(!e)return;if(e.style.height="auto",!t.input.trim()){e.style.height="48px",e.style.overflowY="hidden",i(!1),(u=t.onHeightChange)==null||u.call(t,48);return}const a=e.scrollHeight,d=Math.min(a,120);e.style.height=d+"px",e.style.overflowY=a>120?"auto":"hidden",i(a>120),(f=t.onHeightChange)==null||f.call(t,d)}nt(()=>{e&&o()});const r=a=>{t.setInput(a.currentTarget.value),o()},c=a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),t.sendMessage(),setTimeout(()=>{e&&o()},0))};return(()=>{var a=Si(),d=a.firstChild,u=d.firstChild,f=u.nextSibling,N=f.nextSibling,V=N.firstChild,U=V.nextSibling;return l(d,"position","relative"),l(d,"flex","1"),ce(u,"src",$s),l(u,"position","absolute"),l(u,"left","18px"),l(u,"top","50%"),l(u,"transform","translateY(-60%)"),l(u,"width","20px"),l(u,"height","20px"),l(u,"cursor","pointer"),f.addEventListener("keypress",c),f.$$input=r,Yt(F=>e=F,f),l(f,"color","#1A1D1F"),l(f,"resize","none"),l(f,"width","100%"),l(f,"max-height","120px"),l(f,"overflow","hidden"),l(N,"position","absolute"),l(N,"right","16px"),l(N,"top","50%"),l(N,"transform","translateY(-55%)"),l(N,"display","flex"),l(N,"gap","12px"),Zt(V,"click",t.sendMessage),ce(V,"src",Fs),l(V,"width","24px"),l(V,"height","24px"),l(V,"cursor","pointer"),Zt(U,"click",t.sendMessage),l(U,"width","32px"),l(U,"height","32px"),l(U,"cursor","pointer"),fe(F=>{var J=!!s(),H=t.disabled,E=t.input.trim()?Ns:Rs;return J!==F.e&&a.classList.toggle("is-maxed",F.e=J),H!==F.t&&(f.disabled=F.t=H),E!==F.a&&ce(U,"src",F.a=E),F},{e:void 0,t:void 0,a:void 0}),fe(()=>f.value=t.input),a})()}yt(["input","click"]);var Ai=O("<div class=sidebar-conversation-list style=overflow-y:auto>"),xi=O('<div><div class=sidebar-header><img style=margin-right:4px><span style=user-select:none>Ez</span><span style=margin-left:4px;user-select:none>Advise</span></div><div class=sidebar-section tabindex=0><img class=sidebar-section-icon><span class=sidebar-section-title>Chân dung nhà đầu tư</span></div><div class="sidebar-section sidebar-section--no-padding"tabindex=0><img class=sidebar-section-icon><span class=sidebar-section-title>Định hướng đầu tư</span></div><div class=sidebar-conversation-row><span style=font-weight:400;font-size:14px;user-select:none>Hội thoại</span><div class=sidebar-conversation-action tabindex=0><span style=font-weight:400;font-size:14px;user-select:none>Hội thoại mới</span><img style=margin-left:8px></div></div><div class=sidebar-search-box><img style=margin-right:8px><input type=text placeholder="Tìm kiếm hội thoại"></div><div></div><div style=margin-top:15px>'),Ii=O("<div>"),ki=O("<img style=margin-right:16px>"),Mi=O("<div class=sidebar-header-actions><button><img></button><button><img>"),Ei=O('<div class=sidebar-no-results style=text-align:center><img src=data:image/webp;base64,... alt="no results"><div style=font-size:14px;margin-top:8px>Không tìm thấy cuộc hội thoại nào!'),Ti=O("<div class=sidebar-menu-row>"),$i=O("<input class=sider-bar-input autofocus>"),Ri=O("<span style=font-weight:500;font-size:15px;user-select:none>"),Pi=O("<img class=sidebar-menu-dot style=margin-left:8px>"),Di=O("<div class=sidebar-popover><div class=sidebar-popover-item><img>Đổi tên</div><div class=sidebar-popover-item><img>Xóa");function Fn(t){const[e]=L(!1),[n,s]=L(null),[i,o]=L([]),[r,c]=L(""),[a,d]=L(null),[u,f]=L("");let N,V={};function U(b){return b.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/đ/g,"d").replace(/Đ/g,"d")}function F(){d(null),t.onClose()}function J(){return v(this,null,function*(){if(t.remoteRepo)try{const b=yield t.remoteRepo.listConversationAsync(10);o(b||[])}catch(b){console.error("Sidebar listConversationAsync error:",b)}})}Rt(J),t.onReloadConversations&&t.onReloadConversations(J);const H=st(()=>{const b=U(r());return b?i().filter(y=>U(y.name||"").includes(b)):i()}),E=()=>t.isMobile?"calc(90vh - 320px)":t.fullScreen?"calc(90vh - 330px)":"calc(400px - 220px)";return Rt(()=>{const b=y=>{var q;e(),n()&&V[n()]&&!((q=V[n()])!=null&&q.contains(y.target))&&s(null)};document.addEventListener("mousedown",b),un(()=>{document.removeEventListener("mousedown",b)})}),Rt(()=>v(null,null,function*(){if(t.remoteRepo)try{const b=yield t.remoteRepo.listConversationAsync(10);o(b||[])}catch(b){console.error("Sidebar listConversationAsync error:",b)}})),[te(()=>te(()=>!t.fullScreen)()&&(()=>{var b=Ii();return b.$$click=F,fe(()=>it(b,`sidebar-overlay${t.open?" sidebar-overlay--open":""}`)),b})()),(()=>{var b=xi(),y=b.firstChild,q=y.firstChild,h=q.nextSibling,z=h.nextSibling,Z=y.nextSibling,K=Z.firstChild,M=K.nextSibling,S=Z.nextSibling,C=S.firstChild,m=C.nextSibling,w=S.nextSibling,I=w.firstChild,P=I.nextSibling,_=P.firstChild,D=_.nextSibling,Q=w.nextSibling,me=Q.firstChild,ve=me.nextSibling,ue=Q.nextSibling,re=ue.nextSibling;return k(y,(()=>{var ne=te(()=>!t.fullScreen);return()=>ne()&&(()=>{var T=ki();return T.$$click=F,ce(T,"src",Ps),l(T,"width","28px"),l(T,"height","28px"),l(T,"cursor","pointer"),T})()})(),q),ce(q,"src",mn),l(q,"width","32px"),l(q,"height","32px"),l(h,"color","#1A1D1F"),l(z,"color","#1AAF74"),k(y,(()=>{var ne=te(()=>!!t.fullScreen);return()=>ne()&&(()=>{var T=Mi(),G=T.firstChild,Ae=G.firstChild,se=G.nextSibling,we=se.firstChild;return G.$$click=()=>{var Ve;(Ve=t.onShrink)==null||Ve.call(t)},l(G,"background","none"),l(G,"border","none"),l(G,"cursor","pointer"),l(G,"padding","0"),ce(Ae,"src",Ts),l(Ae,"width","20px"),l(Ae,"height","20px"),se.$$click=F,l(se,"background","none"),l(se,"border","none"),l(se,"cursor","pointer"),l(se,"padding","0"),ce(we,"src",Bn),l(we,"width","20px"),l(we,"height","20px"),T})()})(),null),ce(K,"src",Ds),l(M,"color","#1A1D1F"),ce(C,"src",Bs),l(m,"color","#1A1D1F"),l(I,"color","#858B93"),P.$$click=()=>{t.onNewConversation&&t.onNewConversation(),t.fullScreen||F()},l(_,"color","#858B93"),ce(D,"src",Hs),l(D,"width","20px"),l(D,"height","20px"),ce(me,"src",Ls),l(me,"width","18px"),l(me,"height","18px"),l(me,"opacity","0.7"),ve.addEventListener("change",ne=>c(ne.currentTarget.value)),ve.$$input=ne=>c(ne.currentTarget.value),l(ve,"color","#1A1D1F"),k(re,ae(Qe,{get when(){return H().length>0},get fallback(){return te(()=>i().length>0)()?(()=>{var ne=Ei(),T=ne.firstChild,G=T.nextSibling;return l(ne,"padding","32px 0"),l(T,"width","80px"),l(T,"height","80px"),l(T,"margin","0 auto 12px"),l(G,"color","#888"),ne})():null},get children(){var ne=Ai();return k(ne,ae(ut,{get each(){return H()},children:T=>(()=>{var G=Ti();return G.$$click=()=>{var Ae;(Ae=t.onLoadMessages)==null||Ae.call(t,T.id,T.name),t.fullScreen||F()},l(G,"cursor","pointer"),l(G,"position","relative"),k(G,(()=>{var Ae=te(()=>a()===T.id);return()=>Ae()?(()=>{var se=$i();return se.$$click=we=>we.stopPropagation(),se.addEventListener("blur",()=>{d(null)}),se.$$keydown=we=>v(null,null,function*(){var Ve;if(we.key==="Enter"){if(!u().trim()){console.log("Tên không được để trống");return}try{yield(Ve=t.remoteRepo)==null?void 0:Ve.updateConversationNameAsync(T.id,u().trim()),d(null),J()}catch(Ke){console.log("Error while rename: ",Ke)}}we.key==="Escape"&&d(null)}),se.$$input=we=>f(we.currentTarget.value),l(se,"color","#1A1D1F"),fe(()=>se.value=u()),se})():[(()=>{var se=Ri();return l(se,"color","#1A1D1F"),k(se,()=>T.name),se})(),(()=>{var se=Pi();return se.$$mousedown=we=>we.stopPropagation(),se.$$click=we=>{we.stopPropagation(),s(n()===T.id?null:T.id)},ce(se,"src",Os),l(se,"width","24px"),l(se,"height","24px"),se})(),te(()=>te(()=>n()===T.id)()&&(()=>{var se=Di(),we=se.firstChild,Ve=we.firstChild,Ke=we.nextSibling,ct=Ke.firstChild;return Yt(g=>V[T.id]=g,se),we.$$click=g=>{g.stopPropagation(),s(null),d(T.id),f(T.name)},ce(Ve,"src",Hn),l(Ve,"width","18px"),l(Ve,"height","18px"),l(Ve,"color","#1A1D1F"),Ke.$$click=g=>{var x;g.stopPropagation(),s(null),(x=t.onDeleteConversation)==null||x.call(t,T)},ce(ct,"src",Ln),l(ct,"width","18px"),l(ct,"height","18px"),l(ct,"color","#1A1D1F"),se})())]})()),G})()})),fe(T=>{var G=E(),Ae=E();return G!==T.e&&l(ne,"min-height",T.e=G),Ae!==T.t&&l(ne,"max-height",T.t=Ae),T},{e:void 0,t:void 0}),ne}})),fe(ne=>{var T=`sidebar${t.open?" sidebar--open":""}${t.fullScreen?" sidebar--fullscreen":""}${t.isMobile?" sidebar--mobile":""}`,G=t.isMobile?{width:"280px",height:"100%"}:{};return T!==ne.e&&it(b,ne.e=T),ne.t=pn(b,G,ne.t),ne},{e:void 0,t:void 0}),fe(()=>ve.value=r()),b})()]}yt(["click","input","keydown","mousedown"]);var Bi=O("<button class=chat-action-btn>");function Qt(t){return(()=>{var e=Bi();return Zt(e,"click",t.onClick),k(e,()=>t.text),e})()}yt(["click"]);var Hi=O("<div class=header-steps-container>"),Li=O("<div class=header-steps><div class=header-steps-title>"),Oi=O(`<div class=header-step-wrapper style=position:relative;display:flex><div><div><svg viewBox="0 0 28 6"width=28 height=6><path d="M0 3 Q 7 0 14 3 Q 21 6 28 3 V6 H0 Z"fill=#1AAF74><animate attributeName=d values="\r
2
+ (function(Me,Ae){typeof exports=="object"&&typeof module!="undefined"?Ae(exports):typeof define=="function"&&define.amd?define(["exports"],Ae):(Me=typeof globalThis!="undefined"?globalThis:Me||self,Ae(Me.EzChat={}))})(this,(function(Me){"use strict";var d2=Object.defineProperty,u2=Object.defineProperties;var h2=Object.getOwnPropertyDescriptors;var Cs=Object.getOwnPropertySymbols;var f2=Object.prototype.hasOwnProperty,g2=Object.prototype.propertyIsEnumerable;var Tn=(Me,Ae,Re)=>Ae in Me?d2(Me,Ae,{enumerable:!0,configurable:!0,writable:!0,value:Re}):Me[Ae]=Re,j=(Me,Ae)=>{for(var Re in Ae||(Ae={}))f2.call(Ae,Re)&&Tn(Me,Re,Ae[Re]);if(Cs)for(var Re of Cs(Ae))g2.call(Ae,Re)&&Tn(Me,Re,Ae[Re]);return Me},se=(Me,Ae)=>u2(Me,h2(Ae));var ve=(Me,Ae,Re)=>Tn(Me,typeof Ae!="symbol"?Ae+"":Ae,Re);var y=(Me,Ae,Re)=>new Promise((it,bt)=>{var _t=Ke=>{try{Ge(Re.next(Ke))}catch(At){bt(At)}},Zt=Ke=>{try{Ge(Re.throw(Ke))}catch(At){bt(At)}},Ge=Ke=>Ke.done?it(Ke.value):Promise.resolve(Ke.value).then(_t,Zt);Ge((Re=Re.apply(Me,Ae)).next())});const Re=(t,e)=>t===e,it=Symbol("solid-proxy"),bt=Symbol("solid-track"),_t={equals:Re};let Zt=$n;const Ge=1,Ke=2,At={owned:null,cleanups:null,context:null,owner:null};var we=null;let pn=null,ms=null,Ie=null,Ne=null,ot=null,Yt=0;function Xt(t,e){const n=Ie,s=we,i=t.length===0,o=e===void 0?s:e,r=i?At:{owned:null,cleanups:null,context:o?o.context:null,owner:o},c=i?t:()=>t(()=>st(()=>Ft(r)));we=r,Ie=null;try{return St(c,!0)}finally{Ie=n,we=s}}function D(t,e){e=e?Object.assign({},_t,e):_t;const n={value:t,observers:null,observerSlots:null,comparator:e.equals||void 0},s=i=>(typeof i=="function"&&(i=i(n.value)),Rn(n,i));return[Pn.bind(n),s]}function pe(t,e,n){const s=vn(t,e,!1,Ge);Ot(s)}function nt(t,e,n){Zt=xs;const s=vn(t,e,!1,Ge);s.user=!0,ot?ot.push(s):Ot(s)}function rt(t,e,n){n=n?Object.assign({},_t,n):_t;const s=vn(t,e,!0,0);return s.observers=null,s.observerSlots=null,s.comparator=n.equals||void 0,Ot(s),Pn.bind(s)}function vs(t){return St(t,!1)}function st(t){if(Ie===null)return t();const e=Ie;Ie=null;try{return t()}finally{Ie=e}}function ys(t,e,n){const s=Array.isArray(t);let i;return o=>{let r;if(s){r=Array(t.length);for(let a=0;a<t.length;a++)r[a]=t[a]()}else r=t();const c=st(()=>e(r,i,o));return i=r,c}}function Lt(t){nt(()=>st(t))}function Cn(t){return we===null||(we.cleanups===null?we.cleanups=[t]:we.cleanups.push(t)),t}function mn(){return Ie}function ws(t,e){const n=Symbol("context");return{id:n,Provider:ks(n),defaultValue:t}}function bs(t){let e;return we&&we.context&&(e=we.context[t.id])!==void 0?e:t.defaultValue}function _s(t){const e=rt(t),n=rt(()=>yn(e()));return n.toArray=()=>{const s=n();return Array.isArray(s)?s:s!=null?[s]:[]},n}function Pn(){if(this.sources&&this.state)if(this.state===Ge)Ot(this);else{const t=Ne;Ne=null,St(()=>Kt(this),!1),Ne=t}if(Ie){const t=this.observers?this.observers.length:0;Ie.sources?(Ie.sources.push(this),Ie.sourceSlots.push(t)):(Ie.sources=[this],Ie.sourceSlots=[t]),this.observers?(this.observers.push(Ie),this.observerSlots.push(Ie.sources.length-1)):(this.observers=[Ie],this.observerSlots=[Ie.sources.length-1])}return this.value}function Rn(t,e,n){let s=t.value;return(!t.comparator||!t.comparator(s,e))&&(t.value=e,t.observers&&t.observers.length&&St(()=>{for(let i=0;i<t.observers.length;i+=1){const o=t.observers[i],r=pn&&pn.running;r&&pn.disposed.has(o),(r?!o.tState:!o.state)&&(o.pure?Ne.push(o):ot.push(o),o.observers&&Dn(o)),r||(o.state=Ge)}if(Ne.length>1e6)throw Ne=[],new Error},!1)),e}function Ot(t){if(!t.fn)return;Ft(t);const e=Yt;As(t,t.value,e)}function As(t,e,n){let s;const i=we,o=Ie;Ie=we=t;try{s=t.fn(e)}catch(r){return t.pure&&(t.state=Ge,t.owned&&t.owned.forEach(Ft),t.owned=null),t.updatedAt=n+1,Bn(r)}finally{Ie=o,we=i}(!t.updatedAt||t.updatedAt<=n)&&(t.updatedAt!=null&&"observers"in t?Rn(t,s):t.value=s,t.updatedAt=n)}function vn(t,e,n,s=Ge,i){const o={fn:t,state:s,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:e,owner:we,context:we?we.context:null,pure:n};return we===null||we!==At&&(we.owned?we.owned.push(o):we.owned=[o]),o}function Gt(t){if(t.state===0)return;if(t.state===Ke)return Kt(t);if(t.suspense&&st(t.suspense.inFallback))return t.suspense.effects.push(t);const e=[t];for(;(t=t.owner)&&(!t.updatedAt||t.updatedAt<Yt);)t.state&&e.push(t);for(let n=e.length-1;n>=0;n--)if(t=e[n],t.state===Ge)Ot(t);else if(t.state===Ke){const s=Ne;Ne=null,St(()=>Kt(t,e[0]),!1),Ne=s}}function St(t,e){if(Ne)return t();let n=!1;e||(Ne=[]),ot?n=!0:ot=[],Yt++;try{const s=t();return Ss(n),s}catch(s){n||(ot=null),Ne=null,Bn(s)}}function Ss(t){if(Ne&&($n(Ne),Ne=null),t)return;const e=ot;ot=null,e.length&&St(()=>Zt(e),!1)}function $n(t){for(let e=0;e<t.length;e++)Gt(t[e])}function xs(t){let e,n=0;for(e=0;e<t.length;e++){const s=t[e];s.user?t[n++]=s:Gt(s)}for(e=0;e<n;e++)Gt(t[e])}function Kt(t,e){t.state=0;for(let n=0;n<t.sources.length;n+=1){const s=t.sources[n];if(s.sources){const i=s.state;i===Ge?s!==e&&(!s.updatedAt||s.updatedAt<Yt)&&Gt(s):i===Ke&&Kt(s,e)}}}function Dn(t){for(let e=0;e<t.observers.length;e+=1){const n=t.observers[e];n.state||(n.state=Ke,n.pure?Ne.push(n):ot.push(n),n.observers&&Dn(n))}}function Ft(t){let e;if(t.sources)for(;t.sources.length;){const n=t.sources.pop(),s=t.sourceSlots.pop(),i=n.observers;if(i&&i.length){const o=i.pop(),r=n.observerSlots.pop();s<i.length&&(o.sourceSlots[r]=s,i[s]=o,n.observerSlots[s]=r)}}if(t.tOwned){for(e=t.tOwned.length-1;e>=0;e--)Ft(t.tOwned[e]);delete t.tOwned}if(t.owned){for(e=t.owned.length-1;e>=0;e--)Ft(t.owned[e]);t.owned=null}if(t.cleanups){for(e=t.cleanups.length-1;e>=0;e--)t.cleanups[e]();t.cleanups=null}t.state=0}function Is(t){return t instanceof Error?t:new Error(typeof t=="string"?t:"Unknown error",{cause:t})}function Bn(t,e=we){throw Is(t)}function yn(t){if(typeof t=="function"&&!t.length)return yn(t());if(Array.isArray(t)){const e=[];for(let n=0;n<t.length;n++){const s=yn(t[n]);Array.isArray(s)?e.push.apply(e,s):e.push(s)}return e}return t}function ks(t,e){return function(s){let i;return pe(()=>i=st(()=>(we.context=se(j({},we.context),{[t]:s.value}),_s(()=>s.children))),void 0),i}}const Ms=Symbol("fallback");function Hn(t){for(let e=0;e<t.length;e++)t[e]()}function Es(t,e,n={}){let s=[],i=[],o=[],r=0,c=e.length>1?[]:null;return Cn(()=>Hn(o)),()=>{let a=t()||[],d=a.length,u,f;return a[bt],st(()=>{let V,U,O,te,T,P,z,w,q;if(d===0)r!==0&&(Hn(o),o=[],s=[],i=[],r=0,c&&(c=[])),n.fallback&&(s=[Ms],i[0]=Xt(h=>(o[0]=h,n.fallback())),r=1);else if(r===0){for(i=new Array(d),f=0;f<d;f++)s[f]=a[f],i[f]=Xt(N);r=d}else{for(O=new Array(d),te=new Array(d),c&&(T=new Array(d)),P=0,z=Math.min(r,d);P<z&&s[P]===a[P];P++);for(z=r-1,w=d-1;z>=P&&w>=P&&s[z]===a[w];z--,w--)O[w]=i[z],te[w]=o[z],c&&(T[w]=c[z]);for(V=new Map,U=new Array(w+1),f=w;f>=P;f--)q=a[f],u=V.get(q),U[f]=u===void 0?-1:u,V.set(q,f);for(u=P;u<=z;u++)q=s[u],f=V.get(q),f!==void 0&&f!==-1?(O[f]=i[u],te[f]=o[u],c&&(T[f]=c[u]),f=U[f],V.set(q,f)):o[u]();for(f=P;f<d;f++)f in O?(i[f]=O[f],o[f]=te[f],c&&(c[f]=T[f],c[f](f))):i[f]=Xt(N);i=i.slice(0,r=d),s=a.slice(0)}return i});function N(V){if(o[f]=V,c){const[U,O]=D(f);return c[f]=O,e(a[f],U)}return e(a[f])}}}function ae(t,e){return st(()=>t(e||{}))}const Ts=t=>`Stale read from <${t}>.`;function gt(t){const e="fallback"in t&&{fallback:()=>t.fallback};return rt(Es(()=>t.each,t.children,e||void 0))}function Je(t){const e=t.keyed,n=rt(()=>t.when,void 0,void 0),s=e?n:rt(n,void 0,{equals:(i,o)=>!i==!o});return rt(()=>{const i=s();if(i){const o=t.children;return typeof o=="function"&&o.length>0?st(()=>o(e?i:()=>{if(!st(s))throw Ts("Show");return n()})):o}return t.fallback},void 0,void 0)}const ee=t=>rt(()=>t());function Ps(t,e,n){let s=n.length,i=e.length,o=s,r=0,c=0,a=e[i-1].nextSibling,d=null;for(;r<i||c<o;){if(e[r]===n[c]){r++,c++;continue}for(;e[i-1]===n[o-1];)i--,o--;if(i===r){const u=o<s?c?n[c-1].nextSibling:n[o-c]:a;for(;c<o;)t.insertBefore(n[c++],u)}else if(o===c)for(;r<i;)(!d||!d.has(e[r]))&&e[r].remove(),r++;else if(e[r]===n[o-1]&&n[c]===e[i-1]){const u=e[--i].nextSibling;t.insertBefore(n[c++],e[r++].nextSibling),t.insertBefore(n[--o],u),e[i]=n[o]}else{if(!d){d=new Map;let f=c;for(;f<o;)d.set(n[f],f++)}const u=d.get(e[r]);if(u!=null)if(c<u&&u<o){let f=r,N=1,V;for(;++f<i&&f<o&&!((V=d.get(e[f]))==null||V!==u+N);)N++;if(N>u-c){const U=e[r];for(;c<u;)t.insertBefore(n[c++],U)}else t.replaceChild(n[c++],e[r++])}else r++;else e[r++].remove()}}}const Ln="_$DX_DELEGATE";function Rs(t,e,n,s={}){let i;return Xt(o=>{i=o,e===document?t():I(e,t(),e.firstChild?null:void 0,n)},s.owner),()=>{i(),e.textContent=""}}function B(t,e,n,s){let i;const o=()=>{const c=document.createElement("template");return c.innerHTML=t,c.content.firstChild},r=()=>(i||(i=o())).cloneNode(!0);return r.cloneNode=r,r}function xt(t,e=window.document){const n=e[Ln]||(e[Ln]=new Set);for(let s=0,i=t.length;s<i;s++){const o=t[s];n.has(o)||(n.add(o),e.addEventListener(o,$s))}}function ce(t,e,n){n==null?t.removeAttribute(e):t.setAttribute(e,n)}function at(t,e){e==null?t.removeAttribute("class"):t.className=e}function Qt(t,e,n,s){Array.isArray(n)?(t[`$$${e}`]=n[0],t[`$$${e}Data`]=n[1]):t[`$$${e}`]=n}function wn(t,e,n){if(!e)return n?ce(t,"style"):e;const s=t.style;if(typeof e=="string")return s.cssText=e;typeof n=="string"&&(s.cssText=n=void 0),n||(n={}),e||(e={});let i,o;for(o in n)e[o]==null&&s.removeProperty(o),delete n[o];for(o in e)i=e[o],i!==n[o]&&(s.setProperty(o,i),n[o]=i);return n}function l(t,e,n){n!=null?t.style.setProperty(e,n):t.style.removeProperty(e)}function Jt(t,e,n){return st(()=>t(e,n))}function I(t,e,n,s){if(n!==void 0&&!s&&(s=[]),typeof e!="function")return en(t,e,s,n);pe(i=>en(t,e(),i,n),s)}function $s(t){let e=t.target;const n=`$$${t.type}`,s=t.target,i=t.currentTarget,o=a=>Object.defineProperty(t,"target",{configurable:!0,value:a}),r=()=>{const a=e[n];if(a&&!e.disabled){const d=e[`${n}Data`];if(d!==void 0?a.call(e,d,t):a.call(e,t),t.cancelBubble)return}return e.host&&typeof e.host!="string"&&!e.host._$host&&e.contains(t.target)&&o(e.host),!0},c=()=>{for(;r()&&(e=e._$host||e.parentNode||e.host););};if(Object.defineProperty(t,"currentTarget",{configurable:!0,get(){return e||document}}),t.composedPath){const a=t.composedPath();o(a[0]);for(let d=0;d<a.length-2&&(e=a[d],!!r());d++){if(e._$host){e=e._$host,c();break}if(e.parentNode===i)break}}else c();o(s)}function en(t,e,n,s,i){for(;typeof n=="function";)n=n();if(e===n)return n;const o=typeof e,r=s!==void 0;if(t=r&&n[0]&&n[0].parentNode||t,o==="string"||o==="number"){if(o==="number"&&(e=e.toString(),e===n))return n;if(r){let c=n[0];c&&c.nodeType===3?c.data!==e&&(c.data=e):c=document.createTextNode(e),n=It(t,n,s,c)}else n!==""&&typeof n=="string"?n=t.firstChild.data=e:n=t.textContent=e}else if(e==null||o==="boolean")n=It(t,n,s);else{if(o==="function")return pe(()=>{let c=e();for(;typeof c=="function";)c=c();n=en(t,c,n,s)}),()=>n;if(Array.isArray(e)){const c=[],a=n&&Array.isArray(n);if(bn(c,e,n,i))return pe(()=>n=en(t,c,n,s,!0)),()=>n;if(c.length===0){if(n=It(t,n,s),r)return n}else a?n.length===0?On(t,c,s):Ps(t,n,c):(n&&It(t),On(t,c));n=c}else if(e.nodeType){if(Array.isArray(n)){if(r)return n=It(t,n,s,e);It(t,n,null,e)}else n==null||n===""||!t.firstChild?t.appendChild(e):t.replaceChild(e,t.firstChild);n=e}}return n}function bn(t,e,n,s){let i=!1;for(let o=0,r=e.length;o<r;o++){let c=e[o],a=n&&n[t.length],d;if(!(c==null||c===!0||c===!1))if((d=typeof c)=="object"&&c.nodeType)t.push(c);else if(Array.isArray(c))i=bn(t,c,a)||i;else if(d==="function")if(s){for(;typeof c=="function";)c=c();i=bn(t,Array.isArray(c)?c:[c],Array.isArray(a)?a:[a])||i}else t.push(c),i=!0;else{const u=String(c);a&&a.nodeType===3&&a.data===u?t.push(a):t.push(document.createTextNode(u))}}return i}function On(t,e,n=null){for(let s=0,i=e.length;s<i;s++)t.insertBefore(e[s],n)}function It(t,e,n,s){if(n===void 0)return t.textContent="";const i=s||document.createTextNode("");if(e.length){let o=!1;for(let r=e.length-1;r>=0;r--){const c=e[r];if(i!==c){const a=c.parentNode===t;!o&&!r?a?t.replaceChild(i,c):t.insertBefore(i,n):a&&c.remove()}else o=!0}}else t.insertBefore(i,n);return[i]}const _n="data:image/svg+xml,%3csvg%20width='44'%20height='40'%20viewBox='0%200%2044%2040'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M36.4826%2032.6733C35.865%2033.1908%2035.1941%2033.6282%2034.4904%2033.957L33.74%2034.2621L29.7612%2035.8775C27.1272%2036.125%2024.4866%2036.253%2021.8465%2036.2542C21.235%2036.2549%2020.6236%2036.2482%2020.0127%2036.2348V33.2478L36.4826%2032.6733Z'%20fill='%239EACBA'/%3e%3cpath%20d='M0.438355%2018.8047C0.245806%2020.9769%200.245812%2023.1226%200.438355%2025.2946C0.535045%2025.9265%200.94889%2026.5048%201.4516%2026.8841C2.21046%2027.3799%202.95285%2027.8531%203.87299%2027.9711C4.74581%2027.9246%205.47724%2026.84%205.59973%2026.0356C5.89635%2023.3667%205.89636%2020.7328%205.59973%2018.0638C5.47724%2017.2593%204.74582%2016.1747%203.873%2016.1282C2.95286%2016.2462%202.21046%2016.7194%201.45161%2017.2152C0.948896%2017.5945%200.535045%2018.1729%200.438355%2018.8047Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M43.0616%2018.8047C43.2541%2020.9769%2043.2541%2023.1226%2043.0616%2025.2946C42.9649%2025.9265%2042.551%2026.5048%2042.0483%2026.8841C41.2895%2027.3799%2040.5471%2027.8531%2039.6269%2027.9711C38.7541%2027.9246%2038.0227%2026.84%2037.9002%2026.0356C37.6036%2023.3667%2037.6036%2020.7328%2037.9002%2018.0638C38.0227%2017.2593%2038.7541%2016.1747%2039.6269%2016.1282C40.5471%2016.2462%2041.2895%2016.7194%2042.0483%2017.2152C42.551%2017.5945%2042.9649%2018.1729%2043.0616%2018.8047Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M25.8389%208.85439H21.8867V7.22803H21.9359C22.2919%207.22803%2022.6365%207.24805%2022.9641%207.28506C24.6208%207.47311%2025.8389%208.10461%2025.8389%208.85439Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M22.9637%208.85422V11.641H20.9072V3.74219H21.8863V8.85422H22.9637Z'%20fill='%23171A3B'/%3e%3cpath%20d='M25.8393%208.85439C25.8393%209.60419%2024.6212%2010.2357%2022.9645%2010.4237C22.6369%2010.4607%2022.2923%2010.4808%2021.9362%2010.4808C21.5801%2010.4808%2021.2356%2010.4607%2020.908%2010.4237C19.2513%2010.2357%2018.0332%209.60419%2018.0332%208.85439C18.0332%208.104%2019.2513%207.47311%2020.908%207.28506C21.2204%207.24987%2021.5486%207.22985%2021.8871%207.22803V8.85439H25.8393Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M21.8871%208.85499V35.245H21.8465C21.235%2035.2456%2020.6235%2035.2389%2020.0127%2035.2256C17.1712%2035.1637%2014.331%2034.9538%2011.5017%2034.5856C7.74793%2034.0979%204.29685%2030.281%203.74784%2026.4459C3.32624%2023.5019%203.32624%2020.598%203.74784%2017.6541C4.29684%2013.819%207.74793%2010.0021%2011.5017%209.5144C14.9401%209.06731%2018.393%208.85317%2021.8465%208.85499H21.8871Z'%20fill='%23E7E9EB'/%3e%3cpath%20d='M40.114%2026.4452C39.7718%2028.7455%2038.3748%2031.0864%2036.4821%2032.6728C35.8646%2033.1902%2035.1936%2033.6276%2034.49%2033.9564C34.2437%2034.0716%2033.9931%2034.1736%2033.7396%2034.2615C33.2888%2034.4168%2032.8272%2034.5272%2032.3601%2034.5848C28.8781%2035.0149%2025.3827%2035.2406%2021.8867%2035.2442V8.85425C25.3821%208.85789%2028.8787%209.08355%2032.3601%209.51366C36.1382%209.98014%2039.5516%2013.8729%2040.114%2017.6533C40.5489%2020.5785%2040.5489%2023.5206%2040.114%2026.4452Z'%20fill='%23D1D3D4'/%3e%3cpath%20d='M27.1787%2013.3372C28.7256%2013.4409%2030.2804%2013.5888%2031.834%2013.7805C33.5282%2013.9898%2035.5612%2016.263%2035.8623%2018.2854C36.2336%2020.7829%2036.2336%2023.3159%2035.8623%2025.8127C35.6791%2027.0417%2034.8396%2028.4416%2033.7217%2029.3782C33.3772%2029.6675%2033.0233%2029.8974%2032.6709%2030.0618C32.5593%2030.1145%2032.4464%2030.1603%2032.3359%2030.1985C32.1609%2030.259%2031.9925%2030.2992%2031.835%2030.3186C28.467%2030.7347%2025.0907%2030.9456%2021.7998%2030.9456C21.2369%2030.9456%2020.667%2030.9391%2020.1064%2030.927C17.3961%2030.8675%2014.6875%2030.6643%2012.0566%2030.3215C11.6382%2030.2669%2011.1776%2030.0829%2010.7197%2029.7961L27.1787%2013.3372ZM21.7988%2013.1536C22.397%2013.1536%2022.9986%2013.1605%2023.6016%2013.175H23.6006C24.7855%2013.2017%2025.9795%2013.2559%2027.1777%2013.3372L10.7188%2029.7961C10.3196%2029.5462%209.92292%2029.2179%209.55957%2028.8303C9.2952%2028.5484%209.05604%2028.2435%208.84863%2027.927V27.926C8.40193%2027.2445%208.10127%2026.5082%208.00488%2025.8352C7.82534%2024.5778%207.73289%2023.3374%207.73047%2022.0969C7.72805%2020.825%207.8205%2019.5531%208.00488%2018.2629C8.14621%2017.2772%208.72802%2016.1571%209.56152%2015.2678C10.341%2014.4363%2011.2736%2013.8785%2012.0566%2013.7766C13.5174%2013.5867%2014.9995%2013.4403%2016.4912%2013.3372C18.2497%2013.2152%2020.0239%2013.1536%2021.7988%2013.1536Z'%20fill='%2333383F'/%3e%3cpath%20d='M21.8877%200.164557V4.90412C21.5382%204.90412%2021.207%204.8289%2020.9086%204.69301C20.0878%204.32054%2019.5176%203.49371%2019.5176%202.53403C19.5176%201.22554%2020.5786%200.164557%2021.8877%200.164557Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M29.7612%2035.877L20.0127%2039.8352V36.2343C20.6236%2036.2476%2021.235%2036.2543%2021.8465%2036.2537C24.4866%2036.2525%2027.1272%2036.1245%2029.7612%2035.877Z'%20fill='%23D1D3D4'/%3e%3cpath%20d='M24.2562%202.53403C24.2562%203.45488%2023.7309%204.2532%2022.9641%204.64569C22.6414%204.8107%2022.275%204.90411%2021.8867%204.90411V0.164551C23.1952%200.164551%2024.2562%201.22553%2024.2562%202.53403Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M22.9641%204.646V7.28541C22.6365%207.24841%2022.2919%207.22839%2021.9359%207.22839H21.8867V4.90441C22.275%204.90441%2022.6414%204.811%2022.9641%204.646Z'%20fill='%2301052B'/%3e%3cpath%20d='M15.4282%2025.5157C14.6141%2025.6903%2014.1949%2025.6903%2013.3808%2025.5157C12.8325%2025.2805%2012.4157%2024.7097%2012.2918%2024.124C12.0811%2022.4009%2012.0811%2020.7336%2012.2918%2019.0104C12.4157%2018.4248%2012.8325%2017.854%2013.3808%2017.6188C14.1949%2017.4441%2014.6141%2017.4441%2015.4282%2017.6188C15.9765%2017.854%2016.3933%2018.4248%2016.5173%2019.0104C16.7279%2020.7336%2016.7279%2022.4009%2016.5173%2024.124C16.3933%2024.7097%2015.9765%2025.2805%2015.4282%2025.5157Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M29.4946%2025.5157C28.6805%2025.6903%2028.2613%2025.6903%2027.4472%2025.5157C26.8989%2025.2805%2026.4821%2024.7097%2026.3582%2024.124C26.1475%2022.4009%2026.1475%2020.7336%2026.3582%2019.0104C26.4821%2018.4248%2026.8989%2017.854%2027.4472%2017.6188C28.2613%2017.4441%2028.6805%2017.4441%2029.4946%2017.6188C30.0429%2017.854%2030.4597%2018.4248%2030.5837%2019.0104C30.7943%2020.7336%2030.7943%2022.4009%2030.5837%2024.124C30.4597%2024.7097%2030.0429%2025.2805%2029.4946%2025.5157Z'%20fill='%2351D6A1'/%3e%3cpath%20d='M18.9688%2024.187H23.91C24.2911%2024.187%2024.6004%2024.5023%2024.6004%2024.8906V24.9011C24.6004%2026.6789%2023.184%2028.1222%2021.4394%2028.1222C19.6948%2028.1222%2018.2783%2026.6789%2018.2783%2024.9011V24.8906C18.2783%2024.5023%2018.5877%2024.187%2018.9688%2024.187Z'%20fill='%2351D6A1'/%3e%3c/svg%3e",Ds="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='28'%20height='28'%20rx='14'%20fill='%23EFEFEF'/%3e%3cpath%20d='M20.667%209.83325L7.33366%209.83325'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M16.5%2014L7.33333%2014'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M11.5%2018.1667H7.33333'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",Bs="data:image/svg+xml,%3csvg%20width='29'%20height='28'%20viewBox='0%200%2029%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.5977%2016.0232C11.8613%2015.7596%2012.2882%2015.7596%2012.5518%2016.0232C12.8152%2016.2868%2012.8153%2016.7137%2012.5518%2016.9773L7.87109%2021.658H11.1221C11.4949%2021.658%2011.7969%2021.9609%2011.7969%2022.3337C11.7967%2022.7064%2011.4948%2023.0085%2011.1221%2023.0085H6.24121C5.86853%2023.0085%205.56658%2022.7064%205.56641%2022.3337V17.4529C5.56641%2017.0801%205.86842%2016.7771%206.24121%2016.7771C6.614%2016.7771%206.91602%2017.0801%206.91602%2017.4529V20.7039L11.5977%2016.0232ZM22.9082%204.99194C23.2808%204.99212%2023.583%205.29406%2023.583%205.66675V10.5476C23.583%2010.9203%2023.2808%2011.2222%2022.9082%2011.2224C22.5354%2011.2224%2022.2324%2010.9204%2022.2324%2010.5476V7.29663L17.5518%2011.9773C17.2882%2012.2408%2016.8613%2012.2407%2016.5977%2011.9773C16.3341%2011.7137%2016.3341%2011.2868%2016.5977%2011.0232L21.2783%206.34155H18.0273C17.6546%206.34155%2017.3516%206.03954%2017.3516%205.66675C17.3516%205.29396%2017.6546%204.99194%2018.0273%204.99194H22.9082Z'%20fill='%23858B93'%20stroke='%23858B93'%20stroke-width='0.1'/%3e%3c/svg%3e",Hs="data:image/svg+xml,%3csvg%20width='29'%20height='28'%20viewBox='0%200%2029%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M12.0737%2015.8249C12.4464%2015.8249%2012.7493%2016.127%2012.7495%2016.4997V21.3805C12.7495%2021.7533%2012.4465%2022.0563%2012.0737%2022.0563C11.7011%2022.0561%2011.3989%2021.7532%2011.3989%2021.3805V18.1296L6.71826%2022.8102C6.45466%2023.0738%206.02679%2023.0738%205.76318%2022.8102C5.49996%2022.5466%205.49985%2022.1196%205.76318%2021.8561L10.4438%2017.1755H7.19287C6.82019%2017.1753%206.51807%2016.8724%206.51807%2016.4997C6.51824%2016.1271%206.82029%2015.825%207.19287%2015.8249H12.0737ZM22.4302%205.18913C22.6937%204.9258%2023.1207%204.92591%2023.3843%205.18913C23.6479%205.45274%2023.6479%205.88061%2023.3843%206.14421L18.7046%2010.8249H21.9546C22.3273%2010.8249%2022.6302%2011.127%2022.6304%2011.4997C22.6304%2011.8725%2022.3274%2012.1755%2021.9546%2012.1755H17.0737C16.7011%2012.1753%2016.3989%2011.8724%2016.3989%2011.4997V6.61882C16.3991%206.24624%2016.7012%205.94419%2017.0737%205.94402C17.4464%205.94402%2017.7494%206.24613%2017.7495%206.61882V9.8698L22.4302%205.18913Z'%20fill='%23858B93'%20stroke='%23858B93'%20stroke-width='0.1'/%3e%3c/svg%3e",Fn="data:image/svg+xml,%3csvg%20width='34'%20height='34'%20viewBox='0%200%2034%2034'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.2391%208.55011C9.85199%208.16298%209.22434%208.16298%208.83722%208.55011C8.45009%208.93723%208.45009%209.56488%208.83722%209.95201L15.885%2016.9998L8.83728%2024.0476C8.45016%2024.4347%208.45016%2025.0624%208.83728%2025.4495C9.22441%2025.8366%209.85206%2025.8366%2010.2392%2025.4495L17.2869%2018.4017L24.3346%2025.4494C24.7217%2025.8365%2025.3494%2025.8365%2025.7365%2025.4494C26.1236%2025.0623%2026.1236%2024.4346%2025.7365%2024.0475L18.6888%2016.9998L25.7366%209.95207C26.1237%209.56495%2026.1237%208.9373%2025.7366%208.55017C25.3495%208.16305%2024.7218%208.16305%2024.3347%208.55017L17.2869%2015.5979L10.2391%208.55011Z'%20fill='%23858B93'/%3e%3c/svg%3e",Ls="data:image/svg+xml,%3csvg%20width='24'%20height='24'%20viewBox='0%200%2024%2024'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M11.9912%202.92969C11.4392%202.92969%2010.9912%203.37769%2010.9912%203.92969V10.9297H3.99121C3.43921%2010.9297%202.99121%2011.3777%202.99121%2011.9297C2.99121%2012.4817%203.43921%2012.9297%203.99121%2012.9297H10.9912V19.9297C10.9912%2020.4817%2011.4392%2020.9297%2011.9912%2020.9297C12.5432%2020.9297%2012.9912%2020.4817%2012.9912%2019.9297V12.9297H19.9912C20.5432%2012.9297%2020.9912%2012.4817%2020.9912%2011.9297C20.9912%2011.3777%2020.5432%2010.9297%2019.9912%2010.9297H12.9912V3.92969C12.9912%203.37769%2012.5432%202.92969%2011.9912%202.92969Z'%20fill='%23858B93'/%3e%3c/svg%3e",Os="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='32'%20height='32'%20rx='16'%20fill='white'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M15.6464%2010.3132C15.8417%2010.1179%2016.1583%2010.1179%2016.3536%2010.3132L20.3536%2014.3132C20.5488%2014.5085%2020.5488%2014.825%2020.3536%2015.0203C20.1583%2015.2156%2019.8417%2015.2156%2019.6464%2015.0203L16.5%2011.8739L16.5%2021.3334C16.5%2021.6096%2016.2761%2021.8334%2016%2021.8334C15.7239%2021.8334%2015.5%2021.6096%2015.5%2021.3334L15.5%2011.8739L12.3536%2015.0203C12.1583%2015.2156%2011.8417%2015.2156%2011.6464%2015.0203C11.4512%2014.825%2011.4512%2014.5085%2011.6464%2014.3132L15.6464%2010.3132Z'%20fill='%23858B93'/%3e%3c/svg%3e",Fs="data:image/svg+xml,%3csvg%20width='28'%20height='28'%20viewBox='0%200%2028%2028'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='28'%20height='28'%20rx='14'%20fill='%231AAF74'%20fill-opacity='0.1'/%3e%3cpath%20d='M20.667%209.83325L7.33366%209.83325'%20stroke='%231AAF74'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M16.5%2014L7.33333%2014'%20stroke='%231AAF74'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M11.5%2018.1667H7.33333'%20stroke='%231AAF74'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",Ns="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='12'%20cy='6.5'%20r='4'%20stroke='%23858B93'%20stroke-width='1.3'/%3e%3cellipse%20cx='12'%20cy='17.5'%20rx='7'%20ry='4'%20stroke='%23858B93'%20stroke-width='1.3'/%3e%3c/svg%3e",Us="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M2%2012.5C2%207.78595%202%205.42893%203.46447%203.96447C4.92893%202.5%207.28595%202.5%2012%202.5C16.714%202.5%2019.0711%202.5%2020.5355%203.96447C22%205.42893%2022%207.78595%2022%2012.5C22%2017.214%2022%2019.5711%2020.5355%2021.0355C19.0711%2022.5%2016.714%2022.5%2012%2022.5C7.28595%2022.5%204.92893%2022.5%203.46447%2021.0355C2%2019.5711%202%2017.214%202%2012.5Z'%20stroke='%23858B93'%20stroke-width='1.3'/%3e%3cpath%20d='M7%2014.5L8.79689%2012.3437C9.50894%2011.4893%209.86496%2011.062%2010.3333%2011.062C10.8017%2011.062%2011.1577%2011.4893%2011.8698%2012.3437L12.1302%2012.6563C12.8423%2013.5107%2013.1983%2013.938%2013.6667%2013.938C14.135%2013.938%2014.4911%2013.5107%2015.2031%2012.6563L17%2010.5'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",js="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M22%2011V12.5C22%2017.214%2022%2019.5711%2020.5355%2021.0355C19.0711%2022.5%2016.714%2022.5%2012%2022.5C7.28595%2022.5%204.92893%2022.5%203.46447%2021.0355C2%2019.5711%202%2017.214%202%2012.5C2%207.78595%202%205.42893%203.46447%203.96447C4.92893%202.5%207.28595%202.5%2012%202.5H13.5'%20stroke='%23858B93'%20stroke-width='1.3'%20stroke-linecap='round'/%3e%3cpath%20d='M16.652%203.95506L17.3009%203.30624C18.3759%202.23125%2020.1188%202.23125%2021.1938%203.30624C22.2687%204.38124%2022.2687%206.12415%2021.1938%207.19914L20.5449%207.84795M16.652%203.95506C16.652%203.95506%2016.7331%205.33379%2017.9497%206.55032C19.1662%207.76685%2020.5449%207.84795%2020.5449%207.84795M16.652%203.95506L10.6872%209.91993C10.2832%2010.3239%2010.0812%2010.5259%209.90743%2010.7487C9.70249%2011.0114%209.52679%2011.2957%209.38344%2011.5965C9.26191%2011.8515%209.17157%2012.1225%208.99089%2012.6646L8.41242%2014.4M20.5449%207.84795L14.5801%2013.8128C14.1761%2014.2168%2013.9741%2014.4188%2013.7513%2014.5926C13.4886%2014.7975%2013.2043%2014.9732%2012.9035%2015.1166C12.6485%2015.2381%2012.3775%2015.3284%2011.8354%2015.5091L10.1%2016.0876M10.1%2016.0876L8.97709%2016.4619C8.71035%2016.5508%208.41626%2016.4814%208.21744%2016.2826C8.01862%2016.0837%207.9492%2015.7897%208.03811%2015.5229L8.41242%2014.4M10.1%2016.0876L8.41242%2014.4'%20stroke='%23858B93'%20stroke-width='1.5'/%3e%3c/svg%3e",zs="data:image/svg+xml,%3csvg%20width='20'%20height='21'%20viewBox='0%200%2020%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M9.58366%202.79175C5.55658%202.79175%202.29199%206.05634%202.29199%2010.0834C2.29199%2014.1105%205.55658%2017.3751%209.58366%2017.3751C13.6107%2017.3751%2016.8753%2014.1105%2016.8753%2010.0834C16.8753%206.05634%2013.6107%202.79175%209.58366%202.79175ZM1.04199%2010.0834C1.04199%205.36598%204.86623%201.54175%209.58366%201.54175C14.3011%201.54175%2018.1253%205.36598%2018.1253%2010.0834C18.1253%2012.2172%2017.3429%2014.1682%2016.0494%2015.6653L18.7756%2018.3915C19.0197%2018.6356%2019.0197%2019.0313%2018.7756%2019.2754C18.5315%2019.5194%2018.1358%2019.5194%2017.8917%2019.2754L15.1655%2016.5491C13.6684%2017.8427%2011.7174%2018.6251%209.58366%2018.6251C4.86623%2018.6251%201.04199%2014.8008%201.04199%2010.0834Z'%20fill='%23858B93'/%3e%3c/svg%3e",Vs="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M17%2012.5C17%2011.3954%2017.8954%2010.5%2019%2010.5C20.1046%2010.5%2021%2011.3954%2021%2012.5C21%2013.6046%2020.1046%2014.5%2019%2014.5C17.8954%2014.5%2017%2013.6046%2017%2012.5Z'%20fill='%23858B93'/%3e%3cpath%20d='M10%2012.5C10%2011.3954%2010.8954%2010.5%2012%2010.5C13.1046%2010.5%2014%2011.3954%2014%2012.5C14%2013.6046%2013.1046%2014.5%2012%2014.5C10.8954%2014.5%2010%2013.6046%2010%2012.5Z'%20fill='%23858B93'/%3e%3cpath%20d='M3%2012.5C3%2011.3954%203.89543%2010.5%205%2010.5C6.10457%2010.5%207%2011.3954%207%2012.5C7%2013.6046%206.10457%2014.5%205%2014.5C3.89543%2014.5%203%2013.6046%203%2012.5Z'%20fill='%23858B93'/%3e%3c/svg%3e",Ws="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7%208.5C7%205.73858%209.23858%203.5%2012%203.5C14.7614%203.5%2017%205.73858%2017%208.5V11.5C17%2014.2614%2014.7614%2016.5%2012%2016.5C9.23858%2016.5%207%2014.2614%207%2011.5V8.5Z'%20stroke='%23858B93'%20stroke-width='1.5'/%3e%3cpath%20d='M11%208.5H13'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M10%2011.5L14%2011.5'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M20%2010.5V11.5C20%2015.9183%2016.4183%2019.5%2012%2019.5C7.58172%2019.5%204%2015.9183%204%2011.5V10.5'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3cpath%20d='M12%2019.5V22.5'%20stroke='%23858B93'%20stroke-width='1.5'%20stroke-linecap='round'/%3e%3c/svg%3e",Nn="data:image/svg+xml,%3csvg%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M12.25%202.49258C13.5179%201.2247%2015.5735%201.2247%2016.8414%202.49258C18.1093%203.76046%2018.1093%205.8161%2016.8414%207.08398L10.5131%2013.4123C10.1564%2013.769%209.9386%2013.9869%209.69583%2014.1762C9.40981%2014.3993%209.10033%2014.5906%208.77287%2014.7466C8.49494%2014.8791%208.20269%2014.9765%207.72413%2015.136L5.49692%2015.8784L4.9622%2016.0566C4.48358%2016.2162%203.95589%2016.0916%203.59915%2015.7349C3.2424%2015.3781%203.11783%2014.8504%203.27737%2014.3718L4.19801%2011.6099C4.3575%2011.1313%204.4549%2010.8391%204.58736%2010.5611C4.74342%2010.2337%204.93469%209.9242%205.15778%209.63817C5.34714%209.3954%205.56498%209.17759%205.92169%208.82091L12.25%202.49258ZM5.46809%2014.5704L4.76362%2013.8659L5.37064%2012.0449C5.54737%2011.5147%205.62037%2011.2991%205.71577%2011.0989C5.83276%2010.8534%205.97616%2010.6214%206.14342%2010.4069C6.27979%2010.2321%206.43997%2010.0704%206.83516%209.67521L11.7443%204.76607C11.9469%205.27439%2012.2898%205.88791%2012.8679%206.46606C13.4461%207.04422%2014.0596%207.38707%2014.5679%207.5897L9.65879%2012.4988C9.2636%2012.894%209.1019%2013.0542%208.92706%2013.1906C8.71262%2013.3578%208.4806%2013.5012%208.2351%2013.6182C8.03493%2013.7136%207.81935%2013.7866%207.28915%2013.9634L5.46809%2014.5704ZM15.564%206.59368C15.4608%206.57102%2015.3317%206.53694%2015.1851%206.48604C14.7817%206.34611%2014.2511%206.08149%2013.7518%205.58218C13.2525%205.08287%2012.9879%204.5523%2012.848%204.14895C12.7971%204.00226%2012.763%203.87323%2012.7403%203.77004L13.1339%203.37647C13.9136%202.59674%2015.1778%202.59674%2015.9575%203.37647C16.7373%204.15619%2016.7373%205.42038%2015.9575%206.2001L15.564%206.59368ZM3.209%2018.8333C3.209%2018.4882%203.48882%2018.2083%203.834%2018.2083H17.1673V19.4583H3.834C3.48882%2019.4583%203.209%2019.1785%203.209%2018.8333Z'%20fill='%23858B93'/%3e%3c/svg%3e",Un="data:image/svg+xml,%3csvg%20width='21'%20height='21'%20viewBox='0%200%2021%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.4994%202.79166C9.68396%202.79166%208.9886%203.31251%208.7309%204.0416C8.61587%204.36705%208.2588%204.53763%207.93335%204.4226C7.6079%204.30757%207.43733%203.95049%207.55235%203.62504C7.98105%202.41215%209.13775%201.54166%2010.4994%201.54166C11.861%201.54166%2013.0177%202.41215%2013.4464%203.62504C13.5614%203.95049%2013.3908%204.30757%2013.0654%204.4226C12.74%204.53763%2012.3829%204.36705%2012.2678%204.0416C12.0101%203.31251%2011.3148%202.79166%2010.4994%202.79166Z'%20fill='%23858B93'/%3e%3cpath%20d='M2.79102%205.49999C2.79102%205.15481%203.07084%204.87499%203.41602%204.87499H17.5828C17.9279%204.87499%2018.2078%205.15481%2018.2078%205.49999C18.2078%205.84517%2017.9279%206.12499%2017.5828%206.12499H3.41602C3.07084%206.12499%202.79102%205.84517%202.79102%205.49999Z'%20fill='%23858B93'/%3e%3cpath%20d='M5.42859%207.54175C5.40563%207.19733%205.10781%206.93675%204.7634%206.95971C4.41898%206.98267%204.15839%207.28048%204.18135%207.6249L4.56756%2013.418C4.63881%2014.487%204.69636%2015.3504%204.83134%2016.028C4.97167%2016.7324%205.21035%2017.3208%205.70335%2017.782C6.19634%2018.2432%206.7993%2018.4422%207.51151%2018.5354C8.19654%2018.625%209.06191%2018.625%2010.1332%2018.625H10.8656C11.9369%2018.625%2012.8023%2018.625%2013.4873%2018.5354C14.1995%2018.4422%2014.8025%2018.2432%2015.2955%2017.782C15.7885%2017.3208%2016.0272%2016.7324%2016.1675%2016.028C16.3025%2015.3504%2016.36%2014.487%2016.4313%2013.418L16.8175%207.6249C16.8404%207.28048%2016.5798%206.98267%2016.2354%206.95971C15.891%206.93675%2015.5932%207.19733%2015.5702%207.54175L15.187%2013.291C15.1121%2014.4142%2015.0587%2015.1957%2014.9416%2015.7837C14.828%2016.3541%2014.6693%2016.656%2014.4415%2016.8692C14.2137%2017.0824%2013.9019%2017.2205%2013.3252%2017.296C12.7307%2017.3737%2011.9474%2017.375%2010.8216%2017.375H10.1772C9.05148%2017.375%208.26814%2017.3737%207.67364%2017.296C7.09697%2017.2205%206.78517%2017.0824%206.55733%2016.8692C6.32948%2016.656%206.17087%2016.3541%206.05725%2015.7837C5.94011%2015.1957%205.88675%2014.4142%205.81187%2013.291L5.42859%207.54175Z'%20fill='%23858B93'/%3e%3cpath%20d='M8.3539%209.04476C8.69736%209.01041%209.00364%209.261%209.03799%209.60447L9.45465%2013.7711C9.489%2014.1146%209.23841%2014.4209%208.89494%2014.4552C8.55148%2014.4896%208.2452%2014.239%208.21086%2013.8955L7.79419%209.72885C7.75984%209.38538%208.01043%209.0791%208.3539%209.04476Z'%20fill='%23858B93'/%3e%3cpath%20d='M13.2047%209.72885C13.239%209.38538%2012.9884%209.0791%2012.6449%209.04476C12.3015%209.01041%2011.9952%209.261%2011.9609%209.60447L11.5442%2013.7711C11.5098%2014.1146%2011.7604%2014.4209%2012.1039%2014.4552C12.4474%2014.4896%2012.7536%2014.239%2012.788%2013.8955L13.2047%209.72885Z'%20fill='%23858B93'/%3e%3c/svg%3e",qs="data:image/svg+xml,%3csvg%20width='32'%20height='32'%20viewBox='0%200%2032%2032'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3crect%20width='32'%20height='32'%20rx='16'%20fill='white'/%3e%3cpath%20d='M16%2022.6666L16%209.33331M16%209.33331L21%2014.3333M16%209.33331L11%2014.3333'%20stroke='%231AAF74'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3e%3c/svg%3e",Zs="data:image/svg+xml,%3csvg%20width='17'%20height='17'%20viewBox='0%200%2017%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2361_172518)'%3e%3cpath%20d='M15.6005%2011.6509C15.9284%2011.2327%2016.0856%2010.7843%2016.0656%2010.3226C16.0455%209.81401%2015.818%209.41585%2015.6306%209.1716C15.8481%208.62956%2015.9317%207.77636%2015.2057%207.11388C14.6737%206.62873%2013.7703%206.41125%2012.5189%206.47147C11.639%206.51162%2010.9029%206.67557%2010.8728%206.68226H10.8694C10.7021%206.71238%2010.5248%206.74918%2010.3441%206.78933C10.3307%206.57519%2010.3675%206.0432%2010.7623%204.84537C11.2308%203.42003%2011.204%202.32927%2010.6754%201.59987C10.1199%200.833663%209.23328%200.773438%208.9723%200.773438C8.72136%200.773438%208.49049%200.87716%208.32655%201.06787C7.95515%201.49949%207.99865%202.29581%208.04549%202.66386C7.60384%203.8483%206.36586%206.75253%205.3186%207.55888C5.29852%207.57227%205.2818%207.589%205.26507%207.60572C4.95724%207.93028%204.7498%208.28159%204.60927%208.58941C4.41187%208.48235%204.18769%208.42212%203.94679%208.42212H1.9058C1.13625%208.42212%200.513916%209.0478%200.513916%209.81401V15.2511C0.513916%2016.0206%201.1396%2016.6429%201.9058%2016.6429H3.94679C4.24457%2016.6429%204.52228%2016.5493%204.7498%2016.3887L5.53608%2016.4823C5.65653%2016.4991%207.7979%2016.7701%209.99614%2016.7266C10.3943%2016.7567%2010.769%2016.7734%2011.117%2016.7734C11.7159%2016.7734%2012.2379%2016.7266%2012.6728%2016.6329C13.6967%2016.4154%2014.396%2015.9805%2014.7506%2015.3414C15.0217%2014.8529%2015.0217%2014.3677%2014.9782%2014.0599C15.644%2013.4577%2015.7611%2012.7918%2015.7377%2012.3234C15.7243%2012.0524%2015.6641%2011.8215%2015.6005%2011.6509ZM1.9058%2015.7396C1.63479%2015.7396%201.4173%2015.5187%201.4173%2015.2511V9.81066C1.4173%209.53964%201.63813%209.32216%201.9058%209.32216H3.94679C4.21781%209.32216%204.43529%209.54299%204.43529%209.81066V15.2477C4.43529%2015.5187%204.21446%2015.7362%203.94679%2015.7362H1.9058V15.7396ZM14.7439%2011.2594C14.6034%2011.4066%2014.5767%2011.6308%2014.6837%2011.8048C14.6837%2011.8082%2014.8209%2012.0424%2014.8376%2012.3636C14.8611%2012.8019%2014.6503%2013.19%2014.2086%2013.5212C14.0513%2013.6417%2013.9878%2013.8491%2014.0547%2014.0365C14.0547%2014.0399%2014.1986%2014.4815%2013.9644%2014.8997C13.7402%2015.3013%2013.2416%2015.589%2012.4855%2015.7496C11.8799%2015.8801%2011.0568%2015.9035%2010.0463%2015.8232C10.0329%2015.8232%2010.0162%2015.8232%209.99949%2015.8232C7.84809%2015.87%205.67326%2015.589%205.64984%2015.5856H5.6465L5.30856%2015.5455C5.32864%2015.4518%205.33868%2015.3514%205.33868%2015.2511V9.81066C5.33868%209.66679%205.31525%209.52626%205.2751%209.39577C5.33533%209.1716%205.50262%208.67306%205.89744%208.24813C7.39974%207.057%208.86858%203.0386%208.93215%202.86461C8.95892%202.79435%208.96561%202.71739%208.95223%202.64044C8.89535%202.2657%208.91542%201.80731%208.99572%201.67013C9.17305%201.67348%209.65152%201.72367%209.93926%202.12183C10.2805%202.5936%2010.2672%203.43676%209.89911%204.55428C9.337%206.25734%209.29016%207.15403%209.73516%207.54885C9.95599%207.74625%2010.2504%207.75629%2010.4646%207.67933C10.6687%207.63249%2010.8627%207.59234%2011.0467%207.56223C11.0601%207.55888%2011.0769%207.55554%2011.0902%207.55219C12.1174%207.32802%2013.9577%207.19084%2014.5967%207.77302C15.1388%208.26821%2014.754%208.924%2014.7105%208.99427C14.5867%209.18163%2014.6235%209.42588%2014.7908%209.57645C14.7941%209.57979%2015.1455%209.91104%2015.1622%2010.356C15.1756%2010.6538%2015.035%2010.9583%2014.7439%2011.2594Z'%20fill='%23858B93'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2361_172518'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='translate(0.290527%200.773438)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Ys="data:image/svg+xml,%3csvg%20width='17'%20height='17'%20viewBox='0%200%2017%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2361_172521)'%3e%3cpath%20d='M0.980564%205.89598C0.652667%206.31422%200.495411%206.76256%200.515487%207.2243C0.535562%207.73287%200.763082%208.13103%200.950451%208.37528C0.732968%208.91731%200.649323%209.77051%201.37538%2010.433C1.90737%2010.9181%202.81076%2011.1356%204.06212%2011.0754C4.94209%2011.0353%205.67818%2010.8713%205.70829%2010.8646H5.71164C5.87893%2010.8345%206.05626%2010.7977%206.23694%2010.7575C6.25033%2010.9717%206.21352%2011.5037%205.81871%2012.7015C5.35028%2014.1268%205.37705%2015.2176%205.9057%2015.947C6.46112%2016.7132%207.34777%2016.7734%207.60875%2016.7734C7.85969%2016.7734%208.09056%2016.6697%208.25451%2016.479C8.6259%2016.0474%208.5824%2015.2511%208.53556%2014.883C8.97722%2013.6986%2010.2152%2010.7943%2011.2625%209.98799C11.2825%209.97461%2011.2993%209.95788%2011.316%209.94115C11.6238%209.6166%2011.8313%209.26528%2011.9718%208.95746C12.1692%209.06453%2012.3934%209.12475%2012.6343%209.12475H14.6753C15.4448%209.12475%2016.0671%208.49907%2016.0671%207.73287V2.29581C16.0671%201.52626%2015.4415%200.903928%2014.6753%200.903928H12.6343C12.3365%200.903928%2012.0588%200.997612%2011.8313%201.15821L11.045%201.06453C10.9245%201.0478%208.78316%200.776784%206.58491%200.820281C6.18675%200.790168%205.81201%200.773438%205.46404%200.773438C4.86513%200.773438%204.34317%200.82028%203.90821%200.913965C2.88437%201.13145%202.18508%201.56641%201.83042%202.20547C1.5594%202.69397%201.5594%203.17913%201.6029%203.48695C0.937067%204.0892%200.819963%204.75504%200.843384%205.22346C0.856767%205.49447%200.916992%205.72534%200.980564%205.89598ZM14.6753%201.80732C14.9463%201.80732%2015.1638%202.02814%2015.1638%202.29581V7.73621C15.1638%208.00723%2014.9429%208.22471%2014.6753%208.22471H12.6343C12.3632%208.22471%2012.1458%208.00389%2012.1458%207.73621V2.29916C12.1458%202.02814%2012.3666%201.81066%2012.6343%201.81066H14.6753V1.80732ZM1.83711%206.28745C1.97764%206.14023%202.0044%205.91606%201.89734%205.74207C1.89734%205.73872%201.76015%205.50451%201.74343%205.18331C1.72%204.745%201.93079%204.35688%202.37245%204.02563C2.52971%203.90518%202.59328%203.69774%202.52636%203.51037C2.52636%203.50702%202.38249%203.06537%202.6167%202.64713C2.84087%202.24562%203.33941%201.95788%204.09558%201.79728C4.70118%201.66679%205.52427%201.64337%206.53473%201.72367C6.54811%201.72367%206.56484%201.72367%206.58157%201.72367C8.73297%201.67683%2010.9078%201.95788%2010.9312%201.96123H10.9346L11.2725%202.00138C11.2524%202.09506%2011.2424%202.19544%2011.2424%202.29581V7.73621C11.2424%207.88009%2011.2658%208.02061%2011.306%208.1511C11.2457%208.37528%2011.0784%208.87381%2010.6836%209.29874C9.18132%2010.4899%207.71248%2014.5083%207.6489%2014.6823C7.62214%2014.7525%207.61545%2014.8295%207.62883%2014.9064C7.68571%2015.2812%207.66563%2015.7396%207.58533%2015.8767C7.408%2015.8734%206.92954%2015.8232%206.64179%2015.425C6.30051%2014.9533%206.3139%2014.1101%206.68194%2012.9926C7.24405%2011.2895%207.29089%2010.3928%206.84589%209.99803C6.62506%209.80062%206.33063%209.79059%206.11649%209.86754C5.91239%209.91438%205.71833%209.95453%205.53431%209.98465C5.52092%209.98799%205.50419%209.99134%205.49081%209.99468C4.46363%2010.2189%202.62339%2010.356%201.98433%209.77386C1.4423%209.27867%201.82707%208.62287%201.87057%208.55261C1.99437%208.36524%201.95756%208.12099%201.79027%207.97043C1.78692%207.96708%201.4356%207.63584%201.41887%207.19084C1.40549%206.89305%201.54602%206.58858%201.83711%206.28745Z'%20fill='%23858B93'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2361_172521'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='matrix(-1%200%200%20-1%2016.2905%2016.7734)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Xs="data:image/svg+xml,%3csvg%20width='16'%20height='17'%20viewBox='0%200%2016%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2361_92626)'%3e%3cpath%20d='M15.3092%2011.4575C15.6371%2011.0393%2015.7944%2010.591%2015.7743%2010.1292C15.7542%209.62065%2015.5267%209.22249%2015.3393%208.97824C15.5568%208.4362%2015.6405%207.58301%2014.9144%206.92052C14.3824%206.43537%2013.479%206.21789%2012.2277%206.27811C11.3477%206.31826%2010.6116%206.48221%2010.5815%206.4889H10.5782C10.4109%206.51902%2010.2335%206.55582%2010.0529%206.59597C10.0395%206.38183%2010.0763%205.84984%2010.4711%204.65201C10.9395%203.22667%2010.9127%202.13591%2010.3841%201.40651C9.82868%200.640304%208.94202%200.580078%208.68104%200.580078C8.4301%200.580078%208.19923%200.6838%208.03529%200.874516C7.66389%201.30613%207.70739%202.10245%207.75423%202.4705C7.31258%203.65494%206.0746%206.55917%205.02734%207.36552C5.00726%207.37891%204.99054%207.39564%204.97381%207.41237C4.66599%207.73692%204.45854%208.08823%204.31801%208.39605C4.12061%208.28899%203.89643%208.22876%203.65553%208.22876H1.61454C0.84499%208.22876%200.222656%208.85444%200.222656%209.62065V15.0577C0.222656%2015.8273%200.848336%2016.4496%201.61454%2016.4496H3.65553C3.95331%2016.4496%204.23102%2016.3559%204.45854%2016.1953L5.24482%2016.289C5.36527%2016.3057%207.50664%2016.5767%209.70488%2016.5332C10.103%2016.5633%2010.4778%2016.5801%2010.8258%2016.5801C11.4247%2016.5801%2011.9466%2016.5332%2012.3816%2016.4396C13.4054%2016.2221%2014.1047%2015.7871%2014.4594%2015.148C14.7304%2014.6595%2014.7304%2014.1744%2014.6869%2013.8666C15.3527%2013.2643%2015.4698%2012.5985%2015.4464%2012.1301C15.433%2011.859%2015.3728%2011.6282%2015.3092%2011.4575ZM1.61454%2015.5462C1.34353%2015.5462%201.12604%2015.3254%201.12604%2015.0577V9.6173C1.12604%209.34628%201.34687%209.1288%201.61454%209.1288H3.65553C3.92655%209.1288%204.14403%209.34963%204.14403%209.6173V15.0544C4.14403%2015.3254%203.9232%2015.5429%203.65553%2015.5429H1.61454V15.5462ZM14.4527%2011.0661C14.3122%2011.2133%2014.2854%2011.4375%2014.3925%2011.6114C14.3925%2011.6148%2014.5296%2011.849%2014.5464%2012.1702C14.5698%2012.6085%2014.359%2012.9966%2013.9173%2013.3279C13.7601%2013.4483%2013.6965%2013.6558%2013.7634%2013.8431C13.7634%2013.8465%2013.9073%2014.2881%2013.6731%2014.7064C13.4489%2015.1079%2012.9504%2015.3956%2012.1942%2015.5562C11.5886%2015.6867%2010.7655%2015.7101%209.75507%2015.6298C9.74169%2015.6298%209.72496%2015.6298%209.70823%2015.6298C7.55683%2015.6767%205.382%2015.3956%205.35858%2015.3923H5.35524L5.0173%2015.3521C5.03738%2015.2585%205.04742%2015.1581%205.04742%2015.0577V9.6173C5.04742%209.47343%205.02399%209.3329%204.98384%209.20241C5.04407%208.97824%205.21136%208.4797%205.60618%208.05477C7.10848%206.86364%208.57732%202.84524%208.64089%202.67125C8.66766%202.60099%208.67435%202.52403%208.66097%202.44708C8.60409%202.07234%208.62416%201.61396%208.70446%201.47677C8.88179%201.48012%209.36026%201.53031%209.648%201.92847C9.98928%202.40024%209.9759%203.2434%209.60785%204.36092C9.04574%206.06398%208.9989%206.96067%209.4439%207.35549C9.66473%207.55289%209.95917%207.56293%2010.1733%207.48597C10.3774%207.43913%2010.5715%207.39898%2010.7555%207.36887C10.7689%207.36552%2010.7856%207.36218%2010.799%207.35883C11.8262%207.13466%2013.6664%206.99748%2014.3055%207.57966C14.8475%208.07485%2014.4627%208.73064%2014.4192%208.80091C14.2954%208.98828%2014.3322%209.23252%2014.4995%209.38309C14.5029%209.38644%2014.8542%209.71768%2014.8709%2010.1627C14.8843%2010.4605%2014.7438%2010.7649%2014.4527%2011.0661Z'%20fill='%231AAF74'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2361_92626'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='translate(0%200.580078)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Gs="data:image/svg+xml,%3csvg%20width='17'%20height='17'%20viewBox='0%200%2017%2017'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cg%20clip-path='url(%23clip0_2361_214893)'%3e%3cpath%20d='M0.784519%205.70262C0.456622%206.12086%200.299366%206.5692%200.319442%207.03094C0.339517%207.53951%200.567037%207.93767%200.754406%208.18192C0.536923%208.72395%200.453278%209.57715%201.17933%2010.2396C1.71133%2010.7248%202.61472%2010.9423%203.86607%2010.882C4.74604%2010.8419%205.48213%2010.6779%205.51225%2010.6713H5.51559C5.68289%2010.6411%205.86022%2010.6043%206.0409%2010.5642C6.05428%2010.7783%206.01748%2011.3103%205.62266%2012.5081C5.15424%2013.9335%205.18101%2015.0242%205.70965%2015.7536C6.26507%2016.5199%207.15173%2016.5801%207.41271%2016.5801C7.66365%2016.5801%207.89452%2016.4764%208.05846%2016.2856C8.42986%2015.854%208.38636%2015.0577%208.33952%2014.6897C8.78117%2013.5052%2010.0191%2010.601%2011.0664%209.79463C11.0865%209.78125%2011.1032%209.76452%2011.1199%209.74779C11.4278%209.42324%2011.6352%209.07192%2011.7757%208.7641C11.9731%208.87117%2012.1973%208.9314%2012.4382%208.9314H14.4792C15.2488%208.9314%2015.8711%208.30572%2015.8711%207.53951V2.10245C15.8711%201.3329%2015.2454%200.710568%2014.4792%200.710568H12.4382C12.1404%200.710568%2011.8627%200.804253%2011.6352%200.964854L10.8489%200.87117C10.7285%200.854441%208.58711%200.583425%206.38887%200.626922C5.99071%200.596808%205.61597%200.580078%205.268%200.580078C4.66909%200.580078%204.14713%200.626921%203.71216%200.720606C2.68832%200.938087%201.98904%201.37305%201.63437%202.01212C1.36336%202.50061%201.36336%202.98577%201.40685%203.29359C0.741022%203.89585%200.623918%204.56168%200.647339%205.0301C0.660722%205.30112%200.720947%205.53198%200.784519%205.70262ZM14.4792%201.61396C14.7502%201.61396%2014.9677%201.83478%2014.9677%202.10245V7.54286C14.9677%207.81387%2014.7469%208.03135%2014.4792%208.03135H12.4382C12.1672%208.03135%2011.9497%207.81053%2011.9497%207.54286V2.1058C11.9497%201.83478%2012.1706%201.6173%2012.4382%201.6173H14.4792V1.61396ZM1.64106%206.09409C1.78159%205.94687%201.80836%205.7227%201.70129%205.54871C1.70129%205.54536%201.56411%205.31115%201.54738%204.98995C1.52396%204.55164%201.73475%204.16352%202.1764%203.83227C2.33366%203.71182%202.39723%203.50438%202.33032%203.31701C2.33032%203.31366%202.18644%202.87201%202.42066%202.45377C2.64483%202.05227%203.14336%201.76452%203.89953%201.60392C4.50514%201.47343%205.32822%201.45001%206.33868%201.53031C6.35206%201.53031%206.36879%201.53031%206.38552%201.53031C8.53692%201.48347%2010.7117%201.76452%2010.7352%201.76787H10.7385L11.0764%201.80802C11.0564%201.9017%2011.0463%202.00208%2011.0463%202.10245V7.54286C11.0463%207.68673%2011.0698%207.82726%2011.1099%207.95774C11.0497%208.18192%2010.8824%208.68046%2010.4876%209.10538C8.98527%2010.2965%207.51643%2014.3149%207.45286%2014.4889C7.42609%2014.5592%207.4194%2014.6361%207.43278%2014.7131C7.48966%2015.0878%207.46959%2015.5462%207.38929%2015.6834C7.21196%2015.68%206.73349%2015.6298%206.44575%2015.2317C6.10447%2014.7599%206.11785%2013.9168%206.4859%2012.7992C7.04801%2011.0962%207.09485%2010.1995%206.64985%209.80467C6.42902%209.60726%206.13458%209.59723%205.92045%209.67418C5.71635%209.72102%205.52229%209.76117%205.33826%209.79129C5.32488%209.79463%205.30815%209.79798%205.29477%209.80132C4.26758%2010.0255%202.42735%2010.1627%201.78828%209.5805C1.24625%209.08531%201.63103%208.42951%201.67452%208.35925C1.79832%208.17188%201.76152%207.92763%201.59422%207.77707C1.59088%207.77372%201.23956%207.44248%201.22283%206.99748C1.20945%206.69969%201.34997%206.39522%201.64106%206.09409Z'%20fill='%23F34859'/%3e%3c/g%3e%3cdefs%3e%3cclipPath%20id='clip0_2361_214893'%3e%3crect%20width='16'%20height='16'%20fill='white'%20transform='matrix(-1%200%200%20-1%2016.0938%2016.5801)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",Ks="data:image/svg+xml,%3csvg%20width='24'%20height='25'%20viewBox='0%200%2024%2025'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M22%2012.123C22%2017.6459%2017.5228%2022.123%2012%2022.123C6.47715%2022.123%202%2017.6459%202%2012.123C2%206.6002%206.47715%202.12305%2012%202.12305C17.5228%202.12305%2022%206.6002%2022%2012.123ZM16.0303%209.09272C16.3232%209.38561%2016.3232%209.86048%2016.0303%2010.1534L11.0303%2015.1534C10.7374%2015.4463%2010.2626%2015.4463%209.96967%2015.1534L7.96967%2013.1534C7.67678%2012.8605%207.67678%2012.3856%207.96967%2012.0927C8.26256%2011.7998%208.73744%2011.7998%209.03033%2012.0927L10.5%2013.5624L14.9697%209.09272C15.2626%208.79982%2015.7374%208.79982%2016.0303%209.09272Z'%20fill='%231AAF74'/%3e%3c/svg%3e",Qs="data:image/svg+xml,%3csvg%20width='21'%20height='20'%20viewBox='0%200%2021%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M10.2904%2014.791C10.6355%2014.791%2010.9154%2014.5112%2010.9154%2014.166V9.16602C10.9154%208.82084%2010.6355%208.54102%2010.2904%208.54102C9.94519%208.54102%209.66537%208.82084%209.66537%209.16602V14.166C9.66537%2014.5112%209.94519%2014.791%2010.2904%2014.791Z'%20fill='%23858B93'/%3e%3cpath%20d='M10.2904%205.83268C10.7506%205.83268%2011.1237%206.20578%2011.1237%206.66602C11.1237%207.12625%2010.7506%207.49935%2010.2904%207.49935C9.83013%207.49935%209.45703%207.12625%209.45703%206.66602C9.45703%206.20578%209.83013%205.83268%2010.2904%205.83268Z'%20fill='%23858B93'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M1.33203%209.99935C1.33203%205.0518%205.34281%201.04102%2010.2904%201.04102C15.2379%201.04102%2019.2487%205.0518%2019.2487%209.99935C19.2487%2014.9469%2015.2379%2018.9577%2010.2904%2018.9577C5.34281%2018.9577%201.33203%2014.9469%201.33203%209.99935ZM10.2904%202.29102C6.03317%202.29102%202.58203%205.74215%202.58203%209.99935C2.58203%2014.2565%206.03317%2017.7077%2010.2904%2017.7077C14.5476%2017.7077%2017.9987%2014.2565%2017.9987%209.99935C17.9987%205.74215%2014.5476%202.29102%2010.2904%202.29102Z'%20fill='%23858B93'/%3e%3c/svg%3e",Js="data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.291%205.83301C17.291%206.17819%2017.0112%206.45801%2016.666%206.45801L3.33268%206.45801C2.9875%206.45801%202.70768%206.17819%202.70768%205.83301C2.70768%205.48783%202.9875%205.20801%203.33268%205.20801L16.666%205.20801C17.0112%205.20801%2017.291%205.48783%2017.291%205.83301Z'%20fill='%23858B93'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.291%2010C17.291%2010.3452%2017.0112%2010.625%2016.666%2010.625L3.33268%2010.625C2.9875%2010.625%202.70768%2010.3452%202.70768%2010C2.70768%209.65482%202.9875%209.375%203.33268%209.375L16.666%209.375C17.0112%209.375%2017.291%209.65482%2017.291%2010Z'%20fill='%23858B93'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M17.291%2014.167C17.291%2014.5122%2017.0112%2014.792%2016.666%2014.792L3.33268%2014.792C2.9875%2014.792%202.70768%2014.5122%202.70768%2014.167C2.70768%2013.8218%202.9875%2013.542%203.33268%2013.542L16.666%2013.542C17.0112%2013.542%2017.291%2013.8218%2017.291%2014.167Z'%20fill='%23858B93'/%3e%3c/svg%3e";var ei=B("<div class=survey-message>"),ti=B("<div style=margin-bottom:12px;text-align:left><div style=font-weight:500;font-size:14px>"),ni=B("<div style=font-weight:400;font-size:12px;margin-top:4px>"),si=B("<div class=survey-message><div style=text-align:center;padding:24px>Biểu mẫu khảo sát"),ii=B("<div class=survey-tooltip>"),oi=B("<button tabindex=-1 style=margin-left:8px;margin-top:6px><img alt=tooltip>"),ri=B("<div class=survey-message><div style=flex-direction:column;align-items:flex-start><div style=align-items:center;margin-bottom:8px><span style=font-weight:600;font-size:16px;text-align:left></span></div><div style=font-weight:400;font-size:12px;margin-bottom:16px></div></div><div style=justify-content:flex-end;margin-top:16px>"),ai=B("<div>"),ci=B("<span style=margin-right:4px>-"),li=B("<div class=survey-inputs>"),di=B("<div style=margin-bottom:12px><div style=font-weight:500;margin-bottom:4px;text-align:left></div><input class=survey-input type=text>"),ui=B("<div class=survey-options>"),hi=B("<button type=button style=justify-content:space-between;align-items:center><span>"),fi=B("<img style=margin-right:10px>"),gi=B("<img style=margin-left:16px>"),pi=B("<button class=survey-cancel-button>Hủy"),Ci=B("<button class=survey-submit-button>Gửi đáp án");const mi=t=>{var Y,X,k,_;const[e,n]=D(null),[s,i]=D(null),[o,r]=D(t.selectedIndexes||[]),[c,a]=D(Array((t.options||[]).length).fill("")),[d,u]=D(t.options||[]),[f,N]=D(!1),V=(k=(X=(Y=t.contents)==null?void 0:Y.find(m=>{var C;return(C=m.metadata)==null?void 0:C.description}))==null?void 0:X.metadata)==null?void 0:k.description,U=(_=t.multiSelect)!=null?_:!1,O=()=>{var m;return(m=t.isInputMode)!=null?m:!1},te=()=>t.type||"choice";let T;const P=(m,C)=>{!t.isEditing&&t.canSubmit===!1||C.button===0&&t.isDragDrop&&(C.preventDefault(),n(m))},z=m=>{if(e()===null||!T)return;const C=T.getBoundingClientRect();if(!(m.clientX>=C.left&&m.clientX<=C.right&&m.clientY>=C.top&&m.clientY<=C.bottom))return;const M=T.querySelectorAll(".survey-option");for(let $=0;$<M.length;$++){const L=M[$].getBoundingClientRect();if(m.clientX>=L.left&&m.clientX<=L.right&&m.clientY>=L.top&&m.clientY<=L.bottom&&$!==e()){i($);return}}},w=m=>{if(e()===null||!T)return;const C=T.getBoundingClientRect();if(m.clientX>=C.left&&m.clientX<=C.right&&m.clientY>=C.top&&m.clientY<=C.bottom&&s()!==null){const M=[...d()],$=M[e()];M[e()]=M[s()],M[s()]=$,u(M)}n(null),i(null)},q=m=>{!t.isEditing&&t.canSubmit===!1||t.isDragDrop||r(U?C=>C.includes(m)?C.filter(v=>v!==m):[...C,m]:C=>C.includes(m)?[]:[m])},h=(m,C)=>{a(v=>{const M=[...v];return M[m]=C,M})},H=()=>{if(t.onSubmit){const m=t.msgId||"";if(O()){const C=c().filter(v=>v.trim()!=="");t.onSubmit(C,"input",m)}else if(t.isDragDrop)t.onSubmit(d(),"ordered",m);else if(U){const C=d().filter((v,M)=>o().includes(M));t.onSubmit(C,"selected",m)}else{const C=d()[o()[0]];t.onSubmit([C],"selected",m)}}};return Lt(()=>(document.addEventListener("mousemove",z),document.addEventListener("mouseup",w),()=>{document.removeEventListener("mousemove",z),document.removeEventListener("mouseup",w)})),nt(()=>{u(t.options||[])}),nt(ys(()=>t.isEditing,m=>{m&&(r(t.selectedIndexes||[]),a(Array((t.options||[]).length).fill("").map((C,v)=>{var M;return t.fields&&((M=t.fields[v])==null?void 0:M.value)!==void 0?t.fields[v].value:""})),u(t.options||[]))})),te()==="normal"?(()=>{var m=ei();return I(m,ae(gt,{get each(){return t.contents||[]},children:C=>(()=>{var v=ti(),M=v.firstChild;return l(M,"color","#1A1D1F"),I(M,()=>C.content),I(v,(()=>{var $=ee(()=>{var b;return!!((b=C.metadata)!=null&&b.description)});return()=>$()&&(()=>{var b=ni();return l(b,"color","#858B93"),I(b,()=>C.metadata.description),b})()})(),null),v})()})),m})():te()==="form"?(()=>{var m=si(),C=m.firstChild;return l(C,"color","#858B93"),m})():(()=>{var m=ri(),C=m.firstChild,v=C.firstChild,M=v.firstChild,$=v.nextSibling,b=C.nextSibling;return l(C,"display","flex"),l(v,"display","flex"),l(M,"color","#1A1D1F"),I(M,(()=>{var L=ee(()=>!!O());return()=>L()?"Nhập đáp án":t.question||"Chọn đáp án"})()),I(v,ae(Je,{when:V,get children(){var L=oi(),Q=L.firstChild;return L.addEventListener("mouseleave",()=>N(!1)),L.addEventListener("mouseenter",()=>N(!0)),l(L,"background","none"),l(L,"border","none"),l(L,"cursor","pointer"),l(L,"position","relative"),ce(Q,"src",Qs),l(Q,"width","20px"),l(Q,"height","20px"),I(L,ae(Je,{get when(){return f()},get children(){var xe=ii();return I(xe,ae(gt,{get each(){return(V||"Bạn có thể kéo thả để sắp xếp thứ tự đáp án ưu tiên A, B, C, D").split(/-\s*/).filter(ye=>ye.trim()!=="")},children:(ye,re)=>(()=>{var fe=ai();return I(fe,(()=>{var He=ee(()=>re()>0);return()=>He()&&ci()})(),null),I(fe,()=>ye.trim(),null),fe})()})),xe}}),null),L}}),null),l($,"color","#858B93"),I($,(()=>{var L=ee(()=>!!O());return()=>L()?"Vui lòng nhập đầy đủ thông tin vào các trường bên dưới.":t.isDragDrop?"Bạn có thể kéo thả để sắp xếp thứ tự đáp án ưu tiên A, B, C, D":U?"Bạn có thể chọn nhiều đáp án hoặc nhập trực tiếp A, B, C, D theo thứ tự đáp án":"Bạn có thể chọn 1 đáp án hoặc nhập trực tiếp A, B, C, D"})()),I(m,(()=>{var L=ee(()=>!!O());return()=>L()?(()=>{var Q=li();return I(Q,ae(gt,{get each(){return d()},children:(xe,ye)=>(()=>{var re=di(),fe=re.firstChild,He=fe.nextSibling;return l(fe,"color","#1A1D1F"),I(fe,xe),He.$$input=Z=>h(ye(),Z.currentTarget.value),l(He,"color","#1A1D1F"),pe(Z=>{var F=t.placeholders?t.placeholders[ye()]:xe,ie=!t.isEditing&&t.canSubmit===!1;return F!==Z.e&&ce(He,"placeholder",Z.e=F),ie!==Z.t&&(He.disabled=Z.t=ie),Z},{e:void 0,t:void 0}),pe(()=>He.value=c()[ye()]),re})()})),Q})():(()=>{var Q=ui(),xe=T;return typeof xe=="function"?Jt(xe,Q):T=Q,I(Q,ae(gt,{get each(){return d()},children:(ye,re)=>(()=>{var fe=hi(),He=fe.firstChild;return fe.$$click=()=>q(re()),fe.$$mousedown=Z=>P(re(),Z),I(fe,(()=>{var Z=ee(()=>!!t.isDragDrop);return()=>Z()&&(()=>{var F=fi();return ce(F,"src",Js),l(F,"width","20px"),l(F,"height","20px"),F})()})(),He),l(He,"color","#1A1D1F"),I(He,ye),I(fe,(()=>{var Z=ee(()=>!!(!t.isDragDrop&&o().includes(re())));return()=>Z()&&(()=>{var F=gi();return ce(F,"src",Ks),l(F,"width","20px"),l(F,"height","20px"),F})()})(),null),pe(Z=>{var F=`survey-option${U?" multi-selected":""} ${e()===re()?"dragging":""} ${s()===re()?"hovered":""} ${!t.isDragDrop&&o().includes(re())?"selected":""}`,ie=j({display:"flex",width:U?"100%":"auto"},t.isDragDrop?{}:{cursor:"pointer"});return F!==Z.e&&at(fe,Z.e=F),Z.t=wn(fe,ie,Z.t),Z},{e:void 0,t:void 0}),fe})()})),Q})()})(),b),l(b,"display","flex"),I(b,(()=>{var L=ee(()=>!!t.isEditing);return()=>L()&&(()=>{var Q=pi();return Qt(Q,"click",t.onCancelEdit),Q})()})(),null),I(b,(()=>{var L=ee(()=>!!(t.canSubmit||t.isEditing));return()=>L()&&(()=>{var Q=Ci();return Q.$$click=H,Q})()})(),null),m})()};xt(["input","mousedown","click"]);var vi=B("<div style=text-align:center;font-weight:600;user-select:none;white-space:pre-line>Hôm nay thị trường khiến bạn <br>quan tâm điều gì?"),yi=B("<div class=chat-messages-container style=scroll-behavior:auto>"),wi=B("<div style=margin-bottom:8px>"),bi=B("<div class=message-popup><button class=message-popup-button><img></button><button class=message-popup-button><img>"),_i=B('<div style=border-radius:24px;font-weight:500;font-size:16px;max-width:70%;word-break:break-word;white-space:pre-line;text-align:left;cursor:pointer><form style=flex-direction:column;align-items:flex-end><textarea class=chat-message-edit-textarea placeholder="Nhập vào tin nhắn..."rows=3 autofocus></textarea><div style=margin-top:8px><button class=message-cancel-button type=button>Hủy</button><button class=message-edit-button type=submit>Lưu'),Ai=B("<div style=border-radius:24px;font-weight:500;font-size:16px;max-width:70%;word-break:break-word;white-space:pre-line;text-align:left;cursor:pointer>"),Si=B("<div style=font-size:12px;margin-top:12px;user-select:none;font-weight:400>"),xi=B('<div class="chat-message bot"style=margin-left:24px><div>'),Ii=B("<div style=flex-direction:column;align-items:flex-start;margin-bottom:8px><div><div style=border-radius:24px;font-weight:500;font-size:16px;max-width:70%;word-break:break-word;white-space:pre-line;text-align:left>"),ki=B("<div style=margin-left:16px><button class=feedback-button><img></button><button class=feedback-button><img>");function Mi(t){let e;const[n,s]=D(null),[i,o]=D({}),[r,c]=D(null),[a,d]=D(null),[u,f]=D(null),[N,V]=D(null),[U,O]=D("");function te(w){var H,Y;const q=t.messages[t.messages.length-1];return!((q.type==="survey"||q.type==="choice"||q.type==="form")&&!((Y=(H=t.submittedMessages)==null?void 0:H.has(q.id))!=null&&Y)&&q.id!==w)}const T=w=>{r()&&(clearTimeout(r()),c(null)),s(Number(w))},P=()=>{c(setTimeout(()=>s(null),300))},z=()=>{var w;return t.isFullScreen?t.messages.length>0?"100px":`${((w=t.inputHeight)!=null?w:0)+24}px`:(t.isMobile,t.messages.length>0?"10px":"0px")};return nt(()=>{if(!e)return;const w=()=>{a()&&clearTimeout(a()),d(setTimeout(()=>{var q;e.scrollTop===0&&((q=t.onLoadMoreMessages)==null||q.call(t)),d(null)},0))};e.addEventListener("scroll",w),Cn(()=>{e.removeEventListener("scroll",w),a()&&clearTimeout(a())})}),(()=>{var w=yi(),q=e;return typeof q=="function"?Jt(q,w):e=w,I(w,ae(Je,{get when(){return ee(()=>t.messages.length===0)()&&!t.isFullScreen},get children(){var h=vi();return l(h,"color","#1A1D1F"),pe(H=>l(h,"font-size",t.isMobile?"20px":"24px")),h}}),null),I(w,ae(gt,{get each(){return t.messages},children:(h,H)=>{const Y=H()===t.messages.length-1;return h.type==="normal"&&Array.isArray(h.contents)?ae(gt,{get each(){return h.contents},children:X=>(()=>{var k=wi();return k.addEventListener("mouseleave",()=>h.sender==="user"&&V(null)),k.addEventListener("mouseenter",()=>h.sender==="user"&&V(h.id)),k.$$click=()=>f(u()===h.id?null:h.id),l(k,"display","flex"),l(k,"position","relative"),I(k,(()=>{var _=ee(()=>h.sender==="user"&&N()===h.id);return()=>_()&&(()=>{var m=bi(),C=m.firstChild,v=C.firstChild,M=C.nextSibling,$=M.firstChild;return C.addEventListener("mouseleave",b=>b.currentTarget.style.background="none"),C.addEventListener("mouseenter",b=>b.currentTarget.style.background="#f0f0f0"),C.$$click=b=>{var xe,ye,re,fe;b.stopPropagation();const L=H(),Q=t.messages[L-1];if(!te(h.id)){alert("Hoàn thành câu hỏi theo mẫu trước khi chỉnh sửa");return}h.type==="normal"&&(Q&&Q.sender==="bot"&&Q.type==="normal"?(O(""),(xe=t.setEditingMsgIdUser)==null||xe.call(t,h.id),(ye=t.setEditingMsgIdBot)==null||ye.call(t,null)):Q&&Q.sender==="bot"&&(Q.type==="survey"||Q.type==="choice"||Q.type==="form")&&((re=t.setEditingMsgIdBot)==null||re.call(t,Q.id),(fe=t.setEditingMsgIdUser)==null||fe.call(t,h.id),O("")))},ce(v,"src",Nn),l(v,"width","16px"),l(v,"height","16px"),M.addEventListener("mouseleave",b=>b.currentTarget.style.background="none"),M.addEventListener("mouseenter",b=>b.currentTarget.style.background="#f0f0f0"),M.$$click=b=>{b.stopPropagation(),console.log("Delete message:",h.id)},ce($,"src",Un),l($,"width","16px"),l($,"height","16px"),m})()})(),null),I(k,(()=>{var _=ee(()=>h.sender==="user"&&h.type==="normal"&&t.editingMsgIdUser===h.id&&!t.editingMsgIdBot);return()=>_()?(()=>{var m=_i(),C=m.firstChild,v=C.firstChild,M=v.nextSibling,$=M.firstChild;return l(m,"background","#1AAF741A"),l(m,"color","#000"),l(m,"padding","10px 16px"),C.addEventListener("submit",b=>{var L,Q;b.preventDefault(),U().trim()&&((L=t.onUpdateSurvey)==null||L.call(t,[U()],"input",h.id),(Q=t.setEditingMsgIdUser)==null||Q.call(t,null))}),l(C,"width","100%"),l(C,"display","flex"),v.$$input=b=>O(b.currentTarget.value),l(M,"display","flex"),l(M,"gap","4px"),$.$$click=()=>{var b;return(b=t.setEditingMsgIdUser)==null?void 0:b.call(t,null)},pe(()=>v.value=U()),m})():(()=>{var m=Ai();return l(m,"color","#000"),l(m,"padding","10px 16px"),I(m,()=>X.content,null),I(m,(()=>{var C=ee(()=>!!(h.sender==="user"&&h.sentAt&&u()===h.id));return()=>C()&&(()=>{var v=Si();return l(v,"color","#858B93"),I(v,()=>new Date(h.sentAt).toLocaleString("vi-VN",{hour:"2-digit",minute:"2-digit"})),v})()})(),null),pe(C=>l(m,"background",h.sender==="user"?"#1AAF741A":"#fff")),m})()})(),null),pe(_=>{var m=`chat-message ${h.sender}`,C=h.id,v=h.sender==="bot"?"24px":"0px",M=h.sender==="user"?"24px":"0px",$=h.sender==="user"?"flex-end":"flex-start";return m!==_.e&&at(k,_.e=m),C!==_.t&&ce(k,"data-message-id",_.t=C),v!==_.a&&l(k,"margin-left",_.a=v),M!==_.o&&l(k,"margin-right",_.o=M),$!==_.i&&l(k,"justify-content",_.i=$),_},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),k})()}):h.type==="survey"||h.type==="choice"||h.type==="form"?(()=>{var X=xi(),k=X.firstChild;return I(k,ae(mi,{get msgId(){return h.id},get question(){return h.question},get options(){return h.options},get selectedIndexes(){return h.selectedIndexes},get fields(){return h.fields},get contents(){return h.contents},get multiSelect(){var _;return ee(()=>h.multiSelect!==void 0)()?h.multiSelect:(_=t.surveyOptions)==null?void 0:_.multiSelect},get isInputMode(){var _;return ee(()=>h.isInputMode!==void 0)()?h.isInputMode:(_=t.surveyOptions)==null?void 0:_.isInputMode},get isFormType(){return h.isFormType},get isNormalType(){return h.isNormalType},get isDragDrop(){return h.isDragDrop},get isEditing(){return t.editingMsgIdBot===h.id},onCancelEdit:()=>{var _,m;(_=t.setEditingMsgIdBot)==null||_.call(t,null),(m=t.setEditingMsgIdUser)==null||m.call(t,null)},onSubmit:(_,m,C)=>{var v,M,$,b;t.editingMsgIdUser?((v=t.onUpdateSurvey)==null||v.call(t,_,m,t.editingMsgIdUser),(M=t.setEditingMsgIdBot)==null||M.call(t,null),($=t.setEditingMsgIdUser)==null||$.call(t,null)):(b=t.onSubmit)==null||b.call(t,_,m,C)},get canSubmit(){var _;return Y&&(!((_=t.submittedMessages)!=null&&_.has(h.id))||t.editingMsgIdBot===h.id)},get placeholders(){return h.placeholders}})),pe(()=>ce(X,"data-message-id",h.id)),X})():(()=>{var X=Ii(),k=X.firstChild,_=k.firstChild;return l(X,"display","flex"),k.addEventListener("mouseleave",()=>P()),k.addEventListener("mouseenter",()=>h.sender==="bot"&&T(h.id)),l(k,"position","relative"),l(k,"width","100%"),l(_,"color","#000"),l(_,"padding","10px 16px"),I(_,()=>h.text),I(X,(()=>{var m=ee(()=>h.sender==="bot");return()=>m()&&(()=>{var C=ki(),v=C.firstChild,M=v.firstChild,$=v.nextSibling,b=$.firstChild;return C.addEventListener("mouseleave",()=>P()),C.addEventListener("mouseenter",()=>T(h.id)),l(C,"display","flex"),l(C,"gap","8px"),l(C,"height","16px"),l(C,"transition","opacity 0.2s"),v.$$click=()=>o(L=>se(j({},L),{[h.id]:"like"})),$.$$click=()=>o(L=>se(j({},L),{[h.id]:"dislike"})),pe(L=>{var Q=n()===Number(h.id)?1:0,xe=n()===Number(h.id)?"visible":"hidden",ye=n()===Number(h.id)?"auto":"none",re=i()[Number(h.id)]==="like"?Xs:Zs,fe=i()[Number(h.id)]==="dislike"?Gs:Ys;return Q!==L.e&&l(C,"opacity",L.e=Q),xe!==L.t&&l(C,"visibility",L.t=xe),ye!==L.a&&l(C,"pointer-events",L.a=ye),re!==L.o&&ce(M,"src",L.o=re),fe!==L.i&&ce(b,"src",L.i=fe),L},{e:void 0,t:void 0,a:void 0,o:void 0,i:void 0}),C})()})(),null),pe(m=>{var C=h.id,v=`chat-message ${h.sender}`,M=h.id,$=h.sender==="user"?"#1AAF741A":"#fff";return C!==m.e&&ce(X,"data-message-id",m.e=C),v!==m.t&&at(k,m.t=v),M!==m.a&&ce(k,"data-message-id",m.a=M),$!==m.o&&l(_,"background",m.o=$),m},{e:void 0,t:void 0,a:void 0,o:void 0}),X})()}}),null),pe(h=>{var H=t.messages.length===0?"center":"flex-start",Y=z(),X=t.isLoadingMessages?"hidden":"visible";return H!==h.e&&l(w,"justify-content",h.e=H),Y!==h.t&&l(w,"padding-bottom",h.t=Y),X!==h.a&&l(w,"visibility",h.a=X),h},{e:void 0,t:void 0,a:void 0}),w})()}xt(["click","input"]);var Ei=B('<div class=chat-input-container><div style=min-width:0><img><textarea placeholder="Hỏi bất kỳ điều gì..."class=chat-input-field rows=1 style=padding-left:56px;max-height:48px></textarea><div><img style=margin-top:4px><img>');function jn(t){let e;const[s,i]=D(!1);function o(){var u,f;if(!e)return;if(e.style.height="auto",!t.input.trim()){e.style.height="48px",e.style.overflowY="hidden",i(!1),(u=t.onHeightChange)==null||u.call(t,48);return}const a=e.scrollHeight,d=Math.min(a,120);e.style.height=d+"px",e.style.overflowY=a>120?"auto":"hidden",i(a>120),(f=t.onHeightChange)==null||f.call(t,d)}nt(()=>{e&&o()});const r=a=>{t.setInput(a.currentTarget.value),o()},c=a=>{a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),t.sendMessage(),setTimeout(()=>{e&&o()},0))};return(()=>{var a=Ei(),d=a.firstChild,u=d.firstChild,f=u.nextSibling,N=f.nextSibling,V=N.firstChild,U=V.nextSibling;return l(d,"position","relative"),l(d,"flex","1"),ce(u,"src",Ls),l(u,"position","absolute"),l(u,"left","18px"),l(u,"top","50%"),l(u,"transform","translateY(-60%)"),l(u,"width","20px"),l(u,"height","20px"),l(u,"cursor","pointer"),f.addEventListener("keypress",c),f.$$input=r,Jt(O=>e=O,f),l(f,"color","#1A1D1F"),l(f,"resize","none"),l(f,"height","48px"),l(f,"overflow","hidden"),l(N,"position","absolute"),l(N,"right","16px"),l(N,"top","50%"),l(N,"transform","translateY(-55%)"),l(N,"display","flex"),l(N,"gap","12px"),Qt(V,"click",t.sendMessage),ce(V,"src",Ws),l(V,"width","24px"),l(V,"height","24px"),l(V,"cursor","pointer"),Qt(U,"click",t.sendMessage),l(U,"width","32px"),l(U,"height","32px"),l(U,"cursor","pointer"),pe(O=>{var te=!!s(),T=t.disabled,P=t.input.trim()?qs:Os;return te!==O.e&&a.classList.toggle("is-maxed",O.e=te),T!==O.t&&(f.disabled=O.t=T),P!==O.a&&ce(U,"src",O.a=P),O},{e:void 0,t:void 0,a:void 0}),pe(()=>f.value=t.input),a})()}xt(["input","click"]);var Ti=B("<div class=sidebar-conversation-list style=overflow-y:auto>"),Pi=B('<div><div class=sidebar-header><img style=margin-right:4px><span style=user-select:none>Ez</span><span style=margin-left:4px;user-select:none>Advise</span></div><div class=sidebar-section tabindex=0><img class=sidebar-section-icon><span class=sidebar-section-title>Chân dung nhà đầu tư</span></div><div class="sidebar-section sidebar-section--no-padding"tabindex=0><img class=sidebar-section-icon><span class=sidebar-section-title>Định hướng đầu tư</span></div><div class=sidebar-conversation-row><span style=font-weight:400;font-size:14px;user-select:none>Hội thoại</span><div class=sidebar-conversation-action tabindex=0><span style=font-weight:400;font-size:14px;user-select:none>Hội thoại mới</span><img style=margin-left:8px></div></div><div class=sidebar-search-box><img style=margin-right:8px><input type=text placeholder="Tìm kiếm hội thoại"></div><div></div><div style=margin-top:15px>'),Ri=B("<div>"),$i=B("<img style=margin-right:16px>"),Di=B("<div class=sidebar-header-actions><button><img></button><button><img>"),Bi=B('<div class=sidebar-no-results style=text-align:center><img src=data:image/webp;base64,UklGRrgDAABXRUJQVlA4IKwDAABwGwCdASp4AHgAPp1IoEsoKCMiqBIKKLATiWUA1K3SCGbamacMhih5l/cNtMG1QSdCRbw0gT89Vt31VE1jawLegOmyUBmrShzTFDLytW7P6HAfK2XU/ttvephObBFAkv/wsB1q/Pz1whGCZNnS2WSKDtsFqxNs7CseQgML/PsNlCcTRgFNjIuN5AuavaTUee3sOvQgIFGxPagPShibJRj5mzAhdvH9caOfDbLKUVIBB7H09ZneSyGhnzVtY+LH7s/xIgyhpbKXsB140vHivZJys3SyatPwYUk/l8/ttL4oSoJAXQAA/vmNhJfkSnkhHMictygF8g0uUkir/Q/2G485OOVfwNlOpH+6gf82O4KjBpbJBXJvy8udg4XXsa+XDRDI4oiqR5KZ7Xq8C96nokql9xMKpbDOdJzybzkT5Tj93uq9GUJ8DybN/OmVoZPXpy7wT8YdXW91lB/jrQnulZz/zmV1ACA9Hojbi//5eyeIEAYkI2Qv1JsfUIjb9eDNkv30mIuUB7lq9T2wrFOi/NQiG+k72utwWHszd7yyorVhQEJGdoUoByVCUBT3dYBUOXsQNZZSdUzly/LTuyXZlcZsAPqM+HBaBVpwuIMJyaaVn/37JmyD6RpCVAAB7b5rFdFzKlZg4Wy2OXuZn+wBvXvDnoU5crUugCf6fhjjZAnuBsJlyfrEhc5HUI0M7IaVdfVofU4jiPbmUPeAY/66Db/APkHNCM662fWEyfb9kif6d9KN3ka/PoztjlzllwIT3w6sQbpkAt/DowzYKHul6rfgaclJxmDKRPjar9DYEjusg22jROUZVh7wDg8hBpwfBsJ9DbqnkMCaDuRjjpr7g/wWMq+GY7sRPJAegDUMHu5n19hAP2R/bTZA9YgR6Zr4P3w5CM3r/1NPJeq8SdMREqwsIS/A+f0ojJGsUDc3hGjaCDDyvXiTYk2nTblsW58KslEkr4kDhCBfi3hAr6WRhOn5YlwFPI27PseNnS/EDLqKopiX5+MnUMXRxby7P/OotAtraI3zp8ffRkHhAy1qoRyk6GuKzbzIgYZa5XGMvIatBsaAaniokAHixhF8KpX8z+Su2Q3hjaa+82DBnunaU/BWB4wT/ppo5Y8XEzKau9GE6X4HW1GAFhKEdqocdcyM1827+104IveA7Ky4YbqDNxTOUUBOvwt1DA4hBH+sORRGPi/l4H2ijD2ohthAFuxaPAUOoNeoYDU44qp85SJqEr+NOyRmGY4MvkXAAAAA alt="no results"><div style=font-size:14px;margin-top:8px>Không tìm thấy cuộc hội thoại nào!'),Hi=B("<div class=sidebar-menu-row>"),Li=B("<input class=sider-bar-input autofocus>"),Oi=B("<span style=font-weight:500;font-size:15px;user-select:none>"),Fi=B("<img class=sidebar-menu-dot style=margin-left:8px>"),Ni=B("<div class=sidebar-popover><div class=sidebar-popover-item><img>Đổi tên</div><div class=sidebar-popover-item><img>Xóa");function zn(t){const[e]=D(!1),[n,s]=D(null),[i,o]=D([]),[r,c]=D(""),[a,d]=D(null),[u,f]=D("");let N,V={};function U(w){return w.toLowerCase().normalize("NFD").replace(/[\u0300-\u036f]/g,"").replace(/đ/g,"d").replace(/Đ/g,"d")}function O(){d(null),t.onClose()}function te(){return y(this,null,function*(){if(t.remoteRepo)try{const w=yield t.remoteRepo.listConversationAsync(10);o(w||[])}catch(w){console.error("Sidebar listConversationAsync error:",w)}})}Lt(te),t.onReloadConversations&&t.onReloadConversations(te);const T=t.surveyConversationId,P=rt(()=>{const w=U(r());let q=i();return w&&(q=q.filter(h=>U(h.name||"").includes(w))),q.sort((h,H)=>{const Y=h.id&&T&&h.id===T,X=H.id&&T&&H.id===T;return Y&&!X?-1:!Y&&X?1:0}),q}),z=()=>t.isMobile?"calc(90vh - 320px)":t.fullScreen?"calc(90vh - 330px)":"calc(400px - 220px)";return Lt(()=>{const w=q=>{var h;e(),n()&&V[n()]&&!((h=V[n()])!=null&&h.contains(q.target))&&s(null)};document.addEventListener("mousedown",w),Cn(()=>{document.removeEventListener("mousedown",w)})}),Lt(()=>y(null,null,function*(){if(t.remoteRepo)try{const w=yield t.remoteRepo.listConversationAsync(10);o(w||[])}catch(w){console.error("Sidebar listConversationAsync error:",w)}})),[ee(()=>ee(()=>!t.fullScreen)()&&(()=>{var w=Ri();return w.$$click=O,pe(()=>at(w,`sidebar-overlay${t.open?" sidebar-overlay--open":""}`)),w})()),(()=>{var w=Pi(),q=w.firstChild,h=q.firstChild,H=h.nextSibling,Y=H.nextSibling,X=q.nextSibling,k=X.firstChild,_=k.nextSibling,m=X.nextSibling,C=m.firstChild,v=C.nextSibling,M=m.nextSibling,$=M.firstChild,b=$.nextSibling,L=b.firstChild,Q=L.nextSibling,xe=M.nextSibling,ye=xe.firstChild,re=ye.nextSibling,fe=xe.nextSibling,He=fe.nextSibling;return I(q,(()=>{var Z=ee(()=>!t.fullScreen);return()=>Z()&&(()=>{var F=$i();return F.$$click=O,ce(F,"src",Fs),l(F,"width","28px"),l(F,"height","28px"),l(F,"cursor","pointer"),F})()})(),h),ce(h,"src",_n),l(h,"width","32px"),l(h,"height","32px"),l(H,"color","#1A1D1F"),l(Y,"color","#1AAF74"),I(q,(()=>{var Z=ee(()=>!!t.fullScreen);return()=>Z()&&(()=>{var F=Di(),ie=F.firstChild,Pe=ie.firstChild,K=ie.nextSibling,_e=K.firstChild;return ie.$$click=()=>{var Le;(Le=t.onShrink)==null||Le.call(t)},l(ie,"background","none"),l(ie,"border","none"),l(ie,"cursor","pointer"),l(ie,"padding","0"),ce(Pe,"src",Hs),l(Pe,"width","20px"),l(Pe,"height","20px"),K.$$click=O,l(K,"background","none"),l(K,"border","none"),l(K,"cursor","pointer"),l(K,"padding","0"),ce(_e,"src",Fn),l(_e,"width","20px"),l(_e,"height","20px"),F})()})(),null),ce(k,"src",Ns),l(_,"color","#1A1D1F"),ce(C,"src",Us),l(v,"color","#1A1D1F"),l($,"color","#858B93"),b.$$click=()=>{t.onNewConversation&&t.onNewConversation(),t.fullScreen||O()},l(L,"color","#858B93"),ce(Q,"src",js),l(Q,"width","20px"),l(Q,"height","20px"),ce(ye,"src",zs),l(ye,"width","18px"),l(ye,"height","18px"),l(ye,"opacity","0.7"),re.addEventListener("change",Z=>c(Z.currentTarget.value)),re.$$input=Z=>c(Z.currentTarget.value),l(re,"color","#1A1D1F"),I(He,ae(Je,{get when(){return P().length>0},get fallback(){return ee(()=>i().length>0)()?(()=>{var Z=Bi(),F=Z.firstChild,ie=F.nextSibling;return l(Z,"padding","32px 0"),l(F,"width","80px"),l(F,"height","80px"),l(F,"margin","0 auto 12px"),l(ie,"color","#888"),Z})():null},get children(){var Z=Ti();return I(Z,ae(gt,{get each(){return P()},children:F=>(()=>{var ie=Hi();return ie.$$click=()=>{var Pe;(Pe=t.onLoadMessages)==null||Pe.call(t,F.id,F.name),t.fullScreen||O()},l(ie,"cursor","pointer"),l(ie,"position","relative"),I(ie,(()=>{var Pe=ee(()=>a()===F.id);return()=>Pe()?(()=>{var K=Li();return K.$$click=_e=>_e.stopPropagation(),K.addEventListener("blur",()=>{d(null)}),K.$$keydown=_e=>y(null,null,function*(){var Le;if(_e.key==="Enter"){if(!u().trim()){console.log("Tên không được để trống");return}try{yield(Le=t.remoteRepo)==null?void 0:Le.updateConversationNameAsync(F.id,u().trim()),d(null),te()}catch(ht){console.log("Error while rename: ",ht)}}_e.key==="Escape"&&d(null)}),K.$$input=_e=>f(_e.currentTarget.value),l(K,"color","#1A1D1F"),pe(()=>K.value=u()),K})():[(()=>{var K=Oi();return I(K,()=>F.name),K})(),ee(()=>ee(()=>!(F.id&&T&&F.id===T))()&&(()=>{var K=Fi();return K.$$mousedown=_e=>_e.stopPropagation(),K.$$click=_e=>{_e.stopPropagation(),s(n()===F.id?null:F.id)},ce(K,"src",Vs),l(K,"width","24px"),l(K,"height","24px"),K})()),ee(()=>ee(()=>n()===F.id)()&&(()=>{var K=Ni(),_e=K.firstChild,Le=_e.firstChild,ht=_e.nextSibling,g=ht.firstChild;return Jt(A=>V[F.id]=A,K),_e.$$click=A=>{A.stopPropagation(),s(null),d(F.id),f(F.name)},ce(Le,"src",Nn),l(Le,"width","18px"),l(Le,"height","18px"),l(Le,"color","#1A1D1F"),ht.$$click=A=>{var x;A.stopPropagation(),s(null),(x=t.onDeleteConversation)==null||x.call(t,F)},ce(g,"src",Un),l(g,"width","18px"),l(g,"height","18px"),l(g,"color","#1A1D1F"),K})())]})()),ie})()})),pe(F=>{var ie=z(),Pe=z();return ie!==F.e&&l(Z,"min-height",F.e=ie),Pe!==F.t&&l(Z,"max-height",F.t=Pe),F},{e:void 0,t:void 0}),Z}})),pe(Z=>{var F=`sidebar${t.open?" sidebar--open":""}${t.fullScreen?" sidebar--fullscreen":""}${t.isMobile?" sidebar--mobile":""}`,ie=t.isMobile?{width:"280px",height:"100%"}:{};return F!==Z.e&&at(w,Z.e=F),Z.t=wn(w,ie,Z.t),Z},{e:void 0,t:void 0}),pe(()=>re.value=r()),w})()]}xt(["click","input","keydown","mousedown"]);var Ui=B("<button class=chat-action-btn>");function tn(t){return(()=>{var e=Ui();return Qt(e,"click",t.onClick),I(e,()=>t.text),e})()}xt(["click"]);var ji=B("<div class=header-steps-container>"),zi=B("<div class=header-steps><div class=header-steps-title>"),Vi=B(`<div class=header-step-wrapper style=position:relative;display:flex><div><div><svg viewBox="0 0 28 6"width=28 height=6><path d="M0 3 Q 7 0 14 3 Q 21 6 28 3 V6 H0 Z"fill=#1AAF74><animate attributeName=d values="\r
3
3
  M0 3 Q 7 0 14 3 Q 21 6 28 3 V6 H0 Z;\r
4
4
  M0 3 Q 7 6 14 3 Q 21 0 28 3 V6 H0 Z;\r
5
5
  M0 3 Q 7 0 14 3 Q 21 6 28 3 V6 H0 Z\r
6
- "dur=0.5s repeatCount=indefinite></animate></path></svg></div><span style=user-select:none>`),Fi=O("<div class=header-step-tooltip>"),Ni=O("<span>: <!>%"),Ui=O("<div class=header-step-line>");const ji=t=>{const e=()=>t.currentStep||0,n=()=>t.totalSteps||0,[s,i]=L(null),o=()=>t.title;return(()=>{var r=Li(),c=r.firstChild;return k(c,o),k(r,ae(Qe,{get when(){return t.isSurveyConversation},get children(){var a=Hi();return k(a,()=>Array.from({length:n()},(d,u)=>{var V,U,F,J;const f=(U=(V=t.sections)==null?void 0:V[u])==null?void 0:U.id,N=f&&(J=(F=t.progress)==null?void 0:F[f])!=null?J:0;return[(()=>{var H=Oi(),E=H.firstChild,b=E.firstChild,y=b.firstChild,q=b.nextSibling;return E.addEventListener("mouseleave",()=>i(null)),E.addEventListener("mouseenter",()=>i(u)),l(E,"position","relative"),l(E,"overflow","hidden"),l(b,"position","absolute"),l(b,"left","0"),l(b,"bottom","0"),l(b,"width","100%"),l(b,"height",`${N}%`),l(b,"background","#1AAF74"),l(b,"transition","height 0.3s"),l(q,"position","relative"),l(q,"color",N>=70?"white":void 0),k(q,u+1),k(H,(()=>{var h=te(()=>{var z,Z;return!!(s()===u&&((Z=(z=t.sections)==null?void 0:z[u])!=null&&Z.title))});return()=>h()&&(()=>{var z=Fi();return k(z,()=>t.sections[u].title,null),k(z,(()=>{var Z=te(()=>!!(t.progress&&t.sections[u].id&&t.progress[t.sections[u].id]!=null));return()=>Z()&&(()=>{var K=Ni(),M=K.firstChild,S=M.nextSibling;return S.nextSibling,k(K,()=>t.progress[t.sections[u].id],S),fe(C=>{var m=t.progress[t.sections[u].id]===100?"#1AAF74":void 0,w=t.progress[t.sections[u].id]===100?"600":void 0;return m!==C.e&&l(K,"color",C.e=m),w!==C.t&&l(K,"font-weight",C.t=w),C},{e:void 0,t:void 0}),K})()})(),null),z})()})(),null),fe(h=>{var z=`header-step ${u+1===e()?"current":""} ${N===100?"active":""} ${s()===u?"wave":""}`,Z=`header-step-progress${s()===u&&N<100?" wave-animate":""}`,K=s()===u&&N<100?"wave-svg active":"wave-svg";return z!==h.e&&it(E,h.e=z),Z!==h.t&&it(b,h.t=Z),K!==h.a&&ce(y,"class",h.a=K),h},{e:void 0,t:void 0,a:void 0}),H})(),te(()=>te(()=>u<n()-1)()&&Ui())]})),a}}),null),r})()},Gt=Symbol("store-raw"),_t=Symbol("store-node"),ot=Symbol("store-has"),Nn=Symbol("store-self");function Un(t){let e=t[et];if(!e&&(Object.defineProperty(t,et,{value:e=new Proxy(t,Wi)}),!Array.isArray(t))){const n=Object.keys(t),s=Object.getOwnPropertyDescriptors(t);for(let i=0,o=n.length;i<o;i++){const r=n[i];s[r].get&&Object.defineProperty(t,r,{enumerable:s[r].enumerable,get:s[r].get.bind(e)})}}return e}function St(t){let e;return t!=null&&typeof t=="object"&&(t[et]||!(e=Object.getPrototypeOf(t))||e===Object.prototype||Array.isArray(t))}function At(t,e=new Set){let n,s,i,o;if(n=t!=null&&t[Gt])return n;if(!St(t)||e.has(t))return t;if(Array.isArray(t)){Object.isFrozen(t)?t=t.slice(0):e.add(t);for(let r=0,c=t.length;r<c;r++)i=t[r],(s=At(i,e))!==i&&(t[r]=s)}else{Object.isFrozen(t)?t=Object.assign({},t):e.add(t);const r=Object.keys(t),c=Object.getOwnPropertyDescriptors(t);for(let a=0,d=r.length;a<d;a++)o=r[a],!c[o].get&&(i=t[o],(s=At(i,e))!==i&&(t[o]=s))}return t}function Kt(t,e){let n=t[e];return n||Object.defineProperty(t,e,{value:n=Object.create(null)}),n}function Bt(t,e,n){if(t[e])return t[e];const[s,i]=L(n,{equals:!1,internal:!0});return s.$=i,t[e]=s}function zi(t,e){const n=Reflect.getOwnPropertyDescriptor(t,e);return!n||n.get||!n.configurable||e===et||e===_t||(delete n.value,delete n.writable,n.get=()=>t[et][e]),n}function jn(t){hn()&&Bt(Kt(t,_t),Nn)()}function Vi(t){return jn(t),Reflect.ownKeys(t)}const Wi={get(t,e,n){if(e===Gt)return t;if(e===et)return n;if(e===Ct)return jn(t),n;const s=Kt(t,_t),i=s[e];let o=i?i():t[e];if(e===_t||e===ot||e==="__proto__")return o;if(!i){const r=Object.getOwnPropertyDescriptor(t,e);hn()&&(typeof o!="function"||t.hasOwnProperty(e))&&!(r&&r.get)&&(o=Bt(s,e,o)())}return St(o)?Un(o):o},has(t,e){return e===Gt||e===et||e===Ct||e===_t||e===ot||e==="__proto__"?!0:(hn()&&Bt(Kt(t,ot),e)(),e in t)},set(){return!0},deleteProperty(){return!0},ownKeys:Vi,getOwnPropertyDescriptor:zi};function xt(t,e,n,s=!1){if(!s&&t[e]===n)return;const i=t[e],o=t.length;n===void 0?(delete t[e],t[ot]&&t[ot][e]&&i!==void 0&&t[ot][e].$()):(t[e]=n,t[ot]&&t[ot][e]&&i===void 0&&t[ot][e].$());let r=Kt(t,_t),c;if((c=Bt(r,e,i))&&c.$(()=>n),Array.isArray(t)&&t.length!==o){for(let a=t.length;a<o;a++)(c=r[a])&&c.$();(c=Bt(r,"length",o))&&c.$(t.length)}(c=r[Nn])&&c.$()}function zn(t,e){const n=Object.keys(e);for(let s=0;s<n.length;s+=1){const i=n[s];xt(t,i,e[i])}}function qi(t,e){if(typeof e=="function"&&(e=e(t)),e=At(e),Array.isArray(e)){if(t===e)return;let n=0,s=e.length;for(;n<s;n++){const i=e[n];t[n]!==i&&xt(t,n,i)}xt(t,"length",s)}else zn(t,e)}function Ht(t,e,n=[]){let s,i=t;if(e.length>1){s=e.shift();const r=typeof s,c=Array.isArray(t);if(Array.isArray(s)){for(let a=0;a<s.length;a++)Ht(t,[s[a]].concat(e),n);return}else if(c&&r==="function"){for(let a=0;a<t.length;a++)s(t[a],a)&&Ht(t,[a].concat(e),n);return}else if(c&&r==="object"){const{from:a=0,to:d=t.length-1,by:u=1}=s;for(let f=a;f<=d;f+=u)Ht(t,[f].concat(e),n);return}else if(e.length>1){Ht(t[s],e,[s].concat(n));return}i=t[s],n=[s].concat(n)}let o=e[0];typeof o=="function"&&(o=o(i,n),o===i)||s===void 0&&o==null||(o=At(o),s===void 0||St(i)&&St(o)&&!Array.isArray(o)?zn(i,o):xt(t,s,o))}function Vn(...[t,e]){const n=At(t||{}),s=Array.isArray(n),i=Un(n);function o(...r){hs(()=>{s&&r.length===1?qi(n,r[0]):Ht(n,r)})}return[i,o]}const Jt=new WeakMap,Wn={get(t,e){if(e===Gt)return t;const n=t[e];let s;return St(n)?Jt.get(n)||(Jt.set(n,s=new Proxy(n,Wn)),s):n},set(t,e,n){return xt(t,e,At(n)),!0},deleteProperty(t,e){return xt(t,e,void 0,!0),!0}};function $e(t){return e=>{if(St(e)){let n;(n=Jt.get(e))||Jt.set(e,n=new Proxy(e,Wn)),t(n)}return e}}const Zi=30,Yi="me~SURVEY";function Lt(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}const qn=gs(),Xi=t=>{const[e,n]=L(!1),[s,i]=L(!1),[o,r]=L(!1),[c,a]=L(!1),[d,u]=L(),[f,N]=L(),[V,U]=Vn([]),[F,J]=L(),[H,E]=Vn([]),[b,y]=L(),[q,h]=L(),[z,Z]=L({}),[K,M]=L(),[S,C]=L(),m=new Map,w=t.remoteRepository;t.exportMethods.appendConversation=g=>{if(!g.traceId)U($e(x=>{x.unshift(g)}));else{const x=d();x&&x.id===g.traceId&&(Z({hasNewer:!1,hasOlder:!1}),u(g)),U($e($=>{let A=$.findIndex(B=>B.id===g.traceId);A>=0?($[A].id=g.id,$[A].creating=!1):(A=$.findIndex(B=>B.id===g.id),A<0&&$.unshift(g))}))}},t.exportMethods.appendMessage=g=>{const x=d();if(x&&x.id==g.conversationId){g.traceId?E($e(B=>{let ye=B.findIndex(Ee=>Ee.id===g.traceId);ye>=0?(B[ye].id=g.id,B[ye].mentions=g.mentions,B[ye].sending=!1):(ye=B.findIndex(Ee=>Ee.id===g.id),ye<0&&B.push(g))})):E($e(B=>{B.push(g)}));const A=b();(!A||A&&A.messageId!=g.id)&&y({messageId:g.id,highlight:!1})}const $=V.findIndex(A=>A.id===g.conversationId);$>=0?U($e(A=>{const B=A[$];B.updatedAt=g.sentAt,B.lastMessage=g,A.splice($,1),A.unshift(B)})):w.getConversationAsync(g.conversationId).then(A=>{A&&U($e(B=>{A.updatedAt=g.sentAt||new Date,A.lastMessage=g,B.unshift(A)}))}),N(g)},t.exportMethods.updateMessage=g=>{var x;E($e($=>{const A=$.findIndex(B=>B.id===g.id);if(A>=0){const B=$[A];g.sentAt=B.sentAt,$[A]=g}})),U($e($=>{const A=$.findIndex(B=>B.id===g.conversationId);if(A>=0){const B=$[A];B.updatedAt=g.sentAt,B.lastMessage&&B.lastMessage.id===g.id&&(B.lastMessage=g)}})),((x=f())==null?void 0:x.id)==g.id&&N(g)},t.exportMethods.deleteMessage=g=>{E($e(x=>{const $=x.findIndex(A=>A.id===g.id);$>=0&&(x[$].deleted=!0,x[$].body=void 0)})),U($e(x=>{const $=x.findIndex(A=>A.id===g.conversationId);if($>=0){const A=x[$];A.lastMessage&&A.lastMessage.id===g.id&&(A.lastMessage=oe(j({},A.lastMessage),{deleted:!0,body:void 0}))}}))};function I(g,x){const $=m.get(g);$&&$(x?!1:x===!1?!0:A=>!A)}function P(g,x){const $=`cp-loader-${g}`;I($,x)}function _(g,x){const $=`cp-loader-${g}`;m.set($,x)}function D(g,x){if(!F())return;const A=`cp-drawer-${g}`;I(A,x)}function Q(g,x){const $=`cp-drawer-${g}`;m.set($,x)}t.exportMethods.deleteConversation=ve,t.exportMethods.updateConversationName=me;function me(g,x){U($e(A=>{const B=A.findIndex(ye=>ye.id===g);B>=0&&(A[B].name=x)}));const $=d();$&&$.id===g&&u(oe(j({},$),{name:x}))}function ve(g){var x;((x=d())==null?void 0:x.id)===g&&ue(void 0),U($e($=>{const A=$.findIndex(B=>B.id===g);A>=0&&$.splice(A,1)}))}function ue(g,x){E([]);let $;if(typeof g=="string"){const A=V.findIndex(B=>B.id===g);A>=0?$=V[A]:w.getConversationAsync(g).then(B=>{B?(Z(x?{hasNewer:!1,hasOlder:!1}:ye=>oe(j({},ye),{hasOlder:!0})),u(j({},B)),C(B.name)):u(void 0)})}else $=g;$?(Z(x?{hasNewer:!1,hasOlder:!1}:A=>oe(j({},A),{hasOlder:!0})),u(j({},$)),C($.name)):u(void 0)}function re(g,x){return v(this,null,function*(){const $=yield w.listConversationAsync(g,x);return U($),V})}function ne(g,x){return v(this,null,function*(){return U($e($=>{const A=$.findIndex(B=>B.id===g);if(A>=0){const B=$[A];B.isPinned=x,$.splice(A,1),$.unshift(B)}})),yield w.pinConversationAsync(g,x),!0})}function T(g,x){return v(this,null,function*(){return g.id?(g.traceId=g.id,g.creating=!0,U($e($=>{$.unshift(g)})),ue(g,!0),x&&x(),w.createConversationAsync(g)):(ue(g,!0),g)})}function G(g,x){return v(this,null,function*(){return me(g,x),yield w.updateConversationNameAsync(g,x),!0})}function Ae(g){return v(this,null,function*(){return ve(g),yield w.deleteConversationAsync(g),!0})}function se(g,x,$){return v(this,null,function*(){var ge,ee;const A=d(),B=A==null?void 0:A.id,ye=B||(A==null?void 0:A.id);if(!ye||!B)return H;g?(g=g.toUpperCase(),g!="BEFORE"&&g!="AFTER"&&(g="BEFORE")):g="BEFORE";const Ee=$||Zi;if(!g){const ke=yield w.listMessagesAsync(ye,void 0,void 0,Ee);return E($e(Ne=>{Ne.splice(0,Ne.length,...ke)})),H}if(x){const ke=H.findIndex(Ne=>Ne.id===x);if(ke>=0){if(g==="BEFORE"){if(ke-Ee>=0)return H}else if(ke+Ee<H.length)return H}}else g==="BEFORE"?x=(ge=H[0])==null?void 0:ge.id:x=(ee=H[H.length-1])==null?void 0:ee.id;const X=yield w.listMessagesAsync(B,g,x,Ee);return X.length>0?E($e(ke=>{g==="BEFORE"?ke.unshift(...X):ke.push(...X)})):Z(g==="BEFORE"?ke=>oe(j({},ke),{hasOlder:!1}):ke=>oe(j({},ke),{hasNewer:!1})),H})}function we(g){return v(this,null,function*(){if(H.length>0)return H;const{hasOlder:x}=z();return x&&(yield se(void 0,void 0,g)),H})}function Ve(g,x){return v(this,null,function*(){if(H.findIndex(B=>B.id===g)>=0){y({messageId:g,highlight:!0});return}let A=d();if(Z({hasOlder:!0,hasNewer:!0}),E([]),!A||A.id!==x){const B=V.findIndex(ye=>ye.id===x);if(B>=0){const ye=V[B];yield se("AFTER",g),ue(ye)}else{const ye=yield w.getConversationAsync(x);if(!ye)return;yield se("AFTER",g),ue(ye)}}else yield se("AFTER",g),yield se("BEFORE");setTimeout(()=>{y({messageId:g,highlight:!0})},100)})}function Ke(g){return v(this,null,function*(){let x=d();if(!x)throw new Error("No current conversation");let $=x.id;const A=Lt(),B=oe(j({},g),{id:A,conversationId:$,traceId:A,sending:!0,sentAt:new Date});if($)E($e(Ee=>{Ee.push(B)}));else{x.id=Lt();const Ee=yield T(x,()=>{B.conversationId=x.id,E($e(X=>{X.push(B)}))});B.conversationId=Ee.id,E($e(X=>{const ge=X.findIndex(ee=>ee.id===A);ge>=0&&(X[ge].conversationId=Ee.id)}))}y({messageId:A,highlight:!1});const ye=yield w.sendMessageAsync(B);return E($e(Ee=>{const X=Ee.findIndex(ge=>ge.id===A);X>=0&&(Ee[X].id=ye.id,Ee[X].mentions=ye.mentions,Ee[X].sending=!1)})),ye})}function ct(){return v(this,null,function*(){const g=yield w.getConversationAsync(Yi);return!g||!g.status?"NOT_DONE":g.status})}return ae(qn.Provider,{get value(){return{getPanelElement:F,setPanelElement:J,toggleLoader:P,registerLoader:_,toggleDrawer:D,registerDrawer:Q,getPopupState:e,setPopupState:n,getFullscreenState:s,setFullscreenState:i,getSidebarState:o,setSidebarState:r,getFooterSendBoxState:c,setFooterSendBoxState:a,gotoMessageAsync:Ve,getCurrentConversation:d,getLastMessage:f,setCurrentConversation:ue,getCurrentMessage:b,setCurrentQuotedMessage:h,getCurrentQuotedMessage:q,getCurrentMessages:()=>H,listConversationsAsync:re,createConversationAsync:T,pinConversationAsync:ne,updateConversationNameAsync:G,deleteConversationAsync:Ae,listMessagesAsync:se,initMessagesAsync:we,getMessageLoadingStatus:z,listChatTypesAsync:w.listChatTypesAsync,sendMessageAsync:Ke,updateMessageAsync:w.updateMessageAsync,deleteMessageAsync:w.deleteMessageAsync,batchGetUsersAsync:w.batchGetUsersAsync,searchConversationsAsync:w.searchConversationsAsync,searchMessagesAsync:w.searchMessagesAsync,uploadFile:w.uploadFile,getSurveyStatusAsync:ct,getCurrentChatType:K,setCurrentChatType:M,getTitle:S,setTitle:C}},get children(){return t.children}})};function Qi(){const t=ps(qn);if(!t)throw new Error("usePopup must be used within a PopupProvider");return t}function Gi(t){return t.map(e=>{var o,r,c,a,d,u,f,N,V,U,F,J,H,E,b,y,q,h,z,Z,K;const s=(((o=e.sender)==null?void 0:o.id)||"")==="me"?"user":"bot",i={id:e.id,text:e.content,sender:s,type:void 0,sentAt:e.sentAt};if(((r=e.body)==null?void 0:r.type)==="CHOICE"&&s==="bot")return[oe(j({},i),{type:"choice",question:e.body.content||"",options:((a=(c=e.body.choice)==null?void 0:c.items)==null?void 0:a.map(M=>M.label))||[],rawItems:((d=e.body.choice)==null?void 0:d.items)||[],multiSelect:!!((u=e.body.choice)!=null&&u.multiple),isDragDrop:!1,selectedIndexes:(f=e.body.choice)!=null&&f.items?e.body.choice.items.map((M,S)=>M.selected?S:-1).filter(M=>M!==-1):[],contents:[{content:e.body.content,metadata:e.body.metadata}]})];if(((N=e.body)==null?void 0:N.type)==="FORM"&&((V=e.body)!=null&&V.form)&&s==="bot")return[oe(j({},i),{type:"survey",question:e.content||"",options:((U=e.body.form.fields)==null?void 0:U.map(M=>M.label))||[],placeholders:((F=e.body.form.fields)==null?void 0:F.map(M=>{var S;return((S=M.options)==null?void 0:S.placeHolder)||M.label}))||[],isInputMode:!0,fields:e.body.form.fields})];if(((J=e.body)==null?void 0:J.type)==="FORM"&&s==="user"){const S=(((H=e.body.form)==null?void 0:H.fields)||[]).map(C=>C.value).join(`
6
+ "dur=0.5s repeatCount=indefinite></animate></path></svg></div><span style=user-select:none>`),Wi=B("<div class=header-step-tooltip>"),qi=B("<span>: <!>%"),Zi=B("<div class=header-step-line>");const Yi=t=>{const e=()=>t.currentStep||0,n=()=>t.totalSteps||0,[s,i]=D(null),o=()=>t.title;return(()=>{var r=zi(),c=r.firstChild;return I(c,o),I(r,ae(Je,{get when(){return t.isSurveyConversation},get children(){var a=ji();return I(a,()=>Array.from({length:n()},(d,u)=>{var V,U,O,te;const f=(U=(V=t.sections)==null?void 0:V[u])==null?void 0:U.id,N=f&&(te=(O=t.progress)==null?void 0:O[f])!=null?te:0;return[(()=>{var T=Vi(),P=T.firstChild,z=P.firstChild,w=z.firstChild,q=z.nextSibling;return P.addEventListener("mouseleave",()=>i(null)),P.addEventListener("mouseenter",()=>i(u)),l(P,"position","relative"),l(P,"overflow","hidden"),l(z,"position","absolute"),l(z,"left","0"),l(z,"bottom","0"),l(z,"width","100%"),l(z,"height",`${N}%`),l(z,"background","#1AAF74"),l(z,"transition","height 0.3s"),l(q,"position","relative"),l(q,"color",N>=70?"white":void 0),I(q,u+1),I(T,(()=>{var h=ee(()=>{var H,Y;return!!(s()===u&&((Y=(H=t.sections)==null?void 0:H[u])!=null&&Y.title))});return()=>h()&&(()=>{var H=Wi();return I(H,()=>t.sections[u].title,null),I(H,(()=>{var Y=ee(()=>!!(t.progress&&t.sections[u].id&&t.progress[t.sections[u].id]!=null));return()=>Y()&&(()=>{var X=qi(),k=X.firstChild,_=k.nextSibling;return _.nextSibling,I(X,()=>t.progress[t.sections[u].id],_),pe(m=>{var C=t.progress[t.sections[u].id]===100?"#1AAF74":void 0,v=t.progress[t.sections[u].id]===100?"600":void 0;return C!==m.e&&l(X,"color",m.e=C),v!==m.t&&l(X,"font-weight",m.t=v),m},{e:void 0,t:void 0}),X})()})(),null),H})()})(),null),pe(h=>{var H=`header-step ${u+1===e()?"current":""} ${N===100?"active":""} ${s()===u?"wave":""}`,Y=`header-step-progress${s()===u&&N<100?" wave-animate":""}`,X=s()===u&&N<100?"wave-svg active":"wave-svg";return H!==h.e&&at(P,h.e=H),Y!==h.t&&at(z,h.t=Y),X!==h.a&&ce(w,"class",h.a=X),h},{e:void 0,t:void 0,a:void 0}),T})(),ee(()=>ee(()=>u<n()-1)()&&Zi())]})),a}}),null),r})()},nn=Symbol("store-raw"),kt=Symbol("store-node"),ct=Symbol("store-has"),Vn=Symbol("store-self");function Wn(t){let e=t[it];if(!e&&(Object.defineProperty(t,it,{value:e=new Proxy(t,Ki)}),!Array.isArray(t))){const n=Object.keys(t),s=Object.getOwnPropertyDescriptors(t);for(let i=0,o=n.length;i<o;i++){const r=n[i];s[r].get&&Object.defineProperty(t,r,{enumerable:s[r].enumerable,get:s[r].get.bind(e)})}}return e}function Mt(t){let e;return t!=null&&typeof t=="object"&&(t[it]||!(e=Object.getPrototypeOf(t))||e===Object.prototype||Array.isArray(t))}function Et(t,e=new Set){let n,s,i,o;if(n=t!=null&&t[nn])return n;if(!Mt(t)||e.has(t))return t;if(Array.isArray(t)){Object.isFrozen(t)?t=t.slice(0):e.add(t);for(let r=0,c=t.length;r<c;r++)i=t[r],(s=Et(i,e))!==i&&(t[r]=s)}else{Object.isFrozen(t)?t=Object.assign({},t):e.add(t);const r=Object.keys(t),c=Object.getOwnPropertyDescriptors(t);for(let a=0,d=r.length;a<d;a++)o=r[a],!c[o].get&&(i=t[o],(s=Et(i,e))!==i&&(t[o]=s))}return t}function sn(t,e){let n=t[e];return n||Object.defineProperty(t,e,{value:n=Object.create(null)}),n}function Nt(t,e,n){if(t[e])return t[e];const[s,i]=D(n,{equals:!1,internal:!0});return s.$=i,t[e]=s}function Xi(t,e){const n=Reflect.getOwnPropertyDescriptor(t,e);return!n||n.get||!n.configurable||e===it||e===kt||(delete n.value,delete n.writable,n.get=()=>t[it][e]),n}function qn(t){mn()&&Nt(sn(t,kt),Vn)()}function Gi(t){return qn(t),Reflect.ownKeys(t)}const Ki={get(t,e,n){if(e===nn)return t;if(e===it)return n;if(e===bt)return qn(t),n;const s=sn(t,kt),i=s[e];let o=i?i():t[e];if(e===kt||e===ct||e==="__proto__")return o;if(!i){const r=Object.getOwnPropertyDescriptor(t,e);mn()&&(typeof o!="function"||t.hasOwnProperty(e))&&!(r&&r.get)&&(o=Nt(s,e,o)())}return Mt(o)?Wn(o):o},has(t,e){return e===nn||e===it||e===bt||e===kt||e===ct||e==="__proto__"?!0:(mn()&&Nt(sn(t,ct),e)(),e in t)},set(){return!0},deleteProperty(){return!0},ownKeys:Gi,getOwnPropertyDescriptor:Xi};function Tt(t,e,n,s=!1){if(!s&&t[e]===n)return;const i=t[e],o=t.length;n===void 0?(delete t[e],t[ct]&&t[ct][e]&&i!==void 0&&t[ct][e].$()):(t[e]=n,t[ct]&&t[ct][e]&&i===void 0&&t[ct][e].$());let r=sn(t,kt),c;if((c=Nt(r,e,i))&&c.$(()=>n),Array.isArray(t)&&t.length!==o){for(let a=t.length;a<o;a++)(c=r[a])&&c.$();(c=Nt(r,"length",o))&&c.$(t.length)}(c=r[Vn])&&c.$()}function Zn(t,e){const n=Object.keys(e);for(let s=0;s<n.length;s+=1){const i=n[s];Tt(t,i,e[i])}}function Qi(t,e){if(typeof e=="function"&&(e=e(t)),e=Et(e),Array.isArray(e)){if(t===e)return;let n=0,s=e.length;for(;n<s;n++){const i=e[n];t[n]!==i&&Tt(t,n,i)}Tt(t,"length",s)}else Zn(t,e)}function Ut(t,e,n=[]){let s,i=t;if(e.length>1){s=e.shift();const r=typeof s,c=Array.isArray(t);if(Array.isArray(s)){for(let a=0;a<s.length;a++)Ut(t,[s[a]].concat(e),n);return}else if(c&&r==="function"){for(let a=0;a<t.length;a++)s(t[a],a)&&Ut(t,[a].concat(e),n);return}else if(c&&r==="object"){const{from:a=0,to:d=t.length-1,by:u=1}=s;for(let f=a;f<=d;f+=u)Ut(t,[f].concat(e),n);return}else if(e.length>1){Ut(t[s],e,[s].concat(n));return}i=t[s],n=[s].concat(n)}let o=e[0];typeof o=="function"&&(o=o(i,n),o===i)||s===void 0&&o==null||(o=Et(o),s===void 0||Mt(i)&&Mt(o)&&!Array.isArray(o)?Zn(i,o):Tt(t,s,o))}function Yn(...[t,e]){const n=Et(t||{}),s=Array.isArray(n),i=Wn(n);function o(...r){vs(()=>{s&&r.length===1?Qi(n,r[0]):Ut(n,r)})}return[i,o]}const on=new WeakMap,Xn={get(t,e){if(e===nn)return t;const n=t[e];let s;return Mt(n)?on.get(n)||(on.set(n,s=new Proxy(n,Xn)),s):n},set(t,e,n){return Tt(t,e,Et(n)),!0},deleteProperty(t,e){return Tt(t,e,void 0,!0),!0}};function Ee(t){return e=>{if(Mt(e)){let n;(n=on.get(e))||on.set(e,n=new Proxy(e,Xn)),t(n)}return e}}const Ji=30,eo="me~SURVEY";function jt(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}const Gn=ws(),to=t=>{const[e,n]=D(!1),[s,i]=D(!1),[o,r]=D(!1),[c,a]=D(!1),[d,u]=D(),[f,N]=D(),[V,U]=Yn([]),[O,te]=D(),[T,P]=Yn([]),[z,w]=D(),[q,h]=D(),[H,Y]=D({}),[X,k]=D(),[_,m]=D(),C=new Map,v=t.remoteRepository;t.exportMethods.appendConversation=g=>{if(!g.traceId)U(Ee(A=>{A.unshift(g)}));else{const A=d();A&&A.id===g.traceId&&(Y({hasNewer:!1,hasOlder:!1}),u(g)),U(Ee(x=>{let S=x.findIndex(R=>R.id===g.traceId);S>=0?(x[S].id=g.id,x[S].creating=!1):(S=x.findIndex(R=>R.id===g.id),S<0&&x.unshift(g))}))}},t.exportMethods.appendMessage=g=>{const A=d();if(A&&A.id==g.conversationId){g.traceId?P(Ee(R=>{let Ce=R.findIndex(ke=>ke.id===g.traceId);Ce>=0?(R[Ce].id=g.id,R[Ce].mentions=g.mentions,R[Ce].sending=!1):(Ce=R.findIndex(ke=>ke.id===g.id),Ce<0&&R.push(g))})):P(Ee(R=>{R.push(g)}));const S=z();(!S||S&&S.messageId!=g.id)&&w({messageId:g.id,highlight:!1})}const x=V.findIndex(S=>S.id===g.conversationId);x>=0?U(Ee(S=>{const R=S[x];R.updatedAt=g.sentAt,R.lastMessage=g,S.splice(x,1),S.unshift(R)})):v.getConversationAsync(g.conversationId).then(S=>{S&&U(Ee(R=>{S.updatedAt=g.sentAt||new Date,S.lastMessage=g,R.unshift(S)}))}),N(g)},t.exportMethods.updateMessage=g=>{var A;P(Ee(x=>{const S=x.findIndex(R=>R.id===g.id);if(S>=0){const R=x[S];g.sentAt=R.sentAt,x[S]=g}})),U(Ee(x=>{const S=x.findIndex(R=>R.id===g.conversationId);if(S>=0){const R=x[S];R.updatedAt=g.sentAt,R.lastMessage&&R.lastMessage.id===g.id&&(R.lastMessage=g)}})),((A=f())==null?void 0:A.id)==g.id&&N(g)},t.exportMethods.deleteMessage=g=>{P(Ee(A=>{const x=A.findIndex(S=>S.id===g.id);x>=0&&(A[x].deleted=!0,A[x].body=void 0)})),U(Ee(A=>{const x=A.findIndex(S=>S.id===g.conversationId);if(x>=0){const S=A[x];S.lastMessage&&S.lastMessage.id===g.id&&(S.lastMessage=se(j({},S.lastMessage),{deleted:!0,body:void 0}))}}))};function M(g,A){const x=C.get(g);x&&x(A?!1:A===!1?!0:S=>!S)}function $(g,A){const x=`cp-loader-${g}`;M(x,A)}function b(g,A){const x=`cp-loader-${g}`;C.set(x,A)}function L(g,A){if(!O())return;const S=`cp-drawer-${g}`;M(S,A)}function Q(g,A){const x=`cp-drawer-${g}`;C.set(x,A)}t.exportMethods.deleteConversation=ye,t.exportMethods.updateConversationName=xe;function xe(g,A){U(Ee(S=>{const R=S.findIndex(Ce=>Ce.id===g);R>=0&&(S[R].name=A)}));const x=d();x&&x.id===g&&u(se(j({},x),{name:A}))}function ye(g){var A;((A=d())==null?void 0:A.id)===g&&re(void 0),U(Ee(x=>{const S=x.findIndex(R=>R.id===g);S>=0&&x.splice(S,1)}))}function re(g,A){P([]);let x;if(typeof g=="string"){const S=V.findIndex(R=>R.id===g);S>=0?x=V[S]:v.getConversationAsync(g).then(R=>{R?(Y(A?{hasNewer:!1,hasOlder:!1}:Ce=>se(j({},Ce),{hasOlder:!0})),u(j({},R)),m(R.name)):u(void 0)})}else x=g;x?(Y(A?{hasNewer:!1,hasOlder:!1}:S=>se(j({},S),{hasOlder:!0})),u(j({},x)),m(x.name)):u(void 0)}function fe(g,A){return y(this,null,function*(){const x=yield v.listConversationAsync(g,A);return U(x),V})}function He(g,A){return y(this,null,function*(){return U(Ee(x=>{const S=x.findIndex(R=>R.id===g);if(S>=0){const R=x[S];R.isPinned=A,x.splice(S,1),x.unshift(R)}})),yield v.pinConversationAsync(g,A),!0})}function Z(g,A){return y(this,null,function*(){return g.id?(g.traceId=g.id,g.creating=!0,U(Ee(x=>{x.unshift(g)})),re(g,!0),A&&A(),v.createConversationAsync(g)):(re(g,!0),g)})}function F(g,A){return y(this,null,function*(){return xe(g,A),yield v.updateConversationNameAsync(g,A),!0})}function ie(g){return y(this,null,function*(){return ye(g),yield v.deleteConversationAsync(g),!0})}function Pe(g,A,x){return y(this,null,function*(){var dt,vt;const S=d(),R=S==null?void 0:S.id,Ce=R||(S==null?void 0:S.id);if(!Ce||!R)return T;g?(g=g.toUpperCase(),g!="BEFORE"&&g!="AFTER"&&(g="BEFORE")):g="BEFORE";const ke=x||Ji;if(!g){const qe=yield v.listMessagesAsync(Ce,void 0,void 0,ke);return P(Ee(yt=>{yt.splice(0,yt.length,...qe)})),T}if(A){const qe=T.findIndex(yt=>yt.id===A);if(qe>=0){if(g==="BEFORE"){if(qe-ke>=0)return T}else if(qe+ke<T.length)return T}}else g==="BEFORE"?A=(dt=T[0])==null?void 0:dt.id:A=(vt=T[T.length-1])==null?void 0:vt.id;const Ve=yield v.listMessagesAsync(R,g,A,ke);return Ve.length>0?P(Ee(qe=>{g==="BEFORE"?qe.unshift(...Ve):qe.push(...Ve)})):Y(g==="BEFORE"?qe=>se(j({},qe),{hasOlder:!1}):qe=>se(j({},qe),{hasNewer:!1})),T})}function K(g){return y(this,null,function*(){if(T.length>0)return T;const{hasOlder:A}=H();return A&&(yield Pe(void 0,void 0,g)),T})}function _e(g,A){return y(this,null,function*(){if(T.findIndex(R=>R.id===g)>=0){w({messageId:g,highlight:!0});return}let S=d();if(Y({hasOlder:!0,hasNewer:!0}),P([]),!S||S.id!==A){const R=V.findIndex(Ce=>Ce.id===A);if(R>=0){const Ce=V[R];yield Pe("AFTER",g),re(Ce)}else{const Ce=yield v.getConversationAsync(A);if(!Ce)return;yield Pe("AFTER",g),re(Ce)}}else yield Pe("AFTER",g),yield Pe("BEFORE");setTimeout(()=>{w({messageId:g,highlight:!0})},100)})}function Le(g){return y(this,null,function*(){let A=d();if(!A)throw new Error("No current conversation");let x=A.id;const S=jt(),R=se(j({},g),{id:S,conversationId:x,traceId:S,sending:!0,sentAt:new Date});if(x)P(Ee(ke=>{ke.push(R)}));else{A.id=jt();const ke=yield Z(A,()=>{R.conversationId=A.id,P(Ee(Ve=>{Ve.push(R)}))});R.conversationId=ke.id,P(Ee(Ve=>{const dt=Ve.findIndex(vt=>vt.id===S);dt>=0&&(Ve[dt].conversationId=ke.id)}))}w({messageId:S,highlight:!1});const Ce=yield v.sendMessageAsync(R);return P(Ee(ke=>{const Ve=ke.findIndex(dt=>dt.id===S);Ve>=0&&(ke[Ve].id=Ce.id,ke[Ve].mentions=Ce.mentions,ke[Ve].sending=!1)})),Ce})}function ht(){return y(this,null,function*(){const g=yield v.getConversationAsync(eo);return!g||!g.status?"NOT_DONE":g.status})}return ae(Gn.Provider,{get value(){return{getPanelElement:O,setPanelElement:te,toggleLoader:$,registerLoader:b,toggleDrawer:L,registerDrawer:Q,getPopupState:e,setPopupState:n,getFullscreenState:s,setFullscreenState:i,getSidebarState:o,setSidebarState:r,getFooterSendBoxState:c,setFooterSendBoxState:a,gotoMessageAsync:_e,getCurrentConversation:d,getLastMessage:f,setCurrentConversation:re,getCurrentMessage:z,setCurrentQuotedMessage:h,getCurrentQuotedMessage:q,getCurrentMessages:()=>T,listConversationsAsync:fe,createConversationAsync:Z,pinConversationAsync:He,updateConversationNameAsync:F,deleteConversationAsync:ie,listMessagesAsync:Pe,initMessagesAsync:K,getMessageLoadingStatus:H,listChatTypesAsync:v.listChatTypesAsync,sendMessageAsync:Le,updateMessageAsync:v.updateMessageAsync,deleteMessageAsync:v.deleteMessageAsync,batchGetUsersAsync:v.batchGetUsersAsync,searchConversationsAsync:v.searchConversationsAsync,searchMessagesAsync:v.searchMessagesAsync,uploadFile:v.uploadFile,getSurveyStatusAsync:ht,getCurrentChatType:X,setCurrentChatType:k,getTitle:_,setTitle:m}},get children(){return t.children}})};function no(){const t=bs(Gn);if(!t)throw new Error("usePopup must be used within a PopupProvider");return t}function Kn(t){return t.map(e=>{var o,r,c,a,d,u,f,N,V,U,O,te,T,P,z,w,q,h,H,Y,X;const s=(((o=e.sender)==null?void 0:o.id)||"")==="me"?"user":"bot",i={id:e.id,text:e.content,sender:s,type:void 0,sentAt:e.sentAt};if(((r=e.body)==null?void 0:r.type)==="CHOICE"&&s==="bot")return[se(j({},i),{type:"choice",question:e.body.content||"",options:((a=(c=e.body.choice)==null?void 0:c.items)==null?void 0:a.map(k=>k.label))||[],rawItems:((d=e.body.choice)==null?void 0:d.items)||[],multiSelect:!!((u=e.body.choice)!=null&&u.multiple),isDragDrop:!1,selectedIndexes:(f=e.body.choice)!=null&&f.items?e.body.choice.items.map((k,_)=>k.selected?_:-1).filter(k=>k!==-1):[],contents:[{content:e.body.content,metadata:e.body.metadata}]})];if(((N=e.body)==null?void 0:N.type)==="FORM"&&((V=e.body)!=null&&V.form)&&s==="bot")return[se(j({},i),{type:"survey",question:e.content||"",options:((U=e.body.form.fields)==null?void 0:U.map(k=>k.label))||[],placeholders:((O=e.body.form.fields)==null?void 0:O.map(k=>{var _;return((_=k.options)==null?void 0:_.placeHolder)||k.label}))||[],isInputMode:!0,fields:e.body.form.fields})];if(((te=e.body)==null?void 0:te.type)==="FORM"&&s==="user"){const _=(((T=e.body.form)==null?void 0:T.fields)||[]).map(m=>m.value).join(`
7
7
 
8
- `);return[oe(j({},i),{text:S,type:"normal",isNormalType:!0,contents:[{content:S}]})]}if((E=e.body)!=null&&E.children&&Array.isArray(e.body.children)){const M=e.body.children.find(w=>w.choice&&Array.isArray(w.choice.items)),S=e.body.children.find(w=>w.ranking&&Array.isArray(w.ranking.items)),C=e.body.children.find(w=>w.form&&Array.isArray(w.form.fields)),m=e.body.children.filter(w=>typeof w.content=="string").map(w=>{let I=w.content;return typeof I=="string"&&I.includes("|")&&(I=I.split("|").map(P=>P.trim()).join(`
8
+ `);return[se(j({},i),{text:_,type:"normal",isNormalType:!0,contents:[{content:_}]})]}if((P=e.body)!=null&&P.children&&Array.isArray(e.body.children)){const k=e.body.children.find(v=>v.choice&&Array.isArray(v.choice.items)),_=e.body.children.find(v=>v.ranking&&Array.isArray(v.ranking.items)),m=e.body.children.find(v=>v.form&&Array.isArray(v.form.fields)),C=e.body.children.filter(v=>typeof v.content=="string").map(v=>{let M=v.content;return typeof M=="string"&&M.includes("|")&&(M=M.split("|").map($=>$.trim()).join(`
9
9
 
10
- `)),oe(j({},i),{text:I,type:"normal",isNormalType:!0,contents:[{content:I,metadata:w.metadata}]})});if(S){const w=e.body.children.find(_=>_.type==="NORMAL"&&typeof _.content=="string"&&_.content.includes("Câu")),I=m.length>0?m[m.length-1].text:e.body.children.length>0?e.body.children[e.body.children.length-1].content:"";let P=m;return w?P=m.filter(_=>_.text!==w.content):m.length>1&&(P=m.slice(0,-1)),P.length===1&&P[0].text===I&&(P=[]),[...P,oe(j({},i),{type:"choice",question:I,options:S.ranking.items.map(_=>_.label)||[],rawItems:S.ranking.items||[],multiSelect:!1,isDragDrop:!0,selectedIndexes:S.ranking.items.map((_,D)=>_.rank?D:-1).filter(_=>_!==-1)||[]})]}else if(M){const w=e.body.children.find(_=>_.type==="NORMAL"&&typeof _.content=="string"&&_.content.includes("Câu")),I=m.length>0?m[m.length-1].text:e.body.children.length>0?e.body.children[e.body.children.length-1].content:"";let P=m;return w?P=m.filter(_=>_.text!==w.content):m.length>1&&(P=m.slice(0,-1)),P.length===1&&P[0].text===I&&(P=[]),[...P,oe(j({},i),{type:"choice",question:I,options:M.choice.items.map(_=>_.label)||[],rawItems:M.choice.items||[],multiSelect:!!M.choice.multiple,isDragDrop:!1,selectedIndexes:M.choice.items.map((_,D)=>_.selected?D:-1).filter(_=>_!==-1)||[],contents:e.body.children})]}else if(C){const w=e.body.children.find(_=>_.type==="NORMAL"&&typeof _.content=="string"&&_.content.includes("Câu")),I=m.length>0?m[m.length-1].text:e.body.children.length>0?e.body.children[e.body.children.length-1].content:"";let P=m;return w?P=m.filter(_=>_.text!==w.content):m.length>1&&(P=m.slice(0,-1)),P.length===1&&P[0].text===I&&(P=[]),[...P,oe(j({},i),{type:"survey",question:I,options:C.form.fields.map(_=>_.label)||[],placeholders:C.form.fields.map(_=>{var D;return((D=_.options)==null?void 0:D.placeHolder)||_.label})||[],isInputMode:!0,fields:C.form.fields})]}else if(e.body.children.every(w=>w.type==="NORMAL"))return e.body.children.map(w=>oe(j({},i),{text:w.content,type:"normal",isNormalType:!0,contents:[{content:w.content,metadata:w.metadata}]}))}if(((b=e.body)==null?void 0:b.type)==="CHOICE"&&s==="user"){const M=(q=(y=e.body.choice)==null?void 0:y.items)==null?void 0:q.filter(S=>S.selected);if(M&&M.length>0){const S=M.map(C=>C.label).join(`
10
+ `)),se(j({},i),{text:M,type:"normal",isNormalType:!0,contents:[{content:M,metadata:v.metadata}]})});if(_){const v=e.body.children.find(b=>b.type==="NORMAL"&&typeof b.content=="string"&&b.content.includes("Câu")),M=C.length>0?C[C.length-1].text:e.body.children.length>0?e.body.children[e.body.children.length-1].content:"";let $=C;return v?$=C.filter(b=>b.text!==v.content):C.length>1&&($=C.slice(0,-1)),$.length===1&&$[0].text===M&&($=[]),[...$,se(j({},i),{type:"choice",question:M,options:_.ranking.items.map(b=>b.label)||[],rawItems:_.ranking.items||[],multiSelect:!1,isDragDrop:!0,selectedIndexes:_.ranking.items.map((b,L)=>b.rank?L:-1).filter(b=>b!==-1)||[]})]}else if(k){const v=e.body.children.find(b=>b.type==="NORMAL"&&typeof b.content=="string"&&b.content.includes("Câu")),M=C.length>0?C[C.length-1].text:e.body.children.length>0?e.body.children[e.body.children.length-1].content:"";let $=C;return v?$=C.filter(b=>b.text!==v.content):C.length>1&&($=C.slice(0,-1)),$.length===1&&$[0].text===M&&($=[]),[...$,se(j({},i),{type:"choice",question:M,options:k.choice.items.map(b=>b.label)||[],rawItems:k.choice.items||[],multiSelect:!!k.choice.multiple,isDragDrop:!1,selectedIndexes:k.choice.items.map((b,L)=>b.selected?L:-1).filter(b=>b!==-1)||[],contents:e.body.children})]}else if(m){const v=e.body.children.find(b=>b.type==="NORMAL"&&typeof b.content=="string"&&b.content.includes("Câu")),M=C.length>0?C[C.length-1].text:e.body.children.length>0?e.body.children[e.body.children.length-1].content:"";let $=C;return v?$=C.filter(b=>b.text!==v.content):C.length>1&&($=C.slice(0,-1)),$.length===1&&$[0].text===M&&($=[]),[...$,se(j({},i),{type:"survey",question:M,options:m.form.fields.map(b=>b.label)||[],placeholders:m.form.fields.map(b=>{var L;return((L=b.options)==null?void 0:L.placeHolder)||b.label})||[],isInputMode:!0,fields:m.form.fields})]}else if(e.body.children.every(v=>v.type==="NORMAL"))return e.body.children.map(v=>se(j({},i),{text:v.content,type:"normal",isNormalType:!0,contents:[{content:v.content,metadata:v.metadata}]}))}if(((z=e.body)==null?void 0:z.type)==="CHOICE"&&s==="user"){const k=(q=(w=e.body.choice)==null?void 0:w.items)==null?void 0:q.filter(_=>_.selected);if(k&&k.length>0){const _=k.map(m=>m.label).join(`
11
11
 
12
- `);return[oe(j({},i),{text:S,type:"normal",isNormalType:!0,contents:[{content:S}]})]}}if(((h=e.body)==null?void 0:h.type)==="NORMAL"&&s==="user")return[oe(j({},i),{text:e.body.content,type:"normal",isNormalType:!0,contents:[{content:e.body.content}]})];if(((z=e.body)==null?void 0:z.type)==="RANKING"&&s==="user"){const M=(Z=e.body.ranking)==null?void 0:Z.items;if(Array.isArray(M)&&M.length>0){const C=[...M].sort((m,w)=>{var I,P;return((I=m.rank)!=null?I:0)-((P=w.rank)!=null?P:0)}).map(m=>m.label).join(`
12
+ `);return[se(j({},i),{text:_,type:"normal",isNormalType:!0,contents:[{content:_}]})]}}if(((h=e.body)==null?void 0:h.type)==="NORMAL"&&s==="user")return[se(j({},i),{text:e.body.content,type:"normal",isNormalType:!0,contents:[{content:e.body.content}]})];if(((H=e.body)==null?void 0:H.type)==="RANKING"&&s==="user"){const k=(Y=e.body.ranking)==null?void 0:Y.items;if(Array.isArray(k)&&k.length>0){const m=[...k].sort((C,v)=>{var M,$;return((M=C.rank)!=null?M:0)-(($=v.rank)!=null?$:0)}).map(C=>C.label).join(`
13
13
 
14
- `);return[oe(j({},i),{text:C,type:"normal",isNormalType:!0,contents:[{content:C}]})]}}if(((K=e.body)==null?void 0:K.type)==="MULTIPLE"&&s==="user"){const M=e.body.children.find(S=>S.type==="NORMAL"&&typeof S.content=="string");if(M&&M.content){const S=M.content.split("|").map(C=>C.trim()).join(`
14
+ `);return[se(j({},i),{text:m,type:"normal",isNormalType:!0,contents:[{content:m}]})]}}if(((X=e.body)==null?void 0:X.type)==="MULTIPLE"&&s==="user"){const k=e.body.children.find(_=>_.type==="NORMAL"&&typeof _.content=="string");if(k&&k.content){const _=k.content.split("|").map(m=>m.trim()).join(`
15
15
 
16
- `);return[oe(j({},i),{text:S,type:"normal",isNormalType:!0,contents:[{content:S}]})]}}return s==="bot"&&e.body&&typeof e.body.content=="string"&&!e.body.type?[oe(j({},i),{text:e.body.content,type:"normal",isNormalType:!0,contents:[{content:e.body.content,metadata:e.body.metadata}]})]:[oe(j({},i),{type:"normal",isNormalType:!0,contents:i.text?[{content:i.text}]:[]})]}).flat().filter(e=>e.type==="choice"?!!e.question&&Array.isArray(e.options)&&e.options.length>0:e.type==="normal"?!!e.text&&e.text.trim()!=="":e.type==="form"?Array.isArray(e.fields)&&e.fields.length>0:e.type==="survey"?Array.isArray(e.options)&&e.options.length>0:!!e.text&&e.text.trim()!=="")}function Zn(t){return v(this,null,function*(){var n,s,i;if(!t)return!1;const e=yield t.listConversationAsync(100);for(const o of e)if(o.id&&o.id.endsWith("~SURVEY")){const r=yield t.listMessagesAsync(o.id);let c=1,a=6;for(let d=r.length-1;d>=0;d--){const u=r[d];if(((n=u.sender)==null?void 0:n.id)!=="me"&&((s=u.body)!=null&&s.children)){const f=(i=u.body.children.find(N=>N.metadata))==null?void 0:i.metadata;if(f){c=parseInt(f.section),a=parseInt(f.totalSections)||6;break}}}if(c<a)return!0}return!1})}function vn(t,e,n,s,i,o,r,c,a){return v(this,null,function*(){if(!t.remoteRepo)return;const u=(yield t.remoteRepo.listConversationAsync(100)).find(f=>f.id&&f.id.endsWith("~SURVEY"));if(u)e.setCurrentConversation({id:u.id,name:u.name,type:"BOT"}),n(u.id),s(u.name),i(!0),o(new Set),r(!1),yield e.listMessagesAsync(u.id),c&&c();else{const f=`${Lt()}~SURVEY`,V=yield e.createConversationAsync({id:f,name:"Tư vấn đầu tư",type:"BOT",members:[{userId:"BOT~surveybot",role:"MEMBER"}],updatedAt:new Date});e.setCurrentConversation({id:V.id,name:V.name,type:"BOT"}),n(V.id),s(V.name),i(!0),o(new Set),r(!1),yield e.listMessagesAsync(V.id),c&&c(),a&&a()}})}function Ki(t,e){if(!e||t.length===0)return!0;const n=[...t].reverse().find(s=>s.sender==="bot");return!!(n&&n.type==="normal")}function Ji(t,e,n,s,i,o,r,c,a,d,u){return v(this,null,function*(){if(yield Zn(t.remoteRepo)){alert("Bạn chưa hoàn thành khảo sát hiện tại!");return}const f=e.trim();if(!f){n("Vui lòng nhập tên cuộc hội thoại");return}if(f.length>100){n("Tên cuộc hội thoại không được quá 100 ký tự");return}n(void 0),s(!1);try{const N=Lt(),U=yield i.createConversationAsync({id:N,name:f,type:"BOT",members:[{userId:"BOT~rasaconnector",role:"MEMBER"}],updatedAt:new Date});i.setCurrentConversation({id:U.id,name:U.name,type:"BOT"}),o(U.id),r(U.name),c(!0),a(new Set),d(!1),yield i.listMessagesAsync(U.id),u&&u()}catch(N){console.error("Tạo hội thoại mới thất bại:",N)}})}function eo(t,e,n,s,i,o){return v(this,null,function*(){var f,N,V,U;const{props:r,currentConversationId:c,formattedMessages:a,popup:d,setSubmittedMessages:u}=s;if(!(!r.remoteRepo||!c))try{const F=[...a].reverse().find(b=>b.type==="choice"&&b.sender==="bot");if(!F)return;const J=Array.isArray(F.contents)&&F.contents.length>0?F.contents[F.contents.length-1].metadata||{}:{};u(b=>new Set([...b,n]));let H={};e==="ordered"?H={type:"RANKING",content:"",ranking:{items:((f=F.rawItems)==null?void 0:f.map(y=>oe(j({},y),{rank:t.indexOf(y.label)+1})))||t.map((y,q)=>({label:y,value:y,rank:q+1})),submitted:!0},metadata:J}:e==="selected"?H={type:"CHOICE",content:"",choice:{items:((N=F.rawItems)==null?void 0:N.map(y=>oe(j({},y),{selected:t.includes(y.label)})))||((V=F.options)==null?void 0:V.map(y=>({label:y,value:y,selected:t.includes(y)})))||[],multiple:F.multiSelect||!1,submitted:!0},metadata:J}:e==="input"&&(H={type:"FORM",content:"",form:{fields:((U=F.fields)==null?void 0:U.map((b,y)=>oe(j({},b),{value:t[y]||""})))||[],submitted:!0},metadata:J});const E={body:H,conversationId:c,sender:{id:"me"}};if(yield d.sendMessageAsync(E),r.remoteRepo&&o.length>0){const b=yield r.remoteRepo.getSurveyProgressAsync();let y=1;const q=o.map(h=>h.id);b!=null&&b.progress&&(y=q.findIndex(h=>!b.progress[h]||b.progress[h]<100)+1,y===0&&(y=q.length)),i(y)}}catch(F){console.error("Error sending survey response:",F)}})}function to(t,e,n,s,i,o){return v(this,null,function*(){var N,V,U,F;const{props:r,currentConversationId:c,formattedMessages:a,popup:d,setEditingMsgIdBot:u,setEditingMsgIdUser:f}=s;if(!(!r.remoteRepo||!c))try{if(!a.find(h=>h.id===n&&h.sender==="user"))return;const H=a.findIndex(h=>h.id===n);let E;for(let h=H-1;h>=0;h--){const z=a[h];if(z.sender==="bot"&&(z.type==="choice"||z.type==="survey"||z.type==="form")){E=z;break}}if(!E)return;const b=Array.isArray(E.contents)&&E.contents.length>0?E.contents[E.contents.length-1].metadata||{}:{};let y={};e==="input"?y={type:"NORMAL",content:t[0],metadata:b}:e==="ordered"?y={type:"RANKING",content:"",ranking:{items:((N=E.rawItems)==null?void 0:N.map(z=>oe(j({},z),{rank:t.indexOf(z.label)+1})))||t.map((z,Z)=>({label:z,value:z,rank:Z+1})),submitted:!0},metadata:b}:e==="selected"?y={type:"CHOICE",content:"",choice:{items:((V=E.rawItems)==null?void 0:V.map(z=>oe(j({},z),{selected:t.includes(z.label)})))||((U=E.options)==null?void 0:U.map(z=>({label:z,value:z,selected:t.includes(z)})))||[],multiple:E.multiSelect||!1,submitted:!0},metadata:b}:e==="input"&&(y={type:"FORM",content:"",form:{fields:((F=E.fields)==null?void 0:F.map((h,z)=>oe(j({},h),{value:t[z]||""})))||[],submitted:!0},metadata:b});const q={id:n,body:y,conversationId:c,sender:{id:"me"}};if(yield d.updateMessageAsync(q),r.remoteRepo&&o.length>0){const h=yield r.remoteRepo.getSurveyProgressAsync();let z=1;const Z=o.map(K=>K.id);h!=null&&h.progress&&(z=Z.findIndex(K=>!h.progress[K]||h.progress[K]<100)+1,z===0&&(z=Z.length)),i(z)}u(null),f(null)}catch(J){console.error("Error updating survey response:",J)}})}var no=O("<div>"),so=O("<button class=chat-popup-button><img>"),io=O("<div style=font-size:14px;margin-top:4px>"),oo=O("<div class=modal-backdrop><div class=modal-content style=background-color:white;border-radius:8px><div style=margin-bottom:12px><label style=margin-bottom:18px;font-weight:500>Tên cuộc trò chuyện mới:</label><input autofocus class=chat-popup-input></div><div style=text-align:right><button class=modal-button-delete style=margin-right:8px;background-color:#f0f0f0>Hủy bỏ</button><button class=modal-button-delete style=background-color:#1AAF74>Tạo"),ro=O("<div class=modal-backdrop><div style=background-color:white;border-radius:8px><div style=font-size:16px;font-weight:500;margin-bottom:12px>Xóa đoạn chat?</div><div style=font-size:14px;margin-bottom:16px>Hành động này sẽ xóa <b></b>?</div><div style=text-align:right><button class=modal-button-delete style=margin-right:8px>Hủy bỏ</button><button class=modal-button-delete style=background-color:#e74c3c>Xóa"),ao=O("<div class=modal-backdrop><div class=modal-content style=background-color:white;border-radius:8px><div style=font-size:16px;font-weight:500;margin-bottom:12px>Bạn chưa làm khảo sát. Vui lòng thực hiện khảo sát trước khi bắt đầu tư vấn!</div><div style=text-align:right><button class=modal-button-delete style=background-color:#1AAF74>Đã hiểu"),co=O("<div class=modal-backdrop><div class=modal-content style=background-color:white;border-radius:8px><div style=margin-bottom:12px><div style=font-size:16px;font-weight:500;margin-bottom:12px>Bắt đầu làm khảo sát đầu tư?</div><div style=font-size:14px;margin-bottom:16px>Chỉ với vài phút trả lời bảng hỏi, bạn sẽ giúp hệ thống hiểu rõ nhu cầu, khả năng tài chính và mức độ chấp nhận rủi ro của mình. Từ đó, chúng tôi có thể gửi đến bạn những gợi ý đầu tư cá nhân hóa, phù hợp nhất với mục tiêu và phong cách đầu tư của bạn</div></div><div style=text-align:right><button class=modal-button-delete style=margin-right:8px;background-color:#f0f0f0>Xem ví dụ</button><button class=modal-button-delete style=margin-right:8px;background-color:#f0f0f0>Hướng dẫn sử dụng</button><button class=modal-button-delete style=background-color:#1AAF74>Bắt đầu Khảo sát"),lo=O("<div><div style=flex-direction:row><div style=flex-direction:column;min-height:0>"),uo=O("<div class=chat-popup-header><img><div class=chat-popup-title><img style=margin-right:4px><span style=user-select:none>Ez</span><span style=margin-left:4px;user-select:none>Advise</span></div><div style=align-items:center;margin-top:4px><button><img>"),ho=O("<button><img>"),fo=O("<div><div>"),go=O("<div style=text-align:center;font-size:32px;font-weight:600;margin-bottom:32px;user-select:none>Hôm nay thị trường khiến bạn quan tâm điều gì?"),po=O("<div class=chat-popup-action-buttons>");function Co(t){var Ee;const e=Qi(),[n,s]=L(""),[i,o]=L(!1),[r,c]=L(!1),[a,d]=L(!1),[u,f]=L(!1),[N,V]=L(0),[U]=L({}),[F,J]=L(new Set),[H,E]=L(null),[b,y]=L(!1),[q,h]=L(!0),[z,Z]=L(""),[K,M]=L(1),[S,C]=L(7),[m,w]=L(null),[I,P]=L(null),[_,D]=L(!1),[Q,me]=L(""),[ve,ue]=L(void 0);let re=null;const[ne,T]=L(!1),[G,Ae]=L(null),[se,we]=L(!1),Ve=((Ee=t.options)==null?void 0:Ee.onlyMobile)||!1,[Ke,ct]=L([]),[g,x]=L(null),$=()=>v(null,null,function*(){yield vn(t,e,E,Z,h,J,y,re,()=>we(!0)),yield Ji(t,Q(),ue,D,e,E,Z,h,J,y,re)});nt(()=>{var ke;const X=Ke(),ge=(ke=g())==null?void 0:ke.progress;let ee=0;if(X.length&&ge){const Ne=X.map(at=>at.id),lt=Ne.findIndex(at=>ge[at]!==100);lt===-1?ee=Ne.length:ee=lt}M(ee)}),nt(()=>v(null,null,function*(){if(t.remoteRepo)try{const X=yield t.remoteRepo.listConversationAsync(10);console.log("listConversationAsync result:",X),(!X||X.length===0)&&console.warn("listConversationAsync returned empty or null");const ge=yield t.remoteRepo.getSurveyQuestionSectionAsync();ct(ge!=null?ge:[]),C(Array.isArray(ge)?ge.length:0);const ee=yield t.remoteRepo.getSurveyProgressAsync();x(ee),console.log("getSurveyProgressAsync result:",ee);const ke=ge!=null?ge:[],Ne=ee==null?void 0:ee.progress;let lt=0;if(ke.length&&Ne){const at=ke.map(pe=>pe.id),ln=at.findIndex(pe=>Ne[pe]!==100);ln===-1?lt=at.length:lt=ln}M(lt)}catch(X){console.error("Error calling listConversationAsync or getSurveyProgressAsync:",X)}}));const A=()=>{const X=H();return!!X&&X.endsWith("~SURVEY")},B=()=>v(null,null,function*(){me(""),ue(void 0),D(!0)}),ye=()=>v(null,null,function*(){if(t.remoteRepo)try{const X=yield t.remoteRepo.getSurveyProgressAsync();!X||!X.progress||Object.keys(X.progress).length===0?T(!0):x(X)}catch(X){console.error("Error checking survey progress:",X),T(!0)}});return Rt(()=>{const X=()=>{const ee=window.innerWidth<768;f(ee),a()&&ee&&(d(!1),f(!0))};return window.addEventListener("resize",X),X(),()=>{window.removeEventListener("resize",X)}}),nt(()=>{var X,ge;(X=t.options)!=null&&X.onFullScreen&&t.options.onFullScreen(a()),(ge=t.options)!=null&&ge.onMobile&&t.options.onMobile(u())}),(()=>{var X=no();return k(X,(()=>{var ge=te(()=>!i());return()=>ge()&&(()=>{var ee=so(),ke=ee.firstChild;return ee.$$click=()=>{var Ne;Ve&&f(!0),o(!0),(Ne=t.options)!=null&&Ne.onOpen&&t.options.onOpen()},l(ee,"background","none"),l(ee,"border","none"),l(ee,"cursor","pointer"),l(ee,"padding","0"),ce(ke,"src",mn),ee})()})(),null),k(X,(()=>{var ge=te(()=>!!i());return()=>ge()&&(()=>{const ee=st(()=>Gi(e.getCurrentMessages())),ke=()=>Ki(ee(),H()),Ne=(pe,Fe,he)=>eo(pe,Fe,he,{props:t,currentConversationId:H(),formattedMessages:ee(),popup:e,setSubmittedMessages:J},M,Ke()),lt=(pe,Fe,he)=>to(pe,Fe,he,{props:t,currentConversationId:H(),formattedMessages:ee(),popup:e,setEditingMsgIdBot:w,setEditingMsgIdUser:P},M,Ke()),at=()=>v(null,null,function*(){var pe,Fe;if(!(!n().trim()||!t.remoteRepo)){if(ee().length===0){yield ye();return}if(yield Zn(t.remoteRepo)){alert("Bạn chưa hoàn thành khảo sát hiện tại!");return}if(!H()){yield vn(t,e,E,Z,h,J,y,re,()=>we(!0));try{const he=Lt(),ie="BOT~rasaconnector",R=`Cuộc hội thoại mới ${he.slice(-4)}`,W=yield e.createConversationAsync({id:he,name:R,type:"BOT",members:[{userId:ie,role:"MEMBER"}],updatedAt:new Date});e.setCurrentConversation({id:W.id,name:W.name,type:"BOT"}),E(W.id),Z(W.name),h(!0),J(new Set),y(!1),yield e.listMessagesAsync(W.id),re&&re()}catch(he){console.error("Tạo hội thoại mới thất bại:",he);return}}try{let he={};const ie=ee().filter(W=>W.sender==="bot"&&Array.isArray(W.contents)&&W.contents.length>0&&W.contents[W.contents.length-1].metadata);if(ie.length>0){const W=ie[ie.length-1];he=((Fe=(pe=W.contents)==null?void 0:pe[W.contents.length-1])==null?void 0:Fe.metadata)||{}}const R={body:{type:"NORMAL",content:n(),metadata:he},conversationId:H(),sender:{id:"me"}};yield e.sendMessageAsync(R),s("")}catch(he){console.error("Error sending message:",he)}}}),ln=()=>v(null,null,function*(){var pe,Fe;if(!(!e||ee().length===0||!H()||!q()))try{const he=ee()[0].id,ie=30,R=ee().findIndex(Ue=>Ue.id===he);if(R>=0&&R-ie>=0)return;const W=document.querySelector(".chat-messages-container"),de=W==null?void 0:W.querySelector(`[data-message-id="${he}"]`),le=(pe=de==null?void 0:de.offsetTop)!=null?pe:0,qe=(Fe=W==null?void 0:W.scrollTop)!=null?Fe:0;yield e.listMessagesAsync("BEFORE",he,ie),requestAnimationFrame(()=>{var be;const Ue=W==null?void 0:W.querySelector(`[data-message-id="${he}"]`),je=(be=Ue==null?void 0:Ue.offsetTop)!=null?be:0;W&&(W.scrollTop=je-(le-qe))})}catch(he){console.error("Error loading more messages:",he)}});return nt(()=>{ee(),i()&&requestAnimationFrame(()=>{const pe=document.querySelector(".chat-messages-container");pe&&(pe.scrollTop=pe.scrollHeight)})}),(()=>{var pe=lo(),Fe=pe.firstChild,he=Fe.firstChild;return k(pe,ae(Qe,{get when(){return _()},get children(){var ie=oo(),R=ie.firstChild,W=R.firstChild,de=W.firstChild,le=de.nextSibling,qe=W.nextSibling,Ue=qe.firstChild,je=Ue.nextSibling;return ie.$$click=()=>D(!1),R.$$click=be=>be.stopPropagation(),l(R,"padding","20px"),l(R,"width","400px"),l(de,"display","block"),le.$$keydown=be=>{be.key==="Enter"&&$()},le.$$input=be=>me(be.currentTarget.value),k(W,ae(Qe,{get when(){return ve()},get children(){var be=io();return l(be,"color","red"),k(be,ve),be}}),null),Ue.$$click=()=>D(!1),je.$$click=$,l(je,"color","#fff"),fe(()=>le.value=Q()),ie}}),Fe),k(pe,(()=>{var ie=te(()=>!a());return()=>ie()&&(()=>{var R=uo(),W=R.firstChild,de=W.nextSibling,le=de.firstChild,qe=le.nextSibling,Ue=qe.nextSibling,je=de.nextSibling,be=je.firstChild,Xe=be.firstChild;return W.$$click=()=>c(!0),ce(W,"src",Ms),l(W,"width","28px"),l(W,"height","28px"),l(W,"cursor","pointer"),ce(le,"src",mn),l(le,"width","32px"),l(le,"height","32px"),l(qe,"color","#1A1D1F"),l(Ue,"color","#1AAF74"),l(je,"display","flex"),l(je,"gap","12px"),k(je,(()=>{var pt=te(()=>!u());return()=>pt()&&(()=>{var dt=ho(),xn=dt.firstChild;return dt.$$click=()=>{var ls;f(!1),d(!0),(ls=t.options)!=null&&ls.onMaximize&&t.options.onMaximize()},l(dt,"background","none"),l(dt,"border","none"),l(dt,"cursor","pointer"),l(dt,"padding","0"),ce(xn,"src",Es),l(xn,"width","20px"),l(xn,"height","20px"),dt})()})(),be),be.$$click=()=>{var pt;o(!1),setTimeout(()=>{f(!1),d(!1)},250),(pt=t.options)!=null&&pt.onClose&&t.options.onClose()},l(be,"background","none"),l(be,"border","none"),l(be,"cursor","pointer"),l(be,"padding","0"),ce(Xe,"src",Bn),l(Xe,"width","20px"),l(Xe,"height","20px"),R})()})(),Fe),l(Fe,"display","flex"),l(Fe,"height","100%"),k(Fe,(()=>{var ie=te(()=>!!a());return()=>ie()?ae(Fn,{onClose:()=>{var R;o(!1),setTimeout(()=>{f(!1),d(!1)},250),(R=t.options)!=null&&R.onClose&&t.options.onClose()},onShrink:()=>{var R;d(!1),(R=t.options)!=null&&R.onShrink&&t.options.onShrink()},open:!0,fullScreen:!0,get isMobile(){return u()},onMobile:()=>{d(!1),f(!0)},onNewConversation:B,get options(){return t.options},get remoteRepo(){var R;return(R=t.remoteRepo)!=null?R:void 0},onDeleteConversation:Ae,onReloadConversations:R=>re=R,onLoadMessages:(R,W)=>v(null,null,function*(){if(e.setCurrentConversation({id:R,name:"",type:"BOT"}),E(R),Z(W||""),h(!0),t.remoteRepo)try{yield e.listMessagesAsync(R),J(new Set),y(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{const de=document.querySelector(".chat-messages-container");de&&(de.scrollTop=de.scrollHeight),y(!1)})})}catch(de){console.error("Error loading messages:",de),y(!1)}})}):ae(Fn,{onClose:()=>c(!1),get open(){return r()},fullScreen:!1,get isMobile(){return u()},onNewConversation:B,get options(){return t.options},get remoteRepo(){var R;return(R=t.remoteRepo)!=null?R:void 0},onDeleteConversation:Ae,onReloadConversations:R=>re=R,onLoadMessages:(R,W)=>v(null,null,function*(){if(e.setCurrentConversation({id:R,name:"",type:"BOT"}),E(R),Z(W||""),h(!0),t.remoteRepo)try{yield e.listMessagesAsync(R);const de=e.getCurrentMessages();console.log("message data: ",de),J(new Set),y(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{const le=document.querySelector(".chat-messages-container");le&&(le.scrollTop=le.scrollHeight),y(!1)})})}catch(de){console.error("Error loading messages:",de),y(!1)}})})})(),he),l(he,"flex","1"),l(he,"display","flex"),l(he,"position","relative"),l(he,"height","100%"),k(he,(()=>{var ie=te(()=>!!a());return()=>ie()&&ae(ji,{get currentStep(){return K()},get totalSteps(){return S()},get title(){return z()},get isSurveyConversation(){return A()},get sections(){return Ke()},get progress(){var R;return(R=g())==null?void 0:R.progress}})})(),null),k(he,ae(_i,{get messages(){return ee()},get isFullScreen(){return a()},get inputHeight(){return te(()=>!!a())()?N():void 0},get isMobile(){return u()},onSubmit:Ne,onUpdateSurvey:lt,get surveyOptions(){return U()},get submittedMessages(){return F()},onLoadMoreMessages:ln,get conversationId(){return H()},get isLoadingMessages(){return b()},get editingMsgIdBot(){return m()},setEditingMsgIdBot:w,get editingMsgIdUser(){return I()},setEditingMsgIdUser:P}),null),k(he,(()=>{var ie=te(()=>!!a());return()=>ie()?(()=>{var R=fo(),W=R.firstChild;return k(R,(()=>{var de=te(()=>ee().length===0);return()=>de()&&(()=>{var le=go();return l(le,"width","100%"),l(le,"color","#1A1D1F"),le})()})(),W),l(W,"width","100%"),k(W,ae(On,{get input(){return n()},setInput:s,sendMessage:at,onHeightChange:V,disabled:!ke})),k(R,(()=>{var de=te(()=>ee().length===0);return()=>de()&&(()=>{var le=po();return k(le,ae(Qt,{text:"Khảo sát đầu tư"}),null),k(le,ae(Qt,{text:"Mục tiêu tài chính"}),null),k(le,ae(Qt,{text:"Khả năng chấp nhận rủi ro"}),null),k(le,ae(Qt,{text:"Khả năng chấp nhận rủi ro"}),null),le})()})(),null),fe(()=>it(R,`chat-input-floating-box${ee().length>0?" chat-input-floating-box--with-messages":""}`)),R})():ae(On,{get input(){return n()},setInput:s,sendMessage:at,onHeightChange:V,disabled:!ke})})(),null),k(pe,ae(Qe,{get when(){return!!G()},get children(){var ie=ro(),R=ie.firstChild,W=R.firstChild,de=W.nextSibling,le=de.firstChild,qe=le.nextSibling,Ue=de.nextSibling,je=Ue.firstChild,be=je.nextSibling;return ie.$$click=()=>Ae(null),R.$$click=Xe=>Xe.stopPropagation(),l(R,"padding","20px"),l(R,"width","350px"),k(qe,()=>{var Xe;return(Xe=G())==null?void 0:Xe.name}),je.$$click=Xe=>{Xe.stopPropagation(),Ae(null)},be.$$click=Xe=>v(null,null,function*(){var pt;Xe.stopPropagation();try{yield(pt=t.remoteRepo)==null?void 0:pt.deleteConversationAsync(G().id),Ae(null),re&&re()}catch(dt){alert("Xóa hội thoại thất bại!")}}),l(be,"color","#fff"),ie}}),null),k(pe,ae(Qe,{get when(){return se()},get children(){var ie=ao(),R=ie.firstChild,W=R.firstChild,de=W.nextSibling,le=de.firstChild;return ie.$$click=()=>we(!1),R.$$click=qe=>qe.stopPropagation(),l(R,"padding","20px"),l(R,"width","350px"),le.$$click=()=>we(!1),l(le,"color","#fff"),ie}}),null),k(pe,ae(Qe,{get when(){return ne()},get children(){var ie=co(),R=ie.firstChild,W=R.firstChild,de=W.firstChild;de.nextSibling;var le=W.nextSibling,qe=le.firstChild,Ue=qe.nextSibling,je=Ue.nextSibling;return ie.$$click=()=>T(!1),R.$$click=be=>be.stopPropagation(),l(R,"padding","20px"),l(R,"width","400px"),qe.$$click=()=>T(!1),Ue.$$click=()=>T(!1),je.$$click=()=>v(null,null,function*(){T(!1),yield vn(t,e,E,Z,h,J,y,re,()=>we(!0))}),l(je,"color","#fff"),ie}}),null),fe(ie=>{var R=`chat-popup-window${i()?" chat-popup-window--open":""}${a()?" chat-popup-window--fullscreen":""}${u()?" chat-popup-window--mobile":""}`,W=a()||u()?{"--chat-input-height":`${N()}px`}:void 0;return R!==ie.e&&it(pe,ie.e=R),ie.t=pn(pe,W,ie.t),ie},{e:void 0,t:void 0}),pe})()})()})(),null),X})()}yt(["click","input","keydown"]);function mo(t){return ae(Co,{get remoteRepo(){return t.remoteRepo},get options(){return t.options}})}class ht extends Error{constructor(e,n){const s=new.target.prototype;super(`${e}: Status code '${n}'`),this.statusCode=n,this.__proto__=s}}class wn extends Error{constructor(e="A timeout occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class Ge extends Error{constructor(e="An abort occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class vo extends Error{constructor(e,n){const s=new.target.prototype;super(e),this.transport=n,this.errorType="UnsupportedTransportError",this.__proto__=s}}class wo extends Error{constructor(e,n){const s=new.target.prototype;super(e),this.transport=n,this.errorType="DisabledTransportError",this.__proto__=s}}class yo extends Error{constructor(e,n){const s=new.target.prototype;super(e),this.transport=n,this.errorType="FailedToStartTransportError",this.__proto__=s}}class Yn extends Error{constructor(e){const n=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=n}}class bo extends Error{constructor(e,n){const s=new.target.prototype;super(e),this.innerErrors=n,this.__proto__=s}}class Xn{constructor(e,n,s){this.statusCode=e,this.statusText=n,this.content=s}}class en{get(e,n){return this.send(oe(j({},n),{method:"GET",url:e}))}post(e,n){return this.send(oe(j({},n),{method:"POST",url:e}))}delete(e,n){return this.send(oe(j({},n),{method:"DELETE",url:e}))}getCookieString(e){return""}}var p;(function(t){t[t.Trace=0]="Trace",t[t.Debug=1]="Debug",t[t.Information=2]="Information",t[t.Warning=3]="Warning",t[t.Error=4]="Error",t[t.Critical=5]="Critical",t[t.None=6]="None"})(p||(p={}));class Ot{constructor(){}log(e,n){}}Ot.instance=new Ot;const _o="8.0.17";class Re{static isRequired(e,n){if(e==null)throw new Error(`The '${n}' argument is required.`)}static isNotEmpty(e,n){if(!e||e.match(/^\s*$/))throw new Error(`The '${n}' argument should not be empty.`)}static isIn(e,n,s){if(!(e in n))throw new Error(`Unknown ${s} value: ${e}.`)}}class Ie{static get isBrowser(){return!Ie.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!Ie.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!Ie.isNode&&typeof window=="object"&&typeof window.document=="undefined"}static get isNode(){return typeof process!="undefined"&&process.release&&process.release.name==="node"}}function Ft(t,e){let n="";return ft(t)?(n=`Binary data of length ${t.byteLength}`,e&&(n+=`. Content: '${So(t)}'`)):typeof t=="string"&&(n=`String data of length ${t.length}`,e&&(n+=`. Content: '${t}'`)),n}function So(t){const e=new Uint8Array(t);let n="";return e.forEach(s=>{const i=s<16?"0":"";n+=`0x${i}${s.toString(16)} `}),n.substr(0,n.length-1)}function ft(t){return t&&typeof ArrayBuffer!="undefined"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}function Qn(t,e,n,s,i,o){return v(this,null,function*(){const r={},[c,a]=It();r[c]=a,t.log(p.Trace,`(${e} transport) sending data. ${Ft(i,o.logMessageContent)}.`);const d=ft(i)?"arraybuffer":"text",u=yield n.post(s,{content:i,headers:j(j({},r),o.headers),responseType:d,timeout:o.timeout,withCredentials:o.withCredentials});t.log(p.Trace,`(${e} transport) request complete. Response status: ${u.statusCode}.`)})}function Ao(t){return t===void 0?new tn(p.Information):t===null?Ot.instance:t.log!==void 0?t:new tn(t)}class xo{constructor(e,n){this._subject=e,this._observer=n}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(n=>{})}}class tn{constructor(e){this._minLevel=e,this.out=console}log(e,n){if(e>=this._minLevel){const s=`[${new Date().toISOString()}] ${p[e]}: ${n}`;switch(e){case p.Critical:case p.Error:this.out.error(s);break;case p.Warning:this.out.warn(s);break;case p.Information:this.out.info(s);break;default:this.out.log(s);break}}}}function It(){let t="X-SignalR-User-Agent";return Ie.isNode&&(t="User-Agent"),[t,Io(_o,ko(),Eo(),Mo())]}function Io(t,e,n,s){let i="Microsoft SignalR/";const o=t.split(".");return i+=`${o[0]}.${o[1]}`,i+=` (${t}; `,e&&e!==""?i+=`${e}; `:i+="Unknown OS; ",i+=`${n}`,s?i+=`; ${s}`:i+="; Unknown Runtime Version",i+=")",i}function ko(){if(Ie.isNode)switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}else return""}function Mo(){if(Ie.isNode)return process.versions.node}function Eo(){return Ie.isNode?"NodeJS":"Browser"}function yn(t){return t.stack?t.stack:t.message?t.message:`${t}`}function To(){if(typeof globalThis!="undefined")return globalThis;if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;throw new Error("could not find global")}class $o extends en{constructor(e){if(super(),this._logger=e,typeof fetch=="undefined"||Ie.isNode){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._jar=new(n("tough-cookie")).CookieJar,typeof fetch=="undefined"?this._fetchType=n("node-fetch"):this._fetchType=fetch,this._fetchType=n("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(To());if(typeof AbortController=="undefined"){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._abortControllerType=n("abort-controller")}else this._abortControllerType=AbortController}send(e){return v(this,null,function*(){if(e.abortSignal&&e.abortSignal.aborted)throw new Ge;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const n=new this._abortControllerType;let s;e.abortSignal&&(e.abortSignal.onabort=()=>{n.abort(),s=new Ge});let i=null;if(e.timeout){const a=e.timeout;i=setTimeout(()=>{n.abort(),this._logger.log(p.Warning,"Timeout from HTTP request."),s=new wn},a)}e.content===""&&(e.content=void 0),e.content&&(e.headers=e.headers||{},ft(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");let o;try{o=yield this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:e.withCredentials===!0?"include":"same-origin",headers:j({"X-Requested-With":"XMLHttpRequest"},e.headers),method:e.method,mode:"cors",redirect:"follow",signal:n.signal})}catch(a){throw s||(this._logger.log(p.Warning,`Error from HTTP request. ${a}.`),a)}finally{i&&clearTimeout(i),e.abortSignal&&(e.abortSignal.onabort=null)}if(!o.ok){const a=yield Gn(o,"text");throw new ht(a||o.statusText,o.status)}const c=yield Gn(o,e.responseType);return new Xn(o.status,o.statusText,c)})}getCookieString(e){let n="";return Ie.isNode&&this._jar&&this._jar.getCookies(e,(s,i)=>n=i.join("; ")),n}}function Gn(t,e){let n;switch(e){case"arraybuffer":n=t.arrayBuffer();break;case"text":n=t.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`);default:n=t.text();break}return n}class Ro extends en{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new Ge):e.method?e.url?new Promise((n,s)=>{const i=new XMLHttpRequest;i.open(e.method,e.url,!0),i.withCredentials=e.withCredentials===void 0?!0:e.withCredentials,i.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.content===""&&(e.content=void 0),e.content&&(ft(e.content)?i.setRequestHeader("Content-Type","application/octet-stream"):i.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const o=e.headers;o&&Object.keys(o).forEach(r=>{i.setRequestHeader(r,o[r])}),e.responseType&&(i.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{i.abort(),s(new Ge)}),e.timeout&&(i.timeout=e.timeout),i.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),i.status>=200&&i.status<300?n(new Xn(i.status,i.statusText,i.response||i.responseText)):s(new ht(i.response||i.responseText||i.statusText,i.status))},i.onerror=()=>{this._logger.log(p.Warning,`Error from HTTP request. ${i.status}: ${i.statusText}.`),s(new ht(i.statusText,i.status))},i.ontimeout=()=>{this._logger.log(p.Warning,"Timeout from HTTP request."),s(new wn)},i.send(e.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class Po extends en{constructor(e){if(super(),typeof fetch!="undefined"||Ie.isNode)this._httpClient=new $o(e);else if(typeof XMLHttpRequest!="undefined")this._httpClient=new Ro(e);else throw new Error("No usable HttpClient found.")}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new Ge):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}class We{static write(e){return`${e}${We.RecordSeparator}`}static parse(e){if(e[e.length-1]!==We.RecordSeparator)throw new Error("Message is incomplete.");const n=e.split(We.RecordSeparator);return n.pop(),n}}We.RecordSeparatorCode=30,We.RecordSeparator=String.fromCharCode(We.RecordSeparatorCode);class Do{writeHandshakeRequest(e){return We.write(JSON.stringify(e))}parseHandshakeResponse(e){let n,s;if(ft(e)){const c=new Uint8Array(e),a=c.indexOf(We.RecordSeparatorCode);if(a===-1)throw new Error("Message is incomplete.");const d=a+1;n=String.fromCharCode.apply(null,Array.prototype.slice.call(c.slice(0,d))),s=c.byteLength>d?c.slice(d).buffer:null}else{const c=e,a=c.indexOf(We.RecordSeparator);if(a===-1)throw new Error("Message is incomplete.");const d=a+1;n=c.substring(0,d),s=c.length>d?c.substring(d):null}const i=We.parse(n),o=JSON.parse(i[0]);if(o.type)throw new Error("Expected a handshake response from the server.");return[s,o]}}var Y;(function(t){t[t.Invocation=1]="Invocation",t[t.StreamItem=2]="StreamItem",t[t.Completion=3]="Completion",t[t.StreamInvocation=4]="StreamInvocation",t[t.CancelInvocation=5]="CancelInvocation",t[t.Ping=6]="Ping",t[t.Close=7]="Close",t[t.Ack=8]="Ack",t[t.Sequence=9]="Sequence"})(Y||(Y={}));class Bo{constructor(){this.observers=[]}next(e){for(const n of this.observers)n.next(e)}error(e){for(const n of this.observers)n.error&&n.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new xo(this,e)}}class Ho{constructor(e,n,s){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=e,this._connection=n,this._bufferSize=s}_send(e){return v(this,null,function*(){const n=this._protocol.writeMessage(e);let s=Promise.resolve();if(this._isInvocationMessage(e)){this._totalMessageCount++;let i=()=>{},o=()=>{};ft(n)?this._bufferedByteCount+=n.byteLength:this._bufferedByteCount+=n.length,this._bufferedByteCount>=this._bufferSize&&(s=new Promise((r,c)=>{i=r,o=c})),this._messages.push(new Lo(n,this._totalMessageCount,i,o))}try{this._reconnectInProgress||(yield this._connection.send(n))}catch(i){this._disconnected()}yield s})}_ack(e){let n=-1;for(let s=0;s<this._messages.length;s++){const i=this._messages[s];if(i._id<=e.sequenceId)n=s,ft(i._message)?this._bufferedByteCount-=i._message.byteLength:this._bufferedByteCount-=i._message.length,i._resolver();else if(this._bufferedByteCount<this._bufferSize)i._resolver();else break}n!==-1&&(this._messages=this._messages.slice(n+1))}_shouldProcessMessage(e){if(this._waitForSequenceMessage)return e.type!==Y.Sequence?!1:(this._waitForSequenceMessage=!1,!0);if(!this._isInvocationMessage(e))return!0;const n=this._nextReceivingSequenceId;return this._nextReceivingSequenceId++,n<=this._latestReceivedSequenceId?(n===this._latestReceivedSequenceId&&this._ackTimer(),!1):(this._latestReceivedSequenceId=n,this._ackTimer(),!0)}_resetSequence(e){if(e.sequenceId>this._nextReceivingSequenceId){this._connection.stop(new Error("Sequence ID greater than amount of messages we've received."));return}this._nextReceivingSequenceId=e.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}_resend(){return v(this,null,function*(){const e=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;yield this._connection.send(this._protocol.writeMessage({type:Y.Sequence,sequenceId:e}));const n=this._messages;for(const s of n)yield this._connection.send(s._message);this._reconnectInProgress=!1})}_dispose(e){e!=null||(e=new Error("Unable to reconnect to server."));for(const n of this._messages)n._rejector(e)}_isInvocationMessage(e){switch(e.type){case Y.Invocation:case Y.StreamItem:case Y.Completion:case Y.StreamInvocation:case Y.CancelInvocation:return!0;case Y.Close:case Y.Sequence:case Y.Ping:case Y.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(()=>v(this,null,function*(){try{this._reconnectInProgress||(yield this._connection.send(this._protocol.writeMessage({type:Y.Ack,sequenceId:this._latestReceivedSequenceId})))}catch(e){}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0}),1e3))}}class Lo{constructor(e,n,s,i){this._message=e,this._id=n,this._resolver=s,this._rejector=i}}const Oo=30*1e3,Fo=15*1e3,No=1e5;var Se;(function(t){t.Disconnected="Disconnected",t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Reconnecting="Reconnecting"})(Se||(Se={}));class bn{static create(e,n,s,i,o,r,c){return new bn(e,n,s,i,o,r,c)}constructor(e,n,s,i,o,r,c){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(p.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},Re.isRequired(e,"connection"),Re.isRequired(n,"logger"),Re.isRequired(s,"protocol"),this.serverTimeoutInMilliseconds=o!=null?o:Oo,this.keepAliveIntervalInMilliseconds=r!=null?r:Fo,this._statefulReconnectBufferSize=c!=null?c:No,this._logger=n,this._protocol=s,this.connection=e,this._reconnectPolicy=i,this._handshakeProtocol=new Do,this.connection.onreceive=a=>this._processIncomingData(a),this.connection.onclose=a=>this._connectionClosed(a),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=Se.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:Y.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==Se.Disconnected&&this._connectionState!==Se.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}_startWithStateTransitions(){return v(this,null,function*(){if(this._connectionState!==Se.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=Se.Connecting,this._logger.log(p.Debug,"Starting HubConnection.");try{yield this._startInternal(),Ie.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=Se.Connected,this._connectionStarted=!0,this._logger.log(p.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=Se.Disconnected,this._logger.log(p.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}})}_startInternal(){return v(this,null,function*(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const e=new Promise((n,s)=>{this._handshakeResolver=n,this._handshakeRejecter=s});yield this.connection.start(this._protocol.transferFormat);try{let n=this._protocol.version;this.connection.features.reconnect||(n=1);const s={protocol:this._protocol.name,version:n};if(this._logger.log(p.Debug,"Sending handshake request."),yield this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(s)),this._logger.log(p.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),yield e,this._stopDuringStartError)throw this._stopDuringStartError;(this.connection.features.reconnect||!1)&&(this._messageBuffer=new Ho(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||(yield this._sendMessage(this._cachedPingMessage))}catch(n){throw this._logger.log(p.Debug,`Hub handshake failed with error '${n}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),yield this.connection.stop(n),n}})}stop(){return v(this,null,function*(){const e=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),yield this._stopPromise;try{yield e}catch(n){}})}_stopInternal(e){if(this._connectionState===Se.Disconnected)return this._logger.log(p.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===Se.Disconnecting)return this._logger.log(p.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const n=this._connectionState;return this._connectionState=Se.Disconnecting,this._logger.log(p.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(p.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(n===Se.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new Ge("The connection was stopped before the hub handshake could complete."),this.connection.stop(e))}_sendCloseMessage(){return v(this,null,function*(){try{yield this._sendWithProtocol(this._createCloseMessage())}catch(e){}})}stream(e,...n){const[s,i]=this._replaceStreamingParams(n),o=this._createStreamInvocation(e,n,i);let r;const c=new Bo;return c.cancelCallback=()=>{const a=this._createCancelInvocation(o.invocationId);return delete this._callbacks[o.invocationId],r.then(()=>this._sendWithProtocol(a))},this._callbacks[o.invocationId]=(a,d)=>{if(d){c.error(d);return}else a&&(a.type===Y.Completion?a.error?c.error(new Error(a.error)):c.complete():c.next(a.item))},r=this._sendWithProtocol(o).catch(a=>{c.error(a),delete this._callbacks[o.invocationId]}),this._launchStreams(s,r),c}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._messageBuffer?this._messageBuffer._send(e):this._sendMessage(this._protocol.writeMessage(e))}send(e,...n){const[s,i]=this._replaceStreamingParams(n),o=this._sendWithProtocol(this._createInvocation(e,n,!0,i));return this._launchStreams(s,o),o}invoke(e,...n){const[s,i]=this._replaceStreamingParams(n),o=this._createInvocation(e,n,!1,i);return new Promise((c,a)=>{this._callbacks[o.invocationId]=(u,f)=>{if(f){a(f);return}else u&&(u.type===Y.Completion?u.error?a(new Error(u.error)):c(u.result):a(new Error(`Unexpected message type: ${u.type}`)))};const d=this._sendWithProtocol(o).catch(u=>{a(u),delete this._callbacks[o.invocationId]});this._launchStreams(s,d)})}on(e,n){!e||!n||(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),this._methods[e].indexOf(n)===-1&&this._methods[e].push(n))}off(e,n){if(!e)return;e=e.toLowerCase();const s=this._methods[e];if(s)if(n){const i=s.indexOf(n);i!==-1&&(s.splice(i,1),s.length===0&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){const n=this._protocol.parseMessages(e,this._logger);for(const s of n)if(!(this._messageBuffer&&!this._messageBuffer._shouldProcessMessage(s)))switch(s.type){case Y.Invocation:this._invokeClientMethod(s).catch(i=>{this._logger.log(p.Error,`Invoke client method threw error: ${yn(i)}`)});break;case Y.StreamItem:case Y.Completion:{const i=this._callbacks[s.invocationId];if(i){s.type===Y.Completion&&delete this._callbacks[s.invocationId];try{i(s)}catch(o){this._logger.log(p.Error,`Stream callback threw error: ${yn(o)}`)}}break}case Y.Ping:break;case Y.Close:{this._logger.log(p.Information,"Close message received from server.");const i=s.error?new Error("Server returned an error on close: "+s.error):void 0;s.allowReconnect===!0?this.connection.stop(i):this._stopPromise=this._stopInternal(i);break}case Y.Ack:this._messageBuffer&&this._messageBuffer._ack(s);break;case Y.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(s);break;default:this._logger.log(p.Warning,`Invalid message type: ${s.type}.`);break}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let n,s;try{[s,n]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(i){const o="Error parsing handshake response: "+i;this._logger.log(p.Error,o);const r=new Error(o);throw this._handshakeRejecter(r),r}if(n.error){const i="Server returned handshake error: "+n.error;this._logger.log(p.Error,i);const o=new Error(i);throw this._handshakeRejecter(o),o}else this._logger.log(p.Debug,"Server handshake complete.");return this._handshakeResolver(),s}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if((!this.connection.features||!this.connection.features.inherentKeepAlive)&&(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),this._pingServerHandle===void 0)){let e=this._nextKeepAlive-new Date().getTime();e<0&&(e=0),this._pingServerHandle=setTimeout(()=>v(this,null,function*(){if(this._connectionState===Se.Connected)try{yield this._sendMessage(this._cachedPingMessage)}catch(n){this._cleanupPingTimer()}}),e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}_invokeClientMethod(e){return v(this,null,function*(){const n=e.target.toLowerCase(),s=this._methods[n];if(!s){this._logger.log(p.Warning,`No client method with the name '${n}' found.`),e.invocationId&&(this._logger.log(p.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),yield this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)));return}const i=s.slice(),o=!!e.invocationId;let r,c,a;for(const d of i)try{const u=r;r=yield d.apply(this,e.arguments),o&&r&&u&&(this._logger.log(p.Error,`Multiple results provided for '${n}'. Sending error to server.`),a=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),c=void 0}catch(u){c=u,this._logger.log(p.Error,`A callback for the method '${n}' threw error '${u}'.`)}a?yield this._sendWithProtocol(a):o?(c?a=this._createCompletionMessage(e.invocationId,`${c}`,null):r!==void 0?a=this._createCompletionMessage(e.invocationId,null,r):(this._logger.log(p.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),a=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),yield this._sendWithProtocol(a)):r&&this._logger.log(p.Error,`Result given for '${n}' method but server is not expecting a result.`)})}_connectionClosed(e){this._logger.log(p.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new Ge("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===Se.Disconnecting?this._completeClose(e):this._connectionState===Se.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===Se.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=Se.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(e!=null?e:new Error("Connection closed.")),this._messageBuffer=void 0),Ie.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(n=>n.apply(this,[e]))}catch(n){this._logger.log(p.Error,`An onclose callback called with error '${e}' threw error '${n}'.`)}}}_reconnect(e){return v(this,null,function*(){const n=Date.now();let s=0,i=e!==void 0?e:new Error("Attempting to reconnect due to a unknown error."),o=this._getNextRetryDelay(s++,0,i);if(o===null){this._logger.log(p.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),this._completeClose(e);return}if(this._connectionState=Se.Reconnecting,e?this._logger.log(p.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(p.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(r=>r.apply(this,[e]))}catch(r){this._logger.log(p.Error,`An onreconnecting callback called with error '${e}' threw error '${r}'.`)}if(this._connectionState!==Se.Reconnecting){this._logger.log(p.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.");return}}for(;o!==null;){if(this._logger.log(p.Information,`Reconnect attempt number ${s} will start in ${o} ms.`),yield new Promise(r=>{this._reconnectDelayHandle=setTimeout(r,o)}),this._reconnectDelayHandle=void 0,this._connectionState!==Se.Reconnecting){this._logger.log(p.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");return}try{if(yield this._startInternal(),this._connectionState=Se.Connected,this._logger.log(p.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(r=>r.apply(this,[this.connection.connectionId]))}catch(r){this._logger.log(p.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${r}'.`)}return}catch(r){if(this._logger.log(p.Information,`Reconnect attempt failed because of error '${r}'.`),this._connectionState!==Se.Reconnecting){this._logger.log(p.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),this._connectionState===Se.Disconnecting&&this._completeClose();return}i=r instanceof Error?r:new Error(r.toString()),o=this._getNextRetryDelay(s++,Date.now()-n,i)}}this._logger.log(p.Information,`Reconnect retries have been exhausted after ${Date.now()-n} ms and ${s} failed attempts. Connection disconnecting.`),this._completeClose()})}_getNextRetryDelay(e,n,s){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:n,previousRetryCount:e,retryReason:s})}catch(i){return this._logger.log(p.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${n}) threw error '${i}'.`),null}}_cancelCallbacksWithError(e){const n=this._callbacks;this._callbacks={},Object.keys(n).forEach(s=>{const i=n[s];try{i(null,e)}catch(o){this._logger.log(p.Error,`Stream 'error' callback called with '${e}' threw error: ${yn(o)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,n,s,i){if(s)return i.length!==0?{arguments:n,streamIds:i,target:e,type:Y.Invocation}:{arguments:n,target:e,type:Y.Invocation};{const o=this._invocationId;return this._invocationId++,i.length!==0?{arguments:n,invocationId:o.toString(),streamIds:i,target:e,type:Y.Invocation}:{arguments:n,invocationId:o.toString(),target:e,type:Y.Invocation}}}_launchStreams(e,n){if(e.length!==0){n||(n=Promise.resolve());for(const s in e)e[s].subscribe({complete:()=>{n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(s)))},error:i=>{let o;i instanceof Error?o=i.message:i&&i.toString?o=i.toString():o="Unknown error",n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(s,o)))},next:i=>{n=n.then(()=>this._sendWithProtocol(this._createStreamItemMessage(s,i)))}})}}_replaceStreamingParams(e){const n=[],s=[];for(let i=0;i<e.length;i++){const o=e[i];if(this._isObservable(o)){const r=this._invocationId;this._invocationId++,n[r]=o,s.push(r.toString()),e.splice(i,1)}}return[n,s]}_isObservable(e){return e&&e.subscribe&&typeof e.subscribe=="function"}_createStreamInvocation(e,n,s){const i=this._invocationId;return this._invocationId++,s.length!==0?{arguments:n,invocationId:i.toString(),streamIds:s,target:e,type:Y.StreamInvocation}:{arguments:n,invocationId:i.toString(),target:e,type:Y.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:Y.CancelInvocation}}_createStreamItemMessage(e,n){return{invocationId:e,item:n,type:Y.StreamItem}}_createCompletionMessage(e,n,s){return n?{error:n,invocationId:e,type:Y.Completion}:{invocationId:e,result:s,type:Y.Completion}}_createCloseMessage(){return{type:Y.Close}}}const Uo=[0,2e3,1e4,3e4,null];class Kn{constructor(e){this._retryDelays=e!==void 0?[...e,null]:Uo}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class gt{}gt.Authorization="Authorization",gt.Cookie="Cookie";class jo extends en{constructor(e,n){super(),this._innerClient=e,this._accessTokenFactory=n}send(e){return v(this,null,function*(){let n=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(n=!1,this._accessToken=yield this._accessTokenFactory()),this._setAuthorizationHeader(e);const s=yield this._innerClient.send(e);return n&&s.statusCode===401&&this._accessTokenFactory?(this._accessToken=yield this._accessTokenFactory(),this._setAuthorizationHeader(e),yield this._innerClient.send(e)):s})}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[gt.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[gt.Authorization]&&delete e.headers[gt.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}}var De;(function(t){t[t.None=0]="None",t[t.WebSockets=1]="WebSockets",t[t.ServerSentEvents=2]="ServerSentEvents",t[t.LongPolling=4]="LongPolling"})(De||(De={}));var Oe;(function(t){t[t.Text=1]="Text",t[t.Binary=2]="Binary"})(Oe||(Oe={}));let zo=class{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}};class Jn{get pollAborted(){return this._pollAbort.aborted}constructor(e,n,s){this._httpClient=e,this._logger=n,this._pollAbort=new zo,this._options=s,this._running=!1,this.onreceive=null,this.onclose=null}connect(e,n){return v(this,null,function*(){if(Re.isRequired(e,"url"),Re.isRequired(n,"transferFormat"),Re.isIn(n,Oe,"transferFormat"),this._url=e,this._logger.log(p.Trace,"(LongPolling transport) Connecting."),n===Oe.Binary&&typeof XMLHttpRequest!="undefined"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[s,i]=It(),o=j({[s]:i},this._options.headers),r={abortSignal:this._pollAbort.signal,headers:o,timeout:1e5,withCredentials:this._options.withCredentials};n===Oe.Binary&&(r.responseType="arraybuffer");const c=`${e}&_=${Date.now()}`;this._logger.log(p.Trace,`(LongPolling transport) polling: ${c}.`);const a=yield this._httpClient.get(c,r);a.statusCode!==200?(this._logger.log(p.Error,`(LongPolling transport) Unexpected response code: ${a.statusCode}.`),this._closeError=new ht(a.statusText||"",a.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,r)})}_poll(e,n){return v(this,null,function*(){try{for(;this._running;)try{const s=`${e}&_=${Date.now()}`;this._logger.log(p.Trace,`(LongPolling transport) polling: ${s}.`);const i=yield this._httpClient.get(s,n);i.statusCode===204?(this._logger.log(p.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):i.statusCode!==200?(this._logger.log(p.Error,`(LongPolling transport) Unexpected response code: ${i.statusCode}.`),this._closeError=new ht(i.statusText||"",i.statusCode),this._running=!1):i.content?(this._logger.log(p.Trace,`(LongPolling transport) data received. ${Ft(i.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(i.content)):this._logger.log(p.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(s){this._running?s instanceof wn?this._logger.log(p.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=s,this._running=!1):this._logger.log(p.Trace,`(LongPolling transport) Poll errored after shutdown: ${s.message}`)}}finally{this._logger.log(p.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}})}send(e){return v(this,null,function*(){return this._running?Qn(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return v(this,null,function*(){this._logger.log(p.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{yield this._receiving,this._logger.log(p.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[n,s]=It();e[n]=s;const i={headers:j(j({},e),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials};let o;try{yield this._httpClient.delete(this._url,i)}catch(r){o=r}o?o instanceof ht&&(o.statusCode===404?this._logger.log(p.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(p.Trace,`(LongPolling transport) Error sending a DELETE request: ${o}`)):this._logger.log(p.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(p.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}})}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(p.Trace,e),this.onclose(this._closeError)}}}class Vo{constructor(e,n,s,i){this._httpClient=e,this._accessToken=n,this._logger=s,this._options=i,this.onreceive=null,this.onclose=null}connect(e,n){return v(this,null,function*(){return Re.isRequired(e,"url"),Re.isRequired(n,"transferFormat"),Re.isIn(n,Oe,"transferFormat"),this._logger.log(p.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((s,i)=>{let o=!1;if(n!==Oe.Text){i(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));return}let r;if(Ie.isBrowser||Ie.isWebWorker)r=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const c=this._httpClient.getCookieString(e),a={};a.Cookie=c;const[d,u]=It();a[d]=u,r=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:j(j({},a),this._options.headers)})}try{r.onmessage=c=>{if(this.onreceive)try{this._logger.log(p.Trace,`(SSE transport) data received. ${Ft(c.data,this._options.logMessageContent)}.`),this.onreceive(c.data)}catch(a){this._close(a);return}},r.onerror=c=>{o?this._close():i(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},r.onopen=()=>{this._logger.log(p.Information,`SSE connected to ${this._url}`),this._eventSource=r,o=!0,s()}}catch(c){i(c);return}})})}send(e){return v(this,null,function*(){return this._eventSource?Qn(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class Wo{constructor(e,n,s,i,o,r){this._logger=s,this._accessTokenFactory=n,this._logMessageContent=i,this._webSocketConstructor=o,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=r}connect(e,n){return v(this,null,function*(){Re.isRequired(e,"url"),Re.isRequired(n,"transferFormat"),Re.isIn(n,Oe,"transferFormat"),this._logger.log(p.Trace,"(WebSockets transport) Connecting.");let s;return this._accessTokenFactory&&(s=yield this._accessTokenFactory()),new Promise((i,o)=>{e=e.replace(/^http/,"ws");let r;const c=this._httpClient.getCookieString(e);let a=!1;if(Ie.isNode||Ie.isReactNative){const d={},[u,f]=It();d[u]=f,s&&(d[gt.Authorization]=`Bearer ${s}`),c&&(d[gt.Cookie]=c),r=new this._webSocketConstructor(e,void 0,{headers:j(j({},d),this._headers)})}else s&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(s)}`);r||(r=new this._webSocketConstructor(e)),n===Oe.Binary&&(r.binaryType="arraybuffer"),r.onopen=d=>{this._logger.log(p.Information,`WebSocket connected to ${e}.`),this._webSocket=r,a=!0,i()},r.onerror=d=>{let u=null;typeof ErrorEvent!="undefined"&&d instanceof ErrorEvent?u=d.error:u="There was an error with the transport",this._logger.log(p.Information,`(WebSockets transport) ${u}.`)},r.onmessage=d=>{if(this._logger.log(p.Trace,`(WebSockets transport) data received. ${Ft(d.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(d.data)}catch(u){this._close(u);return}},r.onclose=d=>{if(a)this._close(d);else{let u=null;typeof ErrorEvent!="undefined"&&d instanceof ErrorEvent?u=d.error:u="WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",o(new Error(u))}}})})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(p.Trace,`(WebSockets transport) sending data. ${Ft(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(p.Trace,"(WebSockets transport) socket closed."),this.onclose&&(this._isCloseEvent(e)&&(e.wasClean===!1||e.code!==1e3)?this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)):e instanceof Error?this.onclose(e):this.onclose())}_isCloseEvent(e){return e&&typeof e.wasClean=="boolean"&&typeof e.code=="number"}}const es=100;class qo{constructor(e,n={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,Re.isRequired(e,"url"),this._logger=Ao(n.logger),this.baseUrl=this._resolveUrl(e),n=n||{},n.logMessageContent=n.logMessageContent===void 0?!1:n.logMessageContent,typeof n.withCredentials=="boolean"||n.withCredentials===void 0)n.withCredentials=n.withCredentials===void 0?!0:n.withCredentials;else throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");n.timeout=n.timeout===void 0?100*1e3:n.timeout;let s=null,i=null;if(Ie.isNode&&typeof require!="undefined"){const o=typeof __webpack_require__=="function"?__non_webpack_require__:require;s=o("ws"),i=o("eventsource")}!Ie.isNode&&typeof WebSocket!="undefined"&&!n.WebSocket?n.WebSocket=WebSocket:Ie.isNode&&!n.WebSocket&&s&&(n.WebSocket=s),!Ie.isNode&&typeof EventSource!="undefined"&&!n.EventSource?n.EventSource=EventSource:Ie.isNode&&!n.EventSource&&typeof i!="undefined"&&(n.EventSource=i),this._httpClient=new jo(n.httpClient||new Po(this._logger),n.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=n,this.onreceive=null,this.onclose=null}start(e){return v(this,null,function*(){if(e=e||Oe.Binary,Re.isIn(e,Oe,"transferFormat"),this._logger.log(p.Debug,`Starting connection with transfer format '${Oe[e]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),yield this._startInternalPromise,this._connectionState==="Disconnecting"){const n="Failed to start the HttpConnection before stop() was called.";return this._logger.log(p.Error,n),yield this._stopPromise,Promise.reject(new Ge(n))}else if(this._connectionState!=="Connected"){const n="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(p.Error,n),Promise.reject(new Ge(n))}this._connectionStarted=!0})}send(e){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new _n(this.transport)),this._sendQueue.send(e))}stop(e){return v(this,null,function*(){if(this._connectionState==="Disconnected")return this._logger.log(p.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve();if(this._connectionState==="Disconnecting")return this._logger.log(p.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;this._connectionState="Disconnecting",this._stopPromise=new Promise(n=>{this._stopPromiseResolver=n}),yield this._stopInternal(e),yield this._stopPromise})}_stopInternal(e){return v(this,null,function*(){this._stopError=e;try{yield this._startInternalPromise}catch(n){}if(this.transport){try{yield this.transport.stop()}catch(n){this._logger.log(p.Error,`HttpConnection.transport.stop() threw error '${n}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(p.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")})}_startInternal(e){return v(this,null,function*(){let n=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation)if(this._options.transport===De.WebSockets)this.transport=this._constructTransport(De.WebSockets),yield this._startTransport(n,e);else throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");else{let s=null,i=0;do{if(s=yield this._getNegotiationResponse(n),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new Ge("The connection was stopped during negotiation.");if(s.error)throw new Error(s.error);if(s.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(s.url&&(n=s.url),s.accessToken){const o=s.accessToken;this._accessTokenFactory=()=>o,this._httpClient._accessToken=o,this._httpClient._accessTokenFactory=void 0}i++}while(s.url&&i<es);if(i===es&&s.url)throw new Error("Negotiate redirection limit exceeded.");yield this._createTransport(n,this._options.transport,s,e)}this.transport instanceof Jn&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(p.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(s){return this._logger.log(p.Error,"Failed to start the connection: "+s),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(s)}})}_getNegotiationResponse(e){return v(this,null,function*(){const n={},[s,i]=It();n[s]=i;const o=this._resolveNegotiateUrl(e);this._logger.log(p.Debug,`Sending negotiation request: ${o}.`);try{const r=yield this._httpClient.post(o,{content:"",headers:j(j({},n),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(r.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${r.statusCode}'`));const c=JSON.parse(r.content);return(!c.negotiateVersion||c.negotiateVersion<1)&&(c.connectionToken=c.connectionId),c.useStatefulReconnect&&this._options._useStatefulReconnect!==!0?Promise.reject(new Yn("Client didn't negotiate Stateful Reconnect but the server did.")):c}catch(r){let c="Failed to complete negotiation with the server: "+r;return r instanceof ht&&r.statusCode===404&&(c=c+" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(p.Error,c),Promise.reject(new Yn(c))}})}_createConnectUrl(e,n){return n?e+(e.indexOf("?")===-1?"?":"&")+`id=${n}`:e}_createTransport(e,n,s,i){return v(this,null,function*(){let o=this._createConnectUrl(e,s.connectionToken);if(this._isITransport(n)){this._logger.log(p.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=n,yield this._startTransport(o,i),this.connectionId=s.connectionId;return}const r=[],c=s.availableTransports||[];let a=s;for(const d of c){const u=this._resolveTransportOrError(d,n,i,(a==null?void 0:a.useStatefulReconnect)===!0);if(u instanceof Error)r.push(`${d.transport} failed:`),r.push(u);else if(this._isITransport(u)){if(this.transport=u,!a){try{a=yield this._getNegotiationResponse(e)}catch(f){return Promise.reject(f)}o=this._createConnectUrl(e,a.connectionToken)}try{yield this._startTransport(o,i),this.connectionId=a.connectionId;return}catch(f){if(this._logger.log(p.Error,`Failed to start the transport '${d.transport}': ${f}`),a=void 0,r.push(new yo(`${d.transport} failed: ${f}`,De[d.transport])),this._connectionState!=="Connecting"){const N="Failed to select transport before stop() was called.";return this._logger.log(p.Debug,N),Promise.reject(new Ge(N))}}}}return r.length>0?Promise.reject(new bo(`Unable to connect to the server with any of the available transports. ${r.join(" ")}`,r)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))})}_constructTransport(e){switch(e){case De.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new Wo(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case De.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Vo(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case De.LongPolling:return new Jn(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,n){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=s=>v(this,null,function*(){let i=!1;if(this.features.reconnect)try{this.features.disconnected(),yield this.transport.connect(e,n),yield this.features.resend()}catch(o){i=!0}else{this._stopConnection(s);return}i&&this._stopConnection(s)}):this.transport.onclose=s=>this._stopConnection(s),this.transport.connect(e,n)}_resolveTransportOrError(e,n,s,i){const o=De[e.transport];if(o==null)return this._logger.log(p.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(Zo(n,o))if(e.transferFormats.map(c=>Oe[c]).indexOf(s)>=0){if(o===De.WebSockets&&!this._options.WebSocket||o===De.ServerSentEvents&&!this._options.EventSource)return this._logger.log(p.Debug,`Skipping transport '${De[o]}' because it is not supported in your environment.'`),new vo(`'${De[o]}' is not supported in your environment.`,o);this._logger.log(p.Debug,`Selecting transport '${De[o]}'.`);try{return this.features.reconnect=o===De.WebSockets?i:void 0,this._constructTransport(o)}catch(c){return c}}else return this._logger.log(p.Debug,`Skipping transport '${De[o]}' because it does not support the requested transfer format '${Oe[s]}'.`),new Error(`'${De[o]}' does not support ${Oe[s]}.`);else return this._logger.log(p.Debug,`Skipping transport '${De[o]}' because it was disabled by the client.`),new wo(`'${De[o]}' is disabled by the client.`,o)}_isITransport(e){return e&&typeof e=="object"&&"connect"in e}_stopConnection(e){if(this._logger.log(p.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,this._connectionState==="Disconnected"){this._logger.log(p.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`);return}if(this._connectionState==="Connecting")throw this._logger.log(p.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),e?this._logger.log(p.Error,`Connection disconnected with error '${e}'.`):this._logger.log(p.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(n=>{this._logger.log(p.Error,`TransportSendQueue.stop() threw error '${n}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(n){this._logger.log(p.Error,`HttpConnection.onclose(${e}) threw error '${n}'.`)}}}_resolveUrl(e){if(e.lastIndexOf("https://",0)===0||e.lastIndexOf("http://",0)===0)return e;if(!Ie.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const n=window.document.createElement("a");return n.href=e,this._logger.log(p.Information,`Normalizing '${e}' to '${n.href}'.`),n.href}_resolveNegotiateUrl(e){const n=new URL(e);n.pathname.endsWith("/")?n.pathname+="negotiate":n.pathname+="/negotiate";const s=new URLSearchParams(n.searchParams);return s.has("negotiateVersion")||s.append("negotiateVersion",this._negotiateVersion.toString()),s.has("useStatefulReconnect")?s.get("useStatefulReconnect")==="true"&&(this._options._useStatefulReconnect=!0):this._options._useStatefulReconnect===!0&&s.append("useStatefulReconnect","true"),n.search=s.toString(),n.toString()}}function Zo(t,e){return!t||(e&t)!==0}class _n{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new nn,this._transportResult=new nn,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new nn),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}_sendLoop(){return v(this,null,function*(){for(;;){if(yield this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new nn;const e=this._transportResult;this._transportResult=void 0;const n=typeof this._buffer[0]=="string"?this._buffer.join(""):_n._concatBuffers(this._buffer);this._buffer.length=0;try{yield this._transport.send(n),e.resolve()}catch(s){e.reject(s)}}})}static _concatBuffers(e){const n=e.map(o=>o.byteLength).reduce((o,r)=>o+r),s=new Uint8Array(n);let i=0;for(const o of e)s.set(new Uint8Array(o),i),i+=o.byteLength;return s.buffer}}class nn{constructor(){this.promise=new Promise((e,n)=>[this._resolver,this._rejecter]=[e,n])}resolve(){this._resolver()}reject(e){this._rejecter(e)}}const Yo="json";class Xo{constructor(){this.name=Yo,this.version=2,this.transferFormat=Oe.Text}parseMessages(e,n){if(typeof e!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];n===null&&(n=Ot.instance);const s=We.parse(e),i=[];for(const o of s){const r=JSON.parse(o);if(typeof r.type!="number")throw new Error("Invalid payload.");switch(r.type){case Y.Invocation:this._isInvocationMessage(r);break;case Y.StreamItem:this._isStreamItemMessage(r);break;case Y.Completion:this._isCompletionMessage(r);break;case Y.Ping:break;case Y.Close:break;case Y.Ack:this._isAckMessage(r);break;case Y.Sequence:this._isSequenceMessage(r);break;default:n.log(p.Information,"Unknown message type '"+r.type+"' ignored.");continue}i.push(r)}return i}writeMessage(e){return We.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),e.invocationId!==void 0&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),e.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_isAckMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(e,n){if(typeof e!="string"||e==="")throw new Error(n)}}const Qo={trace:p.Trace,debug:p.Debug,info:p.Information,information:p.Information,warn:p.Warning,warning:p.Warning,error:p.Error,critical:p.Critical,none:p.None};function Go(t){const e=Qo[t.toLowerCase()];if(typeof e!="undefined")return e;throw new Error(`Unknown log level: ${t}`)}class Ko{configureLogging(e){if(Re.isRequired(e,"logging"),Jo(e))this.logger=e;else if(typeof e=="string"){const n=Go(e);this.logger=new tn(n)}else this.logger=new tn(e);return this}withUrl(e,n){return Re.isRequired(e,"url"),Re.isNotEmpty(e,"url"),this.url=e,typeof n=="object"?this.httpConnectionOptions=j(j({},this.httpConnectionOptions),n):this.httpConnectionOptions=oe(j({},this.httpConnectionOptions),{transport:n}),this}withHubProtocol(e){return Re.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new Kn(e):this.reconnectPolicy=e:this.reconnectPolicy=new Kn,this}withServerTimeout(e){return Re.isRequired(e,"milliseconds"),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return Re.isRequired(e,"milliseconds"),this._keepAliveIntervalInMilliseconds=e,this}withStatefulReconnect(e){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=e==null?void 0:e.bufferSize,this}build(){const e=this.httpConnectionOptions||{};if(e.logger===void 0&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const n=new qo(this.url,e);return bn.create(n,this.logger||Ot.instance,this.protocol||new Xo,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}function Jo(t){return t.log!==void 0}function Be(t,e={}){var c;const{popupRequestInfo:n}=window;t=$t(t);const s=(c=n==null?void 0:n.credentialType)==null?void 0:c.toUpperCase(),i=n==null?void 0:n.accessToken,r=j(j({},{method:"GET",headers:{}}),e);switch(r.body&&typeof r.body=="object"&&(r.body instanceof FormData?r.headers=oe(j({},r.headers),{"Content-Type":"multipart/form-data"}):(r.headers=oe(j({},r.headers),{"Content-Type":"application/json"}),r.body=JSON.stringify(r.body))),s){case"COOKIE":r.credentials="include";break;case"QUERY":break;default:i&&(r.headers=oe(j({},r.headers),{Authorization:`Bearer ${i}`}));break}return fetch(t,r).then(a=>{if(!a.ok){console.error(`HTTP error! status: ${a.status}`);return}return a.json()}).then(a=>{if(a&&a.code){if(a.code!=="0"){console.error(`API error! code: ${a.code}, message: ${a.message}`);return}return a.data}return a}).catch(a=>{console.error("Error fetching data:",a)})}function Nt(t,e){if(!e)return t;let n="";for(let s in e){const i=e[s];i!=null&&(n.length>0&&(n+="&"),n+=`${encodeURIComponent(s)}=${encodeURIComponent(i)}`)}return t.indexOf("?")===-1?t+="?"+n:t+="&"+n,t}function ts(t){return v(this,null,function*(){if(!t||t.length===0)return[];const s=yield Be("user/batch/get",{method:"POST",body:{ids:t}});return!s||!Array.isArray(s)?[]:s.map(i=>({id:i.id,username:i.username,fullName:i.fullName,avatarUrl:i.avatarUrl}))})}const Ut=window,er=Ut.indexedDB||Ut.mozIndexedDB||Ut.webkitIndexedDB||Ut.msIndexedDB||Ut.shimIndexedDB,tr="chatPopupDb",nr=1,sn="users";function sr(t){if(!t.objectStoreNames.contains(sn)){const e=t.createObjectStore(sn,{keyPath:"id",autoIncrement:!1});["username","fullName","avatarUrl"].forEach(n=>e.createIndex(n,n,{unique:!1}))}}let on;function ir(){return new Promise((t,e)=>{if(on)t(on);else{const n=er.open(tr,nr);n.onerror=s=>e(s.target.error),n.onsuccess=s=>{on=s.target.result,t(on)},n.onupgradeneeded=s=>{const i=s.target.result;sr(i)}}})}function ns(t,e){return v(this,null,function*(){const n=yield ir();return n?n.transaction(sn,t,e).objectStore(sn):void 0})}function or(t){return new Promise((e,n)=>v(null,null,function*(){if(t==="SYSTEM"){e({id:"SYSTEM",username:"system",fullName:"Hệ thống"});return}const s=yield ns("readonly");if(!s){n(new Error("User object store not found"));return}const i=s.get(t);i.onsuccess=o=>v(null,null,function*(){const r=o.target.result;e(r)}),i.onerror=o=>n(o.target.error)}))}function rr(t){return v(this,null,function*(){const e=yield ns("readwrite");if(!e)throw new Error("User object store not found");return new Promise((n,s)=>{const i=e.put(t);i.onsuccess=o=>n(o.target.result),i.onerror=o=>s(o.target.error)})})}function ar(t){return v(this,null,function*(){const e=t.map(s=>or(s));return(yield Promise.all(e)).filter(s=>s!==void 0)})}function kt(t){return v(this,null,function*(){const e=Array.from(new Set(t.filter(r=>typeof r=="string"&&r.length>0))),n=yield ar(e),s=e.filter(r=>!n.some(c=>c.id===r)),i=yield ts(s);yield Promise.all(i.map(r=>rr(r)));const o=[...n,...i];return new Map(o.map(r=>[r.id,r]))})}function rn(t){return{id:t.id||t.conversationId,name:t.name,lastMessage:t.lastMessage,updatedAt:t.updatedAt||t.dateTime,type:t.type,membersCount:t.membersCount,status:t.status,isPinned:t.isPinned,isRead:t.isRead,traceId:t.traceId}}function rt(t,e){if(!t)return;let n;e||t.quotedMessage&&(n=rt(t.quotedMessage,!0));const s=t.body;return s&&Array.isArray(s.files)&&(s.files=s.files.map(i=>{const o=i.thumbId?$t(`file/${i.thumbId}`):void 0,r=$t(`file/${i.id||i.fileId}`);return{id:i.id||i.fileId,thumbId:i.thumbId,url:r,name:i.name,contentType:i.contentType,thumbUrl:o}})),{id:t.id||t.messageId,conversationId:t.conversationId,senderId:t.senderId||t.editedBy,sender:t.sender,body:s,sentAt:t.sentAt,deleted:t.deleted,edited:t.edited,mentions:t.mentions,deletedFor:t.deletedFor,quotedMessage:n,traceId:t.traceId}}function an(t){return v(this,null,function*(){const e=t.lastMessage?[t.lastMessage.senderId]:[],n=yield kt(e);if(t.lastMessage){const s=n.get(t.lastMessage.senderId);s&&(t.lastMessage.sender=s,t.lastMessage.sentAt=t.lastMessage.sentAt?new Date(t.lastMessage.sentAt):new Date)}return{id:t.id,name:t.name,lastMessage:t.lastMessage,updatedAt:new Date(t.updatedAt),type:t.type,membersCount:t.membersCount,status:t.status,isPinned:t.isPinned,isRead:t.isRead,traceId:t.traceId}})}function Mt(t,e=new Set){return t.senderId&&e.add(t.senderId),t.quotedMessage&&Mt(t.quotedMessage,e),e}function Et(t,e){const n=t.sender||e.get(t.senderId),s=t.quotedMessage?Et(t.quotedMessage,e):void 0;return t.sender=n,s&&(t.quotedMessage=s),t}function Tt(t){if(!t)return;const e=t.quotedMessage?Tt(t.quotedMessage):void 0,n={id:t.id,conversationId:t.conversationId,sender:t.sender,body:t.body,sentAt:t.sentAt?new Date(t.sentAt):new Date,deleted:t.deleted,edited:t.edited,mentions:t.mentions,deletedFor:t.deletedFor,traceId:t.traceId};return e&&(n.quotedMessage=e),n}function ss(t,e){var c;if(!t)return console.error("URL base is not defined."),"";e=e?e.startsWith("/")?e.slice(1):e:"";let n=t.endsWith("/")?`${t}${e}`:`${t}/${e}`;n.endsWith("/")&&(n=n.slice(0,-1));const{popupRequestInfo:s}=window,i=(c=s==null?void 0:s.credentialType)==null?void 0:c.toUpperCase(),o=s==null?void 0:s.credentialName,r=s==null?void 0:s.accessToken;switch(i){case"COOKIE":const a=new URL(n);a.searchParams.append("credentialType",i),a.searchParams.append("credentialName",o||""),n=a.toString();break;case"QUERY":if(r){const d=new URL(n);d.searchParams.append("access_token",r),n=d.toString()}break}return n}function $t(t){const{popupRequestInfo:e}=window,n=e==null?void 0:e.apiUrlBase;return ss(n,t)}function cr(t){const{popupRequestInfo:e}=window,n=t||(e==null?void 0:e.hubUrlBase);return ss(n)}function lr(t){var i;let e=cr(t);const{popupRequestInfo:n}=window,s=(i=n==null?void 0:n.credentialType)==null?void 0:i.toUpperCase();if(s!="COOKIE"&&s!="QUERY"){const o=n==null?void 0:n.accessToken;if(o){const r=new URL(e);r.searchParams.append("access_token",o),e=r.toString()}}return new Ko().withUrl(e).configureLogging(p.Information).withAutomaticReconnect().build()}const Sn=window;Sn.messagesCache={};function dr(t,e,n,s){return v(this,null,function*(){const i=Nt(`message/conversation/${t}/user`,{direction:e,messageId:n,top:s}),o=yield Be(i);return!o||!Array.isArray(o)?[]:o.filter(r=>!!r).map(r=>rt(r))})}function ur(t){return v(this,null,function*(){const e="message";let n;t.quotedMessage&&(n=t.quotedMessage.id,n&&(Sn.messagesCache[n]=t.quotedMessage));const s={conversationId:t.conversationId,body:t.body,quotedId:n,traceId:t.traceId},i=yield Be(e,{method:"POST",body:s});return i.quotedMessage=t.quotedMessage,rt(i)})}function hr(t){return v(this,null,function*(){if(!t||!t.id)return;const e=`message/${t.id}`;let n;t.quotedMessage&&(n=t.quotedMessage.id,n&&(Sn.messagesCache[n]=t.quotedMessage));const s={body:t.body,quotedId:n,mentions:t.mentions},i=yield Be(e,{method:"POST",body:s});return i.quotedMessage=t.quotedMessage,rt(i)})}function fr(t,e){return v(this,null,function*(){if(!t)return!1;e||(e="Recall");const n=`message/${t}/delete`;return!!(yield Be(n,{method:"POST",body:{type:e}}))})}function is(t){return v(this,null,function*(){if(!t)return;const e=`message/${t}`,n=yield Be(e);if(n)return rt(n)})}function gr(t){return v(this,null,function*(){if(!t||t.length===0)return[];const s=yield Be("message/batch/get",{method:"POST",body:{ids:t}});return!s||!Array.isArray(s)?[]:s.map(i=>rt(i))})}function pr(t,e,n,s){return v(this,null,function*(){var c;const i=Nt("aggregate/search",{conversationId:t,keyword:e,from:n,top:s,type:"MESSAGE"}),r=(c=(yield Be(i)).filter(a=>a.type==="MESSAGE").at(0))==null?void 0:c.items;return r?r.map(a=>rt(a)):[]})}const cn=window;function Cr(t,e){return v(this,null,function*(){if(!e||!t)return;if(!t.quotedMessage&&t.quotedId){const c=cn.messagesCache[t.quotedId];c?(t.quotedMessage=c,delete cn.messagesCache[t.quotedId]):t.quotedMessage=yield is(t.quotedId)}const n=rt(t);if(!n)return;const s=Mt(n),i=yield kt(Array.from(s)),o=Et(n,i),r=Tt(o);e(r)})}function mr(t,e){return v(this,null,function*(){if(!e||!t)return;const n=rn(t);if(!n)return;const s=yield an(n);e(s)})}function vr(t,e){if(!e||!t)return;const{conversationId:n,name:s}=t;!n||!s||e(n,s)}function wr(t,e){if(!e||!t)return;const{conversationId:n}=t;n&&e(n)}function yr(t,e){return v(this,null,function*(){if(!e||!t)return;if(!t.quotedMessage&&t.quotedId){const c=cn.messagesCache[t.quotedId];c?(t.quotedMessage=c,delete cn.messagesCache[t.quotedId]):t.quotedMessage=yield is(t.quotedId)}const n=rt(t);if(!n)return;const s=Mt(n),i=yield kt(Array.from(s)),o=Et(n,i),r=Tt(o);e(r)})}function br(t,e){if(!e||!t)return;const{messageId:n,conversationId:s,type:i,deletedBy:o}=t;!n||!s||e({messageId:n,conversationId:s,deleteType:i||"Recall",deletedBy:o||""})}let ze;function _r(t){return ze&&ze.stop(),ze=lr(t),ze?(ze.on("UserStatusChanged",n=>console.log("UserStatusChanged",n)),{onConnected(n){ze.on("Connected",n)},onMessageSent(n){ze.on("MessageSent",s=>v(null,null,function*(){yield Cr(s,n)}))},onMessageEdited(n){ze.on("MessageEdited",s=>v(null,null,function*(){yield yr(s,n)}))},onMessageDeleted(n){ze.on("MessageDeleted",s=>{br(s,n)})},onConversationCreated(n){ze.on("ConversationCreated",s=>v(null,null,function*(){yield mr(s,n)}))},onConversationBasicInfoChanged(n){ze.on("ConversationBasicInfoChanged",s=>{vr(s,n)})},onConversationDeleted(n){ze.on("ConversationDeleted",s=>{wr(s,n)})},start:()=>ze.start(),stop:()=>ze.stop()}):void 0}function Sr(){return new Promise(t=>{t([{name:"Khiếu nại và hỗ trợ",description:"Tạo khiếu nại của khách hàng và được trợ giúp bởi hỗ trợ viên",conversationType:"HELP",icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABGCAYAAABbnhMrAAAAAXNSR0IArs4c6QAAG/hJREFUeF7tXHk8lNv/n2HGPggRcVEporihuvJttVaylW6khlJdKfuaJbJlK2QZVBSVdlFp0WZJkmgh5ep+lSWSyBIGv9fnMcd3cmds6d7++D2v1zTT85xzPue8z2f/nAce9//XdyGA/67eP7jzwMAACw6HY8XhcH14PL7/B5Ob0PD/OoCvXr0iNTY2ylVXV8s0NDRIf/z4Uby5uVmgvb19Sk9PDyesioWFhcrFxdXNx8fXws/P/1FYWPidpKTkWxERkYrffvutHI/H901o9ZPQ6V8BsLq6WuTevXuaJSUl/6mqqlJpaWmZ8enTJ1JXVxdwGw6PxwNo2Ad+DwwM4Pr7+3F9fX3YB+7x8PDgSCTSZ3Fx8VIFBYUiNTW13NmzZ9+SkZHpngRcxjzEPwpgTk7O0uvXr+vn5eWta2homAWgEAiEHlFR0XczZsx4Pn369LfAXSIiIvX8/Pyfubm5O9jY2Pp6enpYgSM/ffok8PHjx2m1tbWS1dXVc2tra+Wam5unwjisrKw4KSmpEi0trQs6OjqZ8+fPfz5mFL6j4T8CYHp6ul5mZqbp06dPdVpaWviFhITalZSUcuXk5O4vWrSoWEhIqGT+/Pkt413Hs2fPZlRWViqVlZWpFRYWrqipqVnQ1dWFExYWfquhoXFFV1c3ffny5Q/HO+542v9QAAsKChbGx8fvKSsrM/rw4QPXrFmz3q1cuTJ12bJlWatWrSoYz0RHa1tXV8f18OFDjRs3bqwvLCw0am1t5ebh4XlvZGR0ysTE5Mi8efPejTbGRJ7/EADBekZERLgeO3bM9suXLyK//P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8WHVFRURk8xPMvXz8VgIAFJCbu3Lyj9t93b+Xq6z9M7+ntIXBzcjfJzpF9M3f+3KJZs2Y1/suYfUP+pwPwZwJnLHP5P2JCPxnrY2whAAAAAElFTkSuQmCC"},{name:"Tư vấn đầu tư",description:"Tạo một cuộc hội thoại để bắt đầu nhận được các tư vấn đầu tư",botId:"BOT~rasaconnector",isDefault:!0,icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABZCAYAAACpHqNlAAAAAXNSR0IArs4c6QAAG71JREFUeF7tXAlYU0fXnpuQBAgCURFRqQvwsbhABUGgoihFoAhal7pUxaVaQVvr8nXRPvWrUpdafxcEra0VFVwQRRG1LqAoS63WBRcgAQSV1QbByBIg+f8zNxNuYoDEBfX7e5+HhyR3ljPvnG3OnBkK/fO8EALUi9SOjY3tW1paOlRGydhyOUtOIZlMJqfkzDZZlFzlu1ztvab+KblqnbZolFOUyjgoSo6/y+T07yy17/AbRckouZzV1M3cvMLCwiK/c+fOOY6Ojk/b6kv9vc4ALl669ItLly4uKyoq6lRWVobbY46X+VltXLrS1i7l5U0y1KlTJ9StW7eKvn37Jvv7+x9ydnY+1q9fP6k2BOgEoLGpSUF1VVUv0jCLzQaeo7/qxjTa0NY+ZeTAjZSSCYyMOyCHvn3zJk6cFL7o889/a4sIrQC0sbHpIxQJ7xjy+byamhoMFkePgxoaGhDSqoW2yHh977kcLmpqasJ/zKdLV3Pk5up2/Nvly0NdXV3vt0Rhm8PndzC6+/Tp038huZwFjXC4dIeyRrpDis1SEeHXB8Vz9ixTUdGIw+Hg8TQ2NeIGXQa5in5YtSrE19c3TaO+bqnbkJAQv13RuxIQQjwQVRailLNE9Jyenh5qbKQ7elsfLpeLJQnGxGaz8X+ilgDMhsYGZN61a9Xe3Xv83n///Uz1cWrkwKVffx24ft3aOLlcrs9isZAM2Ft1opR6g6k/mI2/DQaEVt30wJjjgDHDdyzWLAoBozjYO2THxsR49+vXr1RlnOqIRkdHDwidH5byVCLpiMALU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M/T32sF8HkIftPq/C/BcWIskM+NvgAAAABJRU5ErkJggg=="}])})}function Ar(t,e){return v(this,null,function*(){var a,d;const n=Nt("conversation/user/pinned",{top:t,type:e,ignoredFields:"members"}),s=Nt("conversation/user",{top:t,type:e,ignoredFields:"members"}),i=yield Promise.all([Be(n),Be(s)]);let o=(a=i[0])==null?void 0:a.items,r=(d=i[1])==null?void 0:d.items;return o||(o=[]),r||(r=[]),[...o,...r].map(u=>rn(u))})}function xr(t){return v(this,null,function*(){const e=`conversation/${t}?ignoredFields=members`,n=yield Be(e);if(n)return rn(n)})}function Ir(t){return v(this,null,function*(){const e=t.type?t.type:"BOT";let n="conversation";const s={name:t.name,traceId:t.traceId};switch(e){case"BOT":n+="/bot",s.botId=t.members?t.members.filter(f=>{var N;return(N=f.userId)==null?void 0:N.startsWith("BOT~")}).map(f=>f.userId)[0]:null;break;case"SURVEY":n+="/survey",s.botId=t.members?t.members.filter(f=>{var N;return(N=f.userId)==null?void 0:N.startsWith("BOT~")}).map(f=>f.userId)[0]:null;break;case"GROUP":n+="/group",s.memberIds=t.members?t.members.filter(f=>f.id!=="me").map(f=>f.userId):[];break;case"HELP":n+="/help";break}const i=yield Be(n,{method:"POST",body:s}),{conversationId:o,name:r,type:c,membersCount:a,updatedAt:d,traceId:u}=i;return{id:o,name:r,type:c,membersCount:a,updatedAt:d,traceId:u}})}function kr(t,e){return v(this,null,function*(){let n="conversation";return e?n+=`/${t}/pin`:n+=`/${t}/unpin`,yield Be(n,{method:"POST",body:{}}),!0})}function Mr(t,e){return v(this,null,function*(){const n=`conversation/${t}`;return yield Be(n,{method:"PATCH",body:{name:e}}),!0})}function Er(t){return v(this,null,function*(){const e=`conversation/${t}/delete`;return yield Be(e,{method:"POST",body:{}}),!0})}function Tr(t,e,n){return v(this,null,function*(){var c;const s=Nt("aggregate/search",{keyword:t,from:e,top:n,type:"CONVERSATION"}),o=(c=(yield Be(s)).filter(a=>a.type==="CONVERSATION").at(0))==null?void 0:c.items;if(!o)return[];const r=[...new Set(o.map(a=>a.lastMessageId))];if(r.length>0){const a=yield gr(r),d={};a.forEach(u=>{u&&(d[u.id]=u)}),o.forEach(u=>{u.lastMessageId&&(u.lastMessage=d[u.lastMessageId])})}return o.map(a=>rn(a))})}function $r(){return v(this,null,function*(){return yield Be("/survey/progress")})}function Rr(){return v(this,null,function*(){return yield Be("/survey/question-section")})}function Pr(t){return v(this,null,function*(){const e="survey/conversation",n={name:t.name,traceId:t.traceId,botId:t.members?t.members.filter(i=>{var o;return(o=i.userId)==null?void 0:o.startsWith("BOT~")}).map(i=>i.userId)[0]:null};return yield Be(e,{method:"POST",body:n})})}function Dr(t,e){return v(this,null,function*(){const n=yield Ar(t,e);return yield Promise.all(n.map(an))})}function Br(t){return v(this,null,function*(){const e=yield xr(t);return e?yield an(e):void 0})}function Hr(t,e,n){return v(this,null,function*(){const s=yield Tr(t,e,n);return yield Promise.all(s.map(an))})}function Lr(t){return v(this,null,function*(){const e=yield Ir(t);return{id:e.id,name:e.name,type:e.type,membersCount:e.membersCount,updatedAt:new Date(e.updatedAt)}})}function Or(t,e){return kr(t,e)}function Fr(t,e){return Mr(t,e)}function Nr(t){return Er(t)}function Ur(t){return v(this,null,function*(){return yield Pr(t)})}function jr(t,e){var a;if(!t)return;const{popupRequestInfo:n}=window,s=$t("file"),i=new XMLHttpRequest,o=(a=n==null?void 0:n.credentialType)==null?void 0:a.toUpperCase(),r=n==null?void 0:n.accessToken;switch(o){case"COOKIE":i.withCredentials=!0;break;case"QUERY":break;default:i.setRequestHeader("Authorization",`Bearer ${r}`);break}const c=new FormData;c.append("file",t),e&&(i.upload.onprogress=function(d){if(d.lengthComputable){const u=d.loaded/d.total*80;e({loaded:d.loaded,total:d.total,percent:u,status:"uploading"})}}),i.onload=function(){if(i.status===200){const d=JSON.parse(i.responseText);if(e){const u=d.thumbId?$t(`file/${d.thumbId}`):void 0,f=$t(`file/${d.fileId}`);e({loaded:d.size,total:d.size,percent:100,status:"done",httpCode:i.status,fileItem:{id:d.fileId,name:d.fileName,contentType:d.contentType,thumbId:d.thumbId,thumbUrl:u,url:f}})}}else e&&e({loaded:0,total:0,percent:0,status:"error",error:i.statusText,httpCode:i.status})},i.open("POST",s,!0),i.send(c),console.log(`------- Uploading file: ${t.name} to ${s}`)}function zr(t,e){jr(t,e)}function Vr(t,e,n,s){return v(this,null,function*(){const i=(yield dr(t,e,n,s)).filter(a=>!!a);if(!i||!Array.isArray(i))return[];const o=new Set;i.forEach(a=>Mt(a,o));const r=yield kt(Array.from(o));return i.map(a=>Et(a,r)).map(a=>Tt(a))})}function Wr(t){return v(this,null,function*(){const e=yield ur(t);if(!e)return;const n=Mt(e),s=yield kt(Array.from(n)),i=Et(e,s);return Tt(i)})}function qr(t){return v(this,null,function*(){return!!(yield hr(t))})}function Zr(t,e){return fr(t,e)}function Yr(t,e,n,s){return v(this,null,function*(){const i=yield pr(t,e,n,s);if(!i||!Array.isArray(i))return[];const o=new Set;i.forEach(a=>Mt(a,o));const r=yield kt(Array.from(o));return i.map(a=>Et(a,r)).map(a=>Tt(a))})}function Xr(t){return ts(t)}class Qr{constructor(e){Ce(this,"hubConnection");Ce(this,"onHubConnected",e=>{this.hubConnection.onConnected(n=>{window.currentUserId=n.userId,e(n)})});Ce(this,"onMessageSent",e=>{this.hubConnection.onMessageSent(n=>{n.conversationId=this.normalizeConvId(n.conversationId),this.normalizeSender(n.sender),e(n)})});Ce(this,"onMessageEdited",e=>{this.hubConnection.onMessageEdited(n=>{n.conversationId=this.normalizeConvId(n.conversationId),this.normalizeSender(n.sender),e(n)})});Ce(this,"onMessageDeleted",e=>{this.hubConnection.onMessageDeleted(e)});Ce(this,"onConversationCreated",e=>{this.hubConnection.onConversationCreated(n=>{this.normalizeConversation(n),e(n)})});Ce(this,"onConversationBasicInfoChanged",e=>{this.hubConnection.onConversationBasicInfoChanged((n,s)=>{n=this.normalizeConvId(n),e(n,s)})});Ce(this,"onConversationDeleted",e=>{this.hubConnection.onConversationDeleted(n=>{n=this.normalizeConvId(n),e(n)})});Ce(this,"getConversationAsync",e=>v(this,null,function*(){const n=this.denormalizeConvId(e),s=yield Br(n);if(s)return this.normalizeConversation(s),s}));Ce(this,"listConversationAsync",(e,n)=>v(this,null,function*(){const s=yield Dr(e,n);return s.forEach(i=>this.normalizeConversation(i)),s}));Ce(this,"searchConversationsAsync",(e,n,s)=>v(this,null,function*(){const i=yield Hr(e,n,s);return i.forEach(o=>this.normalizeConversation(o)),i}));Ce(this,"pinConversationAsync",(e,n)=>{const s=this.denormalizeConvId(e);return Or(s,n)});Ce(this,"createConversationAsync",e=>Lr(e));Ce(this,"updateConversationNameAsync",(e,n)=>{const s=this.denormalizeConvId(e);return Fr(s,n)});Ce(this,"deleteConversationAsync",e=>{const n=this.denormalizeConvId(e);return Nr(n)});Ce(this,"sendMessageAsync",e=>v(this,null,function*(){const n=j({},e);n.conversationId=this.denormalizeConvId(n.conversationId);const s=yield Wr(n);return this.normalizeSender(s.sender),s}));Ce(this,"listMessagesAsync",(e,n,s,i)=>v(this,null,function*(){const o=this.denormalizeConvId(e),r=yield Vr(o,n,s,i);return this.normalizeMessages(r),r}));Ce(this,"searchMessagesAsync",(e,n,s,i)=>v(this,null,function*(){const o=this.denormalizeConvId(e),r=yield Yr(o,n,s,i);return this.normalizeMessages(r),r}));Ce(this,"updateMessageAsync",e=>qr(e));Ce(this,"batchGetUsersAsync",e=>Xr(e));Ce(this,"deleteMessageAsync",(e,n)=>Zr(e,n));Ce(this,"uploadFile",(e,n)=>{zr(e,n)});Ce(this,"listChatTypesAsync",()=>v(null,null,function*(){return yield Sr()}));Ce(this,"getSurveyProgressAsync",()=>v(null,null,function*(){return yield $r()}));Ce(this,"getSurveyQuestionSectionAsync",()=>v(null,null,function*(){return yield Rr()}));Ce(this,"createSurveyConversationAsync",e=>v(null,null,function*(){return yield Ur(e)}));const n=_r(e);if(!n)throw new Error("Connect to hub error");this.hubConnection=n,this.hubConnection.start()}get currentUserId(){return window.currentUserId}normalizeConvId(e){return e.startsWith(`${this.currentUserId}~`)?e.replace(new RegExp(`^${this.currentUserId}`),"me"):e}denormalizeConvId(e){return e.replace(/^me/,this.currentUserId)}normalizeSender(e){e&&e.id===this.currentUserId&&(e.id="me")}normalizeConversation(e){e.id=this.normalizeConvId(e.id),e.lastMessage&&this.normalizeSender(e.lastMessage.sender)}normalizeMessages(e){e.forEach(n=>this.normalizeSender(n.sender))}}var Gr=O("<div>Loading...");const[An,Kr]=L(null),[Jr,e2]=L(null),He={},os={apiUrlBase:"http://dev.eztrade.fpts.com.vn/chatapi/api",hubUrlBase:"http://dev.eztrade.fpts.com.vn/chathub/hub/notification",credentialType:"cookie",credentialName:"aspfpt_sessiontoken"};window.popupRequestInfo=os;const rs=os.hubUrlBase,as=()=>{var s;const t=window.popupRequestInfo;if(!rs)throw new Error("VITE_PUBLIC_HUB_URL is not defined");const e=(s=t==null?void 0:t.credentialType)==null?void 0:s.toLowerCase();if(e!=="cookie"&&!(t!=null&&t.accessToken))throw new Error("Missing JWT token: accessToken chưa được gán vào popupRequestInfo");if(e!=="cookie"&&!window.currentUserId)throw new Error("Missing currentUserId: chưa chọn user");const n=new Qr(rs);Kr(n),n.onHubConnected(i=>{console.log("SignalR: Hub connected",i)}),n.onMessageSent(i=>{var o;console.log("SignalR: Message sent event received",i),(o=He.appendMessage)==null||o.call(He,i)}),n.onMessageEdited(i=>{var o;console.log("SignalR: Message edited event received",i),(o=He.updateMessage)==null||o.call(He,i)}),n.onMessageDeleted(i=>{var o;console.log("SignalR: Message deleted event received",i),(o=He.deleteMessage)==null||o.call(He,i)}),n.onConversationCreated(i=>{var o;console.log("SignalR: Conversation created event received",i),(o=He.appendConversation)==null||o.call(He,i)}),n.onConversationBasicInfoChanged((i,o)=>{var r;console.log("SignalR: Conversation name changed",i,o),(r=He.updateConversationName)==null||r.call(He,i,o)}),n.onConversationDeleted(i=>{var o;console.log("SignalR: Conversation deleted",i),(o=He.deleteConversation)==null||o.call(He,i)})};function cs(t,e){const n=typeof t=="string"?document.querySelector(t):t;if(!n)throw new Error(`Element "${t}" not found.`);e!=null&&e.credentialType&&(window.popupRequestInfo.credentialType=e.credentialType),e!=null&&e.accessToken&&(window.popupRequestInfo.accessToken=e.accessToken),e!=null&&e.currentUserId&&(window.currentUserId=e.currentUserId),e2(e),as(),Is(()=>ae(Qe,{get when(){return An()},get fallback(){return Gr()},get children(){return ae(Xi,{get remoteRepository(){return An()},exportMethods:He,get children(){return ae(mo,{get remoteRepo(){return An()},get options(){return Jr()}})}})}}),n)}typeof window!="undefined"&&(window.EzChat={createPopup:cs}),window.addEventListener("startChat",()=>{as()}),Te.createPopup=cs,Object.defineProperty(Te,Symbol.toStringTag,{value:"Module"})}));
16
+ `);return[se(j({},i),{text:_,type:"normal",isNormalType:!0,contents:[{content:_}]})]}}return s==="bot"&&e.body&&typeof e.body.content=="string"&&!e.body.type?[se(j({},i),{text:e.body.content,type:"normal",isNormalType:!0,contents:[{content:e.body.content,metadata:e.body.metadata}]})]:[se(j({},i),{type:"normal",isNormalType:!0,contents:i.text?[{content:i.text}]:[]})]}).flat().filter(e=>e.type==="choice"?!!e.question&&Array.isArray(e.options)&&e.options.length>0:e.type==="normal"?!!e.text&&e.text.trim()!=="":e.type==="form"?Array.isArray(e.fields)&&e.fields.length>0:e.type==="survey"?Array.isArray(e.options)&&e.options.length>0:!!e.text&&e.text.trim()!=="")}function so(t,e,n,s){var c;const i=[...t].reverse().find(a=>a.sender==="bot"&&Array.isArray(a.contents)&&a.contents.some(d=>d.metadata&&d.metadata.progress));let o={};if(i){const a=Array.isArray(i.contents)?(c=i.contents.find(d=>d.metadata&&d.metadata.progress))==null?void 0:c.metadata:void 0;if(a&&a.progress)try{o=JSON.parse(a.progress)}catch(d){o={}}}let r=0;if(s.length&&Object.keys(o).length>0){const a=s.map(u=>u.id),d=a.findIndex(u=>o[u]!==100);d===-1?r=a.length:r=d,e(r),n(a.length)}}function Qn(t){return y(this,null,function*(){var n,s,i;if(!t)return!1;const e=yield t.listConversationAsync(100);for(const o of e)if(o.id&&o.id.endsWith("~SURVEY")){const r=yield t.listMessagesAsync(o.id);let c=1,a=6;for(let d=r.length-1;d>=0;d--){const u=r[d];if(((n=u.sender)==null?void 0:n.id)!=="me"&&((s=u.body)!=null&&s.children)){const f=(i=u.body.children.find(N=>N.metadata))==null?void 0:i.metadata;if(f){c=parseInt(f.section),a=parseInt(f.totalSections)||6;break}}}if(c<a)return!0}return!1})}function Jn(t,e,n,s,i,o,r,c,a){return y(this,null,function*(){if(!t.remoteRepo)return;const u=(yield t.remoteRepo.listConversationAsync(100)).find(f=>f.id&&f.id.endsWith("~SURVEY"));if(u)e.setCurrentConversation({id:u.id,name:u.name,type:"BOT"}),n(u.id),s(u.name),i(!0),o(new Set),r(!1),yield e.listMessagesAsync(u.id),c&&c();else{const f=`${jt()}~SURVEY`,V=yield e.createConversationAsync({id:f,name:"Tư vấn đầu tư",type:"BOT",members:[{userId:"BOT~surveybot",role:"MEMBER"}],updatedAt:new Date});e.setCurrentConversation({id:V.id,name:V.name,type:"BOT"}),n(V.id),s(V.name),i(!0),o(new Set),r(!1),yield e.listMessagesAsync(V.id),c&&c(),a&&a()}})}function io(t,e){if(!e||t.length===0)return!0;const n=[...t].reverse().find(s=>s.sender==="bot");return!!(n&&n.type==="normal")}function oo(t,e,n,s,i,o,r,c,a,d,u){return y(this,null,function*(){if(yield Qn(t.remoteRepo)){alert("Bạn chưa hoàn thành khảo sát hiện tại!");return}const f=e.trim();if(!f){n("Vui lòng nhập tên cuộc hội thoại");return}if(f.length>100){n("Tên cuộc hội thoại không được quá 100 ký tự");return}n(void 0),s(!1);try{const N=jt(),U=yield i.createConversationAsync({id:N,name:f,type:"BOT",members:[{userId:"BOT~rasaconnector",role:"MEMBER"}],updatedAt:new Date});i.setCurrentConversation({id:U.id,name:U.name,type:"BOT"}),o(U.id),r(U.name),c(!0),a(new Set),d(!1),yield i.listMessagesAsync(U.id),u&&u()}catch(N){console.error("Tạo hội thoại mới thất bại:",N)}})}function ro(t,e,n,s,i,o){return y(this,null,function*(){var f,N,V,U;const{props:r,currentConversationId:c,formattedMessages:a,popup:d,setSubmittedMessages:u}=s;if(!(!r.remoteRepo||!c))try{const O=[...a].reverse().find(z=>z.type==="choice"&&z.sender==="bot");if(!O)return;const te=Array.isArray(O.contents)&&O.contents.length>0?O.contents[O.contents.length-1].metadata||{}:{};u(z=>new Set([...z,n]));let T={};e==="ordered"?T={type:"RANKING",content:"",ranking:{items:((f=O.rawItems)==null?void 0:f.map(w=>se(j({},w),{rank:t.indexOf(w.label)+1})))||t.map((w,q)=>({label:w,value:w,rank:q+1})),submitted:!0},metadata:te}:e==="selected"?T={type:"CHOICE",content:"",choice:{items:((N=O.rawItems)==null?void 0:N.map(w=>se(j({},w),{selected:t.includes(w.label)})))||((V=O.options)==null?void 0:V.map(w=>({label:w,value:w,selected:t.includes(w)})))||[],multiple:O.multiSelect||!1,submitted:!0},metadata:te}:e==="input"&&(T={type:"FORM",content:"",form:{fields:((U=O.fields)==null?void 0:U.map((z,w)=>se(j({},z),{value:t[w]||""})))||[],submitted:!0},metadata:te});const P={body:T,conversationId:c,sender:{id:"me"}};if(yield d.sendMessageAsync(P),r.remoteRepo&&o.length>0){const z=yield r.remoteRepo.getSurveyProgressAsync();let w=1;const q=o.map(h=>h.id);z!=null&&z.progress&&(w=q.findIndex(h=>!z.progress[h]||z.progress[h]<100)+1,w===0&&(w=q.length)),i(w)}}catch(O){console.error("Error sending survey response:",O)}})}function ao(t,e,n,s,i,o){return y(this,null,function*(){var N,V,U,O;const{props:r,currentConversationId:c,formattedMessages:a,popup:d,setEditingMsgIdBot:u,setEditingMsgIdUser:f}=s;if(!(!r.remoteRepo||!c))try{if(!a.find(h=>h.id===n&&h.sender==="user"))return;const T=a.findIndex(h=>h.id===n);let P;for(let h=T-1;h>=0;h--){const H=a[h];if(H.sender==="bot"&&(H.type==="choice"||H.type==="survey"||H.type==="form")){P=H;break}}if(!P)return;const z=Array.isArray(P.contents)&&P.contents.length>0?P.contents[P.contents.length-1].metadata||{}:{};let w={};e==="input"?w={type:"NORMAL",content:t[0],metadata:z}:e==="ordered"?w={type:"RANKING",content:"",ranking:{items:((N=P.rawItems)==null?void 0:N.map(H=>se(j({},H),{rank:t.indexOf(H.label)+1})))||t.map((H,Y)=>({label:H,value:H,rank:Y+1})),submitted:!0},metadata:z}:e==="selected"?w={type:"CHOICE",content:"",choice:{items:((V=P.rawItems)==null?void 0:V.map(H=>se(j({},H),{selected:t.includes(H.label)})))||((U=P.options)==null?void 0:U.map(H=>({label:H,value:H,selected:t.includes(H)})))||[],multiple:P.multiSelect||!1,submitted:!0},metadata:z}:e==="input"&&(w={type:"FORM",content:"",form:{fields:((O=P.fields)==null?void 0:O.map((h,H)=>se(j({},h),{value:t[H]||""})))||[],submitted:!0},metadata:z});const q={id:n,body:w,conversationId:c,sender:{id:"me"}};if(yield d.updateMessageAsync(q),r.remoteRepo&&o.length>0){const h=yield r.remoteRepo.getSurveyProgressAsync();let H=1;const Y=o.map(X=>X.id);h!=null&&h.progress&&(H=Y.findIndex(X=>!h.progress[X]||h.progress[X]<100)+1,H===0&&(H=Y.length)),i(H)}u(null),f(null)}catch(te){console.error("Error updating survey response:",te)}})}var co=B("<div>"),lo=B("<button class=chat-popup-button><img>"),uo=B("<div style=font-size:14px;margin-top:4px>"),ho=B("<div class=modal-backdrop><div class=modal-content style=background-color:white;border-radius:8px><div style=margin-bottom:12px><label style=margin-bottom:18px;font-weight:500>Tên cuộc trò chuyện mới:</label><input autofocus class=chat-popup-input></div><div style=text-align:right><button class=modal-button-delete style=margin-right:8px;background-color:#f0f0f0>Hủy bỏ</button><button class=modal-button-delete style=background-color:#1AAF74>Tạo"),fo=B("<div class=modal-backdrop><div style=background-color:white;border-radius:8px><div style=font-size:16px;font-weight:500;margin-bottom:12px>Xóa đoạn chat?</div><div style=font-size:14px;margin-bottom:16px>Hành động này sẽ xóa <b></b>?</div><div style=text-align:right><button class=modal-button-delete style=margin-right:8px>Hủy bỏ</button><button class=modal-button-delete style=background-color:#e74c3c>Xóa"),go=B("<div class=modal-backdrop><div class=modal-content style=background-color:white;border-radius:8px><div style=font-size:16px;font-weight:500;margin-bottom:12px>Bạn chưa làm khảo sát. Vui lòng thực hiện khảo sát trước khi bắt đầu tư vấn!</div><div style=text-align:right><button class=modal-button-delete style=background-color:#1AAF74>Đã hiểu"),po=B("<div class=modal-backdrop><div class=modal-content style=background-color:white;border-radius:8px><div style=margin-bottom:12px><div style=font-size:16px;font-weight:500;margin-bottom:12px>Bắt đầu làm khảo sát đầu tư?</div><div style=font-size:14px;margin-bottom:16px></div></div><div style=text-align:right><button class=modal-button-delete style=background-color:#1AAF74>"),Co=B("<div><div style=flex-direction:row><div style=flex-direction:column;min-height:0>"),mo=B("<div class=chat-popup-header><img><div class=chat-popup-title><img style=margin-right:4px><span style=user-select:none>Ez</span><span style=margin-left:4px;user-select:none>Advise</span></div><div style=align-items:center;margin-top:4px><button><img>"),vo=B("<button><img>"),yo=B("<div><div>"),wo=B("<div style=text-align:center;font-size:32px;font-weight:600;margin-bottom:32px;user-select:none>Hôm nay thị trường khiến bạn quan tâm điều gì?"),bo=B("<div class=chat-popup-action-buttons>"),_o=B("<button class=modal-button-delete style=margin-right:8px;background-color:#f0f0f0>Xem ví dụ"),Ao=B("<button class=modal-button-delete style=margin-right:8px;background-color:#f0f0f0>Hướng dẫn sử dụng"),So=B("<button class=modal-button-delete style=margin-right:8px;background-color:#f0f0f0>Hủy");function xo(t){var yt;const e=no(),[n,s]=D(""),[i,o]=D(!1),[r,c]=D(!1),[a,d]=D(!1),[u,f]=D(!1),[N,V]=D(0),[U]=D({}),[O,te]=D(new Set),[T,P]=D(null),[z,w]=D(!1),[q,h]=D(!0),[H,Y]=D(""),[X,k]=D(""),[_,m]=D(null),[C,v]=D(1),[M,$]=D(7),[b,L]=D(null),[Q,xe]=D(null),[ye,re]=D(!1),[fe,He]=D(""),[Z,F]=D(void 0);let ie=null;const[Pe,K]=D(!1),[_e,Le]=D(null),[ht,g]=D(!1),A=((yt=t.options)==null?void 0:yt.onlyMobile)||!1,[x,S]=D([]),[R,Ce]=D(null),ke=()=>y(null,null,function*(){yield Jn(t,e,P,Y,h,te,w,ie,()=>g(!0)),s(""),yield oo(t,fe(),F,re,e,P,Y,h,te,w,ie)});nt(()=>{var Ye;const de=x(),oe=(Ye=R())==null?void 0:Ye.progress;let J=0;if(de.length&&oe){const Oe=de.map(ut=>ut.id),tt=Oe.findIndex(ut=>oe[ut]!==100);tt===-1?J=Oe.length:J=tt}v(J)}),nt(()=>y(null,null,function*(){if(t.remoteRepo)try{const de=yield t.remoteRepo.listConversationAsync(10);console.log("listConversationAsync result:",de),(!de||de.length===0)&&console.warn("listConversationAsync returned empty or null");const oe=yield t.remoteRepo.getSurveyQuestionSectionAsync();S(oe!=null?oe:[]),$(Array.isArray(oe)?oe.length:0);const J=yield t.remoteRepo.getSurveyProgressAsync();Ce(J),console.log("getSurveyProgressAsync result:",J);const Ye=oe!=null?oe:[],Oe=J==null?void 0:J.progress;let tt=0;if(Ye.length&&Oe){const ut=Ye.map(me=>me.id),gn=ut.findIndex(me=>Oe[me]!==100);gn===-1?tt=ut.length:tt=gn}v(tt)}catch(de){console.error("Error calling listConversationAsync or getSurveyProgressAsync:",de)}})),nt(()=>{const de=e.getCurrentMessages();de&&de.length>0&&so(Kn(de),v,$,x())});function Ve(de){var Ye;const oe=[...de].reverse().find(Oe=>Oe.sender==="bot"&&Array.isArray(Oe.contents)&&Oe.contents.some(tt=>tt.metadata&&tt.metadata.progress));if(!oe||!Array.isArray(oe.contents))return{};const J=(Ye=oe.contents.find(Oe=>Oe.metadata&&Oe.metadata.progress))==null?void 0:Ye.metadata;if(!J||!J.progress)return{};try{return JSON.parse(J.progress)}catch(Oe){return{}}}const dt=()=>{var J;const de=T(),oe=(J=R())==null?void 0:J.surveyConversationId;return!!de&&!!oe&&de===oe},vt=()=>y(null,null,function*(){He(""),F(void 0),re(!0)}),qe=()=>y(null,null,function*(){var de;if(t.remoteRepo)try{const oe=yield t.remoteRepo.getSurveyProgressAsync();if(m((de=oe==null?void 0:oe.status)!=null?de:null),!oe||!oe.progress||Object.keys(oe.status).length===0){k("Chỉ với vài phút trả lời bảng hỏi, bạn sẽ giúp hệ thống hiểu rõ nhu cầu, khả năng tài chính và mức độ chấp nhận rủi ro của mình. Từ đó, chúng tôi có thể gửi đến bạn những gợi ý đầu tư cá nhân hóa, phù hợp nhất với mục tiêu và phong cách đầu tư của bạn"),K(!0);return}switch(oe.status){case"NONE":k("Chỉ với vài phút trả lời bảng hỏi, bạn sẽ giúp hệ thống hiểu rõ nhu cầu, khả năng tài chính và mức độ chấp nhận rủi ro của mình. Từ đó, chúng tôi có thể gửi đến bạn những gợi ý đầu tư cá nhân hóa, phù hợp nhất với mục tiêu và phong cách đầu tư của bạn"),K(!0);break;case"IN_PROGRESS":k("Bạn đang có khảo sát chưa hoàn thành. Bạn có muốn tiếp tục khảo sát không?"),K(!0);break;case"EDITING":k("Bạn đang chỉnh sửa khảo sát. Bạn có muốn tiếp tục chỉnh sửa không?"),K(!0);break;case"AWAITING_APPLY":k("Khảo sát của bạn đang chờ lưu. Bạn có muốn tiếp tục chỉnh sửa không?"),K(!0);break;case"COMPLETED":break;default:k("Chỉ với vài phút trả lời bảng hỏi, bạn sẽ giúp hệ thống hiểu rõ nhu cầu, khả năng tài chính và mức độ chấp nhận rủi ro của mình. Từ đó, chúng tôi có thể gửi đến bạn những gợi ý đầu tư cá nhân hóa, phù hợp nhất với mục tiêu và phong cách đầu tư của bạn"),K(!0);break}Ce(oe)}catch(oe){console.error("Error checking survey progress:",oe),K(!0)}});return Lt(()=>{const de=()=>{const J=window.innerWidth<768;f(J),a()&&J&&(d(!1),f(!0))};return window.addEventListener("resize",de),de(),()=>{window.removeEventListener("resize",de)}}),nt(()=>{var de,oe;(de=t.options)!=null&&de.onFullScreen&&t.options.onFullScreen(a()),(oe=t.options)!=null&&oe.onMobile&&t.options.onMobile(u())}),(()=>{var de=co();return I(de,(()=>{var oe=ee(()=>!i());return()=>oe()&&(()=>{var J=lo(),Ye=J.firstChild;return J.$$click=()=>{var Oe;A&&f(!0),o(!0),(Oe=t.options)!=null&&Oe.onOpen&&t.options.onOpen()},l(J,"background","none"),l(J,"border","none"),l(J,"cursor","pointer"),l(J,"padding","0"),ce(Ye,"src",_n),J})()})(),null),I(de,(()=>{var oe=ee(()=>!!i());return()=>oe()&&(()=>{const J=rt(()=>Kn(e.getCurrentMessages())),Ye=()=>io(J(),T()),Oe=(me,je,ge)=>ro(me,je,ge,{props:t,currentConversationId:T(),formattedMessages:J(),popup:e,setSubmittedMessages:te},v,x()),tt=(me,je,ge)=>ao(me,je,ge,{props:t,currentConversationId:T(),formattedMessages:J(),popup:e,setEditingMsgIdBot:L,setEditingMsgIdUser:xe},v,x()),ut=()=>y(null,null,function*(){var me,je;if(!(!n().trim()||!t.remoteRepo)){if(J().length===0){yield qe();return}if(yield Qn(t.remoteRepo)){alert("Bạn chưa hoàn thành khảo sát hiện tại!");return}if(!T()){yield Jn(t,e,P,Y,h,te,w,ie,()=>g(!0));try{const ge=jt(),ne="BOT~rasaconnector",E=`Cuộc hội thoại mới ${ge.slice(-4)}`,W=yield e.createConversationAsync({id:ge,name:E,type:"BOT",members:[{userId:ne,role:"MEMBER"}],updatedAt:new Date});e.setCurrentConversation({id:W.id,name:W.name,type:"BOT"}),P(W.id),Y(W.name),h(!0),te(new Set),w(!1),yield e.listMessagesAsync(W.id),ie&&ie()}catch(ge){console.error("Tạo hội thoại mới thất bại:",ge);return}}try{let ge={};const ne=J().filter(W=>W.sender==="bot"&&Array.isArray(W.contents)&&W.contents.length>0&&W.contents[W.contents.length-1].metadata);if(ne.length>0){const W=ne[ne.length-1];ge=((je=(me=W.contents)==null?void 0:me[W.contents.length-1])==null?void 0:je.metadata)||{}}const E={body:{type:"NORMAL",content:n(),metadata:ge},conversationId:T(),sender:{id:"me"}};yield e.sendMessageAsync(E),s("")}catch(ge){console.error("Error sending message:",ge)}}}),gn=()=>y(null,null,function*(){var me,je;if(!(!e||J().length===0||!T()||!q()))try{const ge=J()[0].id,ne=30,E=J().findIndex(Fe=>Fe.id===ge);if(E>=0&&E-ne>=0)return;const W=document.querySelector(".chat-messages-container"),he=W==null?void 0:W.querySelector(`[data-message-id="${ge}"]`),ue=(me=he==null?void 0:he.offsetTop)!=null?me:0,Xe=(je=W==null?void 0:W.scrollTop)!=null?je:0;yield e.listMessagesAsync("BEFORE",ge,ne),requestAnimationFrame(()=>{var le;const Fe=W==null?void 0:W.querySelector(`[data-message-id="${ge}"]`),ze=(le=Fe==null?void 0:Fe.offsetTop)!=null?le:0;W&&(W.scrollTop=ze-(ue-Xe))})}catch(ge){console.error("Error loading more messages:",ge)}});return nt(()=>{J(),i()&&requestAnimationFrame(()=>{const me=document.querySelector(".chat-messages-container");me&&(me.scrollTop=me.scrollHeight)})}),(()=>{var me=Co(),je=me.firstChild,ge=je.firstChild;return I(me,ae(Je,{get when(){return ye()},get children(){var ne=ho(),E=ne.firstChild,W=E.firstChild,he=W.firstChild,ue=he.nextSibling,Xe=W.nextSibling,Fe=Xe.firstChild,ze=Fe.nextSibling;return ne.$$click=()=>re(!1),E.$$click=le=>le.stopPropagation(),l(E,"padding","20px"),l(E,"width","400px"),l(he,"display","block"),ue.$$keydown=le=>{le.key==="Enter"&&ke()},ue.$$input=le=>He(le.currentTarget.value),I(W,ae(Je,{get when(){return Z()},get children(){var le=uo();return l(le,"color","red"),I(le,Z),le}}),null),Fe.$$click=()=>re(!1),ze.$$click=ke,l(ze,"color","#fff"),pe(()=>ue.value=fe()),ne}}),je),I(me,(()=>{var ne=ee(()=>!a());return()=>ne()&&(()=>{var E=mo(),W=E.firstChild,he=W.nextSibling,ue=he.firstChild,Xe=ue.nextSibling,Fe=Xe.nextSibling,ze=he.nextSibling,le=ze.firstChild,Qe=le.firstChild;return W.$$click=()=>c(!0),ce(W,"src",Ds),l(W,"width","28px"),l(W,"height","28px"),l(W,"cursor","pointer"),ce(ue,"src",_n),l(ue,"width","32px"),l(ue,"height","32px"),l(Xe,"color","#1A1D1F"),l(Fe,"color","#1AAF74"),l(ze,"display","flex"),l(ze,"gap","12px"),I(ze,(()=>{var wt=ee(()=>!u());return()=>wt()&&(()=>{var ft=vo(),En=ft.firstChild;return ft.$$click=()=>{var ps;f(!1),d(!0),(ps=t.options)!=null&&ps.onMaximize&&t.options.onMaximize()},l(ft,"background","none"),l(ft,"border","none"),l(ft,"cursor","pointer"),l(ft,"padding","0"),ce(En,"src",Bs),l(En,"width","20px"),l(En,"height","20px"),ft})()})(),le),le.$$click=()=>{var wt;o(!1),setTimeout(()=>{f(!1),d(!1)},250),(wt=t.options)!=null&&wt.onClose&&t.options.onClose()},l(le,"background","none"),l(le,"border","none"),l(le,"cursor","pointer"),l(le,"padding","0"),ce(Qe,"src",Fn),l(Qe,"width","20px"),l(Qe,"height","20px"),E})()})(),je),l(je,"display","flex"),l(je,"height","100%"),I(je,(()=>{var ne=ee(()=>!!a());return()=>ne()?ae(zn,{onClose:()=>{var E;o(!1),setTimeout(()=>{f(!1),d(!1)},250),(E=t.options)!=null&&E.onClose&&t.options.onClose()},onShrink:()=>{var E;d(!1),(E=t.options)!=null&&E.onShrink&&t.options.onShrink()},open:!0,fullScreen:!0,get isMobile(){return u()},onMobile:()=>{d(!1),f(!0)},onNewConversation:vt,get options(){return t.options},get remoteRepo(){var E;return(E=t.remoteRepo)!=null?E:void 0},onDeleteConversation:Le,onReloadConversations:E=>ie=E,get surveyConversationId(){var E;return(E=R())==null?void 0:E.surveyConversationId},onLoadMessages:(E,W)=>y(null,null,function*(){if(e.setCurrentConversation({id:E,name:"",type:"BOT"}),P(E),Y(W||""),h(!0),t.remoteRepo)try{yield e.listMessagesAsync(E),te(new Set),w(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{const he=document.querySelector(".chat-messages-container");he&&(he.scrollTop=he.scrollHeight),w(!1)})})}catch(he){console.error("Error loading messages:",he),w(!1)}})}):ae(zn,{onClose:()=>c(!1),get open(){return r()},fullScreen:!1,get isMobile(){return u()},onNewConversation:vt,get options(){return t.options},get remoteRepo(){var E;return(E=t.remoteRepo)!=null?E:void 0},onDeleteConversation:Le,onReloadConversations:E=>ie=E,get surveyConversationId(){var E;return(E=R())==null?void 0:E.surveyConversationId},onLoadMessages:(E,W)=>y(null,null,function*(){if(e.setCurrentConversation({id:E,name:"",type:"BOT"}),P(E),Y(W||""),h(!0),t.remoteRepo)try{yield e.listMessagesAsync(E);const he=e.getCurrentMessages();console.log("message data: ",he),te(new Set),w(!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{const ue=document.querySelector(".chat-messages-container");ue&&(ue.scrollTop=ue.scrollHeight),w(!1)})})}catch(he){console.error("Error loading messages:",he),w(!1)}})})})(),ge),l(ge,"flex","1"),l(ge,"display","flex"),l(ge,"position","relative"),l(ge,"height","100%"),I(ge,(()=>{var ne=ee(()=>!!a());return()=>ne()&&ae(Yi,{get currentStep(){return C()},get totalSteps(){return M()},get title(){return H()},get isSurveyConversation(){return dt()},get sections(){return x()},get progress(){return Ve(J())}})})(),null),I(ge,ae(Mi,{get messages(){return J()},get isFullScreen(){return a()},get inputHeight(){return ee(()=>!!a())()?N():void 0},get isMobile(){return u()},onSubmit:Oe,onUpdateSurvey:tt,get surveyOptions(){return U()},get submittedMessages(){return O()},onLoadMoreMessages:gn,get conversationId(){return T()},get isLoadingMessages(){return z()},get editingMsgIdBot(){return b()},setEditingMsgIdBot:L,get editingMsgIdUser(){return Q()},setEditingMsgIdUser:xe}),null),I(ge,(()=>{var ne=ee(()=>!!a());return()=>ne()?(()=>{var E=yo(),W=E.firstChild;return I(E,(()=>{var he=ee(()=>J().length===0);return()=>he()&&(()=>{var ue=wo();return l(ue,"width","100%"),l(ue,"color","#1A1D1F"),ue})()})(),W),l(W,"width","100%"),I(W,ae(jn,{get input(){return n()},setInput:s,sendMessage:ut,onHeightChange:V,get disabled(){return!Ye()}})),I(E,(()=>{var he=ee(()=>J().length===0);return()=>he()&&(()=>{var ue=bo();return I(ue,ae(tn,{text:"Khảo sát đầu tư"}),null),I(ue,ae(tn,{text:"Mục tiêu tài chính"}),null),I(ue,ae(tn,{text:"Khả năng chấp nhận rủi ro"}),null),I(ue,ae(tn,{text:"Khả năng chấp nhận rủi ro"}),null),ue})()})(),null),pe(()=>at(E,`chat-input-floating-box${J().length>0?" chat-input-floating-box--with-messages":""}`)),E})():ae(jn,{get input(){return n()},setInput:s,sendMessage:ut,onHeightChange:V,get disabled(){return!Ye()}})})(),null),I(me,ae(Je,{get when(){return!!_e()},get children(){var ne=fo(),E=ne.firstChild,W=E.firstChild,he=W.nextSibling,ue=he.firstChild,Xe=ue.nextSibling,Fe=he.nextSibling,ze=Fe.firstChild,le=ze.nextSibling;return ne.$$click=()=>Le(null),E.$$click=Qe=>Qe.stopPropagation(),l(E,"padding","20px"),l(E,"width","350px"),I(Xe,()=>{var Qe;return(Qe=_e())==null?void 0:Qe.name}),ze.$$click=Qe=>{Qe.stopPropagation(),Le(null)},le.$$click=Qe=>y(null,null,function*(){var wt;Qe.stopPropagation();try{yield(wt=t.remoteRepo)==null?void 0:wt.deleteConversationAsync(_e().id),Le(null),ie&&ie()}catch(ft){alert("Xóa hội thoại thất bại!")}}),l(le,"color","#fff"),ne}}),null),I(me,ae(Je,{get when(){return ht()},get children(){var ne=go(),E=ne.firstChild,W=E.firstChild,he=W.nextSibling,ue=he.firstChild;return ne.$$click=()=>g(!1),E.$$click=Xe=>Xe.stopPropagation(),l(E,"padding","20px"),l(E,"width","350px"),ue.$$click=()=>g(!1),l(ue,"color","#fff"),ne}}),null),I(me,ae(Je,{get when(){return Pe()},get children(){var ne=po(),E=ne.firstChild,W=E.firstChild,he=W.firstChild,ue=he.nextSibling,Xe=W.nextSibling,Fe=Xe.firstChild;return ne.$$click=()=>K(!1),E.$$click=ze=>ze.stopPropagation(),l(E,"padding","20px"),l(E,"width","400px"),I(ue,X),I(Xe,(()=>{var ze=ee(()=>!_()||_()==="NONE");return()=>ze()?[(()=>{var le=_o();return le.$$click=()=>K(!1),le})(),(()=>{var le=Ao();return le.$$click=()=>K(!1),le})()]:(()=>{var le=So();return le.$$click=()=>K(!1),le})()})(),Fe),Fe.$$click=()=>y(null,null,function*(){K(!1),s(""),t.remoteRepo&&(yield t.remoteRepo.createSurveyConversationAsync())}),l(Fe,"color","#fff"),I(Fe,()=>!_()||_()==="NONE"?"Bắt đầu Khảo sát":"Tiếp tục khảo sát"),ne}}),null),pe(ne=>{var E=`chat-popup-window${i()?" chat-popup-window--open":""}${a()?" chat-popup-window--fullscreen":""}${u()?" chat-popup-window--mobile":""}`,W=a()||u()?{"--chat-input-height":`${N()}px`}:void 0;return E!==ne.e&&at(me,ne.e=E),ne.t=wn(me,W,ne.t),ne},{e:void 0,t:void 0}),me})()})()})(),null),de})()}xt(["click","input","keydown"]);function Io(t){return ae(xo,{get remoteRepo(){return t.remoteRepo},get options(){return t.options}})}class pt extends Error{constructor(e,n){const s=new.target.prototype;super(`${e}: Status code '${n}'`),this.statusCode=n,this.__proto__=s}}class An extends Error{constructor(e="A timeout occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class et extends Error{constructor(e="An abort occurred."){const n=new.target.prototype;super(e),this.__proto__=n}}class ko extends Error{constructor(e,n){const s=new.target.prototype;super(e),this.transport=n,this.errorType="UnsupportedTransportError",this.__proto__=s}}class Mo extends Error{constructor(e,n){const s=new.target.prototype;super(e),this.transport=n,this.errorType="DisabledTransportError",this.__proto__=s}}class Eo extends Error{constructor(e,n){const s=new.target.prototype;super(e),this.transport=n,this.errorType="FailedToStartTransportError",this.__proto__=s}}class es extends Error{constructor(e){const n=new.target.prototype;super(e),this.errorType="FailedToNegotiateWithServerError",this.__proto__=n}}class To extends Error{constructor(e,n){const s=new.target.prototype;super(e),this.innerErrors=n,this.__proto__=s}}class ts{constructor(e,n,s){this.statusCode=e,this.statusText=n,this.content=s}}class rn{get(e,n){return this.send(se(j({},n),{method:"GET",url:e}))}post(e,n){return this.send(se(j({},n),{method:"POST",url:e}))}delete(e,n){return this.send(se(j({},n),{method:"DELETE",url:e}))}getCookieString(e){return""}}var p;(function(t){t[t.Trace=0]="Trace",t[t.Debug=1]="Debug",t[t.Information=2]="Information",t[t.Warning=3]="Warning",t[t.Error=4]="Error",t[t.Critical=5]="Critical",t[t.None=6]="None"})(p||(p={}));class zt{constructor(){}log(e,n){}}zt.instance=new zt;const Po="8.0.17";class Te{static isRequired(e,n){if(e==null)throw new Error(`The '${n}' argument is required.`)}static isNotEmpty(e,n){if(!e||e.match(/^\s*$/))throw new Error(`The '${n}' argument should not be empty.`)}static isIn(e,n,s){if(!(e in n))throw new Error(`Unknown ${s} value: ${e}.`)}}class Se{static get isBrowser(){return!Se.isNode&&typeof window=="object"&&typeof window.document=="object"}static get isWebWorker(){return!Se.isNode&&typeof self=="object"&&"importScripts"in self}static get isReactNative(){return!Se.isNode&&typeof window=="object"&&typeof window.document=="undefined"}static get isNode(){return typeof process!="undefined"&&process.release&&process.release.name==="node"}}function Vt(t,e){let n="";return Ct(t)?(n=`Binary data of length ${t.byteLength}`,e&&(n+=`. Content: '${Ro(t)}'`)):typeof t=="string"&&(n=`String data of length ${t.length}`,e&&(n+=`. Content: '${t}'`)),n}function Ro(t){const e=new Uint8Array(t);let n="";return e.forEach(s=>{const i=s<16?"0":"";n+=`0x${i}${s.toString(16)} `}),n.substr(0,n.length-1)}function Ct(t){return t&&typeof ArrayBuffer!="undefined"&&(t instanceof ArrayBuffer||t.constructor&&t.constructor.name==="ArrayBuffer")}function ns(t,e,n,s,i,o){return y(this,null,function*(){const r={},[c,a]=Pt();r[c]=a,t.log(p.Trace,`(${e} transport) sending data. ${Vt(i,o.logMessageContent)}.`);const d=Ct(i)?"arraybuffer":"text",u=yield n.post(s,{content:i,headers:j(j({},r),o.headers),responseType:d,timeout:o.timeout,withCredentials:o.withCredentials});t.log(p.Trace,`(${e} transport) request complete. Response status: ${u.statusCode}.`)})}function $o(t){return t===void 0?new an(p.Information):t===null?zt.instance:t.log!==void 0?t:new an(t)}class Do{constructor(e,n){this._subject=e,this._observer=n}dispose(){const e=this._subject.observers.indexOf(this._observer);e>-1&&this._subject.observers.splice(e,1),this._subject.observers.length===0&&this._subject.cancelCallback&&this._subject.cancelCallback().catch(n=>{})}}class an{constructor(e){this._minLevel=e,this.out=console}log(e,n){if(e>=this._minLevel){const s=`[${new Date().toISOString()}] ${p[e]}: ${n}`;switch(e){case p.Critical:case p.Error:this.out.error(s);break;case p.Warning:this.out.warn(s);break;case p.Information:this.out.info(s);break;default:this.out.log(s);break}}}}function Pt(){let t="X-SignalR-User-Agent";return Se.isNode&&(t="User-Agent"),[t,Bo(Po,Ho(),Oo(),Lo())]}function Bo(t,e,n,s){let i="Microsoft SignalR/";const o=t.split(".");return i+=`${o[0]}.${o[1]}`,i+=` (${t}; `,e&&e!==""?i+=`${e}; `:i+="Unknown OS; ",i+=`${n}`,s?i+=`; ${s}`:i+="; Unknown Runtime Version",i+=")",i}function Ho(){if(Se.isNode)switch(process.platform){case"win32":return"Windows NT";case"darwin":return"macOS";case"linux":return"Linux";default:return process.platform}else return""}function Lo(){if(Se.isNode)return process.versions.node}function Oo(){return Se.isNode?"NodeJS":"Browser"}function Sn(t){return t.stack?t.stack:t.message?t.message:`${t}`}function Fo(){if(typeof globalThis!="undefined")return globalThis;if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;throw new Error("could not find global")}class No extends rn{constructor(e){if(super(),this._logger=e,typeof fetch=="undefined"||Se.isNode){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._jar=new(n("tough-cookie")).CookieJar,typeof fetch=="undefined"?this._fetchType=n("node-fetch"):this._fetchType=fetch,this._fetchType=n("fetch-cookie")(this._fetchType,this._jar)}else this._fetchType=fetch.bind(Fo());if(typeof AbortController=="undefined"){const n=typeof __webpack_require__=="function"?__non_webpack_require__:require;this._abortControllerType=n("abort-controller")}else this._abortControllerType=AbortController}send(e){return y(this,null,function*(){if(e.abortSignal&&e.abortSignal.aborted)throw new et;if(!e.method)throw new Error("No method defined.");if(!e.url)throw new Error("No url defined.");const n=new this._abortControllerType;let s;e.abortSignal&&(e.abortSignal.onabort=()=>{n.abort(),s=new et});let i=null;if(e.timeout){const a=e.timeout;i=setTimeout(()=>{n.abort(),this._logger.log(p.Warning,"Timeout from HTTP request."),s=new An},a)}e.content===""&&(e.content=void 0),e.content&&(e.headers=e.headers||{},Ct(e.content)?e.headers["Content-Type"]="application/octet-stream":e.headers["Content-Type"]="text/plain;charset=UTF-8");let o;try{o=yield this._fetchType(e.url,{body:e.content,cache:"no-cache",credentials:e.withCredentials===!0?"include":"same-origin",headers:j({"X-Requested-With":"XMLHttpRequest"},e.headers),method:e.method,mode:"cors",redirect:"follow",signal:n.signal})}catch(a){throw s||(this._logger.log(p.Warning,`Error from HTTP request. ${a}.`),a)}finally{i&&clearTimeout(i),e.abortSignal&&(e.abortSignal.onabort=null)}if(!o.ok){const a=yield ss(o,"text");throw new pt(a||o.statusText,o.status)}const c=yield ss(o,e.responseType);return new ts(o.status,o.statusText,c)})}getCookieString(e){let n="";return Se.isNode&&this._jar&&this._jar.getCookies(e,(s,i)=>n=i.join("; ")),n}}function ss(t,e){let n;switch(e){case"arraybuffer":n=t.arrayBuffer();break;case"text":n=t.text();break;case"blob":case"document":case"json":throw new Error(`${e} is not supported.`);default:n=t.text();break}return n}class Uo extends rn{constructor(e){super(),this._logger=e}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new et):e.method?e.url?new Promise((n,s)=>{const i=new XMLHttpRequest;i.open(e.method,e.url,!0),i.withCredentials=e.withCredentials===void 0?!0:e.withCredentials,i.setRequestHeader("X-Requested-With","XMLHttpRequest"),e.content===""&&(e.content=void 0),e.content&&(Ct(e.content)?i.setRequestHeader("Content-Type","application/octet-stream"):i.setRequestHeader("Content-Type","text/plain;charset=UTF-8"));const o=e.headers;o&&Object.keys(o).forEach(r=>{i.setRequestHeader(r,o[r])}),e.responseType&&(i.responseType=e.responseType),e.abortSignal&&(e.abortSignal.onabort=()=>{i.abort(),s(new et)}),e.timeout&&(i.timeout=e.timeout),i.onload=()=>{e.abortSignal&&(e.abortSignal.onabort=null),i.status>=200&&i.status<300?n(new ts(i.status,i.statusText,i.response||i.responseText)):s(new pt(i.response||i.responseText||i.statusText,i.status))},i.onerror=()=>{this._logger.log(p.Warning,`Error from HTTP request. ${i.status}: ${i.statusText}.`),s(new pt(i.statusText,i.status))},i.ontimeout=()=>{this._logger.log(p.Warning,"Timeout from HTTP request."),s(new An)},i.send(e.content)}):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}}class jo extends rn{constructor(e){if(super(),typeof fetch!="undefined"||Se.isNode)this._httpClient=new No(e);else if(typeof XMLHttpRequest!="undefined")this._httpClient=new Uo(e);else throw new Error("No usable HttpClient found.")}send(e){return e.abortSignal&&e.abortSignal.aborted?Promise.reject(new et):e.method?e.url?this._httpClient.send(e):Promise.reject(new Error("No url defined.")):Promise.reject(new Error("No method defined."))}getCookieString(e){return this._httpClient.getCookieString(e)}}class Ze{static write(e){return`${e}${Ze.RecordSeparator}`}static parse(e){if(e[e.length-1]!==Ze.RecordSeparator)throw new Error("Message is incomplete.");const n=e.split(Ze.RecordSeparator);return n.pop(),n}}Ze.RecordSeparatorCode=30,Ze.RecordSeparator=String.fromCharCode(Ze.RecordSeparatorCode);class zo{writeHandshakeRequest(e){return Ze.write(JSON.stringify(e))}parseHandshakeResponse(e){let n,s;if(Ct(e)){const c=new Uint8Array(e),a=c.indexOf(Ze.RecordSeparatorCode);if(a===-1)throw new Error("Message is incomplete.");const d=a+1;n=String.fromCharCode.apply(null,Array.prototype.slice.call(c.slice(0,d))),s=c.byteLength>d?c.slice(d).buffer:null}else{const c=e,a=c.indexOf(Ze.RecordSeparator);if(a===-1)throw new Error("Message is incomplete.");const d=a+1;n=c.substring(0,d),s=c.length>d?c.substring(d):null}const i=Ze.parse(n),o=JSON.parse(i[0]);if(o.type)throw new Error("Expected a handshake response from the server.");return[s,o]}}var G;(function(t){t[t.Invocation=1]="Invocation",t[t.StreamItem=2]="StreamItem",t[t.Completion=3]="Completion",t[t.StreamInvocation=4]="StreamInvocation",t[t.CancelInvocation=5]="CancelInvocation",t[t.Ping=6]="Ping",t[t.Close=7]="Close",t[t.Ack=8]="Ack",t[t.Sequence=9]="Sequence"})(G||(G={}));class Vo{constructor(){this.observers=[]}next(e){for(const n of this.observers)n.next(e)}error(e){for(const n of this.observers)n.error&&n.error(e)}complete(){for(const e of this.observers)e.complete&&e.complete()}subscribe(e){return this.observers.push(e),new Do(this,e)}}class Wo{constructor(e,n,s){this._bufferSize=1e5,this._messages=[],this._totalMessageCount=0,this._waitForSequenceMessage=!1,this._nextReceivingSequenceId=1,this._latestReceivedSequenceId=0,this._bufferedByteCount=0,this._reconnectInProgress=!1,this._protocol=e,this._connection=n,this._bufferSize=s}_send(e){return y(this,null,function*(){const n=this._protocol.writeMessage(e);let s=Promise.resolve();if(this._isInvocationMessage(e)){this._totalMessageCount++;let i=()=>{},o=()=>{};Ct(n)?this._bufferedByteCount+=n.byteLength:this._bufferedByteCount+=n.length,this._bufferedByteCount>=this._bufferSize&&(s=new Promise((r,c)=>{i=r,o=c})),this._messages.push(new qo(n,this._totalMessageCount,i,o))}try{this._reconnectInProgress||(yield this._connection.send(n))}catch(i){this._disconnected()}yield s})}_ack(e){let n=-1;for(let s=0;s<this._messages.length;s++){const i=this._messages[s];if(i._id<=e.sequenceId)n=s,Ct(i._message)?this._bufferedByteCount-=i._message.byteLength:this._bufferedByteCount-=i._message.length,i._resolver();else if(this._bufferedByteCount<this._bufferSize)i._resolver();else break}n!==-1&&(this._messages=this._messages.slice(n+1))}_shouldProcessMessage(e){if(this._waitForSequenceMessage)return e.type!==G.Sequence?!1:(this._waitForSequenceMessage=!1,!0);if(!this._isInvocationMessage(e))return!0;const n=this._nextReceivingSequenceId;return this._nextReceivingSequenceId++,n<=this._latestReceivedSequenceId?(n===this._latestReceivedSequenceId&&this._ackTimer(),!1):(this._latestReceivedSequenceId=n,this._ackTimer(),!0)}_resetSequence(e){if(e.sequenceId>this._nextReceivingSequenceId){this._connection.stop(new Error("Sequence ID greater than amount of messages we've received."));return}this._nextReceivingSequenceId=e.sequenceId}_disconnected(){this._reconnectInProgress=!0,this._waitForSequenceMessage=!0}_resend(){return y(this,null,function*(){const e=this._messages.length!==0?this._messages[0]._id:this._totalMessageCount+1;yield this._connection.send(this._protocol.writeMessage({type:G.Sequence,sequenceId:e}));const n=this._messages;for(const s of n)yield this._connection.send(s._message);this._reconnectInProgress=!1})}_dispose(e){e!=null||(e=new Error("Unable to reconnect to server."));for(const n of this._messages)n._rejector(e)}_isInvocationMessage(e){switch(e.type){case G.Invocation:case G.StreamItem:case G.Completion:case G.StreamInvocation:case G.CancelInvocation:return!0;case G.Close:case G.Sequence:case G.Ping:case G.Ack:return!1}}_ackTimer(){this._ackTimerHandle===void 0&&(this._ackTimerHandle=setTimeout(()=>y(this,null,function*(){try{this._reconnectInProgress||(yield this._connection.send(this._protocol.writeMessage({type:G.Ack,sequenceId:this._latestReceivedSequenceId})))}catch(e){}clearTimeout(this._ackTimerHandle),this._ackTimerHandle=void 0}),1e3))}}class qo{constructor(e,n,s,i){this._message=e,this._id=n,this._resolver=s,this._rejector=i}}const Zo=30*1e3,Yo=15*1e3,Xo=1e5;var be;(function(t){t.Disconnected="Disconnected",t.Connecting="Connecting",t.Connected="Connected",t.Disconnecting="Disconnecting",t.Reconnecting="Reconnecting"})(be||(be={}));class xn{static create(e,n,s,i,o,r,c){return new xn(e,n,s,i,o,r,c)}constructor(e,n,s,i,o,r,c){this._nextKeepAlive=0,this._freezeEventListener=()=>{this._logger.log(p.Warning,"The page is being frozen, this will likely lead to the connection being closed and messages being lost. For more information see the docs at https://learn.microsoft.com/aspnet/core/signalr/javascript-client#bsleep")},Te.isRequired(e,"connection"),Te.isRequired(n,"logger"),Te.isRequired(s,"protocol"),this.serverTimeoutInMilliseconds=o!=null?o:Zo,this.keepAliveIntervalInMilliseconds=r!=null?r:Yo,this._statefulReconnectBufferSize=c!=null?c:Xo,this._logger=n,this._protocol=s,this.connection=e,this._reconnectPolicy=i,this._handshakeProtocol=new zo,this.connection.onreceive=a=>this._processIncomingData(a),this.connection.onclose=a=>this._connectionClosed(a),this._callbacks={},this._methods={},this._closedCallbacks=[],this._reconnectingCallbacks=[],this._reconnectedCallbacks=[],this._invocationId=0,this._receivedHandshakeResponse=!1,this._connectionState=be.Disconnected,this._connectionStarted=!1,this._cachedPingMessage=this._protocol.writeMessage({type:G.Ping})}get state(){return this._connectionState}get connectionId(){return this.connection&&this.connection.connectionId||null}get baseUrl(){return this.connection.baseUrl||""}set baseUrl(e){if(this._connectionState!==be.Disconnected&&this._connectionState!==be.Reconnecting)throw new Error("The HubConnection must be in the Disconnected or Reconnecting state to change the url.");if(!e)throw new Error("The HubConnection url must be a valid url.");this.connection.baseUrl=e}start(){return this._startPromise=this._startWithStateTransitions(),this._startPromise}_startWithStateTransitions(){return y(this,null,function*(){if(this._connectionState!==be.Disconnected)return Promise.reject(new Error("Cannot start a HubConnection that is not in the 'Disconnected' state."));this._connectionState=be.Connecting,this._logger.log(p.Debug,"Starting HubConnection.");try{yield this._startInternal(),Se.isBrowser&&window.document.addEventListener("freeze",this._freezeEventListener),this._connectionState=be.Connected,this._connectionStarted=!0,this._logger.log(p.Debug,"HubConnection connected successfully.")}catch(e){return this._connectionState=be.Disconnected,this._logger.log(p.Debug,`HubConnection failed to start successfully because of error '${e}'.`),Promise.reject(e)}})}_startInternal(){return y(this,null,function*(){this._stopDuringStartError=void 0,this._receivedHandshakeResponse=!1;const e=new Promise((n,s)=>{this._handshakeResolver=n,this._handshakeRejecter=s});yield this.connection.start(this._protocol.transferFormat);try{let n=this._protocol.version;this.connection.features.reconnect||(n=1);const s={protocol:this._protocol.name,version:n};if(this._logger.log(p.Debug,"Sending handshake request."),yield this._sendMessage(this._handshakeProtocol.writeHandshakeRequest(s)),this._logger.log(p.Information,`Using HubProtocol '${this._protocol.name}'.`),this._cleanupTimeout(),this._resetTimeoutPeriod(),this._resetKeepAliveInterval(),yield e,this._stopDuringStartError)throw this._stopDuringStartError;(this.connection.features.reconnect||!1)&&(this._messageBuffer=new Wo(this._protocol,this.connection,this._statefulReconnectBufferSize),this.connection.features.disconnected=this._messageBuffer._disconnected.bind(this._messageBuffer),this.connection.features.resend=()=>{if(this._messageBuffer)return this._messageBuffer._resend()}),this.connection.features.inherentKeepAlive||(yield this._sendMessage(this._cachedPingMessage))}catch(n){throw this._logger.log(p.Debug,`Hub handshake failed with error '${n}' during start(). Stopping HubConnection.`),this._cleanupTimeout(),this._cleanupPingTimer(),yield this.connection.stop(n),n}})}stop(){return y(this,null,function*(){const e=this._startPromise;this.connection.features.reconnect=!1,this._stopPromise=this._stopInternal(),yield this._stopPromise;try{yield e}catch(n){}})}_stopInternal(e){if(this._connectionState===be.Disconnected)return this._logger.log(p.Debug,`Call to HubConnection.stop(${e}) ignored because it is already in the disconnected state.`),Promise.resolve();if(this._connectionState===be.Disconnecting)return this._logger.log(p.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;const n=this._connectionState;return this._connectionState=be.Disconnecting,this._logger.log(p.Debug,"Stopping HubConnection."),this._reconnectDelayHandle?(this._logger.log(p.Debug,"Connection stopped during reconnect delay. Done reconnecting."),clearTimeout(this._reconnectDelayHandle),this._reconnectDelayHandle=void 0,this._completeClose(),Promise.resolve()):(n===be.Connected&&this._sendCloseMessage(),this._cleanupTimeout(),this._cleanupPingTimer(),this._stopDuringStartError=e||new et("The connection was stopped before the hub handshake could complete."),this.connection.stop(e))}_sendCloseMessage(){return y(this,null,function*(){try{yield this._sendWithProtocol(this._createCloseMessage())}catch(e){}})}stream(e,...n){const[s,i]=this._replaceStreamingParams(n),o=this._createStreamInvocation(e,n,i);let r;const c=new Vo;return c.cancelCallback=()=>{const a=this._createCancelInvocation(o.invocationId);return delete this._callbacks[o.invocationId],r.then(()=>this._sendWithProtocol(a))},this._callbacks[o.invocationId]=(a,d)=>{if(d){c.error(d);return}else a&&(a.type===G.Completion?a.error?c.error(new Error(a.error)):c.complete():c.next(a.item))},r=this._sendWithProtocol(o).catch(a=>{c.error(a),delete this._callbacks[o.invocationId]}),this._launchStreams(s,r),c}_sendMessage(e){return this._resetKeepAliveInterval(),this.connection.send(e)}_sendWithProtocol(e){return this._messageBuffer?this._messageBuffer._send(e):this._sendMessage(this._protocol.writeMessage(e))}send(e,...n){const[s,i]=this._replaceStreamingParams(n),o=this._sendWithProtocol(this._createInvocation(e,n,!0,i));return this._launchStreams(s,o),o}invoke(e,...n){const[s,i]=this._replaceStreamingParams(n),o=this._createInvocation(e,n,!1,i);return new Promise((c,a)=>{this._callbacks[o.invocationId]=(u,f)=>{if(f){a(f);return}else u&&(u.type===G.Completion?u.error?a(new Error(u.error)):c(u.result):a(new Error(`Unexpected message type: ${u.type}`)))};const d=this._sendWithProtocol(o).catch(u=>{a(u),delete this._callbacks[o.invocationId]});this._launchStreams(s,d)})}on(e,n){!e||!n||(e=e.toLowerCase(),this._methods[e]||(this._methods[e]=[]),this._methods[e].indexOf(n)===-1&&this._methods[e].push(n))}off(e,n){if(!e)return;e=e.toLowerCase();const s=this._methods[e];if(s)if(n){const i=s.indexOf(n);i!==-1&&(s.splice(i,1),s.length===0&&delete this._methods[e])}else delete this._methods[e]}onclose(e){e&&this._closedCallbacks.push(e)}onreconnecting(e){e&&this._reconnectingCallbacks.push(e)}onreconnected(e){e&&this._reconnectedCallbacks.push(e)}_processIncomingData(e){if(this._cleanupTimeout(),this._receivedHandshakeResponse||(e=this._processHandshakeResponse(e),this._receivedHandshakeResponse=!0),e){const n=this._protocol.parseMessages(e,this._logger);for(const s of n)if(!(this._messageBuffer&&!this._messageBuffer._shouldProcessMessage(s)))switch(s.type){case G.Invocation:this._invokeClientMethod(s).catch(i=>{this._logger.log(p.Error,`Invoke client method threw error: ${Sn(i)}`)});break;case G.StreamItem:case G.Completion:{const i=this._callbacks[s.invocationId];if(i){s.type===G.Completion&&delete this._callbacks[s.invocationId];try{i(s)}catch(o){this._logger.log(p.Error,`Stream callback threw error: ${Sn(o)}`)}}break}case G.Ping:break;case G.Close:{this._logger.log(p.Information,"Close message received from server.");const i=s.error?new Error("Server returned an error on close: "+s.error):void 0;s.allowReconnect===!0?this.connection.stop(i):this._stopPromise=this._stopInternal(i);break}case G.Ack:this._messageBuffer&&this._messageBuffer._ack(s);break;case G.Sequence:this._messageBuffer&&this._messageBuffer._resetSequence(s);break;default:this._logger.log(p.Warning,`Invalid message type: ${s.type}.`);break}}this._resetTimeoutPeriod()}_processHandshakeResponse(e){let n,s;try{[s,n]=this._handshakeProtocol.parseHandshakeResponse(e)}catch(i){const o="Error parsing handshake response: "+i;this._logger.log(p.Error,o);const r=new Error(o);throw this._handshakeRejecter(r),r}if(n.error){const i="Server returned handshake error: "+n.error;this._logger.log(p.Error,i);const o=new Error(i);throw this._handshakeRejecter(o),o}else this._logger.log(p.Debug,"Server handshake complete.");return this._handshakeResolver(),s}_resetKeepAliveInterval(){this.connection.features.inherentKeepAlive||(this._nextKeepAlive=new Date().getTime()+this.keepAliveIntervalInMilliseconds,this._cleanupPingTimer())}_resetTimeoutPeriod(){if((!this.connection.features||!this.connection.features.inherentKeepAlive)&&(this._timeoutHandle=setTimeout(()=>this.serverTimeout(),this.serverTimeoutInMilliseconds),this._pingServerHandle===void 0)){let e=this._nextKeepAlive-new Date().getTime();e<0&&(e=0),this._pingServerHandle=setTimeout(()=>y(this,null,function*(){if(this._connectionState===be.Connected)try{yield this._sendMessage(this._cachedPingMessage)}catch(n){this._cleanupPingTimer()}}),e)}}serverTimeout(){this.connection.stop(new Error("Server timeout elapsed without receiving a message from the server."))}_invokeClientMethod(e){return y(this,null,function*(){const n=e.target.toLowerCase(),s=this._methods[n];if(!s){this._logger.log(p.Warning,`No client method with the name '${n}' found.`),e.invocationId&&(this._logger.log(p.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),yield this._sendWithProtocol(this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)));return}const i=s.slice(),o=!!e.invocationId;let r,c,a;for(const d of i)try{const u=r;r=yield d.apply(this,e.arguments),o&&r&&u&&(this._logger.log(p.Error,`Multiple results provided for '${n}'. Sending error to server.`),a=this._createCompletionMessage(e.invocationId,"Client provided multiple results.",null)),c=void 0}catch(u){c=u,this._logger.log(p.Error,`A callback for the method '${n}' threw error '${u}'.`)}a?yield this._sendWithProtocol(a):o?(c?a=this._createCompletionMessage(e.invocationId,`${c}`,null):r!==void 0?a=this._createCompletionMessage(e.invocationId,null,r):(this._logger.log(p.Warning,`No result given for '${n}' method and invocation ID '${e.invocationId}'.`),a=this._createCompletionMessage(e.invocationId,"Client didn't provide a result.",null)),yield this._sendWithProtocol(a)):r&&this._logger.log(p.Error,`Result given for '${n}' method but server is not expecting a result.`)})}_connectionClosed(e){this._logger.log(p.Debug,`HubConnection.connectionClosed(${e}) called while in state ${this._connectionState}.`),this._stopDuringStartError=this._stopDuringStartError||e||new et("The underlying connection was closed before the hub handshake could complete."),this._handshakeResolver&&this._handshakeResolver(),this._cancelCallbacksWithError(e||new Error("Invocation canceled due to the underlying connection being closed.")),this._cleanupTimeout(),this._cleanupPingTimer(),this._connectionState===be.Disconnecting?this._completeClose(e):this._connectionState===be.Connected&&this._reconnectPolicy?this._reconnect(e):this._connectionState===be.Connected&&this._completeClose(e)}_completeClose(e){if(this._connectionStarted){this._connectionState=be.Disconnected,this._connectionStarted=!1,this._messageBuffer&&(this._messageBuffer._dispose(e!=null?e:new Error("Connection closed.")),this._messageBuffer=void 0),Se.isBrowser&&window.document.removeEventListener("freeze",this._freezeEventListener);try{this._closedCallbacks.forEach(n=>n.apply(this,[e]))}catch(n){this._logger.log(p.Error,`An onclose callback called with error '${e}' threw error '${n}'.`)}}}_reconnect(e){return y(this,null,function*(){const n=Date.now();let s=0,i=e!==void 0?e:new Error("Attempting to reconnect due to a unknown error."),o=this._getNextRetryDelay(s++,0,i);if(o===null){this._logger.log(p.Debug,"Connection not reconnecting because the IRetryPolicy returned null on the first reconnect attempt."),this._completeClose(e);return}if(this._connectionState=be.Reconnecting,e?this._logger.log(p.Information,`Connection reconnecting because of error '${e}'.`):this._logger.log(p.Information,"Connection reconnecting."),this._reconnectingCallbacks.length!==0){try{this._reconnectingCallbacks.forEach(r=>r.apply(this,[e]))}catch(r){this._logger.log(p.Error,`An onreconnecting callback called with error '${e}' threw error '${r}'.`)}if(this._connectionState!==be.Reconnecting){this._logger.log(p.Debug,"Connection left the reconnecting state in onreconnecting callback. Done reconnecting.");return}}for(;o!==null;){if(this._logger.log(p.Information,`Reconnect attempt number ${s} will start in ${o} ms.`),yield new Promise(r=>{this._reconnectDelayHandle=setTimeout(r,o)}),this._reconnectDelayHandle=void 0,this._connectionState!==be.Reconnecting){this._logger.log(p.Debug,"Connection left the reconnecting state during reconnect delay. Done reconnecting.");return}try{if(yield this._startInternal(),this._connectionState=be.Connected,this._logger.log(p.Information,"HubConnection reconnected successfully."),this._reconnectedCallbacks.length!==0)try{this._reconnectedCallbacks.forEach(r=>r.apply(this,[this.connection.connectionId]))}catch(r){this._logger.log(p.Error,`An onreconnected callback called with connectionId '${this.connection.connectionId}; threw error '${r}'.`)}return}catch(r){if(this._logger.log(p.Information,`Reconnect attempt failed because of error '${r}'.`),this._connectionState!==be.Reconnecting){this._logger.log(p.Debug,`Connection moved to the '${this._connectionState}' from the reconnecting state during reconnect attempt. Done reconnecting.`),this._connectionState===be.Disconnecting&&this._completeClose();return}i=r instanceof Error?r:new Error(r.toString()),o=this._getNextRetryDelay(s++,Date.now()-n,i)}}this._logger.log(p.Information,`Reconnect retries have been exhausted after ${Date.now()-n} ms and ${s} failed attempts. Connection disconnecting.`),this._completeClose()})}_getNextRetryDelay(e,n,s){try{return this._reconnectPolicy.nextRetryDelayInMilliseconds({elapsedMilliseconds:n,previousRetryCount:e,retryReason:s})}catch(i){return this._logger.log(p.Error,`IRetryPolicy.nextRetryDelayInMilliseconds(${e}, ${n}) threw error '${i}'.`),null}}_cancelCallbacksWithError(e){const n=this._callbacks;this._callbacks={},Object.keys(n).forEach(s=>{const i=n[s];try{i(null,e)}catch(o){this._logger.log(p.Error,`Stream 'error' callback called with '${e}' threw error: ${Sn(o)}`)}})}_cleanupPingTimer(){this._pingServerHandle&&(clearTimeout(this._pingServerHandle),this._pingServerHandle=void 0)}_cleanupTimeout(){this._timeoutHandle&&clearTimeout(this._timeoutHandle)}_createInvocation(e,n,s,i){if(s)return i.length!==0?{arguments:n,streamIds:i,target:e,type:G.Invocation}:{arguments:n,target:e,type:G.Invocation};{const o=this._invocationId;return this._invocationId++,i.length!==0?{arguments:n,invocationId:o.toString(),streamIds:i,target:e,type:G.Invocation}:{arguments:n,invocationId:o.toString(),target:e,type:G.Invocation}}}_launchStreams(e,n){if(e.length!==0){n||(n=Promise.resolve());for(const s in e)e[s].subscribe({complete:()=>{n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(s)))},error:i=>{let o;i instanceof Error?o=i.message:i&&i.toString?o=i.toString():o="Unknown error",n=n.then(()=>this._sendWithProtocol(this._createCompletionMessage(s,o)))},next:i=>{n=n.then(()=>this._sendWithProtocol(this._createStreamItemMessage(s,i)))}})}}_replaceStreamingParams(e){const n=[],s=[];for(let i=0;i<e.length;i++){const o=e[i];if(this._isObservable(o)){const r=this._invocationId;this._invocationId++,n[r]=o,s.push(r.toString()),e.splice(i,1)}}return[n,s]}_isObservable(e){return e&&e.subscribe&&typeof e.subscribe=="function"}_createStreamInvocation(e,n,s){const i=this._invocationId;return this._invocationId++,s.length!==0?{arguments:n,invocationId:i.toString(),streamIds:s,target:e,type:G.StreamInvocation}:{arguments:n,invocationId:i.toString(),target:e,type:G.StreamInvocation}}_createCancelInvocation(e){return{invocationId:e,type:G.CancelInvocation}}_createStreamItemMessage(e,n){return{invocationId:e,item:n,type:G.StreamItem}}_createCompletionMessage(e,n,s){return n?{error:n,invocationId:e,type:G.Completion}:{invocationId:e,result:s,type:G.Completion}}_createCloseMessage(){return{type:G.Close}}}const Go=[0,2e3,1e4,3e4,null];class is{constructor(e){this._retryDelays=e!==void 0?[...e,null]:Go}nextRetryDelayInMilliseconds(e){return this._retryDelays[e.previousRetryCount]}}class mt{}mt.Authorization="Authorization",mt.Cookie="Cookie";class Ko extends rn{constructor(e,n){super(),this._innerClient=e,this._accessTokenFactory=n}send(e){return y(this,null,function*(){let n=!0;this._accessTokenFactory&&(!this._accessToken||e.url&&e.url.indexOf("/negotiate?")>0)&&(n=!1,this._accessToken=yield this._accessTokenFactory()),this._setAuthorizationHeader(e);const s=yield this._innerClient.send(e);return n&&s.statusCode===401&&this._accessTokenFactory?(this._accessToken=yield this._accessTokenFactory(),this._setAuthorizationHeader(e),yield this._innerClient.send(e)):s})}_setAuthorizationHeader(e){e.headers||(e.headers={}),this._accessToken?e.headers[mt.Authorization]=`Bearer ${this._accessToken}`:this._accessTokenFactory&&e.headers[mt.Authorization]&&delete e.headers[mt.Authorization]}getCookieString(e){return this._innerClient.getCookieString(e)}}var $e;(function(t){t[t.None=0]="None",t[t.WebSockets=1]="WebSockets",t[t.ServerSentEvents=2]="ServerSentEvents",t[t.LongPolling=4]="LongPolling"})($e||($e={}));var Ue;(function(t){t[t.Text=1]="Text",t[t.Binary=2]="Binary"})(Ue||(Ue={}));let Qo=class{constructor(){this._isAborted=!1,this.onabort=null}abort(){this._isAborted||(this._isAborted=!0,this.onabort&&this.onabort())}get signal(){return this}get aborted(){return this._isAborted}};class os{get pollAborted(){return this._pollAbort.aborted}constructor(e,n,s){this._httpClient=e,this._logger=n,this._pollAbort=new Qo,this._options=s,this._running=!1,this.onreceive=null,this.onclose=null}connect(e,n){return y(this,null,function*(){if(Te.isRequired(e,"url"),Te.isRequired(n,"transferFormat"),Te.isIn(n,Ue,"transferFormat"),this._url=e,this._logger.log(p.Trace,"(LongPolling transport) Connecting."),n===Ue.Binary&&typeof XMLHttpRequest!="undefined"&&typeof new XMLHttpRequest().responseType!="string")throw new Error("Binary protocols over XmlHttpRequest not implementing advanced features are not supported.");const[s,i]=Pt(),o=j({[s]:i},this._options.headers),r={abortSignal:this._pollAbort.signal,headers:o,timeout:1e5,withCredentials:this._options.withCredentials};n===Ue.Binary&&(r.responseType="arraybuffer");const c=`${e}&_=${Date.now()}`;this._logger.log(p.Trace,`(LongPolling transport) polling: ${c}.`);const a=yield this._httpClient.get(c,r);a.statusCode!==200?(this._logger.log(p.Error,`(LongPolling transport) Unexpected response code: ${a.statusCode}.`),this._closeError=new pt(a.statusText||"",a.statusCode),this._running=!1):this._running=!0,this._receiving=this._poll(this._url,r)})}_poll(e,n){return y(this,null,function*(){try{for(;this._running;)try{const s=`${e}&_=${Date.now()}`;this._logger.log(p.Trace,`(LongPolling transport) polling: ${s}.`);const i=yield this._httpClient.get(s,n);i.statusCode===204?(this._logger.log(p.Information,"(LongPolling transport) Poll terminated by server."),this._running=!1):i.statusCode!==200?(this._logger.log(p.Error,`(LongPolling transport) Unexpected response code: ${i.statusCode}.`),this._closeError=new pt(i.statusText||"",i.statusCode),this._running=!1):i.content?(this._logger.log(p.Trace,`(LongPolling transport) data received. ${Vt(i.content,this._options.logMessageContent)}.`),this.onreceive&&this.onreceive(i.content)):this._logger.log(p.Trace,"(LongPolling transport) Poll timed out, reissuing.")}catch(s){this._running?s instanceof An?this._logger.log(p.Trace,"(LongPolling transport) Poll timed out, reissuing."):(this._closeError=s,this._running=!1):this._logger.log(p.Trace,`(LongPolling transport) Poll errored after shutdown: ${s.message}`)}}finally{this._logger.log(p.Trace,"(LongPolling transport) Polling complete."),this.pollAborted||this._raiseOnClose()}})}send(e){return y(this,null,function*(){return this._running?ns(this._logger,"LongPolling",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return y(this,null,function*(){this._logger.log(p.Trace,"(LongPolling transport) Stopping polling."),this._running=!1,this._pollAbort.abort();try{yield this._receiving,this._logger.log(p.Trace,`(LongPolling transport) sending DELETE request to ${this._url}.`);const e={},[n,s]=Pt();e[n]=s;const i={headers:j(j({},e),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials};let o;try{yield this._httpClient.delete(this._url,i)}catch(r){o=r}o?o instanceof pt&&(o.statusCode===404?this._logger.log(p.Trace,"(LongPolling transport) A 404 response was returned from sending a DELETE request."):this._logger.log(p.Trace,`(LongPolling transport) Error sending a DELETE request: ${o}`)):this._logger.log(p.Trace,"(LongPolling transport) DELETE request accepted.")}finally{this._logger.log(p.Trace,"(LongPolling transport) Stop finished."),this._raiseOnClose()}})}_raiseOnClose(){if(this.onclose){let e="(LongPolling transport) Firing onclose event.";this._closeError&&(e+=" Error: "+this._closeError),this._logger.log(p.Trace,e),this.onclose(this._closeError)}}}class Jo{constructor(e,n,s,i){this._httpClient=e,this._accessToken=n,this._logger=s,this._options=i,this.onreceive=null,this.onclose=null}connect(e,n){return y(this,null,function*(){return Te.isRequired(e,"url"),Te.isRequired(n,"transferFormat"),Te.isIn(n,Ue,"transferFormat"),this._logger.log(p.Trace,"(SSE transport) Connecting."),this._url=e,this._accessToken&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(this._accessToken)}`),new Promise((s,i)=>{let o=!1;if(n!==Ue.Text){i(new Error("The Server-Sent Events transport only supports the 'Text' transfer format"));return}let r;if(Se.isBrowser||Se.isWebWorker)r=new this._options.EventSource(e,{withCredentials:this._options.withCredentials});else{const c=this._httpClient.getCookieString(e),a={};a.Cookie=c;const[d,u]=Pt();a[d]=u,r=new this._options.EventSource(e,{withCredentials:this._options.withCredentials,headers:j(j({},a),this._options.headers)})}try{r.onmessage=c=>{if(this.onreceive)try{this._logger.log(p.Trace,`(SSE transport) data received. ${Vt(c.data,this._options.logMessageContent)}.`),this.onreceive(c.data)}catch(a){this._close(a);return}},r.onerror=c=>{o?this._close():i(new Error("EventSource failed to connect. The connection could not be found on the server, either the connection ID is not present on the server, or a proxy is refusing/buffering the connection. If you have multiple servers check that sticky sessions are enabled."))},r.onopen=()=>{this._logger.log(p.Information,`SSE connected to ${this._url}`),this._eventSource=r,o=!0,s()}}catch(c){i(c);return}})})}send(e){return y(this,null,function*(){return this._eventSource?ns(this._logger,"SSE",this._httpClient,this._url,e,this._options):Promise.reject(new Error("Cannot send until the transport is connected"))})}stop(){return this._close(),Promise.resolve()}_close(e){this._eventSource&&(this._eventSource.close(),this._eventSource=void 0,this.onclose&&this.onclose(e))}}class er{constructor(e,n,s,i,o,r){this._logger=s,this._accessTokenFactory=n,this._logMessageContent=i,this._webSocketConstructor=o,this._httpClient=e,this.onreceive=null,this.onclose=null,this._headers=r}connect(e,n){return y(this,null,function*(){Te.isRequired(e,"url"),Te.isRequired(n,"transferFormat"),Te.isIn(n,Ue,"transferFormat"),this._logger.log(p.Trace,"(WebSockets transport) Connecting.");let s;return this._accessTokenFactory&&(s=yield this._accessTokenFactory()),new Promise((i,o)=>{e=e.replace(/^http/,"ws");let r;const c=this._httpClient.getCookieString(e);let a=!1;if(Se.isNode||Se.isReactNative){const d={},[u,f]=Pt();d[u]=f,s&&(d[mt.Authorization]=`Bearer ${s}`),c&&(d[mt.Cookie]=c),r=new this._webSocketConstructor(e,void 0,{headers:j(j({},d),this._headers)})}else s&&(e+=(e.indexOf("?")<0?"?":"&")+`access_token=${encodeURIComponent(s)}`);r||(r=new this._webSocketConstructor(e)),n===Ue.Binary&&(r.binaryType="arraybuffer"),r.onopen=d=>{this._logger.log(p.Information,`WebSocket connected to ${e}.`),this._webSocket=r,a=!0,i()},r.onerror=d=>{let u=null;typeof ErrorEvent!="undefined"&&d instanceof ErrorEvent?u=d.error:u="There was an error with the transport",this._logger.log(p.Information,`(WebSockets transport) ${u}.`)},r.onmessage=d=>{if(this._logger.log(p.Trace,`(WebSockets transport) data received. ${Vt(d.data,this._logMessageContent)}.`),this.onreceive)try{this.onreceive(d.data)}catch(u){this._close(u);return}},r.onclose=d=>{if(a)this._close(d);else{let u=null;typeof ErrorEvent!="undefined"&&d instanceof ErrorEvent?u=d.error:u="WebSocket failed to connect. The connection could not be found on the server, either the endpoint may not be a SignalR endpoint, the connection ID is not present on the server, or there is a proxy blocking WebSockets. If you have multiple servers check that sticky sessions are enabled.",o(new Error(u))}}})})}send(e){return this._webSocket&&this._webSocket.readyState===this._webSocketConstructor.OPEN?(this._logger.log(p.Trace,`(WebSockets transport) sending data. ${Vt(e,this._logMessageContent)}.`),this._webSocket.send(e),Promise.resolve()):Promise.reject("WebSocket is not in the OPEN state")}stop(){return this._webSocket&&this._close(void 0),Promise.resolve()}_close(e){this._webSocket&&(this._webSocket.onclose=()=>{},this._webSocket.onmessage=()=>{},this._webSocket.onerror=()=>{},this._webSocket.close(),this._webSocket=void 0),this._logger.log(p.Trace,"(WebSockets transport) socket closed."),this.onclose&&(this._isCloseEvent(e)&&(e.wasClean===!1||e.code!==1e3)?this.onclose(new Error(`WebSocket closed with status code: ${e.code} (${e.reason||"no reason given"}).`)):e instanceof Error?this.onclose(e):this.onclose())}_isCloseEvent(e){return e&&typeof e.wasClean=="boolean"&&typeof e.code=="number"}}const rs=100;class tr{constructor(e,n={}){if(this._stopPromiseResolver=()=>{},this.features={},this._negotiateVersion=1,Te.isRequired(e,"url"),this._logger=$o(n.logger),this.baseUrl=this._resolveUrl(e),n=n||{},n.logMessageContent=n.logMessageContent===void 0?!1:n.logMessageContent,typeof n.withCredentials=="boolean"||n.withCredentials===void 0)n.withCredentials=n.withCredentials===void 0?!0:n.withCredentials;else throw new Error("withCredentials option was not a 'boolean' or 'undefined' value");n.timeout=n.timeout===void 0?100*1e3:n.timeout;let s=null,i=null;if(Se.isNode&&typeof require!="undefined"){const o=typeof __webpack_require__=="function"?__non_webpack_require__:require;s=o("ws"),i=o("eventsource")}!Se.isNode&&typeof WebSocket!="undefined"&&!n.WebSocket?n.WebSocket=WebSocket:Se.isNode&&!n.WebSocket&&s&&(n.WebSocket=s),!Se.isNode&&typeof EventSource!="undefined"&&!n.EventSource?n.EventSource=EventSource:Se.isNode&&!n.EventSource&&typeof i!="undefined"&&(n.EventSource=i),this._httpClient=new Ko(n.httpClient||new jo(this._logger),n.accessTokenFactory),this._connectionState="Disconnected",this._connectionStarted=!1,this._options=n,this.onreceive=null,this.onclose=null}start(e){return y(this,null,function*(){if(e=e||Ue.Binary,Te.isIn(e,Ue,"transferFormat"),this._logger.log(p.Debug,`Starting connection with transfer format '${Ue[e]}'.`),this._connectionState!=="Disconnected")return Promise.reject(new Error("Cannot start an HttpConnection that is not in the 'Disconnected' state."));if(this._connectionState="Connecting",this._startInternalPromise=this._startInternal(e),yield this._startInternalPromise,this._connectionState==="Disconnecting"){const n="Failed to start the HttpConnection before stop() was called.";return this._logger.log(p.Error,n),yield this._stopPromise,Promise.reject(new et(n))}else if(this._connectionState!=="Connected"){const n="HttpConnection.startInternal completed gracefully but didn't enter the connection into the connected state!";return this._logger.log(p.Error,n),Promise.reject(new et(n))}this._connectionStarted=!0})}send(e){return this._connectionState!=="Connected"?Promise.reject(new Error("Cannot send data if the connection is not in the 'Connected' State.")):(this._sendQueue||(this._sendQueue=new In(this.transport)),this._sendQueue.send(e))}stop(e){return y(this,null,function*(){if(this._connectionState==="Disconnected")return this._logger.log(p.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnected state.`),Promise.resolve();if(this._connectionState==="Disconnecting")return this._logger.log(p.Debug,`Call to HttpConnection.stop(${e}) ignored because the connection is already in the disconnecting state.`),this._stopPromise;this._connectionState="Disconnecting",this._stopPromise=new Promise(n=>{this._stopPromiseResolver=n}),yield this._stopInternal(e),yield this._stopPromise})}_stopInternal(e){return y(this,null,function*(){this._stopError=e;try{yield this._startInternalPromise}catch(n){}if(this.transport){try{yield this.transport.stop()}catch(n){this._logger.log(p.Error,`HttpConnection.transport.stop() threw error '${n}'.`),this._stopConnection()}this.transport=void 0}else this._logger.log(p.Debug,"HttpConnection.transport is undefined in HttpConnection.stop() because start() failed.")})}_startInternal(e){return y(this,null,function*(){let n=this.baseUrl;this._accessTokenFactory=this._options.accessTokenFactory,this._httpClient._accessTokenFactory=this._accessTokenFactory;try{if(this._options.skipNegotiation)if(this._options.transport===$e.WebSockets)this.transport=this._constructTransport($e.WebSockets),yield this._startTransport(n,e);else throw new Error("Negotiation can only be skipped when using the WebSocket transport directly.");else{let s=null,i=0;do{if(s=yield this._getNegotiationResponse(n),this._connectionState==="Disconnecting"||this._connectionState==="Disconnected")throw new et("The connection was stopped during negotiation.");if(s.error)throw new Error(s.error);if(s.ProtocolVersion)throw new Error("Detected a connection attempt to an ASP.NET SignalR Server. This client only supports connecting to an ASP.NET Core SignalR Server. See https://aka.ms/signalr-core-differences for details.");if(s.url&&(n=s.url),s.accessToken){const o=s.accessToken;this._accessTokenFactory=()=>o,this._httpClient._accessToken=o,this._httpClient._accessTokenFactory=void 0}i++}while(s.url&&i<rs);if(i===rs&&s.url)throw new Error("Negotiate redirection limit exceeded.");yield this._createTransport(n,this._options.transport,s,e)}this.transport instanceof os&&(this.features.inherentKeepAlive=!0),this._connectionState==="Connecting"&&(this._logger.log(p.Debug,"The HttpConnection connected successfully."),this._connectionState="Connected")}catch(s){return this._logger.log(p.Error,"Failed to start the connection: "+s),this._connectionState="Disconnected",this.transport=void 0,this._stopPromiseResolver(),Promise.reject(s)}})}_getNegotiationResponse(e){return y(this,null,function*(){const n={},[s,i]=Pt();n[s]=i;const o=this._resolveNegotiateUrl(e);this._logger.log(p.Debug,`Sending negotiation request: ${o}.`);try{const r=yield this._httpClient.post(o,{content:"",headers:j(j({},n),this._options.headers),timeout:this._options.timeout,withCredentials:this._options.withCredentials});if(r.statusCode!==200)return Promise.reject(new Error(`Unexpected status code returned from negotiate '${r.statusCode}'`));const c=JSON.parse(r.content);return(!c.negotiateVersion||c.negotiateVersion<1)&&(c.connectionToken=c.connectionId),c.useStatefulReconnect&&this._options._useStatefulReconnect!==!0?Promise.reject(new es("Client didn't negotiate Stateful Reconnect but the server did.")):c}catch(r){let c="Failed to complete negotiation with the server: "+r;return r instanceof pt&&r.statusCode===404&&(c=c+" Either this is not a SignalR endpoint or there is a proxy blocking the connection."),this._logger.log(p.Error,c),Promise.reject(new es(c))}})}_createConnectUrl(e,n){return n?e+(e.indexOf("?")===-1?"?":"&")+`id=${n}`:e}_createTransport(e,n,s,i){return y(this,null,function*(){let o=this._createConnectUrl(e,s.connectionToken);if(this._isITransport(n)){this._logger.log(p.Debug,"Connection was provided an instance of ITransport, using that directly."),this.transport=n,yield this._startTransport(o,i),this.connectionId=s.connectionId;return}const r=[],c=s.availableTransports||[];let a=s;for(const d of c){const u=this._resolveTransportOrError(d,n,i,(a==null?void 0:a.useStatefulReconnect)===!0);if(u instanceof Error)r.push(`${d.transport} failed:`),r.push(u);else if(this._isITransport(u)){if(this.transport=u,!a){try{a=yield this._getNegotiationResponse(e)}catch(f){return Promise.reject(f)}o=this._createConnectUrl(e,a.connectionToken)}try{yield this._startTransport(o,i),this.connectionId=a.connectionId;return}catch(f){if(this._logger.log(p.Error,`Failed to start the transport '${d.transport}': ${f}`),a=void 0,r.push(new Eo(`${d.transport} failed: ${f}`,$e[d.transport])),this._connectionState!=="Connecting"){const N="Failed to select transport before stop() was called.";return this._logger.log(p.Debug,N),Promise.reject(new et(N))}}}}return r.length>0?Promise.reject(new To(`Unable to connect to the server with any of the available transports. ${r.join(" ")}`,r)):Promise.reject(new Error("None of the transports supported by the client are supported by the server."))})}_constructTransport(e){switch(e){case $e.WebSockets:if(!this._options.WebSocket)throw new Error("'WebSocket' is not supported in your environment.");return new er(this._httpClient,this._accessTokenFactory,this._logger,this._options.logMessageContent,this._options.WebSocket,this._options.headers||{});case $e.ServerSentEvents:if(!this._options.EventSource)throw new Error("'EventSource' is not supported in your environment.");return new Jo(this._httpClient,this._httpClient._accessToken,this._logger,this._options);case $e.LongPolling:return new os(this._httpClient,this._logger,this._options);default:throw new Error(`Unknown transport: ${e}.`)}}_startTransport(e,n){return this.transport.onreceive=this.onreceive,this.features.reconnect?this.transport.onclose=s=>y(this,null,function*(){let i=!1;if(this.features.reconnect)try{this.features.disconnected(),yield this.transport.connect(e,n),yield this.features.resend()}catch(o){i=!0}else{this._stopConnection(s);return}i&&this._stopConnection(s)}):this.transport.onclose=s=>this._stopConnection(s),this.transport.connect(e,n)}_resolveTransportOrError(e,n,s,i){const o=$e[e.transport];if(o==null)return this._logger.log(p.Debug,`Skipping transport '${e.transport}' because it is not supported by this client.`),new Error(`Skipping transport '${e.transport}' because it is not supported by this client.`);if(nr(n,o))if(e.transferFormats.map(c=>Ue[c]).indexOf(s)>=0){if(o===$e.WebSockets&&!this._options.WebSocket||o===$e.ServerSentEvents&&!this._options.EventSource)return this._logger.log(p.Debug,`Skipping transport '${$e[o]}' because it is not supported in your environment.'`),new ko(`'${$e[o]}' is not supported in your environment.`,o);this._logger.log(p.Debug,`Selecting transport '${$e[o]}'.`);try{return this.features.reconnect=o===$e.WebSockets?i:void 0,this._constructTransport(o)}catch(c){return c}}else return this._logger.log(p.Debug,`Skipping transport '${$e[o]}' because it does not support the requested transfer format '${Ue[s]}'.`),new Error(`'${$e[o]}' does not support ${Ue[s]}.`);else return this._logger.log(p.Debug,`Skipping transport '${$e[o]}' because it was disabled by the client.`),new Mo(`'${$e[o]}' is disabled by the client.`,o)}_isITransport(e){return e&&typeof e=="object"&&"connect"in e}_stopConnection(e){if(this._logger.log(p.Debug,`HttpConnection.stopConnection(${e}) called while in state ${this._connectionState}.`),this.transport=void 0,e=this._stopError||e,this._stopError=void 0,this._connectionState==="Disconnected"){this._logger.log(p.Debug,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is already in the disconnected state.`);return}if(this._connectionState==="Connecting")throw this._logger.log(p.Warning,`Call to HttpConnection.stopConnection(${e}) was ignored because the connection is still in the connecting state.`),new Error(`HttpConnection.stopConnection(${e}) was called while the connection is still in the connecting state.`);if(this._connectionState==="Disconnecting"&&this._stopPromiseResolver(),e?this._logger.log(p.Error,`Connection disconnected with error '${e}'.`):this._logger.log(p.Information,"Connection disconnected."),this._sendQueue&&(this._sendQueue.stop().catch(n=>{this._logger.log(p.Error,`TransportSendQueue.stop() threw error '${n}'.`)}),this._sendQueue=void 0),this.connectionId=void 0,this._connectionState="Disconnected",this._connectionStarted){this._connectionStarted=!1;try{this.onclose&&this.onclose(e)}catch(n){this._logger.log(p.Error,`HttpConnection.onclose(${e}) threw error '${n}'.`)}}}_resolveUrl(e){if(e.lastIndexOf("https://",0)===0||e.lastIndexOf("http://",0)===0)return e;if(!Se.isBrowser)throw new Error(`Cannot resolve '${e}'.`);const n=window.document.createElement("a");return n.href=e,this._logger.log(p.Information,`Normalizing '${e}' to '${n.href}'.`),n.href}_resolveNegotiateUrl(e){const n=new URL(e);n.pathname.endsWith("/")?n.pathname+="negotiate":n.pathname+="/negotiate";const s=new URLSearchParams(n.searchParams);return s.has("negotiateVersion")||s.append("negotiateVersion",this._negotiateVersion.toString()),s.has("useStatefulReconnect")?s.get("useStatefulReconnect")==="true"&&(this._options._useStatefulReconnect=!0):this._options._useStatefulReconnect===!0&&s.append("useStatefulReconnect","true"),n.search=s.toString(),n.toString()}}function nr(t,e){return!t||(e&t)!==0}class In{constructor(e){this._transport=e,this._buffer=[],this._executing=!0,this._sendBufferedData=new cn,this._transportResult=new cn,this._sendLoopPromise=this._sendLoop()}send(e){return this._bufferData(e),this._transportResult||(this._transportResult=new cn),this._transportResult.promise}stop(){return this._executing=!1,this._sendBufferedData.resolve(),this._sendLoopPromise}_bufferData(e){if(this._buffer.length&&typeof this._buffer[0]!=typeof e)throw new Error(`Expected data to be of type ${typeof this._buffer} but was of type ${typeof e}`);this._buffer.push(e),this._sendBufferedData.resolve()}_sendLoop(){return y(this,null,function*(){for(;;){if(yield this._sendBufferedData.promise,!this._executing){this._transportResult&&this._transportResult.reject("Connection stopped.");break}this._sendBufferedData=new cn;const e=this._transportResult;this._transportResult=void 0;const n=typeof this._buffer[0]=="string"?this._buffer.join(""):In._concatBuffers(this._buffer);this._buffer.length=0;try{yield this._transport.send(n),e.resolve()}catch(s){e.reject(s)}}})}static _concatBuffers(e){const n=e.map(o=>o.byteLength).reduce((o,r)=>o+r),s=new Uint8Array(n);let i=0;for(const o of e)s.set(new Uint8Array(o),i),i+=o.byteLength;return s.buffer}}class cn{constructor(){this.promise=new Promise((e,n)=>[this._resolver,this._rejecter]=[e,n])}resolve(){this._resolver()}reject(e){this._rejecter(e)}}const sr="json";class ir{constructor(){this.name=sr,this.version=2,this.transferFormat=Ue.Text}parseMessages(e,n){if(typeof e!="string")throw new Error("Invalid input for JSON hub protocol. Expected a string.");if(!e)return[];n===null&&(n=zt.instance);const s=Ze.parse(e),i=[];for(const o of s){const r=JSON.parse(o);if(typeof r.type!="number")throw new Error("Invalid payload.");switch(r.type){case G.Invocation:this._isInvocationMessage(r);break;case G.StreamItem:this._isStreamItemMessage(r);break;case G.Completion:this._isCompletionMessage(r);break;case G.Ping:break;case G.Close:break;case G.Ack:this._isAckMessage(r);break;case G.Sequence:this._isSequenceMessage(r);break;default:n.log(p.Information,"Unknown message type '"+r.type+"' ignored.");continue}i.push(r)}return i}writeMessage(e){return Ze.write(JSON.stringify(e))}_isInvocationMessage(e){this._assertNotEmptyString(e.target,"Invalid payload for Invocation message."),e.invocationId!==void 0&&this._assertNotEmptyString(e.invocationId,"Invalid payload for Invocation message.")}_isStreamItemMessage(e){if(this._assertNotEmptyString(e.invocationId,"Invalid payload for StreamItem message."),e.item===void 0)throw new Error("Invalid payload for StreamItem message.")}_isCompletionMessage(e){if(e.result&&e.error)throw new Error("Invalid payload for Completion message.");!e.result&&e.error&&this._assertNotEmptyString(e.error,"Invalid payload for Completion message."),this._assertNotEmptyString(e.invocationId,"Invalid payload for Completion message.")}_isAckMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Ack message.")}_isSequenceMessage(e){if(typeof e.sequenceId!="number")throw new Error("Invalid SequenceId for Sequence message.")}_assertNotEmptyString(e,n){if(typeof e!="string"||e==="")throw new Error(n)}}const or={trace:p.Trace,debug:p.Debug,info:p.Information,information:p.Information,warn:p.Warning,warning:p.Warning,error:p.Error,critical:p.Critical,none:p.None};function rr(t){const e=or[t.toLowerCase()];if(typeof e!="undefined")return e;throw new Error(`Unknown log level: ${t}`)}class ar{configureLogging(e){if(Te.isRequired(e,"logging"),cr(e))this.logger=e;else if(typeof e=="string"){const n=rr(e);this.logger=new an(n)}else this.logger=new an(e);return this}withUrl(e,n){return Te.isRequired(e,"url"),Te.isNotEmpty(e,"url"),this.url=e,typeof n=="object"?this.httpConnectionOptions=j(j({},this.httpConnectionOptions),n):this.httpConnectionOptions=se(j({},this.httpConnectionOptions),{transport:n}),this}withHubProtocol(e){return Te.isRequired(e,"protocol"),this.protocol=e,this}withAutomaticReconnect(e){if(this.reconnectPolicy)throw new Error("A reconnectPolicy has already been set.");return e?Array.isArray(e)?this.reconnectPolicy=new is(e):this.reconnectPolicy=e:this.reconnectPolicy=new is,this}withServerTimeout(e){return Te.isRequired(e,"milliseconds"),this._serverTimeoutInMilliseconds=e,this}withKeepAliveInterval(e){return Te.isRequired(e,"milliseconds"),this._keepAliveIntervalInMilliseconds=e,this}withStatefulReconnect(e){return this.httpConnectionOptions===void 0&&(this.httpConnectionOptions={}),this.httpConnectionOptions._useStatefulReconnect=!0,this._statefulReconnectBufferSize=e==null?void 0:e.bufferSize,this}build(){const e=this.httpConnectionOptions||{};if(e.logger===void 0&&(e.logger=this.logger),!this.url)throw new Error("The 'HubConnectionBuilder.withUrl' method must be called before building the connection.");const n=new tr(this.url,e);return xn.create(n,this.logger||zt.instance,this.protocol||new ir,this.reconnectPolicy,this._serverTimeoutInMilliseconds,this._keepAliveIntervalInMilliseconds,this._statefulReconnectBufferSize)}}function cr(t){return t.log!==void 0}function De(t,e={}){var c;const{popupRequestInfo:n}=window;t=Ht(t);const s=(c=n==null?void 0:n.credentialType)==null?void 0:c.toUpperCase(),i=n==null?void 0:n.accessToken,r=j(j({},{method:"GET",headers:{}}),e);switch(r.body&&typeof r.body=="object"&&(r.body instanceof FormData?r.headers=se(j({},r.headers),{"Content-Type":"multipart/form-data"}):(r.headers=se(j({},r.headers),{"Content-Type":"application/json"}),r.body=JSON.stringify(r.body))),s){case"COOKIE":r.credentials="include";break;case"QUERY":break;default:i&&(r.headers=se(j({},r.headers),{Authorization:`Bearer ${i}`}));break}return fetch(t,r).then(a=>{if(!a.ok){console.error(`HTTP error! status: ${a.status}`);return}return a.json()}).then(a=>{if(a&&a.code){if(a.code!=="0"){console.error(`API error! code: ${a.code}, message: ${a.message}`);return}return a.data}return a}).catch(a=>{console.error("Error fetching data:",a)})}function Wt(t,e){if(!e)return t;let n="";for(let s in e){const i=e[s];i!=null&&(n.length>0&&(n+="&"),n+=`${encodeURIComponent(s)}=${encodeURIComponent(i)}`)}return t.indexOf("?")===-1?t+="?"+n:t+="&"+n,t}function as(t){return y(this,null,function*(){if(!t||t.length===0)return[];const s=yield De("user/batch/get",{method:"POST",body:{ids:t}});return!s||!Array.isArray(s)?[]:s.map(i=>({id:i.id,username:i.username,fullName:i.fullName,avatarUrl:i.avatarUrl}))})}const qt=window,lr=qt.indexedDB||qt.mozIndexedDB||qt.webkitIndexedDB||qt.msIndexedDB||qt.shimIndexedDB,dr="chatPopupDb",ur=1,ln="users";function hr(t){if(!t.objectStoreNames.contains(ln)){const e=t.createObjectStore(ln,{keyPath:"id",autoIncrement:!1});["username","fullName","avatarUrl"].forEach(n=>e.createIndex(n,n,{unique:!1}))}}let dn;function fr(){return new Promise((t,e)=>{if(dn)t(dn);else{const n=lr.open(dr,ur);n.onerror=s=>e(s.target.error),n.onsuccess=s=>{dn=s.target.result,t(dn)},n.onupgradeneeded=s=>{const i=s.target.result;hr(i)}}})}function cs(t,e){return y(this,null,function*(){const n=yield fr();return n?n.transaction(ln,t,e).objectStore(ln):void 0})}function gr(t){return new Promise((e,n)=>y(null,null,function*(){if(t==="SYSTEM"){e({id:"SYSTEM",username:"system",fullName:"Hệ thống"});return}const s=yield cs("readonly");if(!s){n(new Error("User object store not found"));return}const i=s.get(t);i.onsuccess=o=>y(null,null,function*(){const r=o.target.result;e(r)}),i.onerror=o=>n(o.target.error)}))}function pr(t){return y(this,null,function*(){const e=yield cs("readwrite");if(!e)throw new Error("User object store not found");return new Promise((n,s)=>{const i=e.put(t);i.onsuccess=o=>n(o.target.result),i.onerror=o=>s(o.target.error)})})}function Cr(t){return y(this,null,function*(){const e=t.map(s=>gr(s));return(yield Promise.all(e)).filter(s=>s!==void 0)})}function Rt(t){return y(this,null,function*(){const e=Array.from(new Set(t.filter(r=>typeof r=="string"&&r.length>0))),n=yield Cr(e),s=e.filter(r=>!n.some(c=>c.id===r)),i=yield as(s);yield Promise.all(i.map(r=>pr(r)));const o=[...n,...i];return new Map(o.map(r=>[r.id,r]))})}function un(t){return{id:t.id||t.conversationId,name:t.name,lastMessage:t.lastMessage,updatedAt:t.updatedAt||t.dateTime,type:t.type,membersCount:t.membersCount,status:t.status,isPinned:t.isPinned,isRead:t.isRead,traceId:t.traceId}}function lt(t,e){if(!t)return;let n;e||t.quotedMessage&&(n=lt(t.quotedMessage,!0));const s=t.body;return s&&Array.isArray(s.files)&&(s.files=s.files.map(i=>{const o=i.thumbId?Ht(`file/${i.thumbId}`):void 0,r=Ht(`file/${i.id||i.fileId}`);return{id:i.id||i.fileId,thumbId:i.thumbId,url:r,name:i.name,contentType:i.contentType,thumbUrl:o}})),{id:t.id||t.messageId,conversationId:t.conversationId,senderId:t.senderId||t.editedBy,sender:t.sender,body:s,sentAt:t.sentAt,deleted:t.deleted,edited:t.edited,mentions:t.mentions,deletedFor:t.deletedFor,quotedMessage:n,traceId:t.traceId}}function hn(t){return y(this,null,function*(){const e=t.lastMessage?[t.lastMessage.senderId]:[],n=yield Rt(e);if(t.lastMessage){const s=n.get(t.lastMessage.senderId);s&&(t.lastMessage.sender=s,t.lastMessage.sentAt=t.lastMessage.sentAt?new Date(t.lastMessage.sentAt):new Date)}return{id:t.id,name:t.name,lastMessage:t.lastMessage,updatedAt:new Date(t.updatedAt),type:t.type,membersCount:t.membersCount,status:t.status,isPinned:t.isPinned,isRead:t.isRead,traceId:t.traceId}})}function $t(t,e=new Set){return t.senderId&&e.add(t.senderId),t.quotedMessage&&$t(t.quotedMessage,e),e}function Dt(t,e){const n=t.sender||e.get(t.senderId),s=t.quotedMessage?Dt(t.quotedMessage,e):void 0;return t.sender=n,s&&(t.quotedMessage=s),t}function Bt(t){if(!t)return;const e=t.quotedMessage?Bt(t.quotedMessage):void 0,n={id:t.id,conversationId:t.conversationId,sender:t.sender,body:t.body,sentAt:t.sentAt?new Date(t.sentAt):new Date,deleted:t.deleted,edited:t.edited,mentions:t.mentions,deletedFor:t.deletedFor,traceId:t.traceId};return e&&(n.quotedMessage=e),n}function ls(t,e){var c;if(!t)return console.error("URL base is not defined."),"";e=e?e.startsWith("/")?e.slice(1):e:"";let n=t.endsWith("/")?`${t}${e}`:`${t}/${e}`;n.endsWith("/")&&(n=n.slice(0,-1));const{popupRequestInfo:s}=window,i=(c=s==null?void 0:s.credentialType)==null?void 0:c.toUpperCase(),o=s==null?void 0:s.credentialName,r=s==null?void 0:s.accessToken;switch(i){case"COOKIE":const a=new URL(n);a.searchParams.append("credentialType",i),a.searchParams.append("credentialName",o||""),n=a.toString();break;case"QUERY":if(r){const d=new URL(n);d.searchParams.append("access_token",r),n=d.toString()}break}return n}function Ht(t){const{popupRequestInfo:e}=window,n=e==null?void 0:e.apiUrlBase;return ls(n,t)}function mr(t){const{popupRequestInfo:e}=window,n=t||(e==null?void 0:e.hubUrlBase);return ls(n)}function vr(t){var i;let e=mr(t);const{popupRequestInfo:n}=window,s=(i=n==null?void 0:n.credentialType)==null?void 0:i.toUpperCase();if(s!="COOKIE"&&s!="QUERY"){const o=n==null?void 0:n.accessToken;if(o){const r=new URL(e);r.searchParams.append("access_token",o),e=r.toString()}}return new ar().withUrl(e).configureLogging(p.Information).withAutomaticReconnect().build()}const kn=window;kn.messagesCache={};function yr(t,e,n,s){return y(this,null,function*(){const i=Wt(`message/conversation/${t}/user`,{direction:e,messageId:n,top:s}),o=yield De(i);return!o||!Array.isArray(o)?[]:o.filter(r=>!!r).map(r=>lt(r))})}function wr(t){return y(this,null,function*(){const e="message";let n;t.quotedMessage&&(n=t.quotedMessage.id,n&&(kn.messagesCache[n]=t.quotedMessage));const s={conversationId:t.conversationId,body:t.body,quotedId:n,traceId:t.traceId},i=yield De(e,{method:"POST",body:s});return i.quotedMessage=t.quotedMessage,lt(i)})}function br(t){return y(this,null,function*(){if(!t||!t.id)return;const e=`message/${t.id}`;let n;t.quotedMessage&&(n=t.quotedMessage.id,n&&(kn.messagesCache[n]=t.quotedMessage));const s={body:t.body,quotedId:n,mentions:t.mentions},i=yield De(e,{method:"POST",body:s});return i.quotedMessage=t.quotedMessage,lt(i)})}function _r(t,e){return y(this,null,function*(){if(!t)return!1;e||(e="Recall");const n=`message/${t}/delete`;return!!(yield De(n,{method:"POST",body:{type:e}}))})}function ds(t){return y(this,null,function*(){if(!t)return;const e=`message/${t}`,n=yield De(e);if(n)return lt(n)})}function Ar(t){return y(this,null,function*(){if(!t||t.length===0)return[];const s=yield De("message/batch/get",{method:"POST",body:{ids:t}});return!s||!Array.isArray(s)?[]:s.map(i=>lt(i))})}function Sr(t,e,n,s){return y(this,null,function*(){var c;const i=Wt("aggregate/search",{conversationId:t,keyword:e,from:n,top:s,type:"MESSAGE"}),r=(c=(yield De(i)).filter(a=>a.type==="MESSAGE").at(0))==null?void 0:c.items;return r?r.map(a=>lt(a)):[]})}const fn=window;function xr(t,e){return y(this,null,function*(){if(!e||!t)return;if(!t.quotedMessage&&t.quotedId){const c=fn.messagesCache[t.quotedId];c?(t.quotedMessage=c,delete fn.messagesCache[t.quotedId]):t.quotedMessage=yield ds(t.quotedId)}const n=lt(t);if(!n)return;const s=$t(n),i=yield Rt(Array.from(s)),o=Dt(n,i),r=Bt(o);e(r)})}function Ir(t,e){return y(this,null,function*(){if(!e||!t)return;const n=un(t);if(!n)return;const s=yield hn(n);e(s)})}function kr(t,e){if(!e||!t)return;const{conversationId:n,name:s}=t;!n||!s||e(n,s)}function Mr(t,e){if(!e||!t)return;const{conversationId:n}=t;n&&e(n)}function Er(t,e){return y(this,null,function*(){if(!e||!t)return;if(!t.quotedMessage&&t.quotedId){const c=fn.messagesCache[t.quotedId];c?(t.quotedMessage=c,delete fn.messagesCache[t.quotedId]):t.quotedMessage=yield ds(t.quotedId)}const n=lt(t);if(!n)return;const s=$t(n),i=yield Rt(Array.from(s)),o=Dt(n,i),r=Bt(o);e(r)})}function Tr(t,e){if(!e||!t)return;const{messageId:n,conversationId:s,type:i,deletedBy:o}=t;!n||!s||e({messageId:n,conversationId:s,deleteType:i||"Recall",deletedBy:o||""})}let We;function Pr(t){return We&&We.stop(),We=vr(t),We?(We.on("UserStatusChanged",n=>console.log("UserStatusChanged",n)),{onConnected(n){We.on("Connected",n)},onMessageSent(n){We.on("MessageSent",s=>y(null,null,function*(){yield xr(s,n)}))},onMessageEdited(n){We.on("MessageEdited",s=>y(null,null,function*(){yield Er(s,n)}))},onMessageDeleted(n){We.on("MessageDeleted",s=>{Tr(s,n)})},onConversationCreated(n){We.on("ConversationCreated",s=>y(null,null,function*(){yield Ir(s,n)}))},onConversationBasicInfoChanged(n){We.on("ConversationBasicInfoChanged",s=>{kr(s,n)})},onConversationDeleted(n){We.on("ConversationDeleted",s=>{Mr(s,n)})},start:()=>We.start(),stop:()=>We.stop()}):void 0}function Rr(){return new Promise(t=>{t([{name:"Khiếu nại và hỗ trợ",description:"Tạo khiếu nại của khách hàng và được trợ giúp bởi hỗ trợ viên",conversationType:"HELP",icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABGCAYAAABbnhMrAAAAAXNSR0IArs4c6QAAG/hJREFUeF7tXHk8lNv/n2HGPggRcVEporihuvJttVaylW6khlJdKfuaJbJlK2QZVBSVdlFp0WZJkmgh5ep+lSWSyBIGv9fnMcd3cmds6d7++D2v1zTT85xzPue8z2f/nAce9//XdyGA/67eP7jzwMAACw6HY8XhcH14PL7/B5Ob0PD/OoCvXr0iNTY2ylVXV8s0ND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G1tfXh9evXX55Mmj8lgLm5uYuqq6rla2r+mtrb20eYPl20VXT69D8lJSUfMDopTw/I06dPpW7fvm1w9epV/YqKChUhIaGmtWvXnjM3N08c6/vE4wH4pwIwKytrTXJy8u7nz58r9/f3C4A7RKVSWXh4eHrweHwH/GUjAwODU3v27DlEv0h4gfrSpUsad+7c0S0rK1v+6tUrGT4+vo6lS5feMDExSdahO/4xHnDG0vanATA5Odnk8OHDlObmZn50uAm9gA3hGVTWaCcl+jdt2hSlqal5qr6+XrqsrEyptLR0cXV1tVJvby8XiUT6oKysfM/Q0PCioaFh5kT/dsNYwJvUSGSsBBm1gwOeBnr62c+eP9NAZ2noD0WCgw2gQhgHIPLw8LRzcnE1trW2inb39uBJJFKrlJTUU/g7CsuWLburoaGR/095Az8FB2Kv33t4ZBXkF2hAGgrCOThKi6piEJ2gI7q0cO6roKDgi9mzZV4oq6o+k5WVLZ4zZ87zsbzq/z0bzajvTwEgTCyJQjGNij4S0tTUNB1q0vTHdSFBAWBCqZVAIPRtMt10xIa854C43MQjiMkC8qcBEBaUceHCurPnLlgWlzxZ1tXZyY/iXnQiVUpKqszYeH3Kot8WHVFRURk8xPMvXz8VgIAFJCbu3Lyj9t93b+Xq6z9M7+ntIXBzcjfJzpF9M3f+3KJZs2Y1/suYfUP+pwPwZwJnLHP5P2JCPxnrY2whAAAAAElFTkSuQmCC"},{name:"Tư vấn đầu tư",description:"Tạo một cuộc hội thoại để bắt đầu nhận được các tư vấn đầu tư",botId:"BOT~rasaconnector",isDefault:!0,icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABZCAYAAACpHqNlAAAAAXNSR0IArs4c6QAAG71JREFUeF7tXAlYU0fXnpuQBAgCURFRqQvwsbhABUGgoihFoAhal7pUxaVaQVvr8nXRPvWrUpdafxcEra0VFVwQRRG1LqAoS63WBRcgAQSV1QbByBIg+f8zNxNuYoDEBfX7e5+HhyR3ljPvnG3OnBkK/fO8EALUi9SOjY3tW1paOlRGydh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1v0V/XoxIGaiEg4fnxIYuLRib+fPOVfUlLSWyne5IZwcjBbYYwYh5FonaXhom/mGTtwI9Sj0SQEjw8ySqXYTzM3Ny95z9Pz1IdjPozz9PQ8/7wnj3QF+oUBJB1mZWVZnjh1Kvjw4UPjr1+/Mbi+ro6r3ARiHjBU2/OAi8oASOI20JeG0QeesXjK6TWu+qlyAJXPN6xxGeSa5uPzfoLfqFHHXfr1K9IVgBct/9IAJIRAtCbheMLw+IOHJySnJAcWFxd3I2JNgg8kEEpWEsxBPLP8IhQqDBJwWx+rPnc+CAhMDBjld8jXm74943U9Lx1A5kAu37zc5+TR38ecOXN6fGZmphsAxtydI8dlweAAqPgOa8WqgOzdwsXXYKEFAoF4iJfX6fEfjo339PQ827t378evCzSVCW8PIiCrIC4uzvfwkSMTU86njC4rLTVRbmMydKD6+hWuv7Pva5/uH+Af/8HoDxJcB7jmtwe9uvTxSjlQEyHpV9Otjx85MSY5+dx4kUjkVCN5yiGcB4eyQe9ZWFjk+fr6Hvfz8zsUFBR0SZcBtXfZdgeQOcALGRfs7+fdtxKLxRa1tbVUx44dq6ytrfMsLCxy7OzsnrQ3GM/T32sF8HkIftPq/C/BcWIskM+NvgAAAABJRU5ErkJggg=="}])})}function $r(t,e){return y(this,null,function*(){var a,d;const n=Wt("conversation/user/pinned",{top:t,type:e,ignoredFields:"members"}),s=Wt("conversation/user",{top:t,type:e,ignoredFields:"members"}),i=yield Promise.all([De(n),De(s)]);let o=(a=i[0])==null?void 0:a.items,r=(d=i[1])==null?void 0:d.items;return o||(o=[]),r||(r=[]),[...o,...r].map(u=>un(u))})}function Dr(t){return y(this,null,function*(){const e=`conversation/${t}?ignoredFields=members`,n=yield De(e);if(n)return un(n)})}function Br(t){return y(this,null,function*(){const e=t.type?t.type:"BOT";let n="conversation";const s={name:t.name,traceId:t.traceId};switch(e){case"BOT":n+="/bot",s.botId=t.members?t.members.filter(f=>{var N;return(N=f.userId)==null?void 0:N.startsWith("BOT~")}).map(f=>f.userId)[0]:null;break;case"SURVEY":n+="/survey",s.botId=t.members?t.members.filter(f=>{var N;return(N=f.userId)==null?void 0:N.startsWith("BOT~")}).map(f=>f.userId)[0]:null;break;case"GROUP":n+="/group",s.memberIds=t.members?t.members.filter(f=>f.id!=="me").map(f=>f.userId):[];break;case"HELP":n+="/help";break}const i=yield De(n,{method:"POST",body:s}),{conversationId:o,name:r,type:c,membersCount:a,updatedAt:d,traceId:u}=i;return{id:o,name:r,type:c,membersCount:a,updatedAt:d,traceId:u}})}function Hr(t,e){return y(this,null,function*(){let n="conversation";return e?n+=`/${t}/pin`:n+=`/${t}/unpin`,yield De(n,{method:"POST",body:{}}),!0})}function Lr(t,e){return y(this,null,function*(){const n=`conversation/${t}`;return yield De(n,{method:"PATCH",body:{name:e}}),!0})}function Or(t){return y(this,null,function*(){const e=`conversation/${t}/delete`;return yield De(e,{method:"POST",body:{}}),!0})}function Fr(t,e,n){return y(this,null,function*(){var c;const s=Wt("aggregate/search",{keyword:t,from:e,top:n,type:"CONVERSATION"}),o=(c=(yield De(s)).filter(a=>a.type==="CONVERSATION").at(0))==null?void 0:c.items;if(!o)return[];const r=[...new Set(o.map(a=>a.lastMessageId))];if(r.length>0){const a=yield Ar(r),d={};a.forEach(u=>{u&&(d[u.id]=u)}),o.forEach(u=>{u.lastMessageId&&(u.lastMessage=d[u.lastMessageId])})}return o.map(a=>un(a))})}function Nr(){return y(this,null,function*(){return yield De("/survey/progress")})}function Ur(){return y(this,null,function*(){return yield De("/survey/question-section")})}function jr(){return y(this,null,function*(){return yield De("survey/conversation",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})})}function zr(t,e){return y(this,null,function*(){const n=yield $r(t,e);return yield Promise.all(n.map(hn))})}function Vr(t){return y(this,null,function*(){const e=yield Dr(t);return e?yield hn(e):void 0})}function Wr(t,e,n){return y(this,null,function*(){const s=yield Fr(t,e,n);return yield Promise.all(s.map(hn))})}function qr(t){return y(this,null,function*(){const e=yield Br(t);return{id:e.id,name:e.name,type:e.type,membersCount:e.membersCount,updatedAt:new Date(e.updatedAt)}})}function Zr(t,e){return Hr(t,e)}function Yr(t,e){return Lr(t,e)}function Xr(t){return Or(t)}function Gr(){return y(this,null,function*(){return yield jr()})}function Kr(t,e){var a;if(!t)return;const{popupRequestInfo:n}=window,s=Ht("file"),i=new XMLHttpRequest,o=(a=n==null?void 0:n.credentialType)==null?void 0:a.toUpperCase(),r=n==null?void 0:n.accessToken;switch(o){case"COOKIE":i.withCredentials=!0;break;case"QUERY":break;default:i.setRequestHeader("Authorization",`Bearer ${r}`);break}const c=new FormData;c.append("file",t),e&&(i.upload.onprogress=function(d){if(d.lengthComputable){const u=d.loaded/d.total*80;e({loaded:d.loaded,total:d.total,percent:u,status:"uploading"})}}),i.onload=function(){if(i.status===200){const d=JSON.parse(i.responseText);if(e){const u=d.thumbId?Ht(`file/${d.thumbId}`):void 0,f=Ht(`file/${d.fileId}`);e({loaded:d.size,total:d.size,percent:100,status:"done",httpCode:i.status,fileItem:{id:d.fileId,name:d.fileName,contentType:d.contentType,thumbId:d.thumbId,thumbUrl:u,url:f}})}}else e&&e({loaded:0,total:0,percent:0,status:"error",error:i.statusText,httpCode:i.status})},i.open("POST",s,!0),i.send(c),console.log(`------- Uploading file: ${t.name} to ${s}`)}function Qr(t,e){Kr(t,e)}function Jr(t,e,n,s){return y(this,null,function*(){const i=(yield yr(t,e,n,s)).filter(a=>!!a);if(!i||!Array.isArray(i))return[];const o=new Set;i.forEach(a=>$t(a,o));const r=yield Rt(Array.from(o));return i.map(a=>Dt(a,r)).map(a=>Bt(a))})}function e2(t){return y(this,null,function*(){const e=yield wr(t);if(!e)return;const n=$t(e),s=yield Rt(Array.from(n)),i=Dt(e,s);return Bt(i)})}function t2(t){return y(this,null,function*(){return!!(yield br(t))})}function n2(t,e){return _r(t,e)}function s2(t,e,n,s){return y(this,null,function*(){const i=yield Sr(t,e,n,s);if(!i||!Array.isArray(i))return[];const o=new Set;i.forEach(a=>$t(a,o));const r=yield Rt(Array.from(o));return i.map(a=>Dt(a,r)).map(a=>Bt(a))})}function i2(t){return as(t)}class o2{constructor(e){ve(this,"hubConnection");ve(this,"onHubConnected",e=>{this.hubConnection.onConnected(n=>{window.currentUserId=n.userId,e(n)})});ve(this,"onMessageSent",e=>{this.hubConnection.onMessageSent(n=>{n.conversationId=this.normalizeConvId(n.conversationId),this.normalizeSender(n.sender),e(n)})});ve(this,"onMessageEdited",e=>{this.hubConnection.onMessageEdited(n=>{n.conversationId=this.normalizeConvId(n.conversationId),this.normalizeSender(n.sender),e(n)})});ve(this,"onMessageDeleted",e=>{this.hubConnection.onMessageDeleted(e)});ve(this,"onConversationCreated",e=>{this.hubConnection.onConversationCreated(n=>{this.normalizeConversation(n),e(n)})});ve(this,"onConversationBasicInfoChanged",e=>{this.hubConnection.onConversationBasicInfoChanged((n,s)=>{n=this.normalizeConvId(n),e(n,s)})});ve(this,"onConversationDeleted",e=>{this.hubConnection.onConversationDeleted(n=>{n=this.normalizeConvId(n),e(n)})});ve(this,"getConversationAsync",e=>y(this,null,function*(){const n=this.denormalizeConvId(e),s=yield Vr(n);if(s)return this.normalizeConversation(s),s}));ve(this,"listConversationAsync",(e,n)=>y(this,null,function*(){const s=yield zr(e,n);return s.forEach(i=>this.normalizeConversation(i)),s}));ve(this,"searchConversationsAsync",(e,n,s)=>y(this,null,function*(){const i=yield Wr(e,n,s);return i.forEach(o=>this.normalizeConversation(o)),i}));ve(this,"pinConversationAsync",(e,n)=>{const s=this.denormalizeConvId(e);return Zr(s,n)});ve(this,"createConversationAsync",e=>qr(e));ve(this,"updateConversationNameAsync",(e,n)=>{const s=this.denormalizeConvId(e);return Yr(s,n)});ve(this,"deleteConversationAsync",e=>{const n=this.denormalizeConvId(e);return Xr(n)});ve(this,"sendMessageAsync",e=>y(this,null,function*(){const n=j({},e);n.conversationId=this.denormalizeConvId(n.conversationId);const s=yield e2(n);return this.normalizeSender(s.sender),s}));ve(this,"listMessagesAsync",(e,n,s,i)=>y(this,null,function*(){const o=this.denormalizeConvId(e),r=yield Jr(o,n,s,i);return this.normalizeMessages(r),r}));ve(this,"searchMessagesAsync",(e,n,s,i)=>y(this,null,function*(){const o=this.denormalizeConvId(e),r=yield s2(o,n,s,i);return this.normalizeMessages(r),r}));ve(this,"updateMessageAsync",e=>t2(e));ve(this,"batchGetUsersAsync",e=>i2(e));ve(this,"deleteMessageAsync",(e,n)=>n2(e,n));ve(this,"uploadFile",(e,n)=>{Qr(e,n)});ve(this,"listChatTypesAsync",()=>y(null,null,function*(){return yield Rr()}));ve(this,"getSurveyProgressAsync",()=>y(null,null,function*(){return yield Nr()}));ve(this,"getSurveyQuestionSectionAsync",()=>y(null,null,function*(){return yield Ur()}));ve(this,"createSurveyConversationAsync",()=>y(null,null,function*(){return yield Gr()}));const n=Pr(e);if(!n)throw new Error("Connect to hub error");this.hubConnection=n,this.hubConnection.start()}get currentUserId(){return window.currentUserId}normalizeConvId(e){return e.startsWith(`${this.currentUserId}~`)?e.replace(new RegExp(`^${this.currentUserId}`),"me"):e}denormalizeConvId(e){return e.replace(/^me/,this.currentUserId)}normalizeSender(e){e&&e.id===this.currentUserId&&(e.id="me")}normalizeConversation(e){e.id=this.normalizeConvId(e.id),e.lastMessage&&this.normalizeSender(e.lastMessage.sender)}normalizeMessages(e){e.forEach(n=>this.normalizeSender(n.sender))}}var r2=B("<div>Loading...");const[Mn,a2]=D(null),[c2,l2]=D(null),Be={},us={apiUrlBase:"http://dev.eztrade.fpts.com.vn/chatapi/api",hubUrlBase:"http://dev.eztrade.fpts.com.vn/chathub/hub/notification",credentialType:"cookie",credentialName:"aspfpt_sessiontoken"};window.popupRequestInfo=us;const hs=us.hubUrlBase,fs=()=>{var s;const t=window.popupRequestInfo;if(!hs)throw new Error("VITE_PUBLIC_HUB_URL is not defined");const e=(s=t==null?void 0:t.credentialType)==null?void 0:s.toLowerCase();if(e!=="cookie"&&!(t!=null&&t.accessToken))throw new Error("Missing JWT token: accessToken chưa được gán vào popupRequestInfo");if(e!=="cookie"&&!window.currentUserId)throw new Error("Missing currentUserId: chưa chọn user");const n=new o2(hs);a2(n),n.onHubConnected(i=>{console.log("SignalR: Hub connected",i)}),n.onMessageSent(i=>{var o;console.log("SignalR: Message sent event received",i),(o=Be.appendMessage)==null||o.call(Be,i)}),n.onMessageEdited(i=>{var o;console.log("SignalR: Message edited event received",i),(o=Be.updateMessage)==null||o.call(Be,i)}),n.onMessageDeleted(i=>{var o;console.log("SignalR: Message deleted event received",i),(o=Be.deleteMessage)==null||o.call(Be,i)}),n.onConversationCreated(i=>{var o;console.log("SignalR: Conversation created event received",i),(o=Be.appendConversation)==null||o.call(Be,i)}),n.onConversationBasicInfoChanged((i,o)=>{var r;console.log("SignalR: Conversation name changed",i,o),(r=Be.updateConversationName)==null||r.call(Be,i,o)}),n.onConversationDeleted(i=>{var o;console.log("SignalR: Conversation deleted",i),(o=Be.deleteConversation)==null||o.call(Be,i)})};function gs(t,e){const n=typeof t=="string"?document.querySelector(t):t;if(!n)throw new Error(`Element "${t}" not found.`);e!=null&&e.credentialType&&(window.popupRequestInfo.credentialType=e.credentialType),e!=null&&e.accessToken&&(window.popupRequestInfo.accessToken=e.accessToken),e!=null&&e.currentUserId&&(window.currentUserId=e.currentUserId),l2(e),fs(),Rs(()=>ae(Je,{get when(){return Mn()},get fallback(){return r2()},get children(){return ae(to,{get remoteRepository(){return Mn()},exportMethods:Be,get children(){return ae(Io,{get remoteRepo(){return Mn()},get options(){return c2()}})}})}}),n)}typeof window!="undefined"&&(window.EzChat={createPopup:gs}),window.addEventListener("startChat",()=>{fs()}),Me.createPopup=gs,Object.defineProperty(Me,Symbol.toStringTag,{value:"Module"})}));
17
17
  //# sourceMappingURL=ezchat.umd.js.map