ttp-agent-sdk 2.34.8 → 2.34.10

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,3 +1,3 @@
1
1
  /*! For license information please see agent-widget.esm.js.LICENSE.txt */
2
- import{useEffect as A,useRef as e,useState as t}from"react";var n={354:function(A){A.exports=function(){var A=function(e,t){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},A(e,t)};function e(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}A(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var t=function(){return t=Object.assign||function(A){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(A[o]=e[o]);return A},t.apply(this,arguments)};function n(A,e,t,n){return new(t||(t=Promise))(function(o,i){function r(A){try{a(n.next(A))}catch(A){i(A)}}function s(A){try{a(n.throw(A))}catch(A){i(A)}}function a(A){var e;A.done?o(A.value):(e=A.value,e instanceof t?e:new t(function(A){A(e)})).then(r,s)}a((n=n.apply(A,e||[])).next())})}function o(A,e){var t,n,o,i,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;r;)try{if(t=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return r.label++,{value:i[1],done:!1};case 5:r.label++,n=i[1],i=[0];continue;case 7:i=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){r=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){r.label=i[1];break}if(6===i[0]&&r.label<o[1]){r.label=o[1],o=i;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(i);break}o[2]&&r.ops.pop(),r.trys.pop();continue}i=e.call(A,r)}catch(A){i=[6,A],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function i(A,e,t){if(t||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return A.concat(n||e)}for(var r=function(){function A(A,e,t,n){this.left=A,this.top=e,this.width=t,this.height=n}return A.prototype.add=function(e,t,n,o){return new A(this.left+e,this.top+t,this.width+n,this.height+o)},A.fromClientRect=function(e,t){return new A(t.left+e.windowBounds.left,t.top+e.windowBounds.top,t.width,t.height)},A.fromDOMRectList=function(e,t){var n=Array.from(t).find(function(A){return 0!==A.width});return n?new A(n.left+e.windowBounds.left,n.top+e.windowBounds.top,n.width,n.height):A.EMPTY},A.EMPTY=new A(0,0,0,0),A}(),s=function(A,e){return r.fromClientRect(A,e.getBoundingClientRect())},a=function(A){for(var e=[],t=0,n=A.length;t<n;){var o=A.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var i=A.charCodeAt(t++);56320==(64512&i)?e.push(((1023&o)<<10)+(1023&i)+65536):(e.push(o),t--)}else e.push(o)}return e},c=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var n=[],o=-1,i="";++o<t;){var r=A[o];r<=65535?n.push(r):(r-=65536,n.push(55296+(r>>10),r%1024+56320)),(o+1===t||n.length>16384)&&(i+=String.fromCharCode.apply(String,n),n.length=0)}return i},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d="undefined"==typeof Uint8Array?[]:new Uint8Array(256),u=0;u<64;u++)d[l.charCodeAt(u)]=u;for(var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p="undefined"==typeof Uint8Array?[]:new Uint8Array(256),h=0;h<64;h++)p[g.charCodeAt(h)]=h;for(var B=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},m=function(){function A(A,e,t,n,o,i){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=n,this.index=o,this.data=i}return A.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A<this.highStart)return e=2080+(A>>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",v="undefined"==typeof Uint8Array?[]:new Uint8Array(256),w=0;w<64;w++)v[f.charCodeAt(w)]=w;var C=10,y=13,b=15,x=17,Q=18,F=19,U=20,S=21,I=22,E=24,k=25,H=26,T=27,D=28,K=30,L=32,M=33,R=34,P=35,O=37,V=38,_=39,N=40,G=42,W=[9001,65288],j="×",z="÷",X=function(A){var e,t,n,o=function(A){var e,t,n,o,i,r=.75*A.length,s=A.length,a=0;"="===A[A.length-1]&&(r--,"="===A[A.length-2]&&r--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(r):new Array(r),l=Array.isArray(c)?c:new Uint8Array(c);for(e=0;e<s;e+=4)t=p[A.charCodeAt(e)],n=p[A.charCodeAt(e+1)],o=p[A.charCodeAt(e+2)],i=p[A.charCodeAt(e+3)],l[a++]=t<<2|n>>4,l[a++]=(15&n)<<4|o>>2,l[a++]=(3&o)<<6|63&i;return c}(A),i=Array.isArray(o)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=4)t.push(A[n+3]<<24|A[n+2]<<16|A[n+1]<<8|A[n]);return t}(o):new Uint32Array(o),r=Array.isArray(o)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=2)t.push(A[n+1]<<8|A[n]);return t}(o):new Uint16Array(o),s=B(r,12,i[4]/2),a=2===i[5]?B(r,(24+i[4])/2):(e=i,t=Math.ceil((24+i[4])/4),e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,t,n)));return new m(i[0],i[1],i[2],i[3],s,a)}("KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA=="),J=[K,36],Y=[1,2,3,5],q=[C,8],Z=[T,H],$=Y.concat(q),AA=[V,_,N,R,P],eA=[b,y],tA=function(A,e,t,n){var o=n[t];if(Array.isArray(A)?-1!==A.indexOf(o):A===o)for(var i=t;i<=n.length;){if((a=n[++i])===e)return!0;if(a!==C)break}if(o===C)for(i=t;i>0;){var r=n[--i];if(Array.isArray(A)?-1!==A.indexOf(r):A===r)for(var s=t;s<=n.length;){var a;if((a=n[++s])===e)return!0;if(a!==C)break}if(r!==C)break}return!1},nA=function(A,e){for(var t=A;t>=0;){var n=e[t];if(n!==C)return n;t--}return 0},oA=function(A,e,t,n,o){if(0===t[n])return j;var i=n-1;if(Array.isArray(o)&&!0===o[i])return j;var r=i-1,s=i+1,a=e[i],c=r>=0?e[r]:0,l=e[s];if(2===a&&3===l)return j;if(-1!==Y.indexOf(a))return"!";if(-1!==Y.indexOf(l))return j;if(-1!==q.indexOf(l))return j;if(8===nA(i,e))return z;if(11===X.get(A[i]))return j;if((a===L||a===M)&&11===X.get(A[s]))return j;if(7===a||7===l)return j;if(9===a)return j;if(-1===[C,y,b].indexOf(a)&&9===l)return j;if(-1!==[x,Q,F,E,D].indexOf(l))return j;if(nA(i,e)===I)return j;if(tA(23,I,i,e))return j;if(tA([x,Q],S,i,e))return j;if(tA(12,12,i,e))return j;if(a===C)return z;if(23===a||23===l)return j;if(16===l||16===a)return z;if(-1!==[y,b,S].indexOf(l)||14===a)return j;if(36===c&&-1!==eA.indexOf(a))return j;if(a===D&&36===l)return j;if(l===U)return j;if(-1!==J.indexOf(l)&&a===k||-1!==J.indexOf(a)&&l===k)return j;if(a===T&&-1!==[O,L,M].indexOf(l)||-1!==[O,L,M].indexOf(a)&&l===H)return j;if(-1!==J.indexOf(a)&&-1!==Z.indexOf(l)||-1!==Z.indexOf(a)&&-1!==J.indexOf(l))return j;if(-1!==[T,H].indexOf(a)&&(l===k||-1!==[I,b].indexOf(l)&&e[s+1]===k)||-1!==[I,b].indexOf(a)&&l===k||a===k&&-1!==[k,D,E].indexOf(l))return j;if(-1!==[k,D,E,x,Q].indexOf(l))for(var d=i;d>=0;){if((u=e[d])===k)return j;if(-1===[D,E].indexOf(u))break;d--}if(-1!==[T,H].indexOf(l))for(d=-1!==[x,Q].indexOf(a)?r:i;d>=0;){var u;if((u=e[d])===k)return j;if(-1===[D,E].indexOf(u))break;d--}if(V===a&&-1!==[V,_,R,P].indexOf(l)||-1!==[_,R].indexOf(a)&&-1!==[_,N].indexOf(l)||-1!==[N,P].indexOf(a)&&l===N)return j;if(-1!==AA.indexOf(a)&&-1!==[U,H].indexOf(l)||-1!==AA.indexOf(l)&&a===T)return j;if(-1!==J.indexOf(a)&&-1!==J.indexOf(l))return j;if(a===E&&-1!==J.indexOf(l))return j;if(-1!==J.concat(k).indexOf(a)&&l===I&&-1===W.indexOf(A[s])||-1!==J.concat(k).indexOf(l)&&a===Q)return j;if(41===a&&41===l){for(var g=t[i],p=1;g>0&&41===e[--g];)p++;if(p%2!=0)return j}return a===L&&l===M?j:z},iA=function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=function(A,e){void 0===e&&(e="strict");var t=[],n=[],o=[];return A.forEach(function(A,i){var r=X.get(A);if(r>50?(o.push(!0),r-=50):o.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(A))return n.push(i),t.push(16);if(4===r||11===r){if(0===i)return n.push(i),t.push(K);var s=t[i-1];return-1===$.indexOf(s)?(n.push(n[i-1]),t.push(s)):(n.push(i),t.push(K))}return n.push(i),31===r?t.push("strict"===e?S:O):r===G||29===r?t.push(K):43===r?A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(O):t.push(K):void t.push(r)}),[n,t,o]}(A,e.lineBreak),n=t[0],o=t[1],i=t[2];"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(o=o.map(function(A){return-1!==[k,K,G].indexOf(A)?O:A}));var r="keep-all"===e.wordBreak?i.map(function(e,t){return e&&A[t]>=19968&&A[t]<=40959}):void 0;return[n,o,r]},rA=function(){function A(A,e,t,n){this.codePoints=A,this.required="!"===e,this.start=t,this.end=n}return A.prototype.slice=function(){return c.apply(void 0,this.codePoints.slice(this.start,this.end))},A}(),sA=45,aA=43,cA=-1,lA=function(A){return A>=48&&A<=57},dA=function(A){return lA(A)||A>=65&&A<=70||A>=97&&A<=102},uA=function(A){return 10===A||9===A||32===A},gA=function(A){return function(A){return function(A){return A>=97&&A<=122}(A)||function(A){return A>=65&&A<=90}(A)}(A)||function(A){return A>=128}(A)||95===A},pA=function(A){return gA(A)||lA(A)||A===sA},hA=function(A){return A>=0&&A<=8||11===A||A>=14&&A<=31||127===A},BA=function(A,e){return 92===A&&10!==e},mA=function(A,e,t){return A===sA?gA(e)||BA(e,t):!!gA(A)||!(92!==A||!BA(A,e))},fA=function(A,e,t){return A===aA||A===sA?!!lA(e)||46===e&&lA(t):lA(46===A?e:A)},vA=function(A){var e=0,t=1;A[e]!==aA&&A[e]!==sA||(A[e]===sA&&(t=-1),e++);for(var n=[];lA(A[e]);)n.push(A[e++]);var o=n.length?parseInt(c.apply(void 0,n),10):0;46===A[e]&&e++;for(var i=[];lA(A[e]);)i.push(A[e++]);var r=i.length,s=r?parseInt(c.apply(void 0,i),10):0;69!==A[e]&&101!==A[e]||e++;var a=1;A[e]!==aA&&A[e]!==sA||(A[e]===sA&&(a=-1),e++);for(var l=[];lA(A[e]);)l.push(A[e++]);var d=l.length?parseInt(c.apply(void 0,l),10):0;return t*(o+s*Math.pow(10,-r))*Math.pow(10,a*d)},wA={type:2},CA={type:3},yA={type:4},bA={type:13},xA={type:8},QA={type:21},FA={type:9},UA={type:10},SA={type:11},IA={type:12},EA={type:14},kA={type:23},HA={type:1},TA={type:25},DA={type:24},KA={type:26},LA={type:27},MA={type:28},RA={type:29},PA={type:31},OA={type:32},VA=function(){function A(){this._value=[]}return A.prototype.write=function(A){this._value=this._value.concat(a(A))},A.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==OA;)A.push(e),e=this.consumeToken();return A},A.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case 34:return this.consumeStringToken(34);case 35:var e=this.peekCodePoint(0),t=this.peekCodePoint(1),n=this.peekCodePoint(2);if(pA(e)||BA(t,n)){var o=mA(e,t,n)?2:1;return{type:5,value:this.consumeName(),flags:o}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),bA;break;case 39:return this.consumeStringToken(39);case 40:return wA;case 41:return CA;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),EA;break;case aA:if(fA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 44:return yA;case sA:var i=A,r=this.peekCodePoint(0),s=this.peekCodePoint(1);if(fA(i,r,s))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(mA(i,r,s))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(r===sA&&62===s)return this.consumeCodePoint(),this.consumeCodePoint(),DA;break;case 46:if(fA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var a=this.consumeCodePoint();if(42===a&&47===(a=this.consumeCodePoint()))return this.consumeToken();if(a===cA)return this.consumeToken()}break;case 58:return KA;case 59:return LA;case 60:if(33===this.peekCodePoint(0)&&this.peekCodePoint(1)===sA&&this.peekCodePoint(2)===sA)return this.consumeCodePoint(),this.consumeCodePoint(),TA;break;case 64:var l=this.peekCodePoint(0),d=this.peekCodePoint(1),u=this.peekCodePoint(2);if(mA(l,d,u))return{type:7,value:this.consumeName()};break;case 91:return MA;case 92:if(BA(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case 93:return RA;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),xA;break;case 123:return SA;case 125:return IA;case 117:case 85:var g=this.peekCodePoint(0),p=this.peekCodePoint(1);return g!==aA||!dA(p)&&63!==p||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),FA;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),QA;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),UA;break;case cA:return OA}return uA(A)?(this.consumeWhiteSpace(),PA):lA(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):gA(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:6,value:c(A)}},A.prototype.consumeCodePoint=function(){var A=this._value.shift();return void 0===A?-1:A},A.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},A.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},A.prototype.consumeUnicodeRangeToken=function(){for(var A=[],e=this.consumeCodePoint();dA(e)&&A.length<6;)A.push(e),e=this.consumeCodePoint();for(var t=!1;63===e&&A.length<6;)A.push(e),e=this.consumeCodePoint(),t=!0;if(t)return{type:30,start:parseInt(c.apply(void 0,A.map(function(A){return 63===A?48:A})),16),end:parseInt(c.apply(void 0,A.map(function(A){return 63===A?70:A})),16)};var n=parseInt(c.apply(void 0,A),16);if(this.peekCodePoint(0)===sA&&dA(this.peekCodePoint(1))){this.consumeCodePoint(),e=this.consumeCodePoint();for(var o=[];dA(e)&&o.length<6;)o.push(e),e=this.consumeCodePoint();return{type:30,start:n,end:parseInt(c.apply(void 0,o),16)}}return{type:30,start:n,end:n}},A.prototype.consumeIdentLikeToken=function(){var A=this.consumeName();return"url"===A.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:19,value:A}):{type:20,value:A}},A.prototype.consumeUrlToken=function(){var A=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===cA)return{type:22,value:""};var e=this.peekCodePoint(0);if(39===e||34===e){var t=this.consumeStringToken(this.consumeCodePoint());return 0===t.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===cA||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:t.value}):(this.consumeBadUrlRemnants(),kA)}for(;;){var n=this.consumeCodePoint();if(n===cA||41===n)return{type:22,value:c.apply(void 0,A)};if(uA(n))return this.consumeWhiteSpace(),this.peekCodePoint(0)===cA||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:c.apply(void 0,A)}):(this.consumeBadUrlRemnants(),kA);if(34===n||39===n||40===n||hA(n))return this.consumeBadUrlRemnants(),kA;if(92===n){if(!BA(n,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),kA;A.push(this.consumeEscapedCodePoint())}else A.push(n)}},A.prototype.consumeWhiteSpace=function(){for(;uA(this.peekCodePoint(0));)this.consumeCodePoint()},A.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(41===A||A===cA)return;BA(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},A.prototype.consumeStringSlice=function(A){for(var e="";A>0;){var t=Math.min(5e4,A);e+=c.apply(void 0,this._value.splice(0,t)),A-=t}return this._value.shift(),e},A.prototype.consumeStringToken=function(A){for(var e="",t=0;;){var n=this._value[t];if(n===cA||void 0===n||n===A)return{type:0,value:e+=this.consumeStringSlice(t)};if(10===n)return this._value.splice(0,t),HA;if(92===n){var o=this._value[t+1];o!==cA&&void 0!==o&&(10===o?(e+=this.consumeStringSlice(t),t=-1,this._value.shift()):BA(n,o)&&(e+=this.consumeStringSlice(t),e+=c(this.consumeEscapedCodePoint()),t=-1))}t++}},A.prototype.consumeNumber=function(){var A=[],e=4,t=this.peekCodePoint(0);for(t!==aA&&t!==sA||A.push(this.consumeCodePoint());lA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0);var n=this.peekCodePoint(1);if(46===t&&lA(n))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;lA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0),n=this.peekCodePoint(1);var o=this.peekCodePoint(2);if((69===t||101===t)&&((n===aA||n===sA)&&lA(o)||lA(n)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;lA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[vA(A),e]},A.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),e=A[0],t=A[1],n=this.peekCodePoint(0),o=this.peekCodePoint(1),i=this.peekCodePoint(2);return mA(n,o,i)?{type:15,number:e,flags:t,unit:this.consumeName()}:37===n?(this.consumeCodePoint(),{type:16,number:e,flags:t}):{type:17,number:e,flags:t}},A.prototype.consumeEscapedCodePoint=function(){var A=this.consumeCodePoint();if(dA(A)){for(var e=c(A);dA(this.peekCodePoint(0))&&e.length<6;)e+=c(this.consumeCodePoint());uA(this.peekCodePoint(0))&&this.consumeCodePoint();var t=parseInt(e,16);return 0===t||function(A){return A>=55296&&A<=57343}(t)||t>1114111?65533:t}return A===cA?65533:A},A.prototype.consumeName=function(){for(var A="";;){var e=this.consumeCodePoint();if(pA(e))A+=c(e);else{if(!BA(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),A;A+=c(this.consumeEscapedCodePoint())}}},A}(),_A=function(){function A(A){this._tokens=A}return A.create=function(e){var t=new VA;return t.write(e),new A(t.read())},A.parseValue=function(e){return A.create(e).parseComponentValue()},A.parseValues=function(e){return A.create(e).parseComponentValues()},A.prototype.parseComponentValue=function(){for(var A=this.consumeToken();31===A.type;)A=this.consumeToken();if(32===A.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(A);var e=this.consumeComponentValue();do{A=this.consumeToken()}while(31===A.type);if(32===A.type)return e;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},A.prototype.parseComponentValues=function(){for(var A=[];;){var e=this.consumeComponentValue();if(32===e.type)return A;A.push(e),A.push()}},A.prototype.consumeComponentValue=function(){var A=this.consumeToken();switch(A.type){case 11:case 28:case 2:return this.consumeSimpleBlock(A.type);case 19:return this.consumeFunction(A)}return A},A.prototype.consumeSimpleBlock=function(A){for(var e={type:A,values:[]},t=this.consumeToken();;){if(32===t.type||qA(t,A))return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue()),t=this.consumeToken()}},A.prototype.consumeFunction=function(A){for(var e={name:A.value,values:[],type:18};;){var t=this.consumeToken();if(32===t.type||3===t.type)return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue())}},A.prototype.consumeToken=function(){var A=this._tokens.shift();return void 0===A?OA:A},A.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},A}(),NA=function(A){return 15===A.type},GA=function(A){return 17===A.type},WA=function(A){return 20===A.type},jA=function(A){return 0===A.type},zA=function(A,e){return WA(A)&&A.value===e},XA=function(A){return 31!==A.type},JA=function(A){return 31!==A.type&&4!==A.type},YA=function(A){var e=[],t=[];return A.forEach(function(A){if(4===A.type){if(0===t.length)throw new Error("Error parsing function args, zero tokens for arg");return e.push(t),void(t=[])}31!==A.type&&t.push(A)}),t.length&&e.push(t),e},qA=function(A,e){return 11===e&&12===A.type||28===e&&29===A.type||2===e&&3===A.type},ZA=function(A){return 17===A.type||15===A.type},$A=function(A){return 16===A.type||ZA(A)},Ae=function(A){return A.length>1?[A[0],A[1]]:[A[0]]},ee={type:17,number:0,flags:4},te={type:16,number:50,flags:4},ne={type:16,number:100,flags:4},oe=function(A,e,t){var n=A[0],o=A[1];return[ie(n,e),ie(void 0!==o?o:n,t)]},ie=function(A,e){if(16===A.type)return A.number/100*e;if(NA(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},re="grad",se="turn",ae=function(A,e){if(15===e.type)switch(e.unit){case"deg":return Math.PI*e.number/180;case re:return Math.PI/200*e.number;case"rad":return e.number;case se:return 2*Math.PI*e.number}throw new Error("Unsupported angle type")},ce=function(A){return 15===A.type&&("deg"===A.unit||A.unit===re||"rad"===A.unit||A.unit===se)},le=function(A){switch(A.filter(WA).map(function(A){return A.value}).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[ee,ee];case"to top":case"bottom":return de(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[ee,ne];case"to right":case"left":return de(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[ne,ne];case"to bottom":case"top":return de(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[ne,ee];case"to left":case"right":return de(270)}return 0},de=function(A){return Math.PI*A/180},ue=function(A,e){if(18===e.type){var t=we[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return t(A,e.values)}if(5===e.type){if(3===e.value.length){var n=e.value.substring(0,1),o=e.value.substring(1,2),i=e.value.substring(2,3);return he(parseInt(n+n,16),parseInt(o+o,16),parseInt(i+i,16),1)}if(4===e.value.length){n=e.value.substring(0,1),o=e.value.substring(1,2),i=e.value.substring(2,3);var r=e.value.substring(3,4);return he(parseInt(n+n,16),parseInt(o+o,16),parseInt(i+i,16),parseInt(r+r,16)/255)}if(6===e.value.length)return n=e.value.substring(0,2),o=e.value.substring(2,4),i=e.value.substring(4,6),he(parseInt(n,16),parseInt(o,16),parseInt(i,16),1);if(8===e.value.length)return n=e.value.substring(0,2),o=e.value.substring(2,4),i=e.value.substring(4,6),r=e.value.substring(6,8),he(parseInt(n,16),parseInt(o,16),parseInt(i,16),parseInt(r,16)/255)}if(20===e.type){var s=ye[e.value.toUpperCase()];if(void 0!==s)return s}return ye.TRANSPARENT},ge=function(A){return!(255&A)},pe=function(A){var e=255&A,t=255&A>>8,n=255&A>>16,o=255&A>>24;return e<255?"rgba("+o+","+n+","+t+","+e/255+")":"rgb("+o+","+n+","+t+")"},he=function(A,e,t,n){return(A<<24|e<<16|t<<8|Math.round(255*n))>>>0},Be=function(A,e){if(17===A.type)return A.number;if(16===A.type){var t=3===e?1:255;return 3===e?A.number/100*t:Math.round(A.number/100*t)}return 0},me=function(A,e){var t=e.filter(JA);if(3===t.length){var n=t.map(Be),o=n[0],i=n[1],r=n[2];return he(o,i,r,1)}if(4===t.length){var s=t.map(Be),a=(o=s[0],i=s[1],r=s[2],s[3]);return he(o,i,r,a)}return 0};function fe(A,e,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-A)*t*6+A:t<.5?e:t<2/3?6*(e-A)*(2/3-t)+A:A}var ve=function(A,e){var t=e.filter(JA),n=t[0],o=t[1],i=t[2],r=t[3],s=(17===n.type?de(n.number):ae(A,n))/(2*Math.PI),a=$A(o)?o.number/100:0,c=$A(i)?i.number/100:0,l=void 0!==r&&$A(r)?ie(r,1):1;if(0===a)return he(255*c,255*c,255*c,1);var d=c<=.5?c*(a+1):c+a-c*a,u=2*c-d,g=fe(u,d,s+1/3),p=fe(u,d,s),h=fe(u,d,s-1/3);return he(255*g,255*p,255*h,l)},we={hsl:ve,hsla:ve,rgb:me,rgba:me},Ce=function(A,e){return ue(A,_A.create(e).parseComponentValue())},ye={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},be={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map(function(A){if(WA(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},xe={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Qe=function(A,e){var t=ue(A,e[0]),n=e[1];return n&&$A(n)?{color:t,stop:n}:{color:t,stop:null}},Fe=function(A,e){var t=A[0],n=A[A.length-1];null===t.stop&&(t.stop=ee),null===n.stop&&(n.stop=ne);for(var o=[],i=0,r=0;r<A.length;r++){var s=A[r].stop;if(null!==s){var a=ie(s,e);a>i?o.push(a):o.push(i),i=a}else o.push(null)}var c=null;for(r=0;r<o.length;r++){var l=o[r];if(null===l)null===c&&(c=r);else if(null!==c){for(var d=r-c,u=(l-o[c-1])/(d+1),g=1;g<=d;g++)o[c+g-1]=u*g;c=null}}return A.map(function(A,t){return{color:A.color,stop:Math.max(Math.min(1,o[t]/e),0)}})},Ue=function(A,e,t){var n="number"==typeof A?A:function(A,e,t){var n=e/2,o=t/2,i=ie(A[0],e)-n,r=o-ie(A[1],t);return(Math.atan2(r,i)+2*Math.PI)%(2*Math.PI)}(A,e,t),o=Math.abs(e*Math.sin(n))+Math.abs(t*Math.cos(n)),i=e/2,r=t/2,s=o/2,a=Math.sin(n-Math.PI/2)*s,c=Math.cos(n-Math.PI/2)*s;return[o,i-c,i+c,r-a,r+a]},Se=function(A,e){return Math.sqrt(A*A+e*e)},Ie=function(A,e,t,n,o){return[[0,0],[0,e],[A,0],[A,e]].reduce(function(A,e){var i=e[0],r=e[1],s=Se(t-i,n-r);return(o?s<A.optimumDistance:s>A.optimumDistance)?{optimumCorner:e,optimumDistance:s}:A},{optimumDistance:o?1/0:-1/0,optimumCorner:null}).optimumCorner},Ee=function(A,e){var t=de(180),n=[];return YA(e).forEach(function(e,o){if(0===o){var i=e[0];if(20===i.type&&-1!==["top","left","right","bottom"].indexOf(i.value))return void(t=le(e));if(ce(i))return void(t=(ae(A,i)+de(270))%de(360))}var r=Qe(A,e);n.push(r)}),{angle:t,stops:n,type:1}},ke="closest-side",He="farthest-side",Te="closest-corner",De="farthest-corner",Ke="circle",Le="ellipse",Me="cover",Re="contain",Pe=function(A,e){var t=0,n=3,o=[],i=[];return YA(e).forEach(function(e,r){var s=!0;if(0===r?s=e.reduce(function(A,e){if(WA(e))switch(e.value){case"center":return i.push(te),!1;case"top":case"left":return i.push(ee),!1;case"right":case"bottom":return i.push(ne),!1}else if($A(e)||ZA(e))return i.push(e),!1;return A},s):1===r&&(s=e.reduce(function(A,e){if(WA(e))switch(e.value){case Ke:return t=0,!1;case Le:return t=1,!1;case Re:case ke:return n=0,!1;case He:return n=1,!1;case Te:return n=2,!1;case Me:case De:return n=3,!1}else if(ZA(e)||$A(e))return Array.isArray(n)||(n=[]),n.push(e),!1;return A},s)),s){var a=Qe(A,e);o.push(a)}}),{size:n,shape:t,stops:o,position:i,type:2}},Oe=function(A,e){if(22===e.type){var t={url:e.value,type:0};return A.cache.addImage(e.value),t}if(18===e.type){var n=_e[e.name];if(void 0===n)throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return n(A,e.values)}throw new Error("Unsupported image type "+e.type)};var Ve,_e={"linear-gradient":function(A,e){var t=de(180),n=[];return YA(e).forEach(function(e,o){if(0===o){var i=e[0];if(20===i.type&&"to"===i.value)return void(t=le(e));if(ce(i))return void(t=ae(A,i))}var r=Qe(A,e);n.push(r)}),{angle:t,stops:n,type:1}},"-moz-linear-gradient":Ee,"-ms-linear-gradient":Ee,"-o-linear-gradient":Ee,"-webkit-linear-gradient":Ee,"radial-gradient":function(A,e){var t=0,n=3,o=[],i=[];return YA(e).forEach(function(e,r){var s=!0;if(0===r){var a=!1;s=e.reduce(function(A,e){if(a)if(WA(e))switch(e.value){case"center":return i.push(te),A;case"top":case"left":return i.push(ee),A;case"right":case"bottom":return i.push(ne),A}else($A(e)||ZA(e))&&i.push(e);else if(WA(e))switch(e.value){case Ke:return t=0,!1;case Le:return t=1,!1;case"at":return a=!0,!1;case ke:return n=0,!1;case Me:case He:return n=1,!1;case Re:case Te:return n=2,!1;case De:return n=3,!1}else if(ZA(e)||$A(e))return Array.isArray(n)||(n=[]),n.push(e),!1;return A},s)}if(s){var c=Qe(A,e);o.push(c)}}),{size:n,shape:t,stops:o,position:i,type:2}},"-moz-radial-gradient":Pe,"-ms-radial-gradient":Pe,"-o-radial-gradient":Pe,"-webkit-radial-gradient":Pe,"-webkit-gradient":function(A,e){var t=de(180),n=[],o=1;return YA(e).forEach(function(e,t){var i=e[0];if(0===t){if(WA(i)&&"linear"===i.value)return void(o=1);if(WA(i)&&"radial"===i.value)return void(o=2)}if(18===i.type)if("from"===i.name){var r=ue(A,i.values[0]);n.push({stop:ee,color:r})}else if("to"===i.name)r=ue(A,i.values[0]),n.push({stop:ne,color:r});else if("color-stop"===i.name){var s=i.values.filter(JA);if(2===s.length){r=ue(A,s[1]);var a=s[0];GA(a)&&n.push({stop:{type:16,number:100*a.number,flags:a.flags},color:r})}}}),1===o?{angle:(t+de(180))%de(360),stops:n,type:o}:{size:3,shape:0,stops:n,position:[],type:o}}},Ne={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(0===e.length)return[];var t=e[0];return 20===t.type&&"none"===t.value?[]:e.filter(function(A){return JA(A)&&function(A){return!(20===A.type&&"none"===A.value||18===A.type&&!_e[A.name])}(A)}).map(function(e){return Oe(A,e)})}},Ge={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map(function(A){if(WA(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},We={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(A,e){return YA(e).map(function(A){return A.filter($A)}).map(Ae)}},je={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(A,e){return YA(e).map(function(A){return A.filter(WA).map(function(A){return A.value}).join(" ")}).map(ze)}},ze=function(A){switch(A){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};!function(A){A.AUTO="auto",A.CONTAIN="contain",A.COVER="cover"}(Ve||(Ve={}));var Xe,Je={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(A,e){return YA(e).map(function(A){return A.filter(Ye)})}},Ye=function(A){return WA(A)||$A(A)},qe=function(A){return{name:"border-"+A+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},Ze=qe("top"),$e=qe("right"),At=qe("bottom"),et=qe("left"),tt=function(A){return{name:"border-radius-"+A,initialValue:"0 0",prefix:!1,type:1,parse:function(A,e){return Ae(e.filter($A))}}},nt=tt("top-left"),ot=tt("top-right"),it=tt("bottom-right"),rt=tt("bottom-left"),st=function(A){return{name:"border-"+A+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(A,e){switch(e){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},at=st("top"),ct=st("right"),lt=st("bottom"),dt=st("left"),ut=function(A){return{name:"border-"+A+"-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return NA(e)?e.number:0}}},gt=ut("top"),pt=ut("right"),ht=ut("bottom"),Bt=ut("left"),mt={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},ft={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(A,e){return"rtl"===e?1:0}},vt={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(A,e){return e.filter(WA).reduce(function(A,e){return A|wt(e.value)},0)}},wt=function(A){switch(A){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},Ct={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},yt={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(A,e){return 20===e.type&&"normal"===e.value?0:17===e.type||15===e.type?e.number:0}};!function(A){A.NORMAL="normal",A.STRICT="strict"}(Xe||(Xe={}));var bt,xt={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"strict"===e?Xe.STRICT:Xe.NORMAL}},Qt={name:"line-height",initialValue:"normal",prefix:!1,type:4},Ft=function(A,e){return WA(A)&&"normal"===A.value?1.2*e:17===A.type?e*A.number:$A(A)?ie(A,e):e},Ut={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(A,e){return 20===e.type&&"none"===e.value?null:Oe(A,e)}},St={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(A,e){return"inside"===e?0:1}},It={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},Et=function(A){return{name:"margin-"+A,initialValue:"0",prefix:!1,type:4}},kt=Et("top"),Ht=Et("right"),Tt=Et("bottom"),Dt=Et("left"),Kt={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(A,e){return e.filter(WA).map(function(A){switch(A.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})}},Lt={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"break-word"===e?"break-word":"normal"}},Mt=function(A){return{name:"padding-"+A,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Rt=Mt("top"),Pt=Mt("right"),Ot=Mt("bottom"),Vt=Mt("left"),_t={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(A,e){switch(e){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},Nt={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(A,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Gt={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&zA(e[0],"none")?[]:YA(e).map(function(e){for(var t={color:ye.TRANSPARENT,offsetX:ee,offsetY:ee,blur:ee},n=0,o=0;o<e.length;o++){var i=e[o];ZA(i)?(0===n?t.offsetX=i:1===n?t.offsetY=i:t.blur=i,n++):t.color=ue(A,i)}return t})}},Wt={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},jt={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(A,e){if(20===e.type&&"none"===e.value)return null;if(18===e.type){var t=zt[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported transform function "'+e.name+'"');return t(e.values)}return null}},zt={matrix:function(A){var e=A.filter(function(A){return 17===A.type}).map(function(A){return A.number});return 6===e.length?e:null},matrix3d:function(A){var e=A.filter(function(A){return 17===A.type}).map(function(A){return A.number}),t=e[0],n=e[1];e[2],e[3];var o=e[4],i=e[5];e[6],e[7],e[8],e[9],e[10],e[11];var r=e[12],s=e[13];return e[14],e[15],16===e.length?[t,n,o,i,r,s]:null}},Xt={type:16,number:50,flags:4},Jt=[Xt,Xt],Yt={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(A,e){var t=e.filter($A);return 2!==t.length?Jt:[t[0],t[1]]}},qt={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"hidden":return 1;case"collapse":return 2;default:return 0}}};!function(A){A.NORMAL="normal",A.BREAK_ALL="break-all",A.KEEP_ALL="keep-all"}(bt||(bt={}));for(var Zt={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){switch(e){case"break-all":return bt.BREAK_ALL;case"keep-all":return bt.KEEP_ALL;default:return bt.NORMAL}}},$t={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(A,e){if(20===e.type)return{auto:!0,order:0};if(GA(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},An={name:"time",parse:function(A,e){if(15===e.type)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")}},en={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(A,e){return GA(e)?e.number:1}},tn={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},nn={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(A,e){return e.filter(WA).map(function(A){switch(A.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(A){return 0!==A})}},on={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(A,e){var t=[],n=[];return e.forEach(function(A){switch(A.type){case 20:case 0:t.push(A.value);break;case 17:t.push(A.number.toString());break;case 4:n.push(t.join(" ")),t.length=0}}),t.length&&n.push(t.join(" ")),n.map(function(A){return-1===A.indexOf(" ")?A:"'"+A+"'"})}},rn={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},sn={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(A,e){return GA(e)?e.number:WA(e)&&"bold"===e.value?700:400}},an={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return e.filter(WA).map(function(A){return A.value})}},cn={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){switch(e){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},ln=function(A,e){return 0!==(A&e)},dn={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(0===e.length)return[];var t=e[0];return 20===t.type&&"none"===t.value?[]:e}},un={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return null;var t=e[0];if(20===t.type&&"none"===t.value)return null;for(var n=[],o=e.filter(XA),i=0;i<o.length;i++){var r=o[i],s=o[i+1];if(20===r.type){var a=s&&GA(s)?s.number:1;n.push({counter:r.value,increment:a})}}return n}},gn={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return[];for(var t=[],n=e.filter(XA),o=0;o<n.length;o++){var i=n[o],r=n[o+1];if(WA(i)&&"none"!==i.value){var s=r&&GA(r)?r.number:0;t.push({counter:i.value,reset:s})}}return t}},pn={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(A,e){return e.filter(NA).map(function(e){return An.parse(A,e)})}},hn={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return null;var t=e[0];if(20===t.type&&"none"===t.value)return null;var n=[],o=e.filter(jA);if(o.length%2!=0)return null;for(var i=0;i<o.length;i+=2){var r=o[i].value,s=o[i+1].value;n.push({open:r,close:s})}return n}},Bn=function(A,e,t){if(!A)return"";var n=A[Math.min(e,A.length-1)];return n?t?n.open:n.close:""},mn={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&zA(e[0],"none")?[]:YA(e).map(function(e){for(var t={color:255,offsetX:ee,offsetY:ee,blur:ee,spread:ee,inset:!1},n=0,o=0;o<e.length;o++){var i=e[o];zA(i,"inset")?t.inset=!0:ZA(i)?(0===n?t.offsetX=i:1===n?t.offsetY=i:2===n?t.blur=i:t.spread=i,n++):t.color=ue(A,i)}return t})}},fn={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(A,e){var t=[];return e.filter(WA).forEach(function(A){switch(A.value){case"stroke":t.push(1);break;case"fill":t.push(0);break;case"markers":t.push(2)}}),[0,1,2].forEach(function(A){-1===t.indexOf(A)&&t.push(A)}),t}},vn={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},wn={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return NA(e)?e.number:0}},Cn=function(){function A(A,e){var t,n;this.animationDuration=xn(A,pn,e.animationDuration),this.backgroundClip=xn(A,be,e.backgroundClip),this.backgroundColor=xn(A,xe,e.backgroundColor),this.backgroundImage=xn(A,Ne,e.backgroundImage),this.backgroundOrigin=xn(A,Ge,e.backgroundOrigin),this.backgroundPosition=xn(A,We,e.backgroundPosition),this.backgroundRepeat=xn(A,je,e.backgroundRepeat),this.backgroundSize=xn(A,Je,e.backgroundSize),this.borderTopColor=xn(A,Ze,e.borderTopColor),this.borderRightColor=xn(A,$e,e.borderRightColor),this.borderBottomColor=xn(A,At,e.borderBottomColor),this.borderLeftColor=xn(A,et,e.borderLeftColor),this.borderTopLeftRadius=xn(A,nt,e.borderTopLeftRadius),this.borderTopRightRadius=xn(A,ot,e.borderTopRightRadius),this.borderBottomRightRadius=xn(A,it,e.borderBottomRightRadius),this.borderBottomLeftRadius=xn(A,rt,e.borderBottomLeftRadius),this.borderTopStyle=xn(A,at,e.borderTopStyle),this.borderRightStyle=xn(A,ct,e.borderRightStyle),this.borderBottomStyle=xn(A,lt,e.borderBottomStyle),this.borderLeftStyle=xn(A,dt,e.borderLeftStyle),this.borderTopWidth=xn(A,gt,e.borderTopWidth),this.borderRightWidth=xn(A,pt,e.borderRightWidth),this.borderBottomWidth=xn(A,ht,e.borderBottomWidth),this.borderLeftWidth=xn(A,Bt,e.borderLeftWidth),this.boxShadow=xn(A,mn,e.boxShadow),this.color=xn(A,mt,e.color),this.direction=xn(A,ft,e.direction),this.display=xn(A,vt,e.display),this.float=xn(A,Ct,e.cssFloat),this.fontFamily=xn(A,on,e.fontFamily),this.fontSize=xn(A,rn,e.fontSize),this.fontStyle=xn(A,cn,e.fontStyle),this.fontVariant=xn(A,an,e.fontVariant),this.fontWeight=xn(A,sn,e.fontWeight),this.letterSpacing=xn(A,yt,e.letterSpacing),this.lineBreak=xn(A,xt,e.lineBreak),this.lineHeight=xn(A,Qt,e.lineHeight),this.listStyleImage=xn(A,Ut,e.listStyleImage),this.listStylePosition=xn(A,St,e.listStylePosition),this.listStyleType=xn(A,It,e.listStyleType),this.marginTop=xn(A,kt,e.marginTop),this.marginRight=xn(A,Ht,e.marginRight),this.marginBottom=xn(A,Tt,e.marginBottom),this.marginLeft=xn(A,Dt,e.marginLeft),this.opacity=xn(A,en,e.opacity);var o=xn(A,Kt,e.overflow);this.overflowX=o[0],this.overflowY=o[o.length>1?1:0],this.overflowWrap=xn(A,Lt,e.overflowWrap),this.paddingTop=xn(A,Rt,e.paddingTop),this.paddingRight=xn(A,Pt,e.paddingRight),this.paddingBottom=xn(A,Ot,e.paddingBottom),this.paddingLeft=xn(A,Vt,e.paddingLeft),this.paintOrder=xn(A,fn,e.paintOrder),this.position=xn(A,Nt,e.position),this.textAlign=xn(A,_t,e.textAlign),this.textDecorationColor=xn(A,tn,null!==(t=e.textDecorationColor)&&void 0!==t?t:e.color),this.textDecorationLine=xn(A,nn,null!==(n=e.textDecorationLine)&&void 0!==n?n:e.textDecoration),this.textShadow=xn(A,Gt,e.textShadow),this.textTransform=xn(A,Wt,e.textTransform),this.transform=xn(A,jt,e.transform),this.transformOrigin=xn(A,Yt,e.transformOrigin),this.visibility=xn(A,qt,e.visibility),this.webkitTextStrokeColor=xn(A,vn,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=xn(A,wn,e.webkitTextStrokeWidth),this.wordBreak=xn(A,Zt,e.wordBreak),this.zIndex=xn(A,$t,e.zIndex)}return A.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},A.prototype.isTransparent=function(){return ge(this.backgroundColor)},A.prototype.isTransformed=function(){return null!==this.transform},A.prototype.isPositioned=function(){return 0!==this.position},A.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},A.prototype.isFloating=function(){return 0!==this.float},A.prototype.isInlineLevel=function(){return ln(this.display,4)||ln(this.display,33554432)||ln(this.display,268435456)||ln(this.display,536870912)||ln(this.display,67108864)||ln(this.display,134217728)},A}(),yn=function(A,e){this.content=xn(A,dn,e.content),this.quotes=xn(A,hn,e.quotes)},bn=function(A,e){this.counterIncrement=xn(A,un,e.counterIncrement),this.counterReset=xn(A,gn,e.counterReset)},xn=function(A,e,t){var n=new VA,o=null!=t?t.toString():e.initialValue;n.write(o);var i=new _A(n.read());switch(e.type){case 2:var r=i.parseComponentValue();return e.parse(A,WA(r)?r.value:e.initialValue);case 0:return e.parse(A,i.parseComponentValue());case 1:return e.parse(A,i.parseComponentValues());case 4:return i.parseComponentValue();case 3:switch(e.format){case"angle":return ae(A,i.parseComponentValue());case"color":return ue(A,i.parseComponentValue());case"image":return Oe(A,i.parseComponentValue());case"length":var s=i.parseComponentValue();return ZA(s)?s:ee;case"length-percentage":var a=i.parseComponentValue();return $A(a)?a:ee;case"time":return An.parse(A,i.parseComponentValue())}}},Qn=function(A,e){var t=function(A){switch(A.getAttribute("data-html2canvas-debug")){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}}(A);return 1===t||e===t},Fn=function(A,e){this.context=A,this.textNodes=[],this.elements=[],this.flags=0,Qn(e,3),this.styles=new Cn(A,window.getComputedStyle(e,null)),ko(e)&&(this.styles.animationDuration.some(function(A){return A>0})&&(e.style.animationDuration="0s"),null!==this.styles.transform&&(e.style.transform="none")),this.bounds=s(this.context,e),Qn(e,4)&&(this.flags|=16)},Un="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),In=0;In<64;In++)Sn[Un.charCodeAt(In)]=In;for(var En=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},kn=function(){function A(A,e,t,n,o,i){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=n,this.index=o,this.data=i}return A.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A<this.highStart)return e=2080+(A>>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),Hn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Tn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Dn=0;Dn<64;Dn++)Tn[Hn.charCodeAt(Dn)]=Dn;var Kn,Ln=8,Mn=9,Rn=11,Pn=12,On=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var n=[],o=-1,i="";++o<t;){var r=A[o];r<=65535?n.push(r):(r-=65536,n.push(55296+(r>>10),r%1024+56320)),(o+1===t||n.length>16384)&&(i+=String.fromCharCode.apply(String,n),n.length=0)}return i},Vn=function(A){var e,t,n,o=function(A){var e,t,n,o,i,r=.75*A.length,s=A.length,a=0;"="===A[A.length-1]&&(r--,"="===A[A.length-2]&&r--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(r):new Array(r),l=Array.isArray(c)?c:new Uint8Array(c);for(e=0;e<s;e+=4)t=Sn[A.charCodeAt(e)],n=Sn[A.charCodeAt(e+1)],o=Sn[A.charCodeAt(e+2)],i=Sn[A.charCodeAt(e+3)],l[a++]=t<<2|n>>4,l[a++]=(15&n)<<4|o>>2,l[a++]=(3&o)<<6|63&i;return c}(A),i=Array.isArray(o)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=4)t.push(A[n+3]<<24|A[n+2]<<16|A[n+1]<<8|A[n]);return t}(o):new Uint32Array(o),r=Array.isArray(o)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=2)t.push(A[n+1]<<8|A[n]);return t}(o):new Uint16Array(o),s=En(r,12,i[4]/2),a=2===i[5]?En(r,(24+i[4])/2):(e=i,t=Math.ceil((24+i[4])/4),e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,t,n)));return new kn(i[0],i[1],i[2],i[3],s,a)}("AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA="),_n="×",Nn=function(A){return Vn.get(A)},Gn=function(A,e,t){var n=t-2,o=e[n],i=e[t-1],r=e[t];if(2===i&&3===r)return _n;if(2===i||3===i||4===i)return"÷";if(2===r||3===r||4===r)return"÷";if(i===Ln&&-1!==[Ln,Mn,Rn,Pn].indexOf(r))return _n;if(!(i!==Rn&&i!==Mn||r!==Mn&&10!==r))return _n;if((i===Pn||10===i)&&10===r)return _n;if(13===r||5===r)return _n;if(7===r)return _n;if(1===i)return _n;if(13===i&&14===r){for(;5===o;)o=e[--n];if(14===o)return _n}if(15===i&&15===r){for(var s=0;15===o;)s++,o=e[--n];if(s%2==0)return _n}return"÷"},Wn=function(A){var e=function(A){for(var e=[],t=0,n=A.length;t<n;){var o=A.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var i=A.charCodeAt(t++);56320==(64512&i)?e.push(((1023&o)<<10)+(1023&i)+65536):(e.push(o),t--)}else e.push(o)}return e}(A),t=e.length,n=0,o=0,i=e.map(Nn);return{next:function(){if(n>=t)return{done:!0,value:null};for(var A=_n;n<t&&(A=Gn(0,i,++n))===_n;);if(A!==_n||n===t){var r=On.apply(null,e.slice(o,n));return o=n,{value:r,done:!1}}return{done:!0,value:null}}}},jn=function(A){return 0===A[0]&&255===A[1]&&0===A[2]&&255===A[3]},zn=function(A,e,t,n,o){var i="http://www.w3.org/2000/svg",r=document.createElementNS(i,"svg"),s=document.createElementNS(i,"foreignObject");return r.setAttributeNS(null,"width",A.toString()),r.setAttributeNS(null,"height",e.toString()),s.setAttributeNS(null,"width","100%"),s.setAttributeNS(null,"height","100%"),s.setAttributeNS(null,"x",t.toString()),s.setAttributeNS(null,"y",n.toString()),s.setAttributeNS(null,"externalResourcesRequired","true"),r.appendChild(s),s.appendChild(o),r},Xn=function(A){return new Promise(function(e,t){var n=new Image;n.onload=function(){return e(n)},n.onerror=t,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(A))})},Jn={get SUPPORT_RANGE_BOUNDS(){var A=function(A){if(A.createRange){var e=A.createRange();if(e.getBoundingClientRect){var t=A.createElement("boundtest");t.style.height="123px",t.style.display="block",A.body.appendChild(t),e.selectNode(t);var n=e.getBoundingClientRect(),o=Math.round(n.height);if(A.body.removeChild(t),123===o)return!0}}return!1}(document);return Object.defineProperty(Jn,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_WORD_BREAKING(){var A=Jn.SUPPORT_RANGE_BOUNDS&&function(A){var e=A.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",A.body.appendChild(e);var t=A.createRange();e.innerHTML="function"==typeof"".repeat?"&#128104;".repeat(10):"";var n=e.firstChild,o=a(n.data).map(function(A){return c(A)}),i=0,r={},s=o.every(function(A,e){t.setStart(n,i),t.setEnd(n,i+A.length);var o=t.getBoundingClientRect();i+=A.length;var s=o.x>r.x||o.y>r.y;return r=o,0===e||s});return A.body.removeChild(e),s}(document);return Object.defineProperty(Jn,"SUPPORT_WORD_BREAKING",{value:A}),A},get SUPPORT_SVG_DRAWING(){var A=function(A){var e=new Image,t=A.createElement("canvas"),n=t.getContext("2d");if(!n)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{n.drawImage(e,0,0),t.toDataURL()}catch(A){return!1}return!0}(document);return Object.defineProperty(Jn,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A="function"==typeof Array.from&&"function"==typeof window.fetch?function(A){var e=A.createElement("canvas"),t=100;e.width=t,e.height=t;var n=e.getContext("2d");if(!n)return Promise.reject(!1);n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,t,t);var o=new Image,i=e.toDataURL();o.src=i;var r=zn(t,t,0,0,o);return n.fillStyle="red",n.fillRect(0,0,t,t),Xn(r).then(function(e){n.drawImage(e,0,0);var o=n.getImageData(0,0,t,t).data;n.fillStyle="red",n.fillRect(0,0,t,t);var r=A.createElement("div");return r.style.backgroundImage="url("+i+")",r.style.height=t+"px",jn(o)?Xn(zn(t,t,0,0,r)):Promise.reject(!1)}).then(function(A){return n.drawImage(A,0,0),jn(n.getImageData(0,0,t,t).data)}).catch(function(){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(Jn,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(Jn,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(Jn,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Jn,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var A=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(Jn,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:A}),A}},Yn=function(A,e){this.text=A,this.bounds=e},qn=function(A,e){var t=e.ownerDocument;if(t){var n=t.createElement("html2canvaswrapper");n.appendChild(e.cloneNode(!0));var o=e.parentNode;if(o){o.replaceChild(n,e);var i=s(A,n);return n.firstChild&&o.replaceChild(n.firstChild,n),i}}return r.EMPTY},Zn=function(A,e,t){var n=A.ownerDocument;if(!n)throw new Error("Node has no owner document");var o=n.createRange();return o.setStart(A,e),o.setEnd(A,e+t),o},$n=function(A){if(Jn.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(A)).map(function(A){return A.segment})}return function(A){for(var e,t=Wn(A),n=[];!(e=t.next()).done;)e.value&&n.push(e.value.slice());return n}(A)},Ao=function(A,e){return 0!==e.letterSpacing?$n(A):function(A,e){if(Jn.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(A)).map(function(A){return A.segment})}return to(A,e)}(A,e)},eo=[32,160,4961,65792,65793,4153,4241],to=function(A,e){for(var t,n=function(A,e){var t=a(A),n=iA(t,e),o=n[0],i=n[1],r=n[2],s=t.length,c=0,l=0;return{next:function(){if(l>=s)return{done:!0,value:null};for(var A=j;l<s&&(A=oA(t,i,o,++l,r))===j;);if(A!==j||l===s){var e=new rA(t,A,c,l);return c=l,{value:e,done:!1}}return{done:!0,value:null}}}}(A,{lineBreak:e.lineBreak,wordBreak:"break-word"===e.overflowWrap?"break-word":e.wordBreak}),o=[],i=function(){if(t.value){var A=t.value.slice(),e=a(A),n="";e.forEach(function(A){-1===eo.indexOf(A)?n+=c(A):(n.length&&o.push(n),o.push(c(A)),n="")}),n.length&&o.push(n)}};!(t=n.next()).done;)i();return o},no=function(A,e,t){this.text=oo(e.data,t.textTransform),this.textBounds=function(A,e,t,n){var o=Ao(e,t),i=[],s=0;return o.forEach(function(e){if(t.textDecorationLine.length||e.trim().length>0)if(Jn.SUPPORT_RANGE_BOUNDS){var o=Zn(n,s,e.length).getClientRects();if(o.length>1){var a=$n(e),c=0;a.forEach(function(e){i.push(new Yn(e,r.fromDOMRectList(A,Zn(n,c+s,e.length).getClientRects()))),c+=e.length})}else i.push(new Yn(e,r.fromDOMRectList(A,o)))}else{var l=n.splitText(e.length);i.push(new Yn(e,qn(A,n))),n=l}else Jn.SUPPORT_RANGE_BOUNDS||(n=n.splitText(e.length));s+=e.length}),i}(A,this.text,t,e)},oo=function(A,e){switch(e){case 1:return A.toLowerCase();case 3:return A.replace(io,ro);case 2:return A.toUpperCase();default:return A}},io=/(^|\s|:|-|\(|\))([a-z])/g,ro=function(A,e,t){return A.length>0?e+t.toUpperCase():A},so=function(A){function t(e,t){var n=A.call(this,e,t)||this;return n.src=t.currentSrc||t.src,n.intrinsicWidth=t.naturalWidth,n.intrinsicHeight=t.naturalHeight,n.context.cache.addImage(n.src),n}return e(t,A),t}(Fn),ao=function(A){function t(e,t){var n=A.call(this,e,t)||this;return n.canvas=t,n.intrinsicWidth=t.width,n.intrinsicHeight=t.height,n}return e(t,A),t}(Fn),co=function(A){function t(e,t){var n=A.call(this,e,t)||this,o=new XMLSerializer,i=s(e,t);return t.setAttribute("width",i.width+"px"),t.setAttribute("height",i.height+"px"),n.svg="data:image/svg+xml,"+encodeURIComponent(o.serializeToString(t)),n.intrinsicWidth=t.width.baseVal.value,n.intrinsicHeight=t.height.baseVal.value,n.context.cache.addImage(n.svg),n}return e(t,A),t}(Fn),lo=function(A){function t(e,t){var n=A.call(this,e,t)||this;return n.value=t.value,n}return e(t,A),t}(Fn),uo=function(A){function t(e,t){var n=A.call(this,e,t)||this;return n.start=t.start,n.reversed="boolean"==typeof t.reversed&&!0===t.reversed,n}return e(t,A),t}(Fn),go=[{type:15,flags:0,unit:"px",number:3}],po=[{type:16,flags:0,number:50}],ho="checkbox",Bo="radio",mo="password",fo=707406591,vo=function(A){function t(e,t){var n,o,i,s=A.call(this,e,t)||this;switch(s.type=t.type.toLowerCase(),s.checked=t.checked,s.value=0===(i=(o=t).type===mo?new Array(o.value.length+1).join("•"):o.value).length?o.placeholder||"":i,s.type!==ho&&s.type!==Bo||(s.styles.backgroundColor=3739148031,s.styles.borderTopColor=s.styles.borderRightColor=s.styles.borderBottomColor=s.styles.borderLeftColor=2779096575,s.styles.borderTopWidth=s.styles.borderRightWidth=s.styles.borderBottomWidth=s.styles.borderLeftWidth=1,s.styles.borderTopStyle=s.styles.borderRightStyle=s.styles.borderBottomStyle=s.styles.borderLeftStyle=1,s.styles.backgroundClip=[0],s.styles.backgroundOrigin=[0],s.bounds=(n=s.bounds).width>n.height?new r(n.left+(n.width-n.height)/2,n.top,n.height,n.height):n.width<n.height?new r(n.left,n.top+(n.height-n.width)/2,n.width,n.width):n),s.type){case ho:s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=go;break;case Bo:s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=po}return s}return e(t,A),t}(Fn),wo=function(A){function t(e,t){var n=A.call(this,e,t)||this,o=t.options[t.selectedIndex||0];return n.value=o&&o.text||"",n}return e(t,A),t}(Fn),Co=function(A){function t(e,t){var n=A.call(this,e,t)||this;return n.value=t.value,n}return e(t,A),t}(Fn),yo=function(A){function t(e,t){var n=A.call(this,e,t)||this;n.src=t.src,n.width=parseInt(t.width,10)||0,n.height=parseInt(t.height,10)||0,n.backgroundColor=n.styles.backgroundColor;try{if(t.contentWindow&&t.contentWindow.document&&t.contentWindow.document.documentElement){n.tree=Fo(e,t.contentWindow.document.documentElement);var o=t.contentWindow.document.documentElement?Ce(e,getComputedStyle(t.contentWindow.document.documentElement).backgroundColor):ye.TRANSPARENT,i=t.contentWindow.document.body?Ce(e,getComputedStyle(t.contentWindow.document.body).backgroundColor):ye.TRANSPARENT;n.backgroundColor=ge(o)?ge(i)?n.styles.backgroundColor:i:o}}catch(A){}return n}return e(t,A),t}(Fn),bo=["OL","UL","MENU"],xo=function(A,e,t,n){for(var o=e.firstChild,i=void 0;o;o=i)if(i=o.nextSibling,Io(o)&&o.data.trim().length>0)t.textNodes.push(new no(A,o,t.styles));else if(Eo(o))if(Wo(o)&&o.assignedNodes)o.assignedNodes().forEach(function(e){return xo(A,e,t,n)});else{var r=Qo(A,o);r.styles.isVisible()&&(Uo(o,r,n)?r.flags|=4:So(r.styles)&&(r.flags|=2),-1!==bo.indexOf(o.tagName)&&(r.flags|=8),t.elements.push(r),o.slot,o.shadowRoot?xo(A,o.shadowRoot,r,n):No(o)||Lo(o)||Go(o)||xo(A,o,r,n))}},Qo=function(A,e){return Oo(e)?new so(A,e):Ro(e)?new ao(A,e):Lo(e)?new co(A,e):To(e)?new lo(A,e):Do(e)?new uo(A,e):Ko(e)?new vo(A,e):Go(e)?new wo(A,e):No(e)?new Co(A,e):Vo(e)?new yo(A,e):new Fn(A,e)},Fo=function(A,e){var t=Qo(A,e);return t.flags|=4,xo(A,e,t,t),t},Uo=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||Mo(A)&&t.styles.isTransparent()},So=function(A){return A.isPositioned()||A.isFloating()},Io=function(A){return A.nodeType===Node.TEXT_NODE},Eo=function(A){return A.nodeType===Node.ELEMENT_NODE},ko=function(A){return Eo(A)&&void 0!==A.style&&!Ho(A)},Ho=function(A){return"object"==typeof A.className},To=function(A){return"LI"===A.tagName},Do=function(A){return"OL"===A.tagName},Ko=function(A){return"INPUT"===A.tagName},Lo=function(A){return"svg"===A.tagName},Mo=function(A){return"BODY"===A.tagName},Ro=function(A){return"CANVAS"===A.tagName},Po=function(A){return"VIDEO"===A.tagName},Oo=function(A){return"IMG"===A.tagName},Vo=function(A){return"IFRAME"===A.tagName},_o=function(A){return"STYLE"===A.tagName},No=function(A){return"TEXTAREA"===A.tagName},Go=function(A){return"SELECT"===A.tagName},Wo=function(A){return"SLOT"===A.tagName},jo=function(A){return A.tagName.indexOf("-")>0},zo=function(){function A(){this.counters={}}return A.prototype.getCounterValue=function(A){var e=this.counters[A];return e&&e.length?e[e.length-1]:1},A.prototype.getCounterValues=function(A){return this.counters[A]||[]},A.prototype.pop=function(A){var e=this;A.forEach(function(A){return e.counters[A].pop()})},A.prototype.parse=function(A){var e=this,t=A.counterIncrement,n=A.counterReset,o=!0;null!==t&&t.forEach(function(A){var t=e.counters[A.counter];t&&0!==A.increment&&(o=!1,t.length||t.push(1),t[Math.max(0,t.length-1)]+=A.increment)});var i=[];return o&&n.forEach(function(A){var t=e.counters[A.counter];i.push(A.counter),t||(t=e.counters[A.counter]=[]),t.push(A.reset)}),i},A}(),Xo={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},Jo={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},Yo={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},qo={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Zo=function(A,e,t,n,o,i){return A<e||A>t?si(A,o,i.length>0):n.integers.reduce(function(e,t,o){for(;A>=t;)A-=t,e+=n.values[o];return e},"")+i},$o=function(A,e,t,n){var o="";do{t||A--,o=n(A)+o,A/=e}while(A*e>=e);return o},Ai=function(A,e,t,n,o){var i=t-e+1;return(A<0?"-":"")+($o(Math.abs(A),i,n,function(A){return c(Math.floor(A%i)+e)})+o)},ei=function(A,e,t){void 0===t&&(t=". ");var n=e.length;return $o(Math.abs(A),n,!1,function(A){return e[Math.floor(A%n)]})+t},ti=function(A,e,t,n,o,i){if(A<-9999||A>9999)return si(A,4,o.length>0);var r=Math.abs(A),s=o;if(0===r)return e[0]+s;for(var a=0;r>0&&a<=4;a++){var c=r%10;0===c&&ln(i,1)&&""!==s?s=e[c]+s:c>1||1===c&&0===a||1===c&&1===a&&ln(i,2)||1===c&&1===a&&ln(i,4)&&A>100||1===c&&a>1&&ln(i,8)?s=e[c]+(a>0?t[a-1]:"")+s:1===c&&a>0&&(s=t[a-1]+s),r=Math.floor(r/10)}return(A<0?n:"")+s},ni="十百千萬",oi="拾佰仟萬",ii="マイナス",ri="마이너스",si=function(A,e,t){var n=t?". ":"",o=t?"、":"",i=t?", ":"",r=t?" ":"";switch(e){case 0:return"•"+r;case 1:return"◦"+r;case 2:return"◾"+r;case 5:var s=Ai(A,48,57,!0,n);return s.length<4?"0"+s:s;case 4:return ei(A,"〇一二三四五六七八九",o);case 6:return Zo(A,1,3999,Xo,3,n).toLowerCase();case 7:return Zo(A,1,3999,Xo,3,n);case 8:return Ai(A,945,969,!1,n);case 9:return Ai(A,97,122,!1,n);case 10:return Ai(A,65,90,!1,n);case 11:return Ai(A,1632,1641,!0,n);case 12:case 49:return Zo(A,1,9999,Jo,3,n);case 35:return Zo(A,1,9999,Jo,3,n).toLowerCase();case 13:return Ai(A,2534,2543,!0,n);case 14:case 30:return Ai(A,6112,6121,!0,n);case 15:return ei(A,"子丑寅卯辰巳午未申酉戌亥",o);case 16:return ei(A,"甲乙丙丁戊己庚辛壬癸",o);case 17:case 48:return ti(A,"零一二三四五六七八九",ni,"負",o,14);case 47:return ti(A,"零壹貳參肆伍陸柒捌玖",oi,"負",o,15);case 42:return ti(A,"零一二三四五六七八九",ni,"负",o,14);case 41:return ti(A,"零壹贰叁肆伍陆柒捌玖",oi,"负",o,15);case 26:return ti(A,"〇一二三四五六七八九","十百千万",ii,o,0);case 25:return ti(A,"零壱弐参四伍六七八九","拾百千万",ii,o,7);case 31:return ti(A,"영일이삼사오육칠팔구","십백천만",ri,i,7);case 33:return ti(A,"零一二三四五六七八九","十百千萬",ri,i,0);case 32:return ti(A,"零壹貳參四五六七八九","拾百千",ri,i,7);case 18:return Ai(A,2406,2415,!0,n);case 20:return Zo(A,1,19999,qo,3,n);case 21:return Ai(A,2790,2799,!0,n);case 22:return Ai(A,2662,2671,!0,n);case 22:return Zo(A,1,10999,Yo,3,n);case 23:return ei(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return ei(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return Ai(A,3302,3311,!0,n);case 28:return ei(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",o);case 29:return ei(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",o);case 34:return Ai(A,3792,3801,!0,n);case 37:return Ai(A,6160,6169,!0,n);case 38:return Ai(A,4160,4169,!0,n);case 39:return Ai(A,2918,2927,!0,n);case 40:return Ai(A,1776,1785,!0,n);case 43:return Ai(A,3046,3055,!0,n);case 44:return Ai(A,3174,3183,!0,n);case 45:return Ai(A,3664,3673,!0,n);case 46:return Ai(A,3872,3881,!0,n);default:return Ai(A,48,57,!0,n)}},ai="data-html2canvas-ignore",ci=function(){function A(A,e,t){if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new zo,this.quoteDepth=0,!e.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(e.ownerDocument.documentElement,!1)}return A.prototype.toIFrame=function(A,e){var t=this,i=di(A,e);if(!i.contentWindow)return Promise.reject("Unable to find iframe window");var r=A.defaultView.pageXOffset,s=A.defaultView.pageYOffset,a=i.contentWindow,c=a.document,l=pi(i).then(function(){return n(t,void 0,void 0,function(){var A,t;return o(this,function(n){switch(n.label){case 0:return this.scrolledElements.forEach(vi),a&&(a.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||a.scrollY===e.top&&a.scrollX===e.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(a.scrollX-e.left,a.scrollY-e.top,0,0))),A=this.options.onclone,void 0===(t=this.clonedReferenceElement)?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:c.fonts&&c.fonts.ready?[4,c.fonts.ready]:[3,2];case 1:n.sent(),n.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,gi(c)]:[3,4];case 3:n.sent(),n.label=4;case 4:return"function"==typeof A?[2,Promise.resolve().then(function(){return A(c,t)}).then(function(){return i})]:[2,i]}})})});return c.open(),c.write(mi(document.doctype)+"<html></html>"),fi(this.referenceElement.ownerDocument,r,s),c.replaceChild(c.adoptNode(this.documentElement),c.documentElement),c.close(),l},A.prototype.createElementClone=function(A){if(Qn(A,2),Ro(A))return this.createCanvasClone(A);if(Po(A))return this.createVideoClone(A);if(_o(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return Oo(e)&&(Oo(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),"lazy"===e.loading&&(e.loading="eager")),jo(e)?this.createCustomElementClone(e):e},A.prototype.createCustomElementClone=function(A){var e=document.createElement("html2canvascustomelement");return Bi(A.style,e),e},A.prototype.createStyleClone=function(A){try{var e=A.sheet;if(e&&e.cssRules){var t=[].slice.call(e.cssRules,0).reduce(function(A,e){return e&&"string"==typeof e.cssText?A+e.cssText:A},""),n=A.cloneNode(!1);return n.textContent=t,n}}catch(A){if(this.context.logger.error("Unable to access cssRules property",A),"SecurityError"!==A.name)throw A}return A.cloneNode(!1)},A.prototype.createCanvasClone=function(A){var e;if(this.options.inlineImages&&A.ownerDocument){var t=A.ownerDocument.createElement("img");try{return t.src=A.toDataURL(),t}catch(e){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",A)}}var n=A.cloneNode(!1);try{n.width=A.width,n.height=A.height;var o=A.getContext("2d"),i=n.getContext("2d");if(i)if(!this.options.allowTaint&&o)i.putImageData(o.getImageData(0,0,A.width,A.height),0,0);else{var r=null!==(e=A.getContext("webgl2"))&&void 0!==e?e:A.getContext("webgl");if(r){var s=r.getContextAttributes();!1===(null==s?void 0:s.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",A)}i.drawImage(A,0,0)}return n}catch(e){this.context.logger.info("Unable to clone canvas as it is tainted",A)}return n},A.prototype.createVideoClone=function(A){var e=A.ownerDocument.createElement("canvas");e.width=A.offsetWidth,e.height=A.offsetHeight;var t=e.getContext("2d");try{return t&&(t.drawImage(A,0,0,e.width,e.height),this.options.allowTaint||t.getImageData(0,0,e.width,e.height)),e}catch(e){this.context.logger.info("Unable to clone video as it is tainted",A)}var n=A.ownerDocument.createElement("canvas");return n.width=A.offsetWidth,n.height=A.offsetHeight,n},A.prototype.appendChildNode=function(A,e,t){Eo(e)&&("SCRIPT"===e.tagName||e.hasAttribute(ai)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(e))||this.options.copyStyles&&Eo(e)&&_o(e)||A.appendChild(this.cloneNode(e,t))},A.prototype.cloneChildNodes=function(A,e,t){for(var n=this,o=A.shadowRoot?A.shadowRoot.firstChild:A.firstChild;o;o=o.nextSibling)if(Eo(o)&&Wo(o)&&"function"==typeof o.assignedNodes){var i=o.assignedNodes();i.length&&i.forEach(function(A){return n.appendChildNode(e,A,t)})}else this.appendChildNode(e,o,t)},A.prototype.cloneNode=function(A,e){if(Io(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var t=A.ownerDocument.defaultView;if(t&&Eo(A)&&(ko(A)||Ho(A))){var n=this.createElementClone(A);n.style.transitionProperty="none";var o=t.getComputedStyle(A),i=t.getComputedStyle(A,":before"),r=t.getComputedStyle(A,":after");this.referenceElement===A&&ko(n)&&(this.clonedReferenceElement=n),Mo(n)&&bi(n);var s=this.counters.parse(new bn(this.context,o)),a=this.resolvePseudoContent(A,n,i,Kn.BEFORE);jo(A)&&(e=!0),Po(A)||this.cloneChildNodes(A,n,e),a&&n.insertBefore(a,n.firstChild);var c=this.resolvePseudoContent(A,n,r,Kn.AFTER);return c&&n.appendChild(c),this.counters.pop(s),(o&&(this.options.copyStyles||Ho(A))&&!Vo(A)||e)&&Bi(o,n),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([n,A.scrollLeft,A.scrollTop]),(No(A)||Go(A))&&(No(n)||Go(n))&&(n.value=A.value),n}return A.cloneNode(!1)},A.prototype.resolvePseudoContent=function(A,e,t,n){var o=this;if(t){var i=t.content,r=e.ownerDocument;if(r&&i&&"none"!==i&&"-moz-alt-content"!==i&&"none"!==t.display){this.counters.parse(new bn(this.context,t));var s=new yn(this.context,t),a=r.createElement("html2canvaspseudoelement");Bi(t,a),s.content.forEach(function(e){if(0===e.type)a.appendChild(r.createTextNode(e.value));else if(22===e.type){var t=r.createElement("img");t.src=e.value,t.style.opacity="1",a.appendChild(t)}else if(18===e.type){if("attr"===e.name){var n=e.values.filter(WA);n.length&&a.appendChild(r.createTextNode(A.getAttribute(n[0].value)||""))}else if("counter"===e.name){var i=e.values.filter(JA),c=i[0],l=i[1];if(c&&WA(c)){var d=o.counters.getCounterValue(c.value),u=l&&WA(l)?It.parse(o.context,l.value):3;a.appendChild(r.createTextNode(si(d,u,!1)))}}else if("counters"===e.name){var g=e.values.filter(JA),p=(c=g[0],g[1]);if(l=g[2],c&&WA(c)){var h=o.counters.getCounterValues(c.value),B=l&&WA(l)?It.parse(o.context,l.value):3,m=p&&0===p.type?p.value:"",f=h.map(function(A){return si(A,B,!1)}).join(m);a.appendChild(r.createTextNode(f))}}}else if(20===e.type)switch(e.value){case"open-quote":a.appendChild(r.createTextNode(Bn(s.quotes,o.quoteDepth++,!0)));break;case"close-quote":a.appendChild(r.createTextNode(Bn(s.quotes,--o.quoteDepth,!1)));break;default:a.appendChild(r.createTextNode(e.value))}}),a.className=wi+" "+Ci;var c=n===Kn.BEFORE?" "+wi:" "+Ci;return Ho(e)?e.className.baseValue+=c:e.className+=c,a}}},A.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},A}();!function(A){A[A.BEFORE=0]="BEFORE",A[A.AFTER=1]="AFTER"}(Kn||(Kn={}));var li,di=function(A,e){var t=A.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute(ai,"true"),A.body.appendChild(t),t},ui=function(A){return new Promise(function(e){A.complete?e():A.src?(A.onload=e,A.onerror=e):e()})},gi=function(A){return Promise.all([].slice.call(A.images,0).map(ui))},pi=function(A){return new Promise(function(e,t){var n=A.contentWindow;if(!n)return t("No window assigned for iframe");var o=n.document;n.onload=A.onload=function(){n.onload=A.onload=null;var t=setInterval(function(){o.body.childNodes.length>0&&"complete"===o.readyState&&(clearInterval(t),e(A))},50)}})},hi=["all","d","content"],Bi=function(A,e){for(var t=A.length-1;t>=0;t--){var n=A.item(t);-1===hi.indexOf(n)&&e.style.setProperty(n,A.getPropertyValue(n))}return e},mi=function(A){var e="";return A&&(e+="<!DOCTYPE ",A.name&&(e+=A.name),A.internalSubset&&(e+=A.internalSubset),A.publicId&&(e+='"'+A.publicId+'"'),A.systemId&&(e+='"'+A.systemId+'"'),e+=">"),e},fi=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},vi=function(A){var e=A[0],t=A[1],n=A[2];e.scrollLeft=t,e.scrollTop=n},wi="___html2canvas___pseudoelement_before",Ci="___html2canvas___pseudoelement_after",yi='{\n content: "" !important;\n display: none !important;\n}',bi=function(A){xi(A,"."+wi+":before"+yi+"\n ."+Ci+":after"+yi)},xi=function(A,e){var t=A.ownerDocument;if(t){var n=t.createElement("style");n.textContent=e,A.appendChild(n)}},Qi=function(){function A(){}return A.getOrigin=function(e){var t=A._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},A.isSameOrigin=function(e){return A.getOrigin(e)===A._origin},A.setContext=function(e){A._link=e.document.createElement("a"),A._origin=A.getOrigin(e.location.href)},A._origin="about:blank",A}(),Fi=function(){function A(A,e){this.context=A,this._options=e,this._cache={}}return A.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)?e:Ti(A)||Ei(A)?((this._cache[A]=this.loadImage(A)).catch(function(){}),e):e},A.prototype.match=function(A){return this._cache[A]},A.prototype.loadImage=function(A){return n(this,void 0,void 0,function(){var e,t,n,i,r=this;return o(this,function(o){switch(o.label){case 0:return e=Qi.isSameOrigin(A),t=!ki(A)&&!0===this._options.useCORS&&Jn.SUPPORT_CORS_IMAGES&&!e,n=!ki(A)&&!e&&!Ti(A)&&"string"==typeof this._options.proxy&&Jn.SUPPORT_CORS_XHR&&!t,e||!1!==this._options.allowTaint||ki(A)||Ti(A)||n||t?(i=A,n?[4,this.proxy(i)]:[3,2]):[2];case 1:i=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+A.substring(0,256)),[4,new Promise(function(A,e){var n=new Image;n.onload=function(){return A(n)},n.onerror=e,(Hi(i)||t)&&(n.crossOrigin="anonymous"),n.src=i,!0===n.complete&&setTimeout(function(){return A(n)},500),r._options.imageTimeout>0&&setTimeout(function(){return e("Timed out ("+r._options.imageTimeout+"ms) loading image")},r._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},A.prototype.has=function(A){return void 0!==this._cache[A]},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(A){var e=this,t=this._options.proxy;if(!t)throw new Error("No proxy defined");var n=A.substring(0,256);return new Promise(function(o,i){var r=Jn.SUPPORT_RESPONSE_TYPE?"blob":"text",s=new XMLHttpRequest;s.onload=function(){if(200===s.status)if("text"===r)o(s.response);else{var A=new FileReader;A.addEventListener("load",function(){return o(A.result)},!1),A.addEventListener("error",function(A){return i(A)},!1),A.readAsDataURL(s.response)}else i("Failed to proxy resource "+n+" with status code "+s.status)},s.onerror=i;var a=t.indexOf("?")>-1?"&":"?";if(s.open("GET",""+t+a+"url="+encodeURIComponent(A)+"&responseType="+r),"text"!==r&&s instanceof XMLHttpRequest&&(s.responseType=r),e._options.imageTimeout){var c=e._options.imageTimeout;s.timeout=c,s.ontimeout=function(){return i("Timed out ("+c+"ms) proxying "+n)}}s.send()})},A}(),Ui=/^data:image\/svg\+xml/i,Si=/^data:image\/.*;base64,/i,Ii=/^data:image\/.*/i,Ei=function(A){return Jn.SUPPORT_SVG_DRAWING||!Di(A)},ki=function(A){return Ii.test(A)},Hi=function(A){return Si.test(A)},Ti=function(A){return"blob"===A.substr(0,4)},Di=function(A){return"svg"===A.substr(-3).toLowerCase()||Ui.test(A)},Ki=function(){function A(A,e){this.type=0,this.x=A,this.y=e}return A.prototype.add=function(e,t){return new A(this.x+e,this.y+t)},A}(),Li=function(A,e,t){return new Ki(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)},Mi=function(){function A(A,e,t,n){this.type=1,this.start=A,this.startControl=e,this.endControl=t,this.end=n}return A.prototype.subdivide=function(e,t){var n=Li(this.start,this.startControl,e),o=Li(this.startControl,this.endControl,e),i=Li(this.endControl,this.end,e),r=Li(n,o,e),s=Li(o,i,e),a=Li(r,s,e);return t?new A(this.start,n,r,a):new A(a,s,i,this.end)},A.prototype.add=function(e,t){return new A(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A}(),Ri=function(A){return 1===A.type},Pi=function(A){var e=A.styles,t=A.bounds,n=oe(e.borderTopLeftRadius,t.width,t.height),o=n[0],i=n[1],r=oe(e.borderTopRightRadius,t.width,t.height),s=r[0],a=r[1],c=oe(e.borderBottomRightRadius,t.width,t.height),l=c[0],d=c[1],u=oe(e.borderBottomLeftRadius,t.width,t.height),g=u[0],p=u[1],h=[];h.push((o+s)/t.width),h.push((g+l)/t.width),h.push((i+p)/t.height),h.push((a+d)/t.height);var B=Math.max.apply(Math,h);B>1&&(o/=B,i/=B,s/=B,a/=B,l/=B,d/=B,g/=B,p/=B);var m=t.width-s,f=t.height-d,v=t.width-l,w=t.height-p,C=e.borderTopWidth,y=e.borderRightWidth,b=e.borderBottomWidth,x=e.borderLeftWidth,Q=ie(e.paddingTop,A.bounds.width),F=ie(e.paddingRight,A.bounds.width),U=ie(e.paddingBottom,A.bounds.width),S=ie(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=o>0||i>0?Oi(t.left+x/3,t.top+C/3,o-x/3,i-C/3,li.TOP_LEFT):new Ki(t.left+x/3,t.top+C/3),this.topRightBorderDoubleOuterBox=o>0||i>0?Oi(t.left+m,t.top+C/3,s-y/3,a-C/3,li.TOP_RIGHT):new Ki(t.left+t.width-y/3,t.top+C/3),this.bottomRightBorderDoubleOuterBox=l>0||d>0?Oi(t.left+v,t.top+f,l-y/3,d-b/3,li.BOTTOM_RIGHT):new Ki(t.left+t.width-y/3,t.top+t.height-b/3),this.bottomLeftBorderDoubleOuterBox=g>0||p>0?Oi(t.left+x/3,t.top+w,g-x/3,p-b/3,li.BOTTOM_LEFT):new Ki(t.left+x/3,t.top+t.height-b/3),this.topLeftBorderDoubleInnerBox=o>0||i>0?Oi(t.left+2*x/3,t.top+2*C/3,o-2*x/3,i-2*C/3,li.TOP_LEFT):new Ki(t.left+2*x/3,t.top+2*C/3),this.topRightBorderDoubleInnerBox=o>0||i>0?Oi(t.left+m,t.top+2*C/3,s-2*y/3,a-2*C/3,li.TOP_RIGHT):new Ki(t.left+t.width-2*y/3,t.top+2*C/3),this.bottomRightBorderDoubleInnerBox=l>0||d>0?Oi(t.left+v,t.top+f,l-2*y/3,d-2*b/3,li.BOTTOM_RIGHT):new Ki(t.left+t.width-2*y/3,t.top+t.height-2*b/3),this.bottomLeftBorderDoubleInnerBox=g>0||p>0?Oi(t.left+2*x/3,t.top+w,g-2*x/3,p-2*b/3,li.BOTTOM_LEFT):new Ki(t.left+2*x/3,t.top+t.height-2*b/3),this.topLeftBorderStroke=o>0||i>0?Oi(t.left+x/2,t.top+C/2,o-x/2,i-C/2,li.TOP_LEFT):new Ki(t.left+x/2,t.top+C/2),this.topRightBorderStroke=o>0||i>0?Oi(t.left+m,t.top+C/2,s-y/2,a-C/2,li.TOP_RIGHT):new Ki(t.left+t.width-y/2,t.top+C/2),this.bottomRightBorderStroke=l>0||d>0?Oi(t.left+v,t.top+f,l-y/2,d-b/2,li.BOTTOM_RIGHT):new Ki(t.left+t.width-y/2,t.top+t.height-b/2),this.bottomLeftBorderStroke=g>0||p>0?Oi(t.left+x/2,t.top+w,g-x/2,p-b/2,li.BOTTOM_LEFT):new Ki(t.left+x/2,t.top+t.height-b/2),this.topLeftBorderBox=o>0||i>0?Oi(t.left,t.top,o,i,li.TOP_LEFT):new Ki(t.left,t.top),this.topRightBorderBox=s>0||a>0?Oi(t.left+m,t.top,s,a,li.TOP_RIGHT):new Ki(t.left+t.width,t.top),this.bottomRightBorderBox=l>0||d>0?Oi(t.left+v,t.top+f,l,d,li.BOTTOM_RIGHT):new Ki(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=g>0||p>0?Oi(t.left,t.top+w,g,p,li.BOTTOM_LEFT):new Ki(t.left,t.top+t.height),this.topLeftPaddingBox=o>0||i>0?Oi(t.left+x,t.top+C,Math.max(0,o-x),Math.max(0,i-C),li.TOP_LEFT):new Ki(t.left+x,t.top+C),this.topRightPaddingBox=s>0||a>0?Oi(t.left+Math.min(m,t.width-y),t.top+C,m>t.width+y?0:Math.max(0,s-y),Math.max(0,a-C),li.TOP_RIGHT):new Ki(t.left+t.width-y,t.top+C),this.bottomRightPaddingBox=l>0||d>0?Oi(t.left+Math.min(v,t.width-x),t.top+Math.min(f,t.height-b),Math.max(0,l-y),Math.max(0,d-b),li.BOTTOM_RIGHT):new Ki(t.left+t.width-y,t.top+t.height-b),this.bottomLeftPaddingBox=g>0||p>0?Oi(t.left+x,t.top+Math.min(w,t.height-b),Math.max(0,g-x),Math.max(0,p-b),li.BOTTOM_LEFT):new Ki(t.left+x,t.top+t.height-b),this.topLeftContentBox=o>0||i>0?Oi(t.left+x+S,t.top+C+Q,Math.max(0,o-(x+S)),Math.max(0,i-(C+Q)),li.TOP_LEFT):new Ki(t.left+x+S,t.top+C+Q),this.topRightContentBox=s>0||a>0?Oi(t.left+Math.min(m,t.width+x+S),t.top+C+Q,m>t.width+x+S?0:s-x+S,a-(C+Q),li.TOP_RIGHT):new Ki(t.left+t.width-(y+F),t.top+C+Q),this.bottomRightContentBox=l>0||d>0?Oi(t.left+Math.min(v,t.width-(x+S)),t.top+Math.min(f,t.height+C+Q),Math.max(0,l-(y+F)),d-(b+U),li.BOTTOM_RIGHT):new Ki(t.left+t.width-(y+F),t.top+t.height-(b+U)),this.bottomLeftContentBox=g>0||p>0?Oi(t.left+x+S,t.top+w,Math.max(0,g-(x+S)),p-(b+U),li.BOTTOM_LEFT):new Ki(t.left+x+S,t.top+t.height-(b+U))};!function(A){A[A.TOP_LEFT=0]="TOP_LEFT",A[A.TOP_RIGHT=1]="TOP_RIGHT",A[A.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",A[A.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(li||(li={}));var Oi=function(A,e,t,n,o){var i=(Math.sqrt(2)-1)/3*4,r=t*i,s=n*i,a=A+t,c=e+n;switch(o){case li.TOP_LEFT:return new Mi(new Ki(A,c),new Ki(A,c-s),new Ki(a-r,e),new Ki(a,e));case li.TOP_RIGHT:return new Mi(new Ki(A,e),new Ki(A+r,e),new Ki(a,c-s),new Ki(a,c));case li.BOTTOM_RIGHT:return new Mi(new Ki(a,e),new Ki(a,e+s),new Ki(A+r,c),new Ki(A,c));case li.BOTTOM_LEFT:default:return new Mi(new Ki(a,c),new Ki(a-r,c),new Ki(A,e+s),new Ki(A,e))}},Vi=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},_i=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},Ni=function(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6},Gi=function(A,e){this.path=A,this.target=e,this.type=1},Wi=function(A){this.opacity=A,this.type=2,this.target=6},ji=function(A){return 1===A.type},zi=function(A,e){return A.length===e.length&&A.some(function(A,t){return A===e[t]})},Xi=function(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},Ji=function(){function A(A,e){if(this.container=A,this.parent=e,this.effects=[],this.curves=new Pi(this.container),this.container.styles.opacity<1&&this.effects.push(new Wi(this.container.styles.opacity)),null!==this.container.styles.transform){var t=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,o=this.container.styles.transform;this.effects.push(new Ni(t,n,o))}if(0!==this.container.styles.overflowX){var i=Vi(this.curves),r=_i(this.curves);zi(i,r)?this.effects.push(new Gi(i,6)):(this.effects.push(new Gi(i,2)),this.effects.push(new Gi(r,4)))}}return A.prototype.getEffects=function(A){for(var e=-1===[2,3].indexOf(this.container.styles.position),t=this.parent,n=this.effects.slice(0);t;){var o=t.effects.filter(function(A){return!ji(A)});if(e||0!==t.container.styles.position||!t.parent){if(n.unshift.apply(n,o),e=-1===[2,3].indexOf(t.container.styles.position),0!==t.container.styles.overflowX){var i=Vi(t.curves),r=_i(t.curves);zi(i,r)||n.unshift(new Gi(r,6))}}else n.unshift.apply(n,o);t=t.parent}return n.filter(function(e){return ln(e.target,A)})},A}(),Yi=function(A,e,t,n){A.container.elements.forEach(function(o){var i=ln(o.flags,4),r=ln(o.flags,2),s=new Ji(o,A);ln(o.styles.display,2048)&&n.push(s);var a=ln(o.flags,8)?[]:n;if(i||r){var c=i||o.styles.isPositioned()?t:e,l=new Xi(s);if(o.styles.isPositioned()||o.styles.opacity<1||o.styles.isTransformed()){var d=o.styles.zIndex.order;if(d<0){var u=0;c.negativeZIndex.some(function(A,e){return d>A.element.container.styles.zIndex.order?(u=e,!1):u>0}),c.negativeZIndex.splice(u,0,l)}else if(d>0){var g=0;c.positiveZIndex.some(function(A,e){return d>=A.element.container.styles.zIndex.order?(g=e+1,!1):g>0}),c.positiveZIndex.splice(g,0,l)}else c.zeroOrAutoZIndexOrTransformedOrOpacity.push(l)}else o.styles.isFloating()?c.nonPositionedFloats.push(l):c.nonPositionedInlineLevel.push(l);Yi(s,l,i?l:t,a)}else o.styles.isInlineLevel()?e.inlineLevel.push(s):e.nonInlineLevel.push(s),Yi(s,e,t,a);ln(o.flags,8)&&qi(o,a)})},qi=function(A,e){for(var t=A instanceof uo?A.start:1,n=A instanceof uo&&A.reversed,o=0;o<e.length;o++){var i=e[o];i.container instanceof lo&&"number"==typeof i.container.value&&0!==i.container.value&&(t=i.container.value),i.listValue=si(t,i.container.styles.listStyleType,!0),t+=n?-1:1}},Zi=function(A,e){switch(e){case 0:return Ar(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return Ar(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return Ar(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return Ar(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},$i=function(A,e){var t=[];return Ri(A)?t.push(A.subdivide(.5,!1)):t.push(A),Ri(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},Ar=function(A,e,t,n){var o=[];return Ri(A)?o.push(A.subdivide(.5,!1)):o.push(A),Ri(t)?o.push(t.subdivide(.5,!0)):o.push(t),Ri(n)?o.push(n.subdivide(.5,!0).reverse()):o.push(n),Ri(e)?o.push(e.subdivide(.5,!1).reverse()):o.push(e),o},er=function(A){var e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},tr=function(A){var e=A.styles,t=A.bounds,n=ie(e.paddingLeft,t.width),o=ie(e.paddingRight,t.width),i=ie(e.paddingTop,t.width),r=ie(e.paddingBottom,t.width);return t.add(n+e.borderLeftWidth,i+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+n+o),-(e.borderTopWidth+e.borderBottomWidth+i+r))},nr=function(A,e,t){var n=function(A,e){return 0===A?e.bounds:2===A?tr(e):er(e)}(sr(A.styles.backgroundOrigin,e),A),o=function(A,e){return 0===A?e.bounds:2===A?tr(e):er(e)}(sr(A.styles.backgroundClip,e),A),i=rr(sr(A.styles.backgroundSize,e),t,n),r=i[0],s=i[1],a=oe(sr(A.styles.backgroundPosition,e),n.width-r,n.height-s);return[ar(sr(A.styles.backgroundRepeat,e),a,i,n,o),Math.round(n.left+a[0]),Math.round(n.top+a[1]),r,s]},or=function(A){return WA(A)&&A.value===Ve.AUTO},ir=function(A){return"number"==typeof A},rr=function(A,e,t){var n=e[0],o=e[1],i=e[2],r=A[0],s=A[1];if(!r)return[0,0];if($A(r)&&s&&$A(s))return[ie(r,t.width),ie(s,t.height)];var a=ir(i);if(WA(r)&&(r.value===Ve.CONTAIN||r.value===Ve.COVER))return ir(i)?t.width/t.height<i!=(r.value===Ve.COVER)?[t.width,t.width/i]:[t.height*i,t.height]:[t.width,t.height];var c=ir(n),l=ir(o),d=c||l;if(or(r)&&(!s||or(s)))return c&&l?[n,o]:a||d?d&&a?[c?n:o*i,l?o:n/i]:[c?n:t.width,l?o:t.height]:[t.width,t.height];if(a){var u=0,g=0;return $A(r)?u=ie(r,t.width):$A(s)&&(g=ie(s,t.height)),or(r)?u=g*i:s&&!or(s)||(g=u/i),[u,g]}var p=null,h=null;if($A(r)?p=ie(r,t.width):s&&$A(s)&&(h=ie(s,t.height)),null===p||s&&!or(s)||(h=c&&l?p/n*o:t.height),null!==h&&or(r)&&(p=c&&l?h/o*n:t.width),null!==p&&null!==h)return[p,h];throw new Error("Unable to calculate background-size for element")},sr=function(A,e){var t=A[e];return void 0===t?A[0]:t},ar=function(A,e,t,n,o){var i=e[0],r=e[1],s=t[0],a=t[1];switch(A){case 2:return[new Ki(Math.round(n.left),Math.round(n.top+r)),new Ki(Math.round(n.left+n.width),Math.round(n.top+r)),new Ki(Math.round(n.left+n.width),Math.round(a+n.top+r)),new Ki(Math.round(n.left),Math.round(a+n.top+r))];case 3:return[new Ki(Math.round(n.left+i),Math.round(n.top)),new Ki(Math.round(n.left+i+s),Math.round(n.top)),new Ki(Math.round(n.left+i+s),Math.round(n.height+n.top)),new Ki(Math.round(n.left+i),Math.round(n.height+n.top))];case 1:return[new Ki(Math.round(n.left+i),Math.round(n.top+r)),new Ki(Math.round(n.left+i+s),Math.round(n.top+r)),new Ki(Math.round(n.left+i+s),Math.round(n.top+r+a)),new Ki(Math.round(n.left+i),Math.round(n.top+r+a))];default:return[new Ki(Math.round(o.left),Math.round(o.top)),new Ki(Math.round(o.left+o.width),Math.round(o.top)),new Ki(Math.round(o.left+o.width),Math.round(o.height+o.top)),new Ki(Math.round(o.left),Math.round(o.height+o.top))]}},cr="Hidden Text",lr=function(){function A(A){this._data={},this._document=A}return A.prototype.parseMetrics=function(A,e){var t=this._document.createElement("div"),n=this._document.createElement("img"),o=this._document.createElement("span"),i=this._document.body;t.style.visibility="hidden",t.style.fontFamily=A,t.style.fontSize=e,t.style.margin="0",t.style.padding="0",t.style.whiteSpace="nowrap",i.appendChild(t),n.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",o.style.fontFamily=A,o.style.fontSize=e,o.style.margin="0",o.style.padding="0",o.appendChild(this._document.createTextNode(cr)),t.appendChild(o),t.appendChild(n);var r=n.offsetTop-o.offsetTop+2;t.removeChild(o),t.appendChild(this._document.createTextNode(cr)),t.style.lineHeight="normal",n.style.verticalAlign="super";var s=n.offsetTop-t.offsetTop+2;return i.removeChild(t),{baseline:r,middle:s}},A.prototype.getMetrics=function(A,e){var t=A+" "+e;return void 0===this._data[t]&&(this._data[t]=this.parseMetrics(A,e)),this._data[t]},A}(),dr=function(A,e){this.context=A,this.options=e},ur=function(A){function t(e,t){var n=A.call(this,e,t)||this;return n._activeEffects=[],n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),t.canvas||(n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width=t.width+"px",n.canvas.style.height=t.height+"px"),n.fontMetrics=new lr(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+t.width+"x"+t.height+") with scale "+t.scale),n}return e(t,A),t.prototype.applyEffects=function(A){for(var e=this;this._activeEffects.length;)this.popEffect();A.forEach(function(A){return e.applyEffect(A)})},t.prototype.applyEffect=function(A){this.ctx.save(),function(A){return 2===A.type}(A)&&(this.ctx.globalAlpha=A.opacity),function(A){return 0===A.type}(A)&&(this.ctx.translate(A.offsetX,A.offsetY),this.ctx.transform(A.matrix[0],A.matrix[1],A.matrix[2],A.matrix[3],A.matrix[4],A.matrix[5]),this.ctx.translate(-A.offsetX,-A.offsetY)),ji(A)&&(this.path(A.path),this.ctx.clip()),this._activeEffects.push(A)},t.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},t.prototype.renderStack=function(A){return n(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return A.element.container.styles.isVisible()?[4,this.renderStackContent(A)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},t.prototype.renderNode=function(A){return n(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return ln(A.container.flags,16),A.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(A)]:[3,3];case 1:return e.sent(),[4,this.renderNodeContent(A)];case 2:e.sent(),e.label=3;case 3:return[2]}})})},t.prototype.renderTextWithLetterSpacing=function(A,e,t){var n=this;0===e?this.ctx.fillText(A.text,A.bounds.left,A.bounds.top+t):$n(A.text).reduce(function(e,o){return n.ctx.fillText(o,e,A.bounds.top+t),e+n.ctx.measureText(o).width},A.bounds.left)},t.prototype.createFontStyle=function(A){var e=A.fontVariant.filter(function(A){return"normal"===A||"small-caps"===A}).join(""),t=mr(A.fontFamily).join(", "),n=NA(A.fontSize)?""+A.fontSize.number+A.fontSize.unit:A.fontSize.number+"px";return[[A.fontStyle,e,A.fontWeight,n,t].join(" "),t,n]},t.prototype.renderTextNode=function(A,e){return n(this,void 0,void 0,function(){var t,n,i,r,s,a,c,l,d=this;return o(this,function(o){return t=this.createFontStyle(e),n=t[0],i=t[1],r=t[2],this.ctx.font=n,this.ctx.direction=1===e.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",s=this.fontMetrics.getMetrics(i,r),a=s.baseline,c=s.middle,l=e.paintOrder,A.textBounds.forEach(function(A){l.forEach(function(t){switch(t){case 0:d.ctx.fillStyle=pe(e.color),d.renderTextWithLetterSpacing(A,e.letterSpacing,a);var n=e.textShadow;n.length&&A.text.trim().length&&(n.slice(0).reverse().forEach(function(t){d.ctx.shadowColor=pe(t.color),d.ctx.shadowOffsetX=t.offsetX.number*d.options.scale,d.ctx.shadowOffsetY=t.offsetY.number*d.options.scale,d.ctx.shadowBlur=t.blur.number,d.renderTextWithLetterSpacing(A,e.letterSpacing,a)}),d.ctx.shadowColor="",d.ctx.shadowOffsetX=0,d.ctx.shadowOffsetY=0,d.ctx.shadowBlur=0),e.textDecorationLine.length&&(d.ctx.fillStyle=pe(e.textDecorationColor||e.color),e.textDecorationLine.forEach(function(e){switch(e){case 1:d.ctx.fillRect(A.bounds.left,Math.round(A.bounds.top+a),A.bounds.width,1);break;case 2:d.ctx.fillRect(A.bounds.left,Math.round(A.bounds.top),A.bounds.width,1);break;case 3:d.ctx.fillRect(A.bounds.left,Math.ceil(A.bounds.top+c),A.bounds.width,1)}}));break;case 1:e.webkitTextStrokeWidth&&A.text.trim().length&&(d.ctx.strokeStyle=pe(e.webkitTextStrokeColor),d.ctx.lineWidth=e.webkitTextStrokeWidth,d.ctx.lineJoin=window.chrome?"miter":"round",d.ctx.strokeText(A.text,A.bounds.left,A.bounds.top+a)),d.ctx.strokeStyle="",d.ctx.lineWidth=0,d.ctx.lineJoin="miter"}})}),[2]})})},t.prototype.renderReplacedElement=function(A,e,t){if(t&&A.intrinsicWidth>0&&A.intrinsicHeight>0){var n=tr(A),o=_i(e);this.path(o),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(t,0,0,A.intrinsicWidth,A.intrinsicHeight,n.left,n.top,n.width,n.height),this.ctx.restore()}},t.prototype.renderNodeContent=function(A){return n(this,void 0,void 0,function(){var e,n,i,s,a,c,l,d,u,g,p,h,B,m,f,v,w,C;return o(this,function(o){switch(o.label){case 0:this.applyEffects(A.getEffects(4)),e=A.container,n=A.curves,i=e.styles,s=0,a=e.textNodes,o.label=1;case 1:return s<a.length?(c=a[s],[4,this.renderTextNode(c,i)]):[3,4];case 2:o.sent(),o.label=3;case 3:return s++,[3,1];case 4:if(!(e instanceof so))return[3,8];o.label=5;case 5:return o.trys.push([5,7,,8]),[4,this.context.cache.match(e.src)];case 6:return f=o.sent(),this.renderReplacedElement(e,n,f),[3,8];case 7:return o.sent(),this.context.logger.error("Error loading image "+e.src),[3,8];case 8:if(e instanceof ao&&this.renderReplacedElement(e,n,e.canvas),!(e instanceof co))return[3,12];o.label=9;case 9:return o.trys.push([9,11,,12]),[4,this.context.cache.match(e.svg)];case 10:return f=o.sent(),this.renderReplacedElement(e,n,f),[3,12];case 11:return o.sent(),this.context.logger.error("Error loading svg "+e.svg.substring(0,255)),[3,12];case 12:return e instanceof yo&&e.tree?[4,new t(this.context,{scale:this.options.scale,backgroundColor:e.backgroundColor,x:0,y:0,width:e.width,height:e.height}).render(e.tree)]:[3,14];case 13:l=o.sent(),e.width&&e.height&&this.ctx.drawImage(l,0,0,e.width,e.height,e.bounds.left,e.bounds.top,e.bounds.width,e.bounds.height),o.label=14;case 14:if(e instanceof vo&&(d=Math.min(e.bounds.width,e.bounds.height),e.type===ho?e.checked&&(this.ctx.save(),this.path([new Ki(e.bounds.left+.39363*d,e.bounds.top+.79*d),new Ki(e.bounds.left+.16*d,e.bounds.top+.5549*d),new Ki(e.bounds.left+.27347*d,e.bounds.top+.44071*d),new Ki(e.bounds.left+.39694*d,e.bounds.top+.5649*d),new Ki(e.bounds.left+.72983*d,e.bounds.top+.23*d),new Ki(e.bounds.left+.84*d,e.bounds.top+.34085*d),new Ki(e.bounds.left+.39363*d,e.bounds.top+.79*d)]),this.ctx.fillStyle=pe(fo),this.ctx.fill(),this.ctx.restore()):e.type===Bo&&e.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(e.bounds.left+d/2,e.bounds.top+d/2,d/4,0,2*Math.PI,!0),this.ctx.fillStyle=pe(fo),this.ctx.fill(),this.ctx.restore())),gr(e)&&e.value.length){switch(u=this.createFontStyle(i),w=u[0],g=u[1],p=this.fontMetrics.getMetrics(w,g).baseline,this.ctx.font=w,this.ctx.fillStyle=pe(i.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=hr(e.styles.textAlign),C=tr(e),h=0,e.styles.textAlign){case 1:h+=C.width/2;break;case 2:h+=C.width}B=C.add(h,0,0,-C.height/2+1),this.ctx.save(),this.path([new Ki(C.left,C.top),new Ki(C.left+C.width,C.top),new Ki(C.left+C.width,C.top+C.height),new Ki(C.left,C.top+C.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Yn(e.value,B),i.letterSpacing,p),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!ln(e.styles.display,2048))return[3,20];if(null===e.styles.listStyleImage)return[3,19];if(0!==(m=e.styles.listStyleImage).type)return[3,18];f=void 0,v=m.url,o.label=15;case 15:return o.trys.push([15,17,,18]),[4,this.context.cache.match(v)];case 16:return f=o.sent(),this.ctx.drawImage(f,e.bounds.left-(f.width+10),e.bounds.top),[3,18];case 17:return o.sent(),this.context.logger.error("Error loading list-style-image "+v),[3,18];case 18:return[3,20];case 19:A.listValue&&-1!==e.styles.listStyleType&&(w=this.createFontStyle(i)[0],this.ctx.font=w,this.ctx.fillStyle=pe(i.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",C=new r(e.bounds.left,e.bounds.top+ie(e.styles.paddingTop,e.bounds.width),e.bounds.width,Ft(i.lineHeight,i.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Yn(A.listValue,C),i.letterSpacing,Ft(i.lineHeight,i.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),o.label=20;case 20:return[2]}})})},t.prototype.renderStackContent=function(A){return n(this,void 0,void 0,function(){var e,t,n,i,r,s,a,c,l,d,u,g,p,h,B;return o(this,function(o){switch(o.label){case 0:return ln(A.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(A.element)];case 1:o.sent(),e=0,t=A.negativeZIndex,o.label=2;case 2:return e<t.length?(B=t[e],[4,this.renderStack(B)]):[3,5];case 3:o.sent(),o.label=4;case 4:return e++,[3,2];case 5:return[4,this.renderNodeContent(A.element)];case 6:o.sent(),n=0,i=A.nonInlineLevel,o.label=7;case 7:return n<i.length?(B=i[n],[4,this.renderNode(B)]):[3,10];case 8:o.sent(),o.label=9;case 9:return n++,[3,7];case 10:r=0,s=A.nonPositionedFloats,o.label=11;case 11:return r<s.length?(B=s[r],[4,this.renderStack(B)]):[3,14];case 12:o.sent(),o.label=13;case 13:return r++,[3,11];case 14:a=0,c=A.nonPositionedInlineLevel,o.label=15;case 15:return a<c.length?(B=c[a],[4,this.renderStack(B)]):[3,18];case 16:o.sent(),o.label=17;case 17:return a++,[3,15];case 18:l=0,d=A.inlineLevel,o.label=19;case 19:return l<d.length?(B=d[l],[4,this.renderNode(B)]):[3,22];case 20:o.sent(),o.label=21;case 21:return l++,[3,19];case 22:u=0,g=A.zeroOrAutoZIndexOrTransformedOrOpacity,o.label=23;case 23:return u<g.length?(B=g[u],[4,this.renderStack(B)]):[3,26];case 24:o.sent(),o.label=25;case 25:return u++,[3,23];case 26:p=0,h=A.positiveZIndex,o.label=27;case 27:return p<h.length?(B=h[p],[4,this.renderStack(B)]):[3,30];case 28:o.sent(),o.label=29;case 29:return p++,[3,27];case 30:return[2]}})})},t.prototype.mask=function(A){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(A.slice(0).reverse()),this.ctx.closePath()},t.prototype.path=function(A){this.ctx.beginPath(),this.formatPath(A),this.ctx.closePath()},t.prototype.formatPath=function(A){var e=this;A.forEach(function(A,t){var n=Ri(A)?A.start:A;0===t?e.ctx.moveTo(n.x,n.y):e.ctx.lineTo(n.x,n.y),Ri(A)&&e.ctx.bezierCurveTo(A.startControl.x,A.startControl.y,A.endControl.x,A.endControl.y,A.end.x,A.end.y)})},t.prototype.renderRepeat=function(A,e,t,n){this.path(A),this.ctx.fillStyle=e,this.ctx.translate(t,n),this.ctx.fill(),this.ctx.translate(-t,-n)},t.prototype.resizeImage=function(A,e,t){var n;if(A.width===e&&A.height===t)return A;var o=(null!==(n=this.canvas.ownerDocument)&&void 0!==n?n:document).createElement("canvas");return o.width=Math.max(1,e),o.height=Math.max(1,t),o.getContext("2d").drawImage(A,0,0,A.width,A.height,0,0,e,t),o},t.prototype.renderBackgroundImage=function(A){return n(this,void 0,void 0,function(){var e,t,n,i,r,s;return o(this,function(a){switch(a.label){case 0:e=A.styles.backgroundImage.length-1,t=function(t){var i,r,s,a,c,l,d,u,g,p,h,B,m,f,v,w,C,y,b,x,Q,F,U,S,I,E,k,H,T,D,K;return o(this,function(o){switch(o.label){case 0:if(0!==t.type)return[3,5];i=void 0,r=t.url,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n.context.cache.match(r)];case 2:return i=o.sent(),[3,4];case 3:return o.sent(),n.context.logger.error("Error loading background-image "+r),[3,4];case 4:return i&&(s=nr(A,e,[i.width,i.height,i.width/i.height]),w=s[0],F=s[1],U=s[2],b=s[3],x=s[4],f=n.ctx.createPattern(n.resizeImage(i,b,x),"repeat"),n.renderRepeat(w,f,F,U)),[3,6];case 5:1===t.type?(a=nr(A,e,[null,null,null]),w=a[0],F=a[1],U=a[2],b=a[3],x=a[4],c=Ue(t.angle,b,x),l=c[0],d=c[1],u=c[2],g=c[3],p=c[4],(h=document.createElement("canvas")).width=b,h.height=x,B=h.getContext("2d"),m=B.createLinearGradient(d,g,u,p),Fe(t.stops,l).forEach(function(A){return m.addColorStop(A.stop,pe(A.color))}),B.fillStyle=m,B.fillRect(0,0,b,x),b>0&&x>0&&(f=n.ctx.createPattern(h,"repeat"),n.renderRepeat(w,f,F,U))):function(A){return 2===A.type}(t)&&(v=nr(A,e,[null,null,null]),w=v[0],C=v[1],y=v[2],b=v[3],x=v[4],Q=0===t.position.length?[te]:t.position,F=ie(Q[0],b),U=ie(Q[Q.length-1],x),S=function(A,e,t,n,o){var i=0,r=0;switch(A.size){case 0:0===A.shape?i=r=Math.min(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-o)):1===A.shape&&(i=Math.min(Math.abs(e),Math.abs(e-n)),r=Math.min(Math.abs(t),Math.abs(t-o)));break;case 2:if(0===A.shape)i=r=Math.min(Se(e,t),Se(e,t-o),Se(e-n,t),Se(e-n,t-o));else if(1===A.shape){var s=Math.min(Math.abs(t),Math.abs(t-o))/Math.min(Math.abs(e),Math.abs(e-n)),a=Ie(n,o,e,t,!0),c=a[0],l=a[1];r=s*(i=Se(c-e,(l-t)/s))}break;case 1:0===A.shape?i=r=Math.max(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-o)):1===A.shape&&(i=Math.max(Math.abs(e),Math.abs(e-n)),r=Math.max(Math.abs(t),Math.abs(t-o)));break;case 3:if(0===A.shape)i=r=Math.max(Se(e,t),Se(e,t-o),Se(e-n,t),Se(e-n,t-o));else if(1===A.shape){s=Math.max(Math.abs(t),Math.abs(t-o))/Math.max(Math.abs(e),Math.abs(e-n));var d=Ie(n,o,e,t,!1);c=d[0],l=d[1],r=s*(i=Se(c-e,(l-t)/s))}}return Array.isArray(A.size)&&(i=ie(A.size[0],n),r=2===A.size.length?ie(A.size[1],o):i),[i,r]}(t,F,U,b,x),I=S[0],E=S[1],I>0&&E>0&&(k=n.ctx.createRadialGradient(C+F,y+U,0,C+F,y+U,I),Fe(t.stops,2*I).forEach(function(A){return k.addColorStop(A.stop,pe(A.color))}),n.path(w),n.ctx.fillStyle=k,I!==E?(H=A.bounds.left+.5*A.bounds.width,T=A.bounds.top+.5*A.bounds.height,K=1/(D=E/I),n.ctx.save(),n.ctx.translate(H,T),n.ctx.transform(1,0,0,D,0,0),n.ctx.translate(-H,-T),n.ctx.fillRect(C,K*(y-T)+T,b,x*K),n.ctx.restore()):n.ctx.fill())),o.label=6;case 6:return e--,[2]}})},n=this,i=0,r=A.styles.backgroundImage.slice(0).reverse(),a.label=1;case 1:return i<r.length?(s=r[i],[5,t(s)]):[3,4];case 2:a.sent(),a.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},t.prototype.renderSolidBorder=function(A,e,t){return n(this,void 0,void 0,function(){return o(this,function(n){return this.path(Zi(t,e)),this.ctx.fillStyle=pe(A),this.ctx.fill(),[2]})})},t.prototype.renderDoubleBorder=function(A,e,t,i){return n(this,void 0,void 0,function(){var n,r;return o(this,function(o){switch(o.label){case 0:return e<3?[4,this.renderSolidBorder(A,t,i)]:[3,2];case 1:return o.sent(),[2];case 2:return n=function(A,e){switch(e){case 0:return Ar(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return Ar(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return Ar(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return Ar(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}}(i,t),this.path(n),this.ctx.fillStyle=pe(A),this.ctx.fill(),r=function(A,e){switch(e){case 0:return Ar(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return Ar(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return Ar(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return Ar(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}}(i,t),this.path(r),this.ctx.fill(),[2]}})})},t.prototype.renderNodeBackgroundAndBorders=function(A){return n(this,void 0,void 0,function(){var e,t,n,i,r,s,a,c,l=this;return o(this,function(o){switch(o.label){case 0:return this.applyEffects(A.getEffects(2)),e=A.container.styles,t=!ge(e.backgroundColor)||e.backgroundImage.length,n=[{style:e.borderTopStyle,color:e.borderTopColor,width:e.borderTopWidth},{style:e.borderRightStyle,color:e.borderRightColor,width:e.borderRightWidth},{style:e.borderBottomStyle,color:e.borderBottomColor,width:e.borderBottomWidth},{style:e.borderLeftStyle,color:e.borderLeftColor,width:e.borderLeftWidth}],i=pr(sr(e.backgroundClip,0),A.curves),t||e.boxShadow.length?(this.ctx.save(),this.path(i),this.ctx.clip(),ge(e.backgroundColor)||(this.ctx.fillStyle=pe(e.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(A.container)]):[3,2];case 1:o.sent(),this.ctx.restore(),e.boxShadow.slice(0).reverse().forEach(function(e){l.ctx.save();var t,n,o,i,r,s=Vi(A.curves),a=e.inset?0:1e4,c=(t=s,n=-a+(e.inset?1:-1)*e.spread.number,o=(e.inset?1:-1)*e.spread.number,i=e.spread.number*(e.inset?-2:2),r=e.spread.number*(e.inset?-2:2),t.map(function(A,e){switch(e){case 0:return A.add(n,o);case 1:return A.add(n+i,o);case 2:return A.add(n+i,o+r);case 3:return A.add(n,o+r)}return A}));e.inset?(l.path(s),l.ctx.clip(),l.mask(c)):(l.mask(s),l.ctx.clip(),l.path(c)),l.ctx.shadowOffsetX=e.offsetX.number+a,l.ctx.shadowOffsetY=e.offsetY.number,l.ctx.shadowColor=pe(e.color),l.ctx.shadowBlur=e.blur.number,l.ctx.fillStyle=e.inset?pe(e.color):"rgba(0,0,0,1)",l.ctx.fill(),l.ctx.restore()}),o.label=2;case 2:r=0,s=0,a=n,o.label=3;case 3:return s<a.length?0!==(c=a[s]).style&&!ge(c.color)&&c.width>0?2!==c.style?[3,5]:[4,this.renderDashedDottedBorder(c.color,c.width,r,A.curves,2)]:[3,11]:[3,13];case 4:return o.sent(),[3,11];case 5:return 3!==c.style?[3,7]:[4,this.renderDashedDottedBorder(c.color,c.width,r,A.curves,3)];case 6:return o.sent(),[3,11];case 7:return 4!==c.style?[3,9]:[4,this.renderDoubleBorder(c.color,c.width,r,A.curves)];case 8:return o.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,r,A.curves)];case 10:o.sent(),o.label=11;case 11:r++,o.label=12;case 12:return s++,[3,3];case 13:return[2]}})})},t.prototype.renderDashedDottedBorder=function(A,e,t,i,r){return n(this,void 0,void 0,function(){var n,s,a,c,l,d,u,g,p,h,B,m,f,v,w,C;return o(this,function(o){return this.ctx.save(),n=function(A,e){switch(e){case 0:return $i(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return $i(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return $i(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return $i(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}}(i,t),s=Zi(i,t),2===r&&(this.path(s),this.ctx.clip()),Ri(s[0])?(a=s[0].start.x,c=s[0].start.y):(a=s[0].x,c=s[0].y),Ri(s[1])?(l=s[1].end.x,d=s[1].end.y):(l=s[1].x,d=s[1].y),u=0===t||2===t?Math.abs(a-l):Math.abs(c-d),this.ctx.beginPath(),3===r?this.formatPath(n):this.formatPath(s.slice(0,2)),g=e<3?3*e:2*e,p=e<3?2*e:e,3===r&&(g=e,p=e),h=!0,u<=2*g?h=!1:u<=2*g+p?(g*=B=u/(2*g+p),p*=B):(m=Math.floor((u+p)/(g+p)),f=(u-m*g)/(m-1),p=(v=(u-(m+1)*g)/m)<=0||Math.abs(p-f)<Math.abs(p-v)?f:v),h&&(3===r?this.ctx.setLineDash([0,g+p]):this.ctx.setLineDash([g,p])),3===r?(this.ctx.lineCap="round",this.ctx.lineWidth=e):this.ctx.lineWidth=2*e+1.1,this.ctx.strokeStyle=pe(A),this.ctx.stroke(),this.ctx.setLineDash([]),2===r&&(Ri(s[0])&&(w=s[3],C=s[0],this.ctx.beginPath(),this.formatPath([new Ki(w.end.x,w.end.y),new Ki(C.start.x,C.start.y)]),this.ctx.stroke()),Ri(s[1])&&(w=s[1],C=s[2],this.ctx.beginPath(),this.formatPath([new Ki(w.end.x,w.end.y),new Ki(C.start.x,C.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},t.prototype.render=function(A){return n(this,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=pe(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),n=new Ji(A,null),o=new Xi(n),Yi(n,o,o,i=[]),qi(n.container,i),e=o,[4,this.renderStack(e)];case 1:return t.sent(),this.applyEffects([]),[2,this.canvas]}var n,o,i})})},t}(dr),gr=function(A){return A instanceof Co||A instanceof wo||A instanceof vo&&A.type!==Bo&&A.type!==ho},pr=function(A,e){switch(A){case 0:return Vi(e);case 2:return function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]}(e);default:return _i(e)}},hr=function(A){switch(A){case 1:return"center";case 2:return"right";default:return"left"}},Br=["-apple-system","system-ui"],mr=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter(function(A){return-1===Br.indexOf(A)}):A},fr=function(A){function t(e,t){var n=A.call(this,e,t)||this;return n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=t,n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width=t.width+"px",n.canvas.style.height=t.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+t.width+"x"+t.height+" at "+t.x+","+t.y+") with scale "+t.scale),n}return e(t,A),t.prototype.render=function(A){return n(this,void 0,void 0,function(){var e,t;return o(this,function(n){switch(n.label){case 0:return e=zn(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,A),[4,vr(e)];case 1:return t=n.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=pe(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(t,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},t}(dr),vr=function(A){return new Promise(function(e,t){var n=new Image;n.onload=function(){e(n)},n.onerror=t,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(A))})},wr=function(){function A(A){var e=A.id,t=A.enabled;this.id=e,this.enabled=t,this.start=Date.now()}return A.prototype.debug=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,i([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},A.prototype.getTime=function(){return Date.now()-this.start},A.prototype.info=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,i([this.id,this.getTime()+"ms"],A))},A.prototype.warn=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.warn?console.warn.apply(console,i([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},A.prototype.error=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,i([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},A.instances={},A}(),Cr=function(){function A(e,t){var n;this.windowBounds=t,this.instanceName="#"+A.instanceCount++,this.logger=new wr({id:this.instanceName,enabled:e.logging}),this.cache=null!==(n=e.cache)&&void 0!==n?n:new Fi(this,e)}return A.instanceCount=1,A}();"undefined"!=typeof window&&Qi.setContext(window);var yr=function(A,e){return n(void 0,void 0,void 0,function(){var n,i,a,c,l,d,u,g,p,h,B,m,f,v,w,C,y,b,x,Q,F,U,S,I,E,k,H,T,D,K,L,M,R,P,O,V,_,N;return o(this,function(o){switch(o.label){case 0:if(!A||"object"!=typeof A)return[2,Promise.reject("Invalid element provided as first argument")];if(!(n=A.ownerDocument))throw new Error("Element is not attached to a Document");if(!(i=n.defaultView))throw new Error("Document is not attached to a Window");return a={allowTaint:null!==(U=e.allowTaint)&&void 0!==U&&U,imageTimeout:null!==(S=e.imageTimeout)&&void 0!==S?S:15e3,proxy:e.proxy,useCORS:null!==(I=e.useCORS)&&void 0!==I&&I},c=t({logging:null===(E=e.logging)||void 0===E||E,cache:e.cache},a),l={windowWidth:null!==(k=e.windowWidth)&&void 0!==k?k:i.innerWidth,windowHeight:null!==(H=e.windowHeight)&&void 0!==H?H:i.innerHeight,scrollX:null!==(T=e.scrollX)&&void 0!==T?T:i.pageXOffset,scrollY:null!==(D=e.scrollY)&&void 0!==D?D:i.pageYOffset},d=new r(l.scrollX,l.scrollY,l.windowWidth,l.windowHeight),u=new Cr(c,d),g=null!==(K=e.foreignObjectRendering)&&void 0!==K&&K,p={allowTaint:null!==(L=e.allowTaint)&&void 0!==L&&L,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:g,copyStyles:g},u.logger.debug("Starting document clone with size "+d.width+"x"+d.height+" scrolled to "+-d.left+","+-d.top),h=new ci(u,A,p),(B=h.clonedReferenceElement)?[4,h.toIFrame(n,d)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return m=o.sent(),f=Mo(B)||"HTML"===B.tagName?function(A){var e=A.body,t=A.documentElement;if(!e||!t)throw new Error("Unable to get document size");var n=Math.max(Math.max(e.scrollWidth,t.scrollWidth),Math.max(e.offsetWidth,t.offsetWidth),Math.max(e.clientWidth,t.clientWidth)),o=Math.max(Math.max(e.scrollHeight,t.scrollHeight),Math.max(e.offsetHeight,t.offsetHeight),Math.max(e.clientHeight,t.clientHeight));return new r(0,0,n,o)}(B.ownerDocument):s(u,B),v=f.width,w=f.height,C=f.left,y=f.top,b=br(u,B,e.backgroundColor),x={canvas:e.canvas,backgroundColor:b,scale:null!==(R=null!==(M=e.scale)&&void 0!==M?M:i.devicePixelRatio)&&void 0!==R?R:1,x:(null!==(P=e.x)&&void 0!==P?P:0)+C,y:(null!==(O=e.y)&&void 0!==O?O:0)+y,width:null!==(V=e.width)&&void 0!==V?V:Math.ceil(v),height:null!==(_=e.height)&&void 0!==_?_:Math.ceil(w)},g?(u.logger.debug("Document cloned, using foreign object rendering"),[4,new fr(u,x).render(B)]):[3,3];case 2:return Q=o.sent(),[3,5];case 3:return u.logger.debug("Document cloned, element located at "+C+","+y+" with size "+v+"x"+w+" using computed rendering"),u.logger.debug("Starting DOM parsing"),F=Fo(u,B),b===F.styles.backgroundColor&&(F.styles.backgroundColor=ye.TRANSPARENT),u.logger.debug("Starting renderer for element at "+x.x+","+x.y+" with size "+x.width+"x"+x.height),[4,new ur(u,x).render(F)];case 4:Q=o.sent(),o.label=5;case 5:return(null===(N=e.removeContainer)||void 0===N||N)&&(ci.destroy(m)||u.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),u.logger.debug("Finished rendering"),[2,Q]}})})},br=function(A,e,t){var n=e.ownerDocument,o=n.documentElement?Ce(A,getComputedStyle(n.documentElement).backgroundColor):ye.TRANSPARENT,i=n.body?Ce(A,getComputedStyle(n.body).backgroundColor):ye.TRANSPARENT,r="string"==typeof t?Ce(A,t):null===t?ye.TRANSPARENT:4294967295;return e===n.documentElement?ge(o)?ge(i)?r:i:o:r};return function(A,e){return void 0===e&&(e={}),yr(A,e)}}()},698:(A,e)=>{var t=Symbol.for("react.transitional.element");function n(A,e,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==e.key&&(o=""+e.key),"key"in e)for(var i in n={},e)"key"!==i&&(n[i]=e[i]);else n=e;return e=n.ref,{$$typeof:t,type:A,key:o,ref:void 0!==e?e:null,props:n}}Symbol.for("react.fragment"),e.jsx=n,e.jsxs=n},848:(A,e,t)=>{A.exports=t(698)}},o={};function i(A){var e=o[A];if(void 0!==e)return e.exports;var t=o[A]={exports:{}};return n[A].call(t.exports,t,t.exports,i),t.exports}i.n=A=>{var e=A&&A.__esModule?()=>A.default:()=>A;return i.d(e,{a:e}),e},i.d=(A,e)=>{for(var t in e)i.o(e,t)&&!i.o(A,t)&&Object.defineProperty(A,t,{enumerable:!0,get:e[t]})},i.o=(A,e)=>Object.prototype.hasOwnProperty.call(A,e),i.r=A=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})};var r={};i.r(r),i.d(r,{checkPermissionState:()=>ee,getDeviceInfo:()=>Ae,getPermissionInstructions:()=>ne,openSettings:()=>oe});var s={};i.r(s),i.d(s,{showBlockedModal:()=>se,showNoMicrophoneModal:()=>ae,showPrePromptModal:()=>re});const a=class{constructor(){this.events={}}on(A,e){return this.events[A]||(this.events[A]=[]),this.events[A].push(e),this}off(A,e){return this.events[A]?(this.events[A]=this.events[A].filter(A=>A!==e),this):this}emit(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return!!this.events[A]&&(this.events[A].forEach(A=>{A(...t)}),!0)}once(A,e){var t=this,n=function(){e(...arguments),t.off(A,n)};return this.on(A,n)}removeAllListeners(A){return A?delete this.events[A]:this.events={},this}},c=class{constructor(){this.name="PCM"}decode(A){if(A instanceof ArrayBuffer)return A;if(A instanceof Uint8Array)return A.buffer;throw new Error("Invalid PCM data type")}encode(A){return A}},l=class{constructor(){this.name="PCMU"}decode(A){for(var e=A instanceof Uint8Array?A:new Uint8Array(A),t=new Int16Array(e.length),n=0;n<e.length;n++)t[n]=this.mulawToLinear(e[n]);return t.buffer}encode(A){for(var e=A instanceof Int16Array?A:new Int16Array(A),t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=this.linearToMulaw(e[n]);return t}mulawToLinear(A){var e=1<<3+(A>>4&7);return(128&A?-1:1)*(132+(15&A)*e+(e>>1)-4)}linearToMulaw(A){var e=A>>8&128;e&&(A=-A),A>32635&&(A=32635),A+=132;for(var t=7,n=16384;0===(A&n)&&t>0;t--,n>>=1);return 255&~(e|t<<4|A>>t+3&15)}},d=class{constructor(){this.name="PCMA"}decode(A){for(var e=A instanceof Uint8Array?A:new Uint8Array(A),t=new Int16Array(e.length),n=0;n<e.length;n++)t[n]=this.alawToLinear(e[n]);return t.buffer}encode(A){for(var e=A instanceof Int16Array?A:new Int16Array(A),t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=this.linearToAlaw(e[n]);return t}alawToLinear(A){var e=(A^=85)>>4&7,t=15&A;return(128&A?-1:1)*(0===e?8+(t<<4):264+(t<<4)<<e-1)}linearToAlaw(A){var e,t,n=A>>8&128;if(n&&(A=-A),A>32635&&(A=32635),A<256)e=0,t=A>>4;else{e=7;for(var o=16384;0===(A&o)&&e>0;e--,o>>=1);t=A>>e+3&15}return 85^(n|e<<4|t)}};function u(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function g(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){u(i,n,o,r,s,"next",A)}function s(A){u(i,n,o,r,s,"throw",A)}r(void 0)})}}const p=class extends a{constructor(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),console.log("%c🔊 AUDIO PLAYER - SILENT BUFFER PRIMING FIX ENABLED","background: #10b981; color: white; font-size: 14px; font-weight: bold; padding: 4px 8px; border-radius: 4px;"),console.log("%cAndroid Greeting Cut-Off Fix: Silent buffer priming (100ms) + dynamic startup buffer","background: #d1fae5; color: #065f46; font-size: 12px; padding: 2px 6px; border-radius: 3px;"),console.log("%cBuild: 2026-01-30-SILENT-BUFFER-PRIMING | Look for [scheduleWAV] and priming logs","background: #e0e7ff; color: #1e40af; font-size: 11px; padding: 2px 6px; border-radius: 3px;"),console.log(""),this.config=A,this.audioContext=null,this.gainNode=null,this._audioContextPrimed=!1,this._waitForReadyStateHandler=null,this.audioQueue=[],this.isPlaying=!1,this.isProcessingQueue=!1,this.currentSource=null,this.outputFormat=null,this.nextStartTime=0,this.scheduledBuffers=0,this.scheduledSources=new Set,this.pcmChunkQueue=[],this.preparedBuffer=[],this.MAX_PREPARED_BUFFER_SIZE=200,this.MAX_PCM_CHUNK_QUEUE_SIZE=50,this.isProcessingPcmQueue=!1,this.isSchedulingFrames=!1,this._emptySentenceTimeout=null,this.MAX_LOOKAHEAD_SECONDS=.02,this.pendingSentenceText=null,this.sentenceTimings=[],this.isCheckingTranscripts=!1,this._isStopped=!1,this._currentSentenceId=0,this.codecs={pcm:new c,pcmu:new l,pcma:new d},this.SUPPORTED_CONTAINERS=["wav","raw"],this.SUPPORTED_ENCODINGS=["pcm","pcmu","pcma"],this.SUPPORTED_SAMPLE_RATES=[8e3,16e3,22050,24e3,44100,48e3],this.SUPPORTED_BIT_DEPTHS=[8,16,24],this.SUPPORTED_CHANNELS=[1],console.log("🎵 AudioPlayer v2 initialized")}setOutputFormat(A){var e;this.validateFormat(A)||(console.warn("⚠️ AudioPlayer: Invalid format, using defaults:",A),A=this.getDefaultFormat());var t=null===(e=this.outputFormat)||void 0===e?void 0:e.sampleRate,n=A.sampleRate;this.outputFormat=A,console.log("✅ AudioPlayer v2: Format set:",A),this.audioContext&&t&&t!==n&&(console.warn("⚠️ AudioPlayer: Sample rate changed, recreating AudioContext"),console.warn(" Old: ".concat(t,"Hz → New: ").concat(n,"Hz")),this.stopImmediate(),this._cleanupAudioContext(),console.log("ℹ️ AudioContext will be recreated on next audio chunk with correct sample rate"))}validateFormat(A){var e,t;if(!A)return!1;var n=null===(e=A.container)||void 0===e?void 0:e.toLowerCase(),o=null===(t=A.encoding)||void 0===t?void 0:t.toLowerCase();return n&&o&&this.SUPPORTED_CONTAINERS.includes(n)&&this.SUPPORTED_ENCODINGS.includes(o)&&this.SUPPORTED_SAMPLE_RATES.includes(A.sampleRate)&&this.SUPPORTED_BIT_DEPTHS.includes(A.bitDepth)&&(!A.channels||this.SUPPORTED_CHANNELS.includes(A.channels))}getDefaultFormat(){return{container:"raw",encoding:"pcm",sampleRate:16e3,channels:1,bitDepth:16}}playAudio(A){if(this._isStopped)console.log("🛑 AudioPlayer: Ignoring audio chunk - playback was stopped (barge-in)");else try{var e=this.createAudioBlob(A);this.audioQueue.push(e),this.isPlaying||this.isProcessingQueue||this.currentSource||setTimeout(()=>this.processQueue(),50)}catch(A){console.error("❌ AudioPlayer v2: Playback error:",A),this.emit("playbackError",A)}}playChunk(A){var e=this;return g(function*(){if(e._isStopped)console.log("🛑 AudioPlayer: Ignoring PCM chunk - playback was stopped (barge-in)");else{var t,n=e.prepareChunk(A);if(n)e._emptySentenceTimeout&&(clearTimeout(e._emptySentenceTimeout),e._emptySentenceTimeout=null),e.preparedBuffer.length>=e.MAX_PREPARED_BUFFER_SIZE&&(e.preparedBuffer.shift(),console.warn("⚠️ AudioPlayer: preparedBuffer at max size (".concat(e.MAX_PREPARED_BUFFER_SIZE,"), dropped oldest frame"))),e.preparedBuffer.push(n),e.isSchedulingFrames||e._isStopped?setTimeout(()=>{e.preparedBuffer.length>0&&!e.isSchedulingFrames&&!e._isStopped&&e.schedulePreparedFrames()},5):e.schedulePreparedFrames(),e.pcmChunkQueue.length>0&&!e.isProcessingPcmQueue&&e.processPcmQueue();else console.error("❌ AudioPlayer: playChunk failed - prepareChunk returned null"),console.error(" pcmData length:",(null==A?void 0:A.byteLength)||"undefined"),console.error(" outputFormat:",e.outputFormat),console.error(" audioContext:",e.audioContext?"initialized":"not initialized"),console.error(" audioContext state:",(null===(t=e.audioContext)||void 0===t?void 0:t.state)||"N/A"),e.emit("playbackError",new Error("Failed to prepare PCM chunk for playback"))}})()}prepareChunk(A){try{var e;if(!this.outputFormat)return console.error("❌ AudioPlayer: Cannot prepare chunk - outputFormat not set"),console.error(" Call setOutputFormat() before playing audio chunks"),null;if(this.audioContext||this.initializeAudioContext(),!this.audioContext)return console.error("❌ AudioPlayer: Cannot prepare chunk - AudioContext not available"),null;var t=A;if(A.byteLength%2!=0){console.warn("⚠️ Odd PCM chunk size, padding:",A.byteLength);var n=new Uint8Array(A.byteLength+1);n.set(new Uint8Array(A),0),n[A.byteLength]=0,t=n.buffer}for(var o=new Int16Array(t),i=new Float32Array(o.length),r=1/32768,s=o.length,a=0;a<s;a++)i[a]=o[a]*r;var c=(null===(e=this.outputFormat)||void 0===e?void 0:e.sampleRate)||this.audioContext.sampleRate,l=this.audioContext.sampleRate,d=this.audioContext.createBuffer(1,i.length,c);d.getChannelData(0).set(i);var u=d.duration,g=i.length,p=u;return l!==c&&(p=g/l),{buffer:d,duration:p,sampleRate:c,contextSampleRate:l}}catch(A){return console.error("❌ AudioPlayer: Error preparing chunk:",A),null}}applyFadeOut(A){return A}schedulePreparedFrames(){var A=this;return g(function*(){if(A._isStopped)console.log("🛑 AudioPlayer: Not scheduling frames - playback was stopped (barge-in)");else if(!A.isSchedulingFrames){A.isSchedulingFrames=!0;var e=A.preparedBuffer.length,t=Math.min(e,5);0===t&&e>0&&(t=1);try{var n,o,i,r;A.audioContext||A.initializeAudioContext(),console.log("🔍 [scheduleWAV] BEFORE waitForAudioContextReady - state:",null===(n=A.audioContext)||void 0===n?void 0:n.state,"currentTime:",null===(o=A.audioContext)||void 0===o?void 0:o.currentTime),yield A.waitForAudioContextReady(),console.log("🔍 [scheduleWAV] AFTER waitForAudioContextReady - state:",null===(i=A.audioContext)||void 0===i?void 0:i.state,"currentTime:",null===(r=A.audioContext)||void 0===r?void 0:r.currentTime);for(var s=0,a=function*(){if(A._isStopped)return console.log("🛑 AudioPlayer: Stopping frame scheduling - playback was stopped"),0;var e=A.preparedBuffer.shift();if(!e)return 0;var t=A.audioContext.createBufferSource();t.buffer=e.buffer,t.connect(A.gainNode||A.audioContext.destination),A.scheduledSources.add(t);var n=A.audioContext.currentTime;if(0===A.scheduledBuffers){var o=.03;/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(A._audioContextPrimed?o=0:(o=2,console.warn("⚠️ AudioPlayer: Audio not primed yet, using 2000ms fallback buffer"))),A.nextStartTime=n+o,console.log("🎵 [scheduleWAV] FIRST FRAME - primed: ".concat(A._audioContextPrimed,", buffer: ").concat(1e3*o,"ms"))}else{var i=n+A.MAX_LOOKAHEAD_SECONDS;A.nextStartTime<i&&(A.nextStartTime=i,console.warn("⚠️ AudioPlayer: Fell behind schedule, adjusting nextStartTime to ".concat(A.nextStartTime.toFixed(4),"s")))}A.pendingSentenceText&&(A.sentenceTimings.push({startTime:A.nextStartTime,text:A.pendingSentenceText,displayed:!1}),console.log("📝 AudioPlayer: Sentence scheduled at ".concat(A.nextStartTime.toFixed(3),'s: "').concat(A.pendingSentenceText.substring(0,40),'..."')),A.pendingSentenceText=null,A.isCheckingTranscripts||A.startTranscriptChecker()),t.start(A.nextStartTime),A.nextStartTime+=e.duration,A.nextStartTime=Math.round(1e6*A.nextStartTime)/1e6;var r=A.nextStartTime-e.duration;A.scheduledBuffers<5&&(console.log("🎵 AudioPlayer: Scheduled frame ".concat(A.scheduledBuffers+1," at ").concat(r.toFixed(4),"s, next at ").concat(A.nextStartTime.toFixed(4),"s")),console.log(" Duration: ".concat(e.duration.toFixed(4),"s (").concat((1e3*e.duration).toFixed(2),"ms), Queued: ").concat(A.preparedBuffer.length,", Scheduled: ").concat(A.scheduledBuffers))),A.scheduledBuffers++,s++,t.onended=()=>{if(!A._isStopped&&A.scheduledSources.has(t))if(A.scheduledSources.delete(t),!A._isStopped&&A.scheduledBuffers>0&&A.scheduledBuffers--,0!==A.scheduledBuffers||0!==A.preparedBuffer.length||0!==A.pcmChunkQueue.length||A._isStopped){if(A.preparedBuffer.length>0&&!A._isStopped)setTimeout(()=>{A.preparedBuffer.length>0&&!A.isSchedulingFrames&&!A._isStopped&&A.schedulePreparedFrames()},0);else if(A.scheduledBuffers>0&&!A._isStopped){var e=()=>{A._isStopped||(A.preparedBuffer.length>0&&!A.isSchedulingFrames&&A.scheduledBuffers>0?A.schedulePreparedFrames():A.scheduledBuffers>0&&!A._isStopped&&setTimeout(e,10))};setTimeout(e,10)}}else A.isPlaying=!1,A.isSchedulingFrames=!1,console.log("🛑 AudioPlayer: Emitting playbackStopped event (all buffers finished)"),A.emit("playbackStopped")},A.isPlaying||(A.isPlaying=!0,console.log("🎵 AudioPlayer: Emitting playbackStarted event"),A.emit("playbackStarted"))};A.preparedBuffer.length>0&&s<t&&0!==(yield*a()););A.isSchedulingFrames=!1,A.preparedBuffer.length>0&&!A._isStopped&&requestAnimationFrame(()=>{A.preparedBuffer.length>0&&!A.isSchedulingFrames&&!A._isStopped&&A.schedulePreparedFrames()}),A.scheduledBuffers>0&&!A._isStopped&&setTimeout(()=>{A.preparedBuffer.length>0&&!A.isSchedulingFrames&&A.scheduledBuffers>0&&!A._isStopped?A.schedulePreparedFrames():A.scheduledBuffers>0&&!A._isStopped&&setTimeout(()=>{A.preparedBuffer.length>0&&!A.isSchedulingFrames&&A.scheduledBuffers>0&&!A._isStopped&&A.schedulePreparedFrames()},10)},10)}catch(e){console.error("❌ AudioPlayer v2: Error scheduling frames:",e),A.emit("playbackError",e),A.isSchedulingFrames=!1}}})()}processPcmQueue(){var A=this;return g(function*(){if(A._isStopped)console.log("🛑 AudioPlayer: Not processing PCM queue - playback was stopped (barge-in)");else if(!A.isProcessingPcmQueue){A.isProcessingPcmQueue=!0;try{for(A.audioContext||A.initializeAudioContext(),yield A.waitForAudioContextReady();A.pcmChunkQueue.length>0;){var e,t;if(A._isStopped){console.log("🛑 AudioPlayer: Stopping PCM queue processing - playback was stopped");break}var n=A.pcmChunkQueue.shift();if(n){var o=n;if(n.byteLength%2!=0){console.warn("⚠️ Odd PCM chunk size, padding:",n.byteLength);var i=new Uint8Array(n.byteLength+1);i.set(new Uint8Array(n),0),i[n.byteLength]=0,o=i.buffer}for(var r=new Int16Array(o),s=new Float32Array(r.length),a=1/32768,c=r.length,l=0;l<c;l++)s[l]=r[l]*a;var d=(null===(e=A.outputFormat)||void 0===e?void 0:e.sampleRate)||A.audioContext.sampleRate,u=A.audioContext.sampleRate;null!==(t=A.outputFormat)&&void 0!==t&&t.sampleRate?A.scheduledBuffers<3&&console.log("🎵 AudioPlayer: Creating buffer at ".concat(d,"Hz (AudioContext: ").concat(u,"Hz)")):console.warn("⚠️ AudioPlayer: outputFormat.sampleRate not set! Using AudioContext sample rate:",u);var g=A.audioContext.createBuffer(1,s.length,d);g.getChannelData(0).set(s);var p=A.audioContext.createBufferSource();p.buffer=g,p.connect(A.gainNode||A.audioContext.destination);var h=A.audioContext.currentTime;A.nextStartTime<h&&(A.nextStartTime=h,0===A.scheduledBuffers&&console.log("🎵 Starting playback at current time:",h));var B=g.duration,m=s.length,f=B;if(u!==d&&(f=m/u,A.scheduledBuffers<3&&(console.log("🔄 Resampling detected: ".concat(d,"Hz → ").concat(u,"Hz")),console.log(" Buffer duration: ".concat(B.toFixed(4),"s, Calculated: ").concat(f.toFixed(4),"s")))),p.start(A.nextStartTime),A.nextStartTime+=f,A.nextStartTime=Math.round(1e6*A.nextStartTime)/1e6,A.scheduledBuffers<3){var v=A.nextStartTime-f;console.log("🎵 AudioPlayer: Scheduled chunk ".concat(A.scheduledBuffers+1," at ").concat(v.toFixed(4),"s, next at ").concat(A.nextStartTime.toFixed(4),"s")),console.log(" Duration: ".concat(f.toFixed(4),"s (").concat((1e3*f).toFixed(2),"ms)"))}A.scheduledBuffers++,p.onended=()=>{A.scheduledBuffers--,0===A.scheduledBuffers&&0===A.pcmChunkQueue.length&&(A.isPlaying=!1,A.isProcessingPcmQueue=!1,A.emit("playbackStopped"))},A.isPlaying||(A.isPlaying=!0,A.emit("playbackStarted"))}}A.isProcessingPcmQueue=!1}catch(e){console.error("❌ AudioPlayer v2: Error playing chunk:",e),A.emit("playbackError",e),A.isProcessingPcmQueue=!1}}})()}createAudioBlob(A){var e=new Uint8Array(A);console.log("🎵 AudioPlayer: Processing ".concat(e.length," bytes")),console.log("🎵 AudioPlayer: Negotiated format:",this.outputFormat);var t=this.outputFormat&&this.outputFormat.container&&"wav"===this.outputFormat.container.toLowerCase(),n=this.outputFormat&&this.outputFormat.container&&"raw"===this.outputFormat.container.toLowerCase(),o=this.isWavFile(e);if(o&&console.log("🎵 AudioPlayer: Data has WAV header (RIFF)"),n&&o)return console.error("❌ AudioPlayer: CRITICAL MISMATCH!"),console.error(" Negotiated format: RAW"),console.error(" Actual data: WAV (RIFF header detected)"),console.error(" Backend is ignoring format request and sending WAV anyway."),console.warn("⚠️ AudioPlayer: Processing as WAV to avoid playback failure, but UI configuration was bypassed."),this.handleWavFile(e);if(n&&!o)console.log("🎵 AudioPlayer: Processing as RAW data (as negotiated)");else{if(t&&o)return console.log("✅ AudioPlayer: Processing as WAV file (matches negotiation)"),this.handleWavFile(e);if(t&&!o)return console.warn("⚠️ AudioPlayer: Negotiated WAV but data lacks WAV header. Attempting WAV processing anyway."),this.handleWavFile(e);if(!this.outputFormat&&o)return console.log("🎵 AudioPlayer: No format negotiated, auto-detecting WAV"),this.handleWavFile(e);this.outputFormat||o||(console.warn("⚠️ AudioPlayer: No format negotiated and data not WAV, using defaults"),this.outputFormat=this.getDefaultFormat())}return this.outputFormat||(console.warn("⚠️ AudioPlayer: No format set, using defaults"),this.outputFormat=this.getDefaultFormat()),console.log("🎵 AudioPlayer: Processing as RAW data with encoding:",this.outputFormat.encoding),this.handleRawData(e)}isWavFile(A){return A.length>=44&&82===A[0]&&73===A[1]&&70===A[2]&&70===A[3]}handleWavFile(A){var e=this.parseWavHeader(A);if(console.log("🎵 WAV file detected:",{format:e.audioFormat,encoding:this.getEncodingName(e.audioFormat),sampleRate:e.sampleRate,channels:e.channels,bitDepth:e.bitsPerSample}),1===e.audioFormat)return console.log("✅ PCM WAV - using directly"),new Blob([A],{type:"audio/wav"});var t=this.getCodecForWavFormat(e.audioFormat);if(!t)throw new Error("Unsupported WAV format code: ".concat(e.audioFormat));console.log("🔄 Non-PCM WAV - converting to PCM WAV");var n=A.slice(44),o=t.decode(n),i=this.createWavHeader(o.byteLength,e.sampleRate,e.channels,16);return new Blob([i,o],{type:"audio/wav"})}handleRawData(A){var e,t,n=this.outputFormat.encoding.toLowerCase(),o=this.getCodec(n);if(!o)throw new Error("No codec found for encoding: ".concat(n));if(console.log("🎵 AudioPlayer: Decoding ".concat(n.toUpperCase()," to PCM")),console.log("🎵 AudioPlayer: Input format - bitDepth: ".concat(this.outputFormat.bitDepth,", sampleRate: ").concat(this.outputFormat.sampleRate)),"pcm"===n){var i=this.outputFormat.bitDepth||16;A.length,24===i?(console.warn("⚠️ AudioPlayer: Format says 24-bit PCM, but browser support is limited."),console.warn(" Treating as 16-bit PCM. If audio sounds wrong, backend should send 16-bit instead."),e=this.convert24BitTo16Bit(A),t=16):8===i?(console.log("🔄 AudioPlayer: Converting 8-bit PCM to 16-bit PCM"),e=this.convert8BitTo16Bit(A),t=16):(e=A.buffer,t=i,console.log("✅ AudioPlayer: Using native ".concat(i,"-bit PCM (no conversion needed)")))}else e=o.decode(A),t=16,console.log("🔄 AudioPlayer: Decoded ".concat(n.toUpperCase()," to 16-bit PCM"));var r=this.createWavHeader(e.byteLength,this.outputFormat.sampleRate,this.outputFormat.channels,t);return new Blob([r,e],{type:"audio/wav"})}convert24BitTo16Bit(A){for(var e=Math.floor(A.length/3),t=new Int16Array(e),n=0;n<e;n++){var o=A[3*n],i=A[3*n+1],r=A[3*n+2],s=o|i<<8|(255&r)<<16;128&r&&(s|=4278190080),t[n]=Math.max(-32768,Math.min(32767,Math.round(s/256)))}return t.buffer}convert8BitTo16Bit(A){for(var e=A.length,t=new Int16Array(e),n=0;n<e;n++){var o=A[n];t[n]=256*(o-128)}return t.buffer}getCodec(A){var e={pcm:"pcm",linear:"pcm",l16:"pcm",pcmu:"pcmu",ulaw:"pcmu",mulaw:"pcmu",g711u:"pcmu",pcma:"pcma",alaw:"pcma",g711a:"pcma"}[A.toLowerCase()];return this.codecs[e]}getCodecForWavFormat(A){switch(A){case 1:return this.codecs.pcm;case 6:return this.codecs.pcma;case 7:return this.codecs.pcmu;default:return null}}getEncodingName(A){switch(A){case 1:return"PCM";case 6:return"A-law";case 7:return"μ-law";default:return"Unknown (".concat(A,")")}}parseWavHeader(A){var e=new DataView(A.buffer,A.byteOffset,A.byteLength);return{audioFormat:e.getUint16(20,!0),channels:e.getUint16(22,!0),sampleRate:e.getUint32(24,!0),byteRate:e.getUint32(28,!0),blockAlign:e.getUint16(32,!0),bitsPerSample:e.getUint16(34,!0)}}createWavHeader(A,e,t,n){var o=new ArrayBuffer(44),i=new DataView(o);return i.setUint32(0,1380533830,!1),i.setUint32(4,36+A,!0),i.setUint32(8,1463899717,!1),i.setUint32(12,1718449184,!1),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,t,!0),i.setUint32(24,e,!0),i.setUint32(28,e*t*n/8,!0),i.setUint16(32,t*n/8,!0),i.setUint16(34,n,!0),i.setUint32(36,1684108385,!1),i.setUint32(40,A,!0),o}waitForAudioContextReady(){var A=this;return g(function*(){var e,t;if(console.log("🔍 [waitForAudioContextReady] ENTRY - audioContext exists:",!!A.audioContext),A.audioContext||(console.log("🔍 [waitForAudioContextReady] Creating AudioContext..."),A.initializeAudioContext(),console.log("🔍 [waitForAudioContextReady] After initializeAudioContext - state:",null===(e=A.audioContext)||void 0===e?void 0:e.state,"currentTime:",null===(t=A.audioContext)||void 0===t?void 0:t.currentTime)),!A.audioContext)return console.error("❌ AudioPlayer: Failed to create AudioContext"),Promise.resolve();var n=A.audioContext;if(console.log("🔍 [waitForAudioContextReady] Initial state:",n.state,"currentTime:",n.currentTime),"running"===n.state)return console.log("🔍 [waitForAudioContextReady] Already running - returning immediately, currentTime:",n.currentTime),Promise.resolve();if("suspended"===n.state){if(console.log("🔍 [waitForAudioContextReady] State is suspended - calling resume()..."),yield n.resume(),console.log("🔍 [waitForAudioContextReady] After resume() - state:",n.state,"currentTime:",n.currentTime),"running"!==n.state)return console.log("🔍 [waitForAudioContextReady] Still not running after resume() - waiting for statechange event..."),new Promise(e=>{var t=setTimeout(()=>{n&&A._waitForReadyStateHandler&&(n.removeEventListener("statechange",A._waitForReadyStateHandler),A._waitForReadyStateHandler=null),console.warn("⚠️ AudioPlayer: AudioContext did not become running within timeout - proceeding anyway, state:",null==n?void 0:n.state,"currentTime:",null==n?void 0:n.currentTime),e()},2e3),o=()=>{if(console.log("🔍 [waitForAudioContextReady] statechange event fired - state:",null==n?void 0:n.state,"currentTime:",null==n?void 0:n.currentTime),!n)return clearTimeout(t),A._waitForReadyStateHandler=null,console.warn("⚠️ AudioPlayer: AudioContext became null during state change"),void e();"running"===n.state&&(clearTimeout(t),A._waitForReadyStateHandler&&(n.removeEventListener("statechange",A._waitForReadyStateHandler),A._waitForReadyStateHandler=null),console.log("✅ [waitForAudioContextReady] AudioContext became running via statechange, currentTime:",n.currentTime),e())};A._waitForReadyStateHandler=o,n.addEventListener("statechange",o),console.log("🔍 [waitForAudioContextReady] Synchronous check - state:",null==n?void 0:n.state),n&&"running"===n.state&&(clearTimeout(t),A._waitForReadyStateHandler&&(n.removeEventListener("statechange",A._waitForReadyStateHandler),A._waitForReadyStateHandler=null),console.log("✅ [waitForAudioContextReady] State became running synchronously, currentTime:",n.currentTime),e())});console.log("🔍 [waitForAudioContextReady] State is running after resume() - returning, currentTime:",n.currentTime)}return"closed"===n.state?(console.warn("⚠️ AudioPlayer: AudioContext was closed, recreating..."),A.initializeAudioContext(),A.waitForAudioContextReady()):(console.log("🔍 [waitForAudioContextReady] EXIT - state:",n.state,"currentTime:",n.currentTime),Promise.resolve())})()}initializeAudioContext(){var A,e,t=(null===(A=this.outputFormat)||void 0===A?void 0:A.sampleRate)||44100;if(48e3!==t&&44100!==t&&(console.log("ℹ️ AudioPlayer: Backend requested ".concat(t,"Hz, but browser may resample")),console.log(" Consider requesting 44100Hz or 48000Hz from backend to avoid resampling and improve quality")),this.audioContext){var n=this.audioContext.sampleRate;if(!(Math.abs(n-t)>100))return;console.warn("⚠️ AudioPlayer: AudioContext sample rate (".concat(n,"Hz) doesn't match format (").concat(t,"Hz), recreating...")),this.stopImmediate(),this._cleanupAudioContext()}console.log("🎵 AudioPlayer: Creating AudioContext at ".concat(t,"Hz (from outputFormat: ").concat((null===(e=this.outputFormat)||void 0===e?void 0:e.sampleRate)||"not set",")"));try{this.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:t,latencyHint:"playback"}),console.log("✅ AudioContext created at ".concat(this.audioContext.sampleRate,"Hz (requested: ").concat(t,"Hz)")),Math.abs(this.audioContext.sampleRate-t)>100?(console.error("❌ CRITICAL: Browser sample rate mismatch!"),console.error(" Requested: ".concat(t,"Hz")),console.error(" Got: ".concat(this.audioContext.sampleRate,"Hz")),console.error(" This WILL cause audio distortion/noise!"),console.error(" Solution: Backend should send ".concat(this.audioContext.sampleRate,"Hz audio instead"))):this.audioContext.sampleRate!==t&&(console.warn("⚠️ Browser adjusted sample rate: ".concat(t,"Hz → ").concat(this.audioContext.sampleRate,"Hz")),console.warn(" Browser will automatically resample audio.")),this.setupAudioContextStateMonitoring(),this.gainNode=this.audioContext.createGain(),this.gainNode.gain.value=1,this.gainNode.connect(this.audioContext.destination),console.log("✅ AudioPlayer: GainNode created for volume control"),this._primeAudioContext()}catch(A){console.error("❌ Failed to create AudioContext:",A),this.audioContext=new(window.AudioContext||window.webkitAudioContext),console.log("ℹ️ Using browser default: ".concat(this.audioContext.sampleRate,"Hz")),this.setupAudioContextStateMonitoring(),this.gainNode=this.audioContext.createGain(),this.gainNode.gain.value=1,this.gainNode.connect(this.audioContext.destination),console.log("✅ AudioPlayer: GainNode created for volume control (fallback)"),this._primeAudioContext()}}_primeAudioContext(){var A=this;return g(function*(){try{if(!A.audioContext||A._audioContextPrimed)return;var e=A.audioContext.sampleRate,t=A.audioContext.createBuffer(1,.1*e,e),n=A.audioContext.createBufferSource();n.buffer=t,n.connect(A.audioContext.destination),n.start(),yield new Promise(A=>setTimeout(A,100)),A._audioContextPrimed=!0,console.log("✅ AudioPlayer: Audio hardware primed with silent buffer")}catch(A){console.error("❌ AudioPlayer: Audio priming failed:",A)}})()}_cleanupAudioContext(){if(console.log("[TTP AudioPlayer] 🧹 Cleaning up AudioContext (refactored method)"),this.gainNode){try{this.gainNode.disconnect()}catch(A){}this.gainNode=null}this._audioContextStateChangeHandler&&this.audioContext&&(this.audioContext.removeEventListener("statechange",this._audioContextStateChangeHandler),this._audioContextStateChangeHandler=null),this._waitForReadyStateHandler&&this.audioContext&&(this.audioContext.removeEventListener("statechange",this._waitForReadyStateHandler),this._waitForReadyStateHandler=null),this.audioContext&&"closed"!==this.audioContext.state&&this.audioContext.close(),this.audioContext=null,this._audioContextPrimed=!1}setupAudioContextStateMonitoring(){this.audioContext&&(this._audioContextStateChangeHandler&&this.audioContext.removeEventListener("statechange",this._audioContextStateChangeHandler),this._audioContextStateChangeHandler=()=>{this.audioContext?(console.log("🎵 AudioPlayer: AudioContext state changed to: ".concat(this.audioContext.state)),"suspended"===this.audioContext.state&&this.isPlaying?console.warn("⚠️ AudioPlayer: AudioContext suspended during playback"):"running"===this.audioContext.state&&!this.isPlaying&&(this.audioQueue.length>0||this.pcmChunkQueue.length>0||this.preparedBuffer.length>0)&&(console.log("✅ AudioPlayer: AudioContext resumed - resuming queue processing"),this.audioQueue.length>0&&!this.isProcessingQueue&&setTimeout(()=>this.processQueue(),50),this.pcmChunkQueue.length>0&&!this.isProcessingPcmQueue&&setTimeout(()=>this.processPcmQueue(),50),this.preparedBuffer.length>0&&!this.isSchedulingFrames&&setTimeout(()=>this.scheduleFrames(),50))):console.warn("⚠️ AudioPlayer: State change handler fired but AudioContext is null")},this.audioContext.addEventListener("statechange",this._audioContextStateChangeHandler))}processQueue(){var A=this;return g(function*(){if(A._isStopped)console.log("🛑 AudioPlayer: Not processing queue - playback was stopped (barge-in)");else if(!A.isProcessingQueue&&0!==A.audioQueue.length){A.isProcessingQueue=!0;var e=A.audioQueue.shift();if(e)try{var t=!A.isPlaying&&null===A.currentSource;A.audioContext||A.initializeAudioContext(),yield A.waitForAudioContextReady();var n=A.audioContext,o=yield e.arrayBuffer(),i=yield n.decodeAudioData(o),r=t&&!A.isPlaying&&null===A.currentSource,s=n.createBufferSource();s.buffer=i,s.connect(A.gainNode||n.destination),A.currentSource=s,A.isPlaying=!0,r&&A.emit("playbackStarted"),s.onended=()=>{A.currentSource=null,A.isProcessingQueue=!1,A.audioQueue.length>0?setTimeout(()=>A.processQueue(),50):setTimeout(()=>{0!==A.audioQueue.length||A.currentSource||(A.isPlaying=!1,A.emit("playbackStopped"))},100)},s.start()}catch(e){console.error("❌ AudioPlayer v2: Error processing queue:",e),A.currentSource=null,A.emit("playbackError",e),A.audioQueue.length>0?(A.isProcessingQueue=!1,setTimeout(()=>A.processQueue(),100)):(A.isPlaying=!1,A.isProcessingQueue=!1,A.emit("playbackStopped"))}else A.isProcessingQueue=!1}})()}stop(){this.stopImmediate()}reset(){this.stop(),this.audioQueue=[],this.pcmChunkQueue=[]}stopImmediate(){var A=this.isPlaying||null!==this.currentSource||this.scheduledSources.size>0;if(console.log("🛑 AudioPlayer.stopImmediate() called"),console.log(" isPlaying:",this.isPlaying),console.log(" currentSource:",null!==this.currentSource),console.log(" scheduledSources.size:",this.scheduledSources.size),console.log(" scheduledBuffers:",this.scheduledBuffers),this._isStopped=!0,this.isSchedulingFrames=!1,this.currentSource){try{console.log(" Stopping currentSource..."),this.currentSource.stop()}catch(A){console.log(" currentSource already stopped or error:",A.message)}this.currentSource=null}if(this.scheduledSources.size>0){console.log(" Stopping ".concat(this.scheduledSources.size," scheduled sources..."));var e=0,t=Array.from(this.scheduledSources),n=t.length;for(var o of(this.scheduledSources.clear(),this.scheduledBuffers=0,t))try{o.stop(),e++}catch(A){console.log(" Source already stopped or not started:",A.message)}console.log(" Stopped ".concat(e," sources (cleared ").concat(n," from scheduledSources)"))}this.isPlaying=!1,this.isProcessingQueue=!1,this.audioQueue=[],this.pcmChunkQueue=[],this.preparedBuffer=[],this.isProcessingPcmQueue=!1,this.isSchedulingFrames=!1,this._emptySentenceTimeout&&(clearTimeout(this._emptySentenceTimeout),this._emptySentenceTimeout=null),this.nextStartTime=0,this.clearTranscriptState(),A&&(console.log("🛑 AudioPlayer: Emitting playbackStopped event (stopImmediate called)"),this.emit("playbackStopped"))}markNewSentence(A){var e=this._isStopped,t=this.isPlaying||this.scheduledSources.size>0;this._isStopped?(console.log("🛑 AudioPlayer: Clearing stopped flag - new audio starting after barge-in"),this._isStopped=!1,this.nextStartTime=0,this.scheduledBuffers<0&&console.log("🔄 AudioPlayer: scheduledBuffers was negative (".concat(this.scheduledBuffers,"), resetting to 0")),this.scheduledBuffers=0,this.preparedBuffer.length>0&&console.log("🔄 AudioPlayer: Clearing ".concat(this.preparedBuffer.length," prepared frames from previous sentence (after barge-in)")),this.preparedBuffer=[],this.pcmChunkQueue.length>0&&console.log("🔄 AudioPlayer: Clearing ".concat(this.pcmChunkQueue.length," raw PCM chunks from previous sentence (after barge-in)")),this.pcmChunkQueue=[],this.isProcessingPcmQueue=!1,console.log("🔄 AudioPlayer: Reset scheduling state for new sentence (after barge-in)")):t&&console.log("📝 AudioPlayer: New sentence queued while audio playing - will start after current sentence finishes"),this.pendingSentenceText=A,console.log('📝 AudioPlayer: New sentence marked: "'.concat(A.substring(0,40),'..." (wasStopped: ').concat(e,", isPlaying: ").concat(t,")")),this._emptySentenceTimeout&&clearTimeout(this._emptySentenceTimeout);var n=A;this._emptySentenceTimeout=setTimeout(()=>{this.pendingSentenceText!==n||0!==this.scheduledBuffers||0!==this.preparedBuffer.length||0!==this.pcmChunkQueue.length||this._isStopped||(console.warn('⚠️ AudioPlayer: Empty sentence detected after 5s timeout - no chunks received for: "'.concat(n.substring(0,40),'..."')),this.pendingSentenceText===n&&(this.pendingSentenceText=null),this.isPlaying||0!==this.scheduledSources.size||(console.log("🛑 AudioPlayer: Emitting playbackStopped for empty sentence timeout"),this.emit("playbackStopped"))),this._emptySentenceTimeout=null},5e3)}startTranscriptChecker(){if(!this.isCheckingTranscripts){this.isCheckingTranscripts=!0,console.log("📝 AudioPlayer: Transcript checker started");var A=()=>{if(this.isCheckingTranscripts&&this.audioContext){var e=this.audioContext.currentTime;for(var t of this.sentenceTimings)!t.displayed&&e>=t.startTime&&(t.displayed=!0,console.log("📝 AudioPlayer: Display transcript at ".concat(e.toFixed(3),'s: "').concat(t.text.substring(0,40),'..."')),this.emit("transcriptDisplay",{text:t.text}));this.isPlaying||this.scheduledBuffers>0?requestAnimationFrame(A):(this.isCheckingTranscripts=!1,console.log("📝 AudioPlayer: Transcript checker stopped"))}};requestAnimationFrame(A)}}clearTranscriptState(){this.pendingSentenceText=null,this.sentenceTimings=[],this.isCheckingTranscripts=!1,console.log("📝 AudioPlayer: Transcript state cleared")}resumeAudioContext(){var A=this;return g(function*(){if(A.audioContext&&"closed"!==A.audioContext.state){if("suspended"===A.audioContext.state)try{yield A.audioContext.resume(),console.log("✅ AudioPlayer v2: AudioContext resumed after mic permission")}catch(A){console.warn("⚠️ AudioPlayer v2: Failed to resume AudioContext:",A)}}else yield A.initializeAudioContext()})()}setVolume(A){this.gainNode?(this.gainNode.gain.value=Math.max(0,Math.min(1,A)),console.log("🔊 AudioPlayer: Volume set to ".concat(this.gainNode.gain.value))):console.warn("⚠️ AudioPlayer: Cannot set volume - gainNode not initialized")}setMuted(A){this.setVolume(A?0:1)}getStatus(){return{isPlaying:this.isPlaying,isProcessingQueue:this.isProcessingQueue,queueLength:this.audioQueue.length,audioContextState:this.audioContext?this.audioContext.state:"closed",outputFormat:this.outputFormat,scheduledBuffers:this.scheduledBuffers,preparedBufferLength:this.preparedBuffer.length,scheduledSourcesCount:this.scheduledSources.size}}destroy(){this.stop(),this._cleanupAudioContext(),this.removeAllListeners()}};class h{constructor(){this.events={}}on(A,e){this.events[A]||(this.events[A]=[]),this.events[A].push(e)}off(A,e){this.events[A]&&(this.events[A]=this.events[A].filter(A=>A!==e))}emit(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];this.events[A]&&this.events[A].forEach(e=>{try{e(...t)}catch(e){console.error("Error in event listener for ".concat(A,":"),e)}})}removeAllListeners(A){A?delete this.events[A]:this.events={}}}function B(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function m(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?B(Object(t),!0).forEach(function(e){f(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):B(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function f(A,e,t){return(e=function(A){var e=function(A){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==typeof e?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function v(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function w(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){v(i,n,o,r,s,"next",A)}function s(A){v(i,n,o,r,s,"throw",A)}r(void 0)})}}class C extends h{constructor(A){super(),this.config=A,this.audioContext=null,this.audioWorkletNode=null,this.mediaStream=null,this.isRecording=!1}getAudioProcessorPath(){if(this.config.audioProcessorPath)return this.config.audioProcessorPath;var A=document.getElementsByTagName("script");for(var e of A){var t=e.src;if(t&&(t.includes("agent-widget.js")||t.includes("ttp-agent-sdk")))try{new URL(t);var n=t.substring(0,t.lastIndexOf("/"));return"".concat(n,"/audio-processor.js")}catch(A){var o=t.substring(0,t.lastIndexOf("/"));return"".concat(o,"/audio-processor.js")}}return"https://cdn.talktopc.com/audio-processor.js"}checkPermissionState(){return w(function*(){try{if(navigator.permissions&&navigator.permissions.query)return(yield navigator.permissions.query({name:"microphone"})).state}catch(A){console.log("⚠️ AudioRecorder: Permissions API not available or not supported for microphone")}return null})()}requestPermission(){var A=this;return w(function*(){try{if("granted"===(yield A.checkPermissionState()))return console.log("✅ AudioRecorder: Microphone permission already granted"),!0;console.log("🎤 AudioRecorder: Requesting microphone permission...");var e=A.config.sampleRate||A.config.outputSampleRate||44100,t={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},n=A.config.audioConstraints?m(m({},t),A.config.audioConstraints):t;return(yield navigator.mediaDevices.getUserMedia({audio:m({sampleRate:e,channelCount:1},n)})).getTracks().forEach(A=>A.stop()),console.log("✅ AudioRecorder: Microphone permission granted"),!0}catch(A){return console.error("❌ AudioRecorder: Failed to get microphone permission:",A),!1}})()}start(){var A=this;return w(function*(){try{console.log("🎤 AudioRecorder: Requesting microphone access...");var e=yield A.checkPermissionState();e&&(console.log("📋 AudioRecorder: Current permission state: ".concat(e)),"denied"===e&&console.warn('⚠️ AudioRecorder: Permission state is "denied" - browser may not show prompt. User may need to change in browser settings.'));var t=A.config.sampleRate||A.config.outputSampleRate||44100,n={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},o=A.config.audioConstraints?m(m({},n),A.config.audioConstraints):n;if(A.mediaStream=yield navigator.mediaDevices.getUserMedia({audio:m({sampleRate:t,channelCount:1},o)}),A.config.checkConnection&&"function"==typeof A.config.checkConnection&&!A.config.checkConnection()){A.mediaStream.getTracks().forEach(A=>A.stop()),A.mediaStream=null;var i=new Error("Connection lost - server may have rejected the call");throw i.name="ServerRejected",i.isServerRejection=!0,i}if(A.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:t}),"suspended"===A.audioContext.state&&(yield A.audioContext.resume()),A.config.checkConnection&&"function"==typeof A.config.checkConnection&&!A.config.checkConnection()){A.mediaStream.getTracks().forEach(A=>A.stop()),A.mediaStream=null,A.audioContext&&"closed"!==A.audioContext.state&&(yield A.audioContext.close()),A.audioContext=null;var r=new Error("Connection lost - server may have rejected the call");throw r.name="ServerRejected",r.isServerRejection=!0,r}var s=A.getAudioProcessorPath();if(yield A.audioContext.audioWorklet.addModule(s),A.config.checkConnection&&"function"==typeof A.config.checkConnection&&!A.config.checkConnection()){A.mediaStream.getTracks().forEach(A=>A.stop()),A.mediaStream=null,A.audioContext&&"closed"!==A.audioContext.state&&(yield A.audioContext.close()),A.audioContext=null;var a=new Error("Connection lost - server may have rejected the call");throw a.name="ServerRejected",a.isServerRejection=!0,a}A.audioWorkletNode=new AudioWorkletNode(A.audioContext,"audio-processor",{processorOptions:{sampleRate:t,outputSampleRate:A.config.outputSampleRate}});var c=A.audioContext.createMediaStreamSource(A.mediaStream);c.connect(A.audioWorkletNode),A.mediaStreamSource=c,A.audioWorkletNode.port.onmessage=e=>{var{type:t,data:n}=e.data;"pcm_audio_data"===t&&A.emit("audioData",n)},A.audioWorkletNode.port.postMessage({type:"setForceContinuous",data:{enabled:!0}}),console.log("✅ AudioRecorder: Microphone access granted"),A.isRecording=!0,A.emit("recordingStarted")}catch(i){if(i.isServerRejection||"ServerRejected"===i.name)throw i;var l=i.message;if("NotAllowedError"===i.name||"PermissionDeniedError"===i.name){var d=yield A.checkPermissionState();"denied"===d?(l='Microphone access was blocked. To enable it: 1) Click the lock icon (🔒) in your browser\'s address bar, 2) Find "Microphone" and change it to "Allow", 3) Refresh this page and try again.',console.error("❌ AudioRecorder: Permission explicitly denied. User must change in browser settings.")):"prompt"===d?(l='Microphone permission was denied. Click the "Voice Call" button again to see the permission prompt.',console.error('❌ AudioRecorder: Permission denied but state is "prompt" - user can try again.')):(l="Microphone permission was denied. Click the button again to retry, or enable microphone access in your browser settings (lock icon 🔒 in address bar).",console.error("❌ AudioRecorder: Permission denied. User can try again or change in browser settings."))}else"NotFoundError"===i.name||"DevicesNotFoundError"===i.name?(l="No microphone found. Please connect a microphone and try again.",console.error("❌ AudioRecorder: No microphone device found.")):"NotReadableError"===i.name||"TrackStartError"===i.name?(l="Microphone is already in use by another application. Please close other apps using the microphone and try again.",console.error("❌ AudioRecorder: Microphone is busy or not readable.")):"SecurityError"!==i.name&&"PermissionDeniedError"!==i.name||(l="Microphone access blocked. On mobile devices, please tap the recording button directly (not from an iframe or popup).",console.error("❌ AudioRecorder: User agent blocked microphone access. This often happens on mobile when not called from direct user interaction."));var u=new Error(l);throw u.name=i.name,u.originalError=i,A.emit("error",u),u}})()}stop(){var A=this;return w(function*(){if(A.isRecording)try{if(A.mediaStreamSource)try{console.log("🛑 AudioRecorder: Disconnecting media stream source to stop audio flow..."),A.mediaStreamSource.disconnect(),A.mediaStreamSource=null,console.log("✅ AudioRecorder: Media stream source disconnected")}catch(A){console.warn("⚠️ AudioRecorder: Error disconnecting source:",A)}if(A.audioWorkletNode){console.log("🛑 AudioRecorder: Sending stop message to AudioWorklet to stop VAD..."),A.audioWorkletNode.port.postMessage({type:"stop"}),yield new Promise(A=>setTimeout(A,150)),A.audioWorkletNode.port.postMessage({type:"flush"}),yield new Promise(A=>setTimeout(A,50));try{A.audioWorkletNode.disconnect(),console.log("✅ AudioRecorder: AudioWorkletNode disconnected")}catch(A){console.log("⚠️ AudioRecorder: AudioWorkletNode already disconnected")}}A.mediaStream&&(console.log("🛑 AudioRecorder: Stopping media stream tracks..."),A.mediaStream.getTracks().forEach(A=>{A.stop(),console.log("✅ AudioRecorder: Stopped track:",A.kind)}),A.mediaStream=null),A.audioContext&&"closed"!==A.audioContext.state&&(console.log("🛑 AudioRecorder: Closing AudioContext..."),yield A.audioContext.close(),A.audioContext=null,console.log("✅ AudioRecorder: AudioContext closed")),A.audioWorkletNode=null,A.isRecording=!1,A.emit("recordingStopped"),console.log("✅ AudioRecorder: Recording stopped, VAD should be stopped")}catch(e){throw A.emit("error",e),e}})()}resumeAudioContext(){var A=this;return w(function*(){if(A.isRecording&&A.audioContext)try{if("suspended"===A.audioContext.state&&(console.log("🔄 AudioRecorder: Resuming suspended AudioContext..."),yield A.audioContext.resume(),console.log("✅ AudioRecorder: AudioContext resumed")),A.mediaStream){var e=A.mediaStream.getAudioTracks();0===e.filter(A=>"live"===A.readyState).length&&e.length>0&&(console.warn("⚠️ AudioRecorder: All audio tracks are inactive. Recording may have stopped."),A.emit("tracksInactive"))}}catch(e){console.error("❌ AudioRecorder: Failed to resume AudioContext:",e),A.emit("error",e)}})()}getStatus(){return{isRecording:this.isRecording,audioContextState:this.audioContext?this.audioContext.state:"closed"}}destroy(){this.stop()}}class y{static extractPcmFromWav(A){var e=A instanceof Uint8Array?A:new Uint8Array(A);if(e.length<44)throw new Error("WAV data too short (< 44 bytes)");if("RIFF"!==String.fromCharCode(e[0],e[1],e[2],e[3]))throw new Error("Not a valid WAV file - missing RIFF header");if("WAVE"!==String.fromCharCode(e[8],e[9],e[10],e[11]))throw new Error("Not a valid WAV file - missing WAVE format");for(var t=e[22]|e[23]<<8,n=e[24]|e[25]<<8|e[26]<<16|e[27]<<24,o=e[34]|e[35]<<8,i=-1,r=12;r<e.length-8;r+=4){if("data"===String.fromCharCode(e[r],e[r+1],e[r+2],e[r+3])){i=r;break}r+=4+(e[r+4]|e[r+5]<<8|e[r+6]<<16|e[r+7]<<24)}if(-1===i)throw new Error("No data chunk found in WAV");var s=e[i+4]|e[i+5]<<8|e[i+6]<<16|e[i+7]<<24,a=i+8,c=Math.min(s,e.length-a);return{pcmData:e.slice(a,a+c).buffer,format:{sampleRate:n,channels:t,bitDepth:o}}}static isWavFile(A){return A.length>=44&&82===A[0]&&73===A[1]&&70===A[2]&&70===A[3]}static createWavHeader(A,e,t,n){var o=new ArrayBuffer(44),i=new DataView(o);return i.setUint32(0,1380533830,!1),i.setUint32(4,36+A,!0),i.setUint32(8,1463899717,!1),i.setUint32(12,1718449184,!1),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,t,!0),i.setUint32(24,e,!0),i.setUint32(28,e*t*n/8,!0),i.setUint16(32,t*n/8,!0),i.setUint16(34,n,!0),i.setUint32(36,1684108385,!1),i.setUint32(40,A,!0),o}static wrapPcmInWav(A,e){var t=y.createWavHeader(A.byteLength,e.sampleRate,e.channels||1,e.bitDepth||16),n=new Uint8Array(t.byteLength+A.byteLength);return n.set(new Uint8Array(t),0),n.set(new Uint8Array(A),t.byteLength),n.buffer}}const b=y,x=class{constructor(){this.codecs={pcm:new c,pcmu:new l,pcma:new d}}decodeToPcm(A,e){var t=null==e?void 0:e.toLowerCase();if(!t||"pcm"===t)return A instanceof ArrayBuffer?A:A instanceof Uint8Array?A.buffer:A;var n=this.codecs[t];if(!n)throw new Error("Unsupported encoding: ".concat(e));var o=A instanceof Uint8Array?A:new Uint8Array(A);return n.decode(o)}encodeFromPcm(A,e){var t=null==e?void 0:e.toLowerCase();if(!t||"pcm"===t)return A;var n=this.codecs[t];if(!n)throw new Error("Unsupported target encoding: ".concat(e));var o=n.encode(A);return o instanceof Uint8Array?o.buffer:o}getCodec(A){var e=null==A?void 0:A.toLowerCase();return this.codecs[e]||null}};class Q{static convert(A,e,t){if(e===t)return A;if(8===e)throw new Error("Source bit depth cannot be 8-bit (only 16-bit or 24-bit supported)");var n=e/8,o=t/8,i=A.byteLength/n;if(new ArrayBuffer(i*o),16===e&&16===t)return A;if(24===e&&16===t)return Q.convert24To16(A);if(16===e&&24===t)return Q.convert16To24(A);if(16===e&&8===t)return Q.convert16To8(A);if(24===e&&8===t)return Q.convert24To8(A);throw new Error("Unsupported bit depth conversion: ".concat(e,"-bit → ").concat(t,"-bit"))}static convert24To16(A){for(var e=new Uint8Array(A),t=Math.floor(e.length/3),n=new Int16Array(t),o=0;o<t;o++){var i=e[3*o],r=e[3*o+1],s=e[3*o+2],a=i|r<<8|(255&s)<<16;128&s&&(a|=4278190080),n[o]=Math.max(-32768,Math.min(32767,Math.round(a/256)))}return n.buffer}static convert16To24(A){for(var e=new Int16Array(A),t=new Uint8Array(3*e.length),n=0;n<e.length;n++){var o=256*e[n];t[3*n]=255&o,t[3*n+1]=o>>8&255,t[3*n+2]=o>>16&255}return t.buffer}static convert16To8(A){for(var e=new Int16Array(A),t=new Uint8Array(e.length),n=0;n<e.length;n++){var o=e[n];t[n]=Math.max(0,Math.min(255,Math.round(o/256+128)))}return t.buffer}static convert24To8(A){var e=Q.convert24To16(A);return Q.convert16To8(e)}}const F=Q;function U(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}const S=class{static resample(A,e,t){return(n=function*(){if(e===t)return A;for(var n=new Int16Array(A),o=new Float32Array(n.length),i=1/32768,r=0;r<n.length;r++)o[r]=n[r]*i;var s=Math.ceil(o.length*t/e),a=new OfflineAudioContext(1,s,t),c=a.createBuffer(1,o.length,e);c.getChannelData(0).set(o);var l=a.createBufferSource();l.buffer=c,l.connect(a.destination),l.start();for(var d=(yield a.startRendering()).getChannelData(0),u=new Int16Array(d.length),g=0;g<d.length;g++){var p=Math.max(-1,Math.min(1,d[g]));u[g]=Math.round(32767*p)}return u.buffer},function(){var A=this,e=arguments;return new Promise(function(t,o){var i=n.apply(A,e);function r(A){U(i,t,o,r,s,"next",A)}function s(A){U(i,t,o,r,s,"throw",A)}r(void 0)})})();var n}};class I{static convert(A,e,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:16;if(e===t)return A;if(1===e&&1===t)return A;if(1===e&&2===t)return I.monoToStereo(A,n);if(2===e&&1===t)return I.stereoToMono(A,n);throw new Error("Unsupported channel conversion: ".concat(e," → ").concat(t))}static monoToStereo(A,e){for(var t=e/8,n=A.byteLength/t,o=new ArrayBuffer(n*t*2),i=new Uint8Array(A),r=new Uint8Array(o),s=0;s<n;s++)for(var a=s*t,c=s*t*2,l=0;l<t;l++)r[c+l]=i[a+l],r[c+t+l]=i[a+l];return o}static stereoToMono(A,e){var t=e/8,n=A.byteLength/(2*t),o=new ArrayBuffer(n*t),i=new Uint8Array(A),r=new Uint8Array(o);if(16===e)for(var s=0;s<n;s++){var a=s*t*2,c=a+t,l=(i[a]|i[a+1]<<8)<<16>>16,d=(i[c]|i[c+1]<<8)<<16>>16,u=Math.round((l+d)/2),g=s*t;r[g]=255&u,r[g+1]=u>>8&255}else for(var p=0;p<n;p++)for(var h=p*t*2,B=p*t,m=0;m<t;m++)r[B+m]=i[h+m];return o}}const E=I;function k(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function H(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?k(Object(t),!0).forEach(function(e){T(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):k(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function T(A,e,t){return(e=function(A){var e=function(A){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==typeof e?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function D(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}const K=class{constructor(A,e){this.requestedFormat=A,this.actualFormat=e,this.encodingConverter=new x,this.conversionSteps=[],this._analyzeConversions()}_analyzeConversions(){this.conversionSteps=[],this.actualFormat.container!==this.requestedFormat.container&&("wav"===this.actualFormat.container?this.conversionSteps.push("extract_wav"):"wav"===this.requestedFormat.container&&this.conversionSteps.push("wrap_wav")),this.actualFormat.encoding!==this.requestedFormat.encoding&&("pcm"!==this.actualFormat.encoding&&this.conversionSteps.push("decode_encoding"),"pcm"!==this.requestedFormat.encoding&&this.conversionSteps.push("encode_encoding")),this.actualFormat.sampleRate!==this.requestedFormat.sampleRate&&this.conversionSteps.push("resample"),this.actualFormat.bitDepth!==this.requestedFormat.bitDepth&&this.conversionSteps.push("convert_bitdepth"),this.actualFormat.channels!==this.requestedFormat.channels&&this.conversionSteps.push("convert_channels")}needsConversion(){return this.conversionSteps.length>0}getConversionSteps(){var A=[];return this.conversionSteps.includes("extract_wav")&&A.push("Extract PCM from WAV (".concat(this.actualFormat.container," → raw)")),this.conversionSteps.includes("decode_encoding")&&A.push("Decode ".concat(this.actualFormat.encoding.toUpperCase()," → PCM")),this.conversionSteps.includes("resample")&&A.push("Resample ".concat(this.actualFormat.sampleRate,"Hz → ").concat(this.requestedFormat.sampleRate,"Hz")),this.conversionSteps.includes("convert_bitdepth")&&A.push("Convert bit depth ".concat(this.actualFormat.bitDepth,"-bit → ").concat(this.requestedFormat.bitDepth,"-bit")),this.conversionSteps.includes("convert_channels")&&A.push("Convert channels ".concat(this.actualFormat.channels," → ").concat(this.requestedFormat.channels)),this.conversionSteps.includes("encode_encoding")&&A.push("Encode PCM → ".concat(this.requestedFormat.encoding.toUpperCase())),this.conversionSteps.includes("wrap_wav")&&A.push("Wrap in WAV container (raw → ".concat(this.requestedFormat.container,")")),A}convert(A){var e,t=this;return(e=function*(){if(!t.needsConversion())return A instanceof ArrayBuffer?A:A.buffer;var e=A instanceof ArrayBuffer?A:A.buffer,n=H({},t.actualFormat);if(t.conversionSteps.includes("extract_wav")){var o=b.extractPcmFromWav(e);e=o.pcmData,n=H(H({},n),{},{container:"raw",sampleRate:o.format.sampleRate,channels:o.format.channels,bitDepth:o.format.bitDepth}),console.log("🔄 AudioFormatConverter: Extracted PCM from WAV",o.format)}if(t.conversionSteps.includes("decode_encoding")&&(e=t.encodingConverter.decodeToPcm(e,n.encoding),n.encoding="pcm",n.bitDepth=16,console.log("🔄 AudioFormatConverter: Decoded ".concat(t.actualFormat.encoding.toUpperCase()," → PCM"))),24===n.bitDepth&&n.bitDepth!==t.requestedFormat.bitDepth&&(t.conversionSteps.includes("resample")||t.conversionSteps.includes("convert_channels")||24!==t.requestedFormat.bitDepth)&&(e=F.convert(e,24,16),n.bitDepth=16,console.log("🔄 AudioFormatConverter: Normalized 24-bit → 16-bit PCM")),t.conversionSteps.includes("resample")&&(e=yield S.resample(e,n.sampleRate,t.requestedFormat.sampleRate),n.sampleRate=t.requestedFormat.sampleRate,console.log("🔄 AudioFormatConverter: Resampled ".concat(t.actualFormat.sampleRate,"Hz → ").concat(t.requestedFormat.sampleRate,"Hz"))),t.conversionSteps.includes("convert_channels")&&(e=E.convert(e,n.channels,t.requestedFormat.channels,n.bitDepth),n.channels=t.requestedFormat.channels,console.log("🔄 AudioFormatConverter: Converted channels ".concat(t.actualFormat.channels," → ").concat(t.requestedFormat.channels))),t.conversionSteps.includes("convert_bitdepth")&&(e=F.convert(e,n.bitDepth,t.requestedFormat.bitDepth),n.bitDepth=t.requestedFormat.bitDepth,console.log("🔄 AudioFormatConverter: Converted bit depth ".concat(t.actualFormat.bitDepth,"-bit → ").concat(t.requestedFormat.bitDepth,"-bit"))),t.conversionSteps.includes("encode_encoding")){var i=t.encodingConverter.encodeFromPcm(e,t.requestedFormat.encoding);e=i instanceof ArrayBuffer?i:i.buffer,n.encoding=t.requestedFormat.encoding,console.log("🔄 AudioFormatConverter: Encoded PCM → ".concat(t.requestedFormat.encoding.toUpperCase()))}return t.conversionSteps.includes("wrap_wav")&&(e=b.wrapPcmInWav(e,n),n.container="wav",console.log("🔄 AudioFormatConverter: Wrapped in WAV container")),console.log("✅ AudioFormatConverter: Conversion complete"),e},function(){var A=this,t=arguments;return new Promise(function(n,o){var i=e.apply(A,t);function r(A){D(i,n,o,r,s,"next",A)}function s(A){D(i,n,o,r,s,"throw",A)}r(void 0)})})()}};function L(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}const M=class{constructor(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>null;this.handlers=new Map,this.sendMessage=A,this.getConversationId=e}registerHandler(A,e){if("function"!=typeof e)throw new Error("Handler for tool '".concat(A,"' must be a function"));this.handlers.set(A,e),console.log("🔧 ClientTools: Registered handler for '".concat(A,"'"))}unregisterHandler(A){this.handlers.delete(A),console.log("🔧 ClientTools: Unregistered handler for '".concat(A,"'"))}hasHandler(A){return this.handlers.has(A)}getRegisteredTools(){return Array.from(this.handlers.keys())}handleToolCall(A){var e,t=this;return(e=function*(){var{toolCallId:e,toolName:n,parameters:o}=A,i=Date.now(),r=(new Date).toISOString();console.log("🔧 ClientTools: [".concat(r,"] Received tool call '").concat(n,"' (id: ").concat(e,")")),console.log(" 📋 Full message received:",JSON.stringify(A,null,2)),console.log(" ⏱️ Start time: ".concat(i,"ms (").concat(new Date(i).toISOString(),")"));var s=t.handlers.get(n);if(!s){var a=Array.from(t.handlers.keys());return console.error("🔧 ClientTools: No handler registered for '".concat(n,"'")),console.error(" 📋 Currently registered tools:",a),console.error(" 📋 Total registered: ".concat(a.length)),void t.sendError(e,n,"No handler registered for tool '".concat(n,"'"),"NO_HANDLER",i)}try{var c=yield s(o),l=Date.now()-i;console.log("🔧 ClientTools: Tool '".concat(n,"' completed in ").concat(l,"ms")),t.sendResult(e,n,c,l)}catch(A){var d,u,g=Date.now()-i;console.error("🔧 ClientTools: Tool '".concat(n,"' failed:"),A);var p="EXECUTION_ERROR";"NotAllowedError"===A.name||null!==(d=A.message)&&void 0!==d&&d.includes("permission")?p="PERMISSION_DENIED":("NotSupportedError"===A.name||null!==(u=A.message)&&void 0!==u&&u.includes("not supported"))&&(p="API_UNAVAILABLE"),t.sendError(e,n,A.message||"Unknown error",p,g)}},function(){var A=this,t=arguments;return new Promise(function(n,o){var i=e.apply(A,t);function r(A){L(i,n,o,r,s,"next",A)}function s(A){L(i,n,o,r,s,"throw",A)}r(void 0)})})()}sendResult(A,e,t,n){var o=this.getConversationId(),i=(new Date).toISOString(),r={t:"client_tool_result",toolCallId:A,toolName:e,conversationId:o,result:t,executionTimeMs:n};console.log("🔧 ClientTools: [".concat(i,"] Sending result for tool '").concat(e,"'")),console.log(" 📋 toolCallId: ".concat(A)),console.log(" 📋 conversationId: ".concat(o||"null")),console.log(" 📋 toolName: ".concat(e)),console.log(" 📋 result:",t),console.log(" 📋 Full message:",JSON.stringify(r,null,2)),this.sendMessage(r),console.log("✅ ClientTools: Result message sent at ".concat(i))}sendError(A,e,t,n,o){var i="number"==typeof o?Date.now()-o:o,r=(new Date).toISOString(),s=this.getConversationId(),a={t:"client_tool_error",toolCallId:A,toolName:e,conversationId:s,error:t,errorCode:n,executionTimeMs:i};console.log("🔧 ClientTools: [".concat(r,"] Sending error for tool '").concat(e,"'")),console.log(" 📋 toolCallId: ".concat(A)),console.log(" 📋 conversationId: ".concat(s||"null")),console.log(" 📋 toolName: ".concat(e)),console.log(" 📋 error: ".concat(t,", errorCode: ").concat(n)),console.log(" 📋 Full message:",JSON.stringify(a,null,2)),this.sendMessage(a),console.log("✅ ClientTools: Error message sent at ".concat(r))}setSendMessage(A){this.sendMessage=A}};var R=i(354),P=i.n(R);function O(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function V(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?O(Object(t),!0).forEach(function(e){_(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):O(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function _(A,e,t){return(e=function(A){var e=function(A){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==typeof e?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function N(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}var G={useCORS:!0,allowTaint:!1,backgroundColor:"#ffffff",scale:1,logging:!1,imageTimeout:15e3};function W(){return j.apply(this,arguments)}function j(){var A;return A=function*(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{selector:e=null,format:t="jpeg",quality:n=.85,scale:o=1,maxWidth:i=1280,maxHeight:r=1280,fullPage:s=!1}=A;console.log("📸 SDK Screenshot: Starting capture with options:",A);var a=Date.now();try{var c=document.body;if(e){var l=document.querySelector(e);if(!l)throw new Error("Element not found: ".concat(e));c=l,console.log("📸 SDK Screenshot: Capturing element: ".concat(e))}else console.log("📸 SDK Screenshot: Capturing entire page");var d=V(V({},G),{},{scale:o});s&&!e&&(d.windowHeight=document.documentElement.scrollHeight,d.height=document.documentElement.scrollHeight,d.y=0);var u=yield P()(c,d);console.log("📸 SDK Screenshot: Canvas created (".concat(u.width,"x").concat(u.height,")"));var g=u;(i||r)&&(g=function(A,e,t){var{width:n,height:o}=A,i=1;if(e&&n>e&&(i=Math.min(i,e/n)),t&&o>t&&(i=Math.min(i,t/o)),1===i)return A;var r=Math.round(n*i),s=Math.round(o*i),a=document.createElement("canvas");return a.width=r,a.height=s,a.getContext("2d").drawImage(A,0,0,r,s),a}(u,i,r),g!==u&&console.log("📸 SDK Screenshot: Resized to ".concat(g.width,"x").concat(g.height)));var p="jpeg"===t?"image/jpeg":"image/png",h=g.toDataURL(p,"jpeg"===t?n:void 0).split(",")[1],B=Date.now()-a;return console.log("📸 SDK Screenshot: Capture completed in ".concat(B,"ms")),console.log("📸 SDK Screenshot: Size: ".concat(Math.round(h.length/1024),"KB")),{image:h,mimeType:p,width:g.width,height:g.height,captureTimeMs:B,selector:e||"body"}}catch(A){throw console.error("📸 SDK Screenshot: Capture failed:",A),new Error("Screenshot capture failed: ".concat(A.message))}},j=function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){N(i,n,o,r,s,"next",A)}function s(A){N(i,n,o,r,s,"throw",A)}r(void 0)})},j.apply(this,arguments)}var z={types:["password"],names:["cc","card","credit","cvv","cvc","csc","expir","cardnumber","card-number","card_number","cardholder","card-holder","card_holder","password","pwd","passwd","pass","secret","token","auth","api-key","apikey","api_key","access-key","accesskey","access_key","secret-key","secretkey","secret_key","private-key","privatekey","private_key","bearer","jwt","ssn","social-security","social_security","socialsecurity","tax-id","taxid","tax_id","national-id","nationalid","national_id","credential","private","secure"],autocomplete:["cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc","cc-name","cc-type","current-password","new-password"],dataAttributes:["data-secret","data-sensitive","data-private","data-api-key","data-token","data-auth"]};function X(A){if(!A)return!1;var e=(A.type||"").toLowerCase(),t=(A.name||"").toLowerCase(),n=(A.id||"").toLowerCase(),o=(A.className||"").toLowerCase(),i=(A.autocomplete||"").toLowerCase(),r=(A.placeholder||"").toLowerCase(),s=(A.getAttribute("aria-label")||"").toLowerCase(),a="".concat(t," ").concat(n," ").concat(o," ").concat(r," ").concat(s);if(z.types.includes(e))return!0;if(z.autocomplete.includes(i))return!0;for(var c of z.names)if(a.includes(c))return!0;for(var l of z.dataAttributes)if(A.hasAttribute(l))return!0;return"password"===(A.inputMode||"").toLowerCase()}function J(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function Y(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?J(Object(t),!0).forEach(function(e){q(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):J(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function q(A,e,t){return(e=function(A){var e=function(A){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==typeof e?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function Z(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}var $={buttons:20,links:30,forms:5,fieldsPerForm:15,sections:10,headings:15,maxTextLength:100,maxSummaryLength:150};function AA(A){var e,t;if(!A||!A.tagName)return null;if(null!==(e=A.dataset)&&void 0!==e&&e.testid)return'[data-testid="'.concat(A.dataset.testid,'"]');if(null!==(t=A.dataset)&&void 0!==t&&t.cy)return'[data-cy="'.concat(A.dataset.cy,'"]');var n=A.getAttribute("aria-label");if(n&&n.length<50)return'[aria-label="'.concat(n.replace(/"/g,'\\"'),'"]');if(A.id&&!eA(A.id))return"#".concat(CSS.escape(A.id));if(A.name){var o=A.tagName.toLowerCase();return"".concat(o,'[name="').concat(A.name,'"]')}if(["BUTTON","A"].includes(A.tagName)){var i,r=null===(i=A.innerText)||void 0===i?void 0:i.trim();if(r&&r.length<30&&r.length>0){var s=A.tagName.toLowerCase(),a=document.querySelectorAll("".concat(s));if(1===Array.from(a).filter(A=>{var e;return(null===(e=A.innerText)||void 0===e?void 0:e.trim())===r}).length)return"".concat(s,':contains("').concat(r.replace(/"/g,'\\"'),'")')}}return function(A){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,t=[],n=A,o=0;n&&n!==document.body&&o<e;){var i=n.tagName.toLowerCase();if(n.id&&!eA(n.id)){t.unshift("#".concat(CSS.escape(n.id)));break}var r=tA(n);if(r)t.unshift("".concat(i,".").concat(r));else{var s,a=null===(s=n.parentElement)||void 0===s?void 0:s.children;if(a&&a.length>1){var c=Array.from(a).indexOf(n)+1;t.unshift("".concat(i,":nth-child(").concat(c,")"))}else t.unshift(i)}n=n.parentElement,o++}return t.join(" > ")}(A)}function eA(A){return[/^:r[0-9a-z]+:$/,/^react-/i,/^ng-/i,/^vue-/i,/^ember[0-9]+/i,/^_[a-z0-9]{8,}$/i,/^[a-f0-9]{8}-[a-f0-9]{4}/i,/^uid-/i,/^id[0-9]+$/i].some(e=>e.test(A))}function tA(A){var e=Array.from(A.classList||[]),t=[/^(flex|grid|block|inline|hidden)$/,/^(m|p|w|h|min|max)-/,/^(text|font|bg|border)-/,/^(col|row)-/,/^(sm|md|lg|xl|2xl):/,/^hover:|focus:|active:/,/^[a-z]{1,3}-[0-9]+$/];return e.filter(A=>!t.some(e=>e.test(A))&&A.length>2&&A.length<30)[0]||null}function nA(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,t=A.getBoundingClientRect();return t.bottom>=-e&&t.top<=window.innerHeight+e&&t.right>=0&&t.left<=window.innerWidth}function oA(A){if(!A)return!1;var e=window.getComputedStyle(A);return"none"!==e.display&&"hidden"!==e.visibility&&"0"!==e.opacity&&A.offsetWidth>0&&A.offsetHeight>0}function iA(){return rA.apply(this,arguments)}function rA(){return A=function*(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Y(Y({},$),e.limits),n=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$,e=[],t=document.querySelectorAll('button, [type="submit"], [type="button"], [role="button"], .btn, .button');for(var n of t){if(e.length>=A.buttons)break;if(oA(n)){var o=(n.innerText||n.value||n.getAttribute("aria-label")||"").trim();o&&e.push({selector:AA(n),text:o.substring(0,A.maxTextLength),type:n.type||"button",disabled:n.disabled||!1,inViewport:nA(n,0)})}}return e}(t),o=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$,e=[],t=document.querySelectorAll("a[href]"),n=window.location.origin;for(var o of t){if(e.length>=A.links)break;if(oA(o)){var i=(o.innerText||o.getAttribute("aria-label")||"").trim();if(i&&!(i.length<2)){var r=o.href;if(r&&!r.startsWith("javascript:")&&"#"!==r){var s=!1;try{s=new URL(r).origin===n}catch(A){}e.push({selector:AA(o),text:i.substring(0,A.maxTextLength),href:r,internal:s,inViewport:nA(o,0)})}}}}return e}(t),{forms:i,sensitiveCount:r}=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$,e=[],t=document.querySelectorAll("form"),n=0;for(var o of t){if(e.length>=A.forms)break;if(oA(o)){var i=[],r=o.querySelectorAll("input, textarea, select");for(var s of r){var a,c;if(i.length>=A.fieldsPerForm)break;if("hidden"!==s.type)if(X(s))n++;else{var l=null;if(s.id){var d,u=document.querySelector('label[for="'.concat(s.id,'"]'));l=null==u||null===(d=u.innerText)||void 0===d?void 0:d.trim()}!l&&s.getAttribute("aria-label")&&(l=s.getAttribute("aria-label")),!l&&s.placeholder&&(l=s.placeholder),i.push({selector:AA(s),name:s.name||null,type:s.type||"text",label:(null===(a=l)||void 0===a?void 0:a.substring(0,50))||null,placeholder:(null===(c=s.placeholder)||void 0===c?void 0:c.substring(0,50))||null,required:s.required||!1})}}0!==i.length&&e.push({selector:AA(o),id:o.id||null,action:o.action||null,method:(o.method||"get").toUpperCase(),fields:i})}}return{forms:e,sensitiveCount:n}}(t),s=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$,e=[],t=document.querySelectorAll('section, article, main, [role="main"], [role="region"], .section');for(var n of t){var o,i,r;if(e.length>=A.sections)break;if(oA(n)){var s=n.querySelector("h1, h2, h3"),a=(null==s||null===(o=s.innerText)||void 0===o?void 0:o.trim())||"",c=n.querySelector("p"),l=a||(null==c||null===(i=c.innerText)||void 0===i?void 0:i.trim().substring(0,A.maxSummaryLength))||(null===(r=n.innerText)||void 0===r?void 0:r.trim().substring(0,A.maxSummaryLength))||"";e.push({selector:AA(n),id:n.id||null,tagName:n.tagName.toLowerCase(),summary:l.substring(0,A.maxSummaryLength),inViewport:nA(n,0)})}}return e}(t),a=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$,e=[],t=document.querySelectorAll("h1, h2, h3");for(var n of t){var o;if(e.length>=A.headings)break;if(oA(n)){var i=null===(o=n.innerText)||void 0===o?void 0:o.trim();i&&e.push({selector:AA(n),level:n.tagName.toLowerCase(),text:i.substring(0,A.maxTextLength),inViewport:nA(n,0)})}}return e}(t),c=n.length+o.length+i.reduce((A,e)=>A+e.fields.length,0)+s.length+a.length,l=n.filter(A=>A.inViewport).length+o.filter(A=>A.inViewport).length+s.filter(A=>A.inViewport).length+a.filter(A=>A.inViewport).length,d=document.documentElement.lang||(null===(A=document.querySelector("html"))||void 0===A?void 0:A.getAttribute("lang"))||null,u=navigator.language||navigator.languages&&navigator.languages[0]||null,g=d||u||null;return{url:window.location.href,title:document.title,timestamp:Date.now(),language:g,viewport:{width:window.innerWidth,height:window.innerHeight,scrollX:window.scrollX,scrollY:window.scrollY,pageHeight:document.documentElement.scrollHeight},buttons:n,links:o,forms:i,sections:s,headings:a,metadata:{totalElements:c,visibleInViewport:l,formsCount:i.length,sensitiveFieldsFiltered:r}}},rA=function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){Z(i,n,o,r,s,"next",A)}function s(A){Z(i,n,o,r,s,"throw",A)}r(void 0)})},rA.apply(this,arguments);var A}function sA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function aA(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){sA(i,n,o,r,s,"next",A)}function s(A){sA(i,n,o,r,s,"throw",A)}r(void 0)})}}function cA(){return cA=aA(function*(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{selector:t,color:n="#6366f1",duration:o=3e3}=e;if(!t)return{success:!1,error:"Selector is required"};var i=document.querySelector(t);if(!i)return{success:!1,error:"Element not found: ".concat(t)};i.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),yield hA(400);var r=i.getBoundingClientRect();lA();var s=document.createElement("div");return s.className="ttp-highlight-overlay",s.style.cssText="\n position: fixed;\n top: ".concat(r.top-4,"px;\n left: ").concat(r.left-4,"px;\n width: ").concat(r.width+8,"px;\n height: ").concat(r.height+8,"px;\n --ttp-highlight-color: ").concat(n,";\n border-color: ").concat(n,";\n box-shadow: 0 0 20px ").concat(n,"80, 0 0 40px ").concat(n,"40;\n pointer-events: none;\n z-index: 2147483647;\n "),document.body.appendChild(s),setTimeout(()=>{s.classList.add("ttp-fade-out"),setTimeout(()=>{s.remove()},300)},o),{success:!0,selector:t,elementInfo:{tag:i.tagName.toLowerCase(),id:i.id||null,text:(null===(A=i.innerText)||void 0===A?void 0:A.trim().substring(0,100))||null,position:{top:r.top,left:r.left,width:r.width,height:r.height}}}}),cA.apply(this,arguments)}function lA(){if(!document.getElementById("ttp-highlight-styles")){var A=document.createElement("style");A.id="ttp-highlight-styles",A.textContent="\n @keyframes ttp-pulse {\n 0%, 100% {\n box-shadow: 0 0 20px var(--ttp-highlight-color, #6366f1)80,\n 0 0 40px var(--ttp-highlight-color, #6366f1)40;\n }\n 50% {\n box-shadow: 0 0 30px var(--ttp-highlight-color, #6366f1)99,\n 0 0 60px var(--ttp-highlight-color, #6366f1)60;\n }\n }\n \n .ttp-highlight-overlay {\n border: 3px solid var(--ttp-highlight-color, #6366f1);\n border-radius: 8px;\n animation: ttp-pulse 1s ease-in-out infinite;\n transition: opacity 0.3s ease;\n }\n \n .ttp-highlight-overlay.ttp-fade-out {\n opacity: 0;\n }\n \n .ttp-fill-success {\n outline: 3px solid #22c55e !important;\n outline-offset: 2px;\n transition: outline 0.3s ease;\n }\n ",document.head.appendChild(A)}}function dA(){return dA=aA(function*(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{selector:e,x:t,y:n,direction:o,amount:i=500,position:r="center",behavior:s="smooth"}=A;if(e){var a=document.querySelector(e);if(!a)return{success:!1,error:"Element not found: ".concat(e)};var c="top"===r?"start":"bottom"===r?"end":"center";a.scrollIntoView({behavior:s,block:c,inline:"nearest"}),yield hA("smooth"===s?500:100);var l=a.getBoundingClientRect();return{success:!0,scrollType:"element",selector:e,elementPosition:{top:l.top,left:l.left}}}if("up"===o||"down"===o){var d,u=i||500,g=window.scrollY,p=document.documentElement.scrollHeight-window.innerHeight;return d="up"===o?Math.max(0,g-u):Math.min(p,g+u),window.scrollTo({top:d,left:window.scrollX,behavior:s}),yield hA("smooth"===s?500:100),{success:!0,scrollType:"relative",direction:o,amount:u,scrolledFrom:{y:g},scrolledTo:{y:window.scrollY},atTop:0===window.scrollY,atBottom:window.scrollY>=p-1}}return void 0!==t||void 0!==n?(window.scrollTo({top:null!=n?n:window.scrollY,left:null!=t?t:window.scrollX,behavior:s}),yield hA("smooth"===s?500:100),{success:!0,scrollType:"position",scrolledTo:{x:null!=t?t:window.scrollX,y:null!=n?n:window.scrollY}}):{success:!1,error:"Either selector, x/y position, or direction (up/down) required"}}),dA.apply(this,arguments)}function uA(){return uA=aA(function*(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{url:t}=e;if(!t)return{success:!1,error:"URL is required"};try{A=new URL(t,window.location.origin)}catch(A){return{success:!1,error:"Invalid URL: ".concat(t)}}if(!["http:","https:"].includes(A.protocol))return{success:!1,error:"Invalid protocol: ".concat(A.protocol)};if(A.origin!==window.location.origin)try{return window.open(A.href,"_blank","noopener,noreferrer"),{success:!0,openedInNewTab:!0,navigatedTo:A.href,message:"Opened external link in a new tab"}}catch(e){return{success:!1,error:"Failed to open external link in new tab: "+e.message,attempted:A.href}}var n=window.location.href;return window.location.href=A.href,{success:!0,navigatedTo:A.href,from:n}}),uA.apply(this,arguments)}function gA(){return gA=aA(function*(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{selector:e,value:t,triggerEvents:n=!0}=A;if(!e)return{success:!1,error:"Selector is required"};if(null==t)return{success:!1,error:"Value is required"};var o=document.querySelector(e);if(!o)return{success:!1,error:"Element not found: ".concat(e)};var i=o.tagName.toLowerCase();if(!["input","textarea","select"].includes(i))return{success:!1,error:"Element is not a form field: ".concat(i)};if(X(o))return{success:!1,error:"Cannot fill sensitive fields (password, credit card, etc.)",blocked:!0,fieldType:o.type,fieldName:o.name};if(o.scrollIntoView({behavior:"smooth",block:"center"}),yield hA(300),o.focus(),"select"===i){var r=Array.from(o.options).find(A=>A.value===t||A.text.toLowerCase()===t.toLowerCase());o.value=r?r.value:t}else if("checkbox"===o.type||"radio"===o.type){var s=!0===t||"true"===t||"1"===t;o.checked=s}else o.value=t;if(n){var a;o.dispatchEvent(new Event("input",{bubbles:!0})),o.dispatchEvent(new Event("change",{bubbles:!0}));var c=null===(a=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))||void 0===a?void 0:a.set;c&&(c.call(o,t),o.dispatchEvent(new Event("input",{bubbles:!0})))}return lA(),o.classList.add("ttp-fill-success"),setTimeout(()=>{o.classList.remove("ttp-fill-success")},2e3),{success:!0,selector:e,fieldType:o.type||i,fieldName:o.name||null,filled:!0}}),gA.apply(this,arguments)}function pA(){return pA=aA(function*(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{selector:t,waitForNavigation:n=!1,openInNewTab:o=!1,isExternal:i=!1,href:r=null}=e;if(!t)return{success:!1,error:"Selector is required"};var s=document.querySelector(t);if(!s)return{success:!1,error:"Element not found: ".concat(t)};var a=s.getBoundingClientRect();if(0===a.width||0===a.height)return{success:!1,error:"Element is not visible (zero size)"};if(s.disabled)return{success:!1,error:"Element is disabled"};s.scrollIntoView({behavior:"smooth",block:"center"}),yield hA(300);var c=document.createElement("div");if(c.style.cssText="\n position: fixed;\n top: ".concat(a.top-2,"px;\n left: ").concat(a.left-2,"px;\n width: ").concat(a.width+4,"px;\n height: ").concat(a.height+4,"px;\n border: 2px solid #22c55e;\n border-radius: 4px;\n pointer-events: none;\n z-index: 2147483647;\n transition: opacity 0.2s;\n "),document.body.appendChild(c),yield hA(200),c.remove(),o||i){var l=r||s.href||("A"===s.tagName?s.getAttribute("href"):null);if(l&&"#"!==l&&!l.startsWith("javascript:"))try{var d;return window.open(l,"_blank","noopener,noreferrer"),{success:!0,selector:t,clicked:!0,openedInNewTab:!0,url:l,elementInfo:{tag:s.tagName.toLowerCase(),text:(null===(d=s.innerText)||void 0===d?void 0:d.trim().substring(0,50))||null},message:"Opened link in a new tab"}}catch(A){console.warn("[TTP] Failed to open in new tab:",A)}}if(n){var u,g=window.location.href,p=new Promise(A=>{var e=setTimeout(()=>{A({navigated:!1})},5e3),t=()=>{clearTimeout(e),window.removeEventListener("beforeunload",t),A({navigated:!0})};window.addEventListener("beforeunload",t)});s.click();var h=yield p;return{success:!0,selector:t,clicked:!0,elementInfo:{tag:s.tagName.toLowerCase(),text:(null===(u=s.innerText)||void 0===u?void 0:u.trim().substring(0,50))||null},navigated:h.navigated||window.location.href!==g}}return s.click(),{success:!0,selector:t,clicked:!0,elementInfo:{tag:s.tagName.toLowerCase(),text:(null===(A=s.innerText)||void 0===A?void 0:A.trim().substring(0,50))||null}}}),pA.apply(this,arguments)}function hA(A){return new Promise(e=>setTimeout(e,A))}function BA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function mA(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){BA(i,n,o,r,s,"next",A)}function s(A){BA(i,n,o,r,s,"throw",A)}r(void 0)})}}function fA(A){A.registerHandler("read_page",mA(function*(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};console.log("[TTP] 📋 Reading page structure...");var e=yield iA(A);return console.log("[TTP] ✅ Page structure extracted:",{buttons:e.buttons.length,links:e.links.length,forms:e.forms.length,headings:e.headings.length}),e})),A.registerHandler("highlight_element",mA(function*(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};console.log("[TTP] ✨ Highlighting element:",A.selector);var e=yield function(){return cA.apply(this,arguments)}(A);return e.success?console.log("[TTP] ✅ Element highlighted"):console.warn("[TTP] ⚠️ Highlight failed:",e.error),e})),A.registerHandler("scroll_to_element",mA(function*(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(A.selector)console.log("[TTP] 📜 Scrolling to element:",A.selector);else if(A.direction)console.log("[TTP] 📜 Scrolling",A.direction,"by",A.amount||500,"px");else if(void 0!==A.x||void 0!==A.y){var e,t;console.log("[TTP] 📜 Scrolling to position:","(".concat(null!==(e=A.x)&&void 0!==e?e:"current",", ").concat(null!==(t=A.y)&&void 0!==t?t:"current",")"))}else console.log("[TTP] 📜 Scroll called with params:",A);var n=yield function(){return dA.apply(this,arguments)}(A);return n.success?console.log("[TTP] ✅ Scrolled successfully"):console.warn("[TTP] ⚠️ Scroll failed:",n.error),n})),A.registerHandler("navigate_to",mA(function*(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};console.log("[TTP] 🔗 Navigating to:",A.url);var e=yield function(){return uA.apply(this,arguments)}(A);return e.success?console.log("[TTP] ✅ Navigation initiated"):console.warn("[TTP] ⚠️ Navigation blocked:",e.error),e})),A.registerHandler("fill_field",mA(function*(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};console.log("[TTP] 📝 Filling field:",A.selector);var e=yield function(){return gA.apply(this,arguments)}(A);return e.success?console.log("[TTP] ✅ Field filled"):console.warn("[TTP] ⚠️ Fill failed:",e.error),e})),A.registerHandler("click_element",mA(function*(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};console.log("[TTP] 👆 Clicking element:",A.selector);var e=yield function(){return pA.apply(this,arguments)}(A);return e.success?console.log("[TTP] ✅ Element clicked"):console.warn("[TTP] ⚠️ Click failed:",e.error),e}));var e=A.getRegisteredTools(),t=["read_page","highlight_element","scroll_to_element","navigate_to","fill_field","click_element"].filter(A=>!e.includes(A));t.length>0?console.error("[TTP] ❌ Some visual tools failed to register:",t):console.log("[TTP] 👁️ Visual assistant tools registered successfully:",e)}function vA(){return(vA=mA(function*(){var A=yield iA();return{url:A.url,title:A.title,timestamp:A.timestamp,language:A.language,viewport:A.viewport,dom:{buttons:A.buttons,links:A.links,forms:A.forms,sections:A.sections,headings:A.headings,metadata:A.metadata}}})).apply(this,arguments)}function wA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function CA(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){wA(i,n,o,r,s,"next",A)}function s(A){wA(i,n,o,r,s,"throw",A)}r(void 0)})}}function yA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function bA(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?yA(Object(t),!0).forEach(function(e){xA(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):yA(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function xA(A,e,t){return(e=function(A){var e=function(A){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==typeof e?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}class QA extends a{constructor(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this.version="2.0.0",this.config={signedUrl:A.signedUrl||A.websocketUrl||"wss://speech.talktopc.com/ws/conv",websocketUrl:A.signedUrl||A.websocketUrl||"wss://speech.talktopc.com/ws/conv",agentId:A.agentId,appId:A.appId,sampleRate:A.sampleRate||16e3,channels:A.channels||1,bitDepth:A.bitDepth||16,audioProcessorPath:A.audioProcessorPath,outputContainer:A.outputContainer||this.getDefaultContainer(A),outputEncoding:A.outputEncoding||A.outputCodec||"pcm",outputSampleRate:A.outputSampleRate||16e3,outputChannels:A.outputChannels||1,outputBitDepth:A.outputBitDepth||16,outputFrameDurationMs:A.outputFrameDurationMs||600,outputCodec:A.outputCodec,agentSettingsOverride:A.agentSettingsOverride||null,visualAssistant:A.visualAssistant||null,variables:A.variables||null,autoReconnect:!1!==A.autoReconnect,audioConstraints:A.audioConstraints||null,protocolVersion:A.protocolVersion||2},this.isConnected=!1,this.hasEverConnected=!1,this.isRecording=!1,this.isPlaying=!1,this.isDestroyed=!1,this.outputAudioFormat=null,this.requestedOutputFormat=null,this.formatConverter=null,this.websocket=null,this.conversationId=null,this.transcriptQueue=[],this.currentPlayingSentenceId=null,this.audioFrameCount=0,this.lastAudioStartTime=0,this.wakeLock=null,this._wakeLockRequesting=!1,this.pendingInjections=new Map,this.injectionCounter=0,this.audioPlayer=new p(this.config);var e=bA(bA({},this.config),{},{checkConnection:()=>this.isConnected&&this.websocket&&this.websocket.readyState===WebSocket.OPEN});this.audioRecorder=new C(e),this.setupAudioPlayerEvents(),this.setupAudioRecorderEvents(),this.clientToolsRegistry=new M(A=>this.sendMessage(A),()=>this.conversationId),this._registerBuiltInTools(),this.validateConfig(),this._setupPageUnloadHandler(),console.log("🎵 VoiceSDK v2 initialized:",{version:this.version,outputContainer:this.config.outputContainer,outputEncoding:this.config.outputEncoding,outputSampleRate:this.config.outputSampleRate})}_registerBuiltInTools(){var A=this;console.log("📸 VoiceSDK: _registerBuiltInTools() called"),console.log("📸 VoiceSDK: captureScreenshot available?",void 0!==W);try{if(void 0===W)return console.error("❌ VoiceSDK: captureScreenshot is undefined - import may have failed"),void console.error(" This will prevent capture_screen tool from working");console.log("📸 VoiceSDK: Registering capture_screen tool, captureScreenshot type:",typeof W),this.clientToolsRegistry.registerHandler("capture_screen",CA(function*(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};console.log("📸 VoiceSDK: capture_screen tool called with params:",e);var{selector:t=null,format:n="jpeg",quality:o=.85,scale:i=1,fullPage:r=!1,maxWidth:s=1280,maxHeight:a=1280}=e;try{var c=yield W({selector:t,format:n,quality:o,scale:i,fullPage:r,maxWidth:s,maxHeight:a});return console.log("📸 VoiceSDK: Screenshot captured: ".concat(c.width,"x").concat(c.height,", ").concat(Math.round(c.image.length/1024),"KB")),A.emit("screenshotCaptured",{width:c.width,height:c.height,sizeKB:Math.round(c.image.length/1024),selector:c.selector}),c}catch(e){throw console.error("📸 VoiceSDK: Screenshot capture failed:",e),A.emit("screenshotError",{error:e.message}),e}})),console.log("📸 VoiceSDK: Built-in capture_screen tool registered")}catch(A){console.error("❌ VoiceSDK: Error registering built-in tools:",A),console.error(" Error details:",A.message,A.stack)}try{fA(this.clientToolsRegistry);var e=this.clientToolsRegistry.getRegisteredTools(),t=["read_page","click_element","fill_field","highlight_element","scroll_to_element","navigate_to"],n=e.filter(A=>t.includes(A));if(n.length!==t.length){var o=t.filter(A=>!n.includes(A));console.error("❌ VoiceSDK: Some visual tools failed to register:",o),console.error(" Registered visual tools:",n)}else console.log("✅ VoiceSDK: All visual tools registered:",n)}catch(A){console.error("❌ VoiceSDK: Error registering visual assistant tools:",A),console.error(" Error details:",A.message,A.stack)}var i=this.clientToolsRegistry.getRegisteredTools(),r=["read_page","capture_screen","highlight_element","click_element","fill_field","scroll_to_element","navigate_to"],s=i.filter(A=>r.includes(A));if(s.length!==r.length){var a=r.filter(A=>!s.includes(A));console.error("❌ VoiceSDK: Missing internal tools:",a),console.error(" Expected 7 internal tools:",r),console.error(" Registered:",s)}else console.log("✅ VoiceSDK: All 7 internal tools registered:",s);console.log("🔧 VoiceSDK: All registered tools after _registerBuiltInTools():",i)}getStoredConversationId(){try{if("undefined"==typeof sessionStorage)return console.warn("⚠️ VoiceSDK v2: sessionStorage not available (private mode?)"),null;var A=sessionStorage.getItem(QA.RESUME_STORAGE_KEY);if(A){var e=JSON.parse(A);if(e&&e.conversationId)return console.log("📦 VoiceSDK v2: Found stored conversationId:",e.conversationId),e.conversationId}return null}catch(A){return console.warn("⚠️ VoiceSDK v2: Error reading sessionStorage:",A),null}}storeConversationId(A){if(A)try{if("undefined"==typeof sessionStorage)return void console.warn("⚠️ VoiceSDK v2: sessionStorage not available (private mode?)");var e={},t=sessionStorage.getItem(QA.RESUME_STORAGE_KEY);if(t)try{e=JSON.parse(t)}catch(A){}e.conversationId=A,e.timestamp=Date.now(),e.fromPage=e.fromPage||window.location.pathname+window.location.search,sessionStorage.setItem(QA.RESUME_STORAGE_KEY,JSON.stringify(e)),console.log("💾 VoiceSDK v2: Stored conversationId:",A)}catch(A){console.warn("⚠️ VoiceSDK v2: Error writing to sessionStorage:",A)}}clearStoredConversationId(){try{if("undefined"==typeof sessionStorage)return;sessionStorage.removeItem(QA.RESUME_STORAGE_KEY),console.log("🗑️ VoiceSDK v2: Cleared stored conversationId")}catch(A){console.warn("⚠️ VoiceSDK v2: Error clearing sessionStorage:",A)}}_getResumeState(){try{if("undefined"==typeof sessionStorage)return null;var A=sessionStorage.getItem(QA.RESUME_STORAGE_KEY);if(!A)return null;var e=JSON.parse(A),t=Date.now()-e.timestamp;return t>QA.RESUME_TTL_MS?(console.log("[VoiceSDK] Resume state expired:",t,"ms"),this._clearResumeState(),null):(console.log("[VoiceSDK] Found valid resume state:",e,"age:",t,"ms"),e)}catch(A){return console.warn("[VoiceSDK] Failed to get resume state:",A),null}}_clearResumeState(){try{if("undefined"==typeof sessionStorage)return;sessionStorage.removeItem(QA.RESUME_STORAGE_KEY)}catch(A){}}_setupPageUnloadHandler(){window.addEventListener("beforeunload",()=>{this.conversationId&&this.websocket&&this.websocket.readyState===WebSocket.OPEN&&this.storeConversationId(this.conversationId)}),document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&&(this.isRecording&&this.isConnected&&this._requestWakeLock(),this.isRecording&&this.audioRecorder&&this.audioRecorder.resumeAudioContext().catch(A=>{console.error("VoiceSDK v2: Error resuming AudioContext on visibility change:",A)}),this.audioPlayer&&this.audioPlayer.resumeAudioContext().catch(A=>{console.error("VoiceSDK v2: Error resuming playback AudioContext on visibility change:",A)})),"hidden"===document.visibilityState&&this.conversationId&&this.websocket&&this.websocket.readyState===WebSocket.OPEN&&this.storeConversationId(this.conversationId)})}checkAndResume(){var A=this._getResumeState();if(!A)return null;var e=window.location.pathname+window.location.search;return console.log("[VoiceSDK] Auto-resuming conversation:",A.conversationId),console.log("[VoiceSDK] Page change:",A.fromPage,"→",e),{conversationId:A.conversationId,fromPage:A.fromPage,toPage:e}}getDefaultContainer(A){return"wav"===A.outputCodec?"wav":"raw"}validateInputFormat(A){var e;if(!A)return"Input format is required";var t=null===(e=A.encoding)||void 0===e?void 0:e.toLowerCase();return t&&QA.SUPPORTED_INPUT_ENCODINGS.includes(t)?A.sampleRate&&QA.SUPPORTED_INPUT_SAMPLE_RATES.includes(A.sampleRate)?A.bitDepth&&QA.SUPPORTED_INPUT_BIT_DEPTHS.includes(A.bitDepth)?A.channels&&QA.SUPPORTED_INPUT_CHANNELS.includes(A.channels)?null:"Unsupported input channels: ".concat(A.channels,". Supported: ").concat(QA.SUPPORTED_INPUT_CHANNELS.join(", ")):"Unsupported input bit depth: ".concat(A.bitDepth,". Supported: ").concat(QA.SUPPORTED_INPUT_BIT_DEPTHS.join(", ")):"Unsupported input sample rate: ".concat(A.sampleRate,". Supported: ").concat(QA.SUPPORTED_INPUT_SAMPLE_RATES.join(", ")):"Unsupported input encoding: ".concat(A.encoding,". Supported: ").concat(QA.SUPPORTED_INPUT_ENCODINGS.join(", "))}validateOutputFormat(A){var e,t;if(!A)return"Output format is required";var n=null===(e=A.encoding)||void 0===e?void 0:e.toLowerCase();if(!n||!QA.SUPPORTED_OUTPUT_ENCODINGS.includes(n))return"Unsupported output encoding: ".concat(A.encoding,". Supported: ").concat(QA.SUPPORTED_OUTPUT_ENCODINGS.join(", "));if(!A.sampleRate||!QA.SUPPORTED_OUTPUT_SAMPLE_RATES.includes(A.sampleRate))return"Unsupported output sample rate: ".concat(A.sampleRate,". Supported: ").concat(QA.SUPPORTED_OUTPUT_SAMPLE_RATES.join(", "));if(!A.bitDepth||!QA.SUPPORTED_OUTPUT_BIT_DEPTHS.includes(A.bitDepth))return"Unsupported output bit depth: ".concat(A.bitDepth,". Supported: ").concat(QA.SUPPORTED_OUTPUT_BIT_DEPTHS.join(", "));if(!A.channels||!QA.SUPPORTED_OUTPUT_CHANNELS.includes(A.channels))return"Unsupported output channels: ".concat(A.channels,". Supported: ").concat(QA.SUPPORTED_OUTPUT_CHANNELS.join(", "));var o=null===(t=A.container)||void 0===t?void 0:t.toLowerCase();return o&&QA.SUPPORTED_OUTPUT_CONTAINERS.includes(o)?null:"Unsupported output container: ".concat(A.container,". Supported: ").concat(QA.SUPPORTED_OUTPUT_CONTAINERS.join(", "))}validateConfig(){var A={encoding:"pcm",sampleRate:this.config.sampleRate,channels:this.config.channels,bitDepth:this.config.bitDepth},e=this.validateInputFormat(A);if(e)return console.error("❌ VoiceSDK v2: Invalid input format:",e),void this.emit("error",new Error(e));var t={encoding:this.config.outputEncoding,sampleRate:this.config.outputSampleRate,channels:this.config.outputChannels,bitDepth:this.config.outputBitDepth,container:this.config.outputContainer},n=this.validateOutputFormat(t);if(n)return console.error("❌ VoiceSDK v2: Invalid output format:",n),void this.emit("error",new Error(n));console.log("✅ VoiceSDK v2: Format validation passed")}setupAudioPlayerEvents(){this.audioPlayer.on("playbackStarted",()=>{this.isPlaying=!0,this.emit("playbackStarted"),this.isConnected?(console.log("📤 VoiceSDK v2: Sending audio_started_playing message to server"),this.sendMessage({t:"audio_started_playing"})):console.warn("⚠️ VoiceSDK v2: Cannot send audio_started_playing - not connected")}),this.audioPlayer.on("transcriptDisplay",A=>{var e=this.currentPlayingSentenceId?this.currentPlayingSentenceId+1:1;this.currentPlayingSentenceId=e;var t={text:A.text,role:"assistant",sentenceId:e,final:!0,timestamp:Date.now()};console.log("📝 VoiceSDK v2: Emitting synced transcriptDisplay from AudioPlayer:",t),this.emit("transcriptDisplay",t),this.emit("transcript",t)}),this.audioPlayer.on("playbackStopped",()=>{this.isPlaying=!1,this.emit("playbackStopped"),this.isConnected?(console.log("📤 VoiceSDK v2: Sending audio_stopped_playing message to server"),this.sendMessage({t:"audio_stopped_playing"})):console.warn("⚠️ VoiceSDK v2: Cannot send audio_stopped_playing - not connected")}),this.audioPlayer.on("playbackError",A=>{this.emit("playbackError",A),this.emit("error",A)})}setupAudioRecorderEvents(){this.audioRecorder.on("recordingStarted",()=>{this.isRecording=!0,this.emit("recordingStarted")}),this.audioRecorder.on("recordingStopped",()=>{this.isRecording&&(this.isRecording=!1,this.emit("recordingStopped"),console.log("🛑 VoiceSDK v2: Recording stopped (from audioRecorder event)"))}),this.audioRecorder.on("audioData",A=>{this.isConnected&&this.sendBinary(A)}),this.audioRecorder.on("error",A=>{A.isServerRejection||"ServerRejected"===A.name||(console.error("❌ AudioRecorder error:",A),this.emit("error",A))})}buildWebSocketUrl(){var A=this.config.signedUrl||this.config.websocketUrl,e=new URL(A,"wss://placeholder.com"),t=e.searchParams;this.config.agentId&&!t.has("agentId")&&t.append("agentId",this.config.agentId),this.config.appId&&!t.has("appId")&&t.append("appId",this.config.appId);var n=this.getStoredConversationId();n&&!t.has("conversationId")&&(t.append("conversationId",n),console.log("🔄 VoiceSDK v2: Attempting resume via query param:",n));var o=window.location.pathname+window.location.search;o&&!t.has("currentPage")&&t.append("currentPage",o);var i=t.toString();return i?"".concat(e.origin).concat(e.pathname,"?").concat(i):"".concat(e.origin).concat(e.pathname)}connect(){var A=this;return CA(function*(){if(A.isDestroyed)return console.warn("VoiceSDK v2: Cannot connect - SDK is destroyed"),!1;if(A.isConnected)return console.warn("VoiceSDK v2: Already connected"),!0;try{var e=A.buildWebSocketUrl();return"undefined"!=typeof __DEV__&&__DEV__&&(console.log("[TTPAgentSDK] WebSocket URL:",e),console.log("🔌 VoiceSDK v2: Connecting to",e)),yield new Promise((t,n)=>{A.websocket=new WebSocket(e),A.websocket.onopen=()=>{if(console.log("✅ VoiceSDK v2: WebSocket connected"),A.isConnected=!0,A.hasEverConnected=!0,A.clientToolsRegistry){A.clientToolsRegistry.setSendMessage(e=>A.sendMessage(e));var e=A.clientToolsRegistry.getRegisteredTools();console.log("🔧 VoiceSDK v2: Registered tools on connect:",e);var n=["read_page","capture_screen","highlight_element","click_element","fill_field","scroll_to_element","navigate_to"].filter(A=>!e.includes(A));if(n.length>0){console.warn("⚠️ VoiceSDK v2: Missing tools detected, re-registering:",n),A._registerBuiltInTools();var o=A.clientToolsRegistry.getRegisteredTools();console.log("🔧 VoiceSDK v2: Tools after re-registration:",o)}}A.sendHelloMessage(),A.emit("connected"),t(!0)},A.websocket.onerror=A=>{console.error("❌ VoiceSDK v2: WebSocket error:",A),n(A)},A.websocket.onclose=e=>{if(console.log("🔌 VoiceSDK v2: WebSocket closed:",e.code,e.reason),A.isConnected=!1,A.isRecording&&A.stopRecording().catch(A=>console.error("Error stopping recording:",A)),A._releaseWakeLock(),A.pendingInjections.size>0){console.warn("VoiceSDK v2: Rejecting ".concat(A.pendingInjections.size," pending data injections due to disconnect"));var t=new Error("Connection closed - data injection cancelled");t.error="CONNECTION_CLOSED",A.pendingInjections.forEach((e,n)=>{clearTimeout(e.timeout),e.reject(t),A.emit("dataInjectionError",{error:"CONNECTION_CLOSED",message:"Connection closed - data injection cancelled",correlationId:n})}),A.pendingInjections.clear()}A.emit("disconnected",e),A.config.autoReconnect&&!A.isDestroyed&&A.hasEverConnected?(console.log("🔄 VoiceSDK v2: Auto-reconnecting in 3s..."),setTimeout(()=>{A.isDestroyed||A.isConnected||A.connect()},3e3)):A.config.autoReconnect&&!A.hasEverConnected&&console.log("⚠️ VoiceSDK v2: Initial connection failed. Auto-reconnect disabled to prevent retry loop.")},A.websocket.onmessage=e=>{A.handleMessage(e)}})}catch(e){return console.error("🔌 VoiceSDK v2: Connection failed:",e),A.emit("error",e),!1}})()}detectBrowserLocale(){var A,e,t=navigator.language||(null===(A=navigator.languages)||void 0===A?void 0:A[0])||"en-US";return{language:(null===(e=t.split("-")[0])||void 0===e?void 0:e.toLowerCase())||"en",fullLocale:t}}sendHelloMessage(){var A=this;return CA(function*(){if(A.isConnected){var e={encoding:"pcm",sampleRate:A.config.sampleRate,channels:A.config.channels,bitDepth:A.config.bitDepth},t={encoding:A.config.outputEncoding,sampleRate:A.config.outputSampleRate,channels:A.config.outputChannels,bitDepth:A.config.outputBitDepth,container:A.config.outputContainer},n=A.validateInputFormat(e);if(n)return console.error("❌ VoiceSDK v2: Cannot send hello - invalid input format:",n),void A.emit("error",new Error("Invalid input format: ".concat(n)));var o=A.validateOutputFormat(t);if(o)return console.error("❌ VoiceSDK v2: Cannot send hello - invalid output format:",o),void A.emit("error",new Error("Invalid output format: ".concat(o)));var i={t:"hello",v:A.config.protocolVersion,inputFormat:e,requestedOutputFormat:t,outputFrameDurationMs:A.config.outputFrameDurationMs};A.config.agentSettingsOverride&&(i.agentSettingsOverride=A.config.agentSettingsOverride),i.locale=A.detectBrowserLocale(),console.log("🌍 VoiceSDK v2: Auto-detected locale:",i.locale),console.log("🔍 VoiceSDK v2: Checking variables:",{hasVariables:!!A.config.variables,variables:A.config.variables,keys:A.config.variables?Object.keys(A.config.variables):[]}),A.config.variables&&Object.keys(A.config.variables).length>0?(i.variables=A.config.variables,console.log("📝 VoiceSDK v2: Including variables in hello:",Object.keys(A.config.variables))):console.log("⚠️ VoiceSDK v2: Variables NOT included - condition failed"),console.log("📤 VoiceSDK v2: Sending hello:",{version:i.v,requestedFormat:i.requestedOutputFormat,variables:i.variables?Object.keys(i.variables):void 0}),console.log("📤 VoiceSDK v2: Requested output format:",{container:i.requestedOutputFormat.container,encoding:i.requestedOutputFormat.encoding,sampleRate:i.requestedOutputFormat.sampleRate,bitDepth:i.requestedOutputFormat.bitDepth}),console.log("📤 VoiceSDK v2: Full hello message being sent:",JSON.stringify(i,null,2));try{A.sendMessage(i)}catch(e){console.error("VoiceSDK v2: Failed to send hello:",e),A.emit("error",e)}}else console.warn("VoiceSDK v2: Cannot send hello - not connected")})()}handleMessage(A){var e;if(A.data instanceof ArrayBuffer||A.data instanceof Blob)this.handleBinaryMessage(A.data);else try{var t=JSON.parse(A.data);switch("audio"!==t.t&&console.log("📥 VoiceSDK v2: Received message type:",t.t,"Full message:",JSON.stringify(t).substring(0,200)),!this.conversationId&&t.conversationId&&(this.conversationId=t.conversationId,console.log("🔍 VoiceSDK v2: Captured conversationId from message:",this.conversationId),this.emit("conversationIdChanged",this.conversationId)),"audio"!==t.t&&console.log("📨 VoiceSDK v2: Received message type:",t.t,t),t.t){case"hello_ack":this.handleHelloAck(t);break;case"transcript":console.log("📝 VoiceSDK v2: Processing transcript message:",t),this.handleTranscript(t);break;case"user_transcript":console.log("📝 VoiceSDK v2: Received user_transcript:",t),this.emit("message",t);break;case"agent_response":if(console.log("📝 VoiceSDK v2: Received agent_response:",t),(t.text||t.transcript)&&(console.log("📝 VoiceSDK v2: agent_response contains transcript data:",t.text||t.transcript),t.sentenceId&&(t.text||t.transcript))){var n={t:"transcript",sentenceId:t.sentenceId,text:t.text||t.transcript,role:t.role||"assistant",final:!1!==t.final,timestamp:t.timestamp||Date.now()};console.log("📝 VoiceSDK v2: Converting agent_response to transcript:",n),this.handleTranscript(n)}this.emit("message",t);break;case"error":this.emit("message",t);break;case"barge_in":this.emit("bargeIn",t),this.stopAudioPlayback();break;case"stop_playing":var o=Date.now()-this.lastAudioStartTime;if(o<200){console.warn("⚠️ VoiceSDK v2: Ignoring premature stop_playing (".concat(o,"ms after audio_start, minimum ").concat(200,"ms required)"));break}this.emit("stopPlaying",t),this.stopAudioPlayback();break;case"audio_start":console.log("📝 VoiceSDK v2: Received audio_start with text:",t.text),this.lastAudioStartTime=Date.now(),this.audioPlayer&&(this.audioPlayer.isPlaying||(null===(e=this.audioPlayer.scheduledSources)||void 0===e?void 0:e.size)>0)&&console.log("📝 VoiceSDK v2: New sentence received while audio playing - will queue and wait for current sentence to finish"),t.text&&this.audioPlayer&&this.audioPlayer.markNewSentence(t.text),this.emit("message",t);break;case"client_tool_call":this.clientToolsRegistry.handleToolCall(t);break;case"text_inject_ack":this.handleTextInjectAck(t);break;case"data_inject_ack":this.handleDataInjectAck(t);break;case"data_inject_error":this.handleDataInjectError(t);break;case"hangup_ack":console.log("📞 VoiceSDK v2: Hangup acknowledged by server"),this.websocket&&this.websocket.readyState===WebSocket.OPEN&&(this.websocket.close(1e3,"User hangup"),this.websocket=null),this.isConnected=!1,this.emit("hangupAcknowledged");break;case"get_page_context":console.log("📖 [VISUAL ASSISTANT] Backend requested page context"),function(){return vA.apply(this,arguments)}().then(A=>{this.sendMessage({t:"page_context",pageContext:A}),console.log("📖 [VISUAL ASSISTANT] Page context sent:",A.url)}).catch(A=>{console.error("❌ [VISUAL ASSISTANT] Failed to scan page:",A),this.sendMessage({t:"page_context",pageContext:null,error:A.message})});break;case"get_screenshot":console.log("📸 [VISUAL ASSISTANT] Backend requested screenshot");try{W().then(A=>{this.sendMessage({t:"screenshot",screenshot:{image:A.base64,mimeType:A.mimeType||"image/png",width:A.width,height:A.height}}),console.log("📸 [VISUAL ASSISTANT] Screenshot sent:",A.width+"x"+A.height)}).catch(A=>{console.error("❌ [VISUAL ASSISTANT] Screenshot capture failed:",A),this.sendMessage({t:"screenshot",screenshot:null,error:A.message})})}catch(A){console.error("❌ [VISUAL ASSISTANT] Screenshot error:",A),this.sendMessage({t:"screenshot",screenshot:null,error:A.message})}break;case"page_context_ack":t.ok?console.log("✅ [VISUAL ASSISTANT] Page context acknowledged"):console.warn("⚠️ [VISUAL ASSISTANT] Page context error:",t.error);break;case"screenshot_ack":t.ok?console.log("✅ [VISUAL ASSISTANT] Screenshot acknowledged"):console.warn("⚠️ [VISUAL ASSISTANT] Screenshot error:",t.error);break;default:if(console.log("VoiceSDK v2: Unknown message type:",t.t,"Full message:",JSON.stringify(t).substring(0,300)),(t.text||t.transcript||t.transcription)&&(console.log("📝 VoiceSDK v2: Unknown message contains transcript-like data:",{text:t.text,transcript:t.transcript,transcription:t.transcription,sentenceId:t.sentenceId,role:t.role}),t.sentenceId&&(t.text||t.transcript||t.transcription))){var i={t:"transcript",sentenceId:t.sentenceId,text:t.text||t.transcript||t.transcription,role:t.role||"assistant",final:!1!==t.final,timestamp:t.timestamp||Date.now()};console.log("📝 VoiceSDK v2: Attempting to process unknown message as transcript:",i),this.handleTranscript(i)}this.emit("message",t)}}catch(e){var r,s,a="string"==typeof A.data?A.data:String(A.data),c=(null===(r=e.message)||void 0===r||null===(r=r.match(/position (\d+)/))||void 0===r?void 0:r[1])||"unknown",l=parseInt(c,10);if(console.error("VoiceSDK v2: Error parsing message:",e),console.error("VoiceSDK v2: Raw message length:",a.length),console.error("VoiceSDK v2: Error at position:",l),"unknown"!==l&&l>0){var d=Math.max(0,l-50),u=Math.min(a.length,l+50),g=a.substring(d,u),p=" ".repeat(l-d)+"^";console.error("VoiceSDK v2: Context around error:"),console.error(g),console.error(p);var h=a.charAt(l),B=h.charCodeAt(0);console.error('VoiceSDK v2: Problematic character: "'.concat(h,'" (charCode: ').concat(B,")")),B<32&&9!==B&&10!==B&&13!==B&&console.error("VoiceSDK v2: This is an unescaped control character. The backend should escape it in JSON strings.")}var m=a.includes("client_tool_call")||a.includes('"t":"client_tool_call"');if(m){console.error("⚠️ VoiceSDK v2: CRITICAL - Failed to parse client_tool_call message!"),console.error("⚠️ VoiceSDK v2: This means a tool execution (like form filling) was lost due to JSON parsing error."),console.error("⚠️ VoiceSDK v2: The backend sent malformed JSON with unescaped control characters.");var f=a.match(/"toolName"\s*:\s*"([^"]+)"/);f&&console.error('⚠️ VoiceSDK v2: Attempted tool: "'.concat(f[1],'"'));var v=a.match(/"toolCallId"\s*:\s*"([^"]+)"/);v&&console.error('⚠️ VoiceSDK v2: Tool call ID: "'.concat(v[1],'"'))}if(null!==(s=e.message)&&void 0!==s&&s.includes("Bad control character")){console.warn("VoiceSDK v2: Attempting to recover by sanitizing control characters...");try{var w=a;w=w.replace(/([^\\])([\x00-\x08\x0B\x0C\x0E-\x1F])/g,(A,e,t)=>{var n=t.charCodeAt(0);return e+({0:"\\u0000",1:"\\u0001",2:"\\u0002",3:"\\u0003",4:"\\u0004",5:"\\u0005",6:"\\u0006",7:"\\u0007",8:"\\b",11:"\\u000B",12:"\\f",14:"\\u000E",15:"\\u000F",16:"\\u0010",17:"\\u0011",18:"\\u0012",19:"\\u0013",20:"\\u0014",21:"\\u0015",22:"\\u0016",23:"\\u0017",24:"\\u0018",25:"\\u0019",26:"\\u001A",27:"\\u001B",28:"\\u001C",29:"\\u001D",30:"\\u001E",31:"\\u001F"}[n]||"\\u".concat(n.toString(16).padStart(4,"0")))});var C=JSON.parse(w);if(console.warn("✅ VoiceSDK v2: Successfully recovered message after sanitization!"),console.warn("✅ VoiceSDK v2: Processing recovered message..."),"client_tool_call"===C.t&&this.clientToolsRegistry)console.warn("✅ VoiceSDK v2: Recovered client_tool_call - executing tool"),this.clientToolsRegistry.handleToolCall(C);else{var y=C;"audio"!==y.t&&console.log("📥 VoiceSDK v2: Received message type:",y.t,"Full message:",JSON.stringify(y).substring(0,200)),!this.conversationId&&y.conversationId&&(this.conversationId=y.conversationId,console.log("🔍 VoiceSDK v2: Captured conversationId from message:",this.conversationId),this.emit("conversationIdChanged",this.conversationId)),"audio"!==y.t&&console.log("📨 VoiceSDK v2: Received message type:",y.t,y),"client_tool_call"===y.t?this.clientToolsRegistry.handleToolCall(y):this.emit("message",y)}return}catch(A){console.error("❌ VoiceSDK v2: Recovery attempt failed:",A)}}console.error("VoiceSDK v2: First 500 chars of raw message:",a.substring(0,500)),this.emit("error",{type:"json_parse_error",error:e,rawMessage:a.substring(0,1e3),position:l,wasToolCall:m})}}handleHelloAck(A){if(console.log("📥 VoiceSDK v2: Received hello_ack:",{hasOutputFormat:!!A.outputAudioFormat,outputFormat:A.outputAudioFormat,hasConversationId:!!A.conversationId,messageType:A.t}),A.conversationId&&(this.conversationId=A.conversationId,console.log("🔍 VoiceSDK v2: Received conversationId:",this.conversationId),this.emit("conversationIdChanged",this.conversationId),this.storeConversationId(this.conversationId)),!0===A.resumed?(console.log("✅ VoiceSDK v2: Conversation resumed successfully"),this.emit("callResumed",{conversationId:this.conversationId,timestamp:Date.now()})):!1===A.resumed&&A.resumeRejectedReason&&(console.warn("⚠️ VoiceSDK v2: Resume rejected:",A.resumeRejectedReason),this.clearStoredConversationId(),this.emit("resumeRejected",{reason:A.resumeRejectedReason,conversationId:A.conversationId||null,timestamp:Date.now()})),A.outputAudioFormat){this.outputAudioFormat=A.outputAudioFormat,this.audioPlayer.setOutputFormat(A.outputAudioFormat),console.log("✅ VoiceSDK v2: Format negotiated by server:",this.outputAudioFormat),this.requestedOutputFormat={container:this.config.outputContainer||"wav",encoding:this.config.outputEncoding||"pcm",sampleRate:this.config.outputSampleRate||16e3,bitDepth:this.config.outputBitDepth||16,channels:this.config.outputChannels||1};var e={container:this.outputAudioFormat.container||"unknown",encoding:this.outputAudioFormat.encoding||"unknown",sampleRate:this.outputAudioFormat.sampleRate||0,bitDepth:this.outputAudioFormat.bitDepth||0,channels:this.outputAudioFormat.channels||0},t=[];if(this.requestedOutputFormat.container!==e.container&&t.push('container: "'.concat(this.requestedOutputFormat.container,'" → "').concat(e.container,'"')),this.requestedOutputFormat.encoding!==e.encoding&&t.push('encoding: "'.concat(this.requestedOutputFormat.encoding,'" → "').concat(e.encoding,'"')),this.requestedOutputFormat.sampleRate!==e.sampleRate&&t.push("sampleRate: ".concat(this.requestedOutputFormat.sampleRate,"Hz → ").concat(e.sampleRate,"Hz")),this.requestedOutputFormat.bitDepth!==e.bitDepth&&t.push("bitDepth: ".concat(this.requestedOutputFormat.bitDepth,"-bit → ").concat(e.bitDepth,"-bit")),this.requestedOutputFormat.channels!==e.channels&&t.push("channels: ".concat(this.requestedOutputFormat.channels," → ").concat(e.channels)),t.length>0){console.warn("⚠️ VoiceSDK v2: Format negotiation mismatch!"),console.warn(" Requested:",this.requestedOutputFormat),console.warn(" Negotiated:",e),console.warn(" Differences:",t.join(", "));try{if(this.formatConverter=new K(this.requestedOutputFormat,e),this.formatConverter.needsConversion()){var n=this.formatConverter.getConversionSteps();console.log("🔄 VoiceSDK v2: Format conversion enabled"),console.log(" Conversion steps:",n.join(", ")),console.log(" Audio will be automatically converted to requested format")}}catch(A){console.error("❌ VoiceSDK v2: Failed to create format converter:",A),console.warn(" Will use backend format without conversion"),this.formatConverter=null}}else console.log("✅ VoiceSDK v2: Format perfectly matched!",e),this.formatConverter=null;this.emit("formatNegotiated",this.outputAudioFormat)}else{this.config.protocolVersion>=2&&(console.warn("⚠️ VoiceSDK v2: hello_ack received but no outputAudioFormat in response."),console.warn(" This may happen if:"),console.warn(" 1. Backend is not sending outputAudioFormat (check backend logs)"),console.warn(" 2. Hello message missing v2 fields (v, inputFormat, requestedOutputFormat)"),console.warn(" 3. Backend validation failed (check backend error logs)"),console.warn(" Using default format from config..."));var o={container:this.config.outputContainer||"wav",encoding:this.config.outputEncoding||"pcm",sampleRate:this.config.outputSampleRate||16e3,channels:this.config.outputChannels||1,bitDepth:this.config.outputBitDepth||16};this.outputAudioFormat=o,this.requestedOutputFormat=o,this.audioPlayer.setOutputFormat(o),this.formatConverter=null}}handleTextInjectAck(A){console.log("📝 VoiceSDK v2: Text inject ack received:",A),this.emit("textInjectAck",A)}injectData(A){var e=arguments,t=this;return CA(function*(){var n=e.length>1&&void 0!==e[1]?e[1]:{},o=null==A?void 0:A.trim();if(!o){var i={error:"EMPTY_DATA",message:"Cannot inject empty data"};throw console.warn("VoiceSDK v2: Cannot inject empty data"),t.emit("dataInjectionError",i),new Error(i.message)}if(!t.isConnected||!t.websocket){var r={error:"NOT_CONNECTED",message:"Voice call is not active"};throw console.warn("VoiceSDK v2: Cannot inject data - not connected"),t.emit("dataInjectionError",r),new Error(r.message)}if(o.length>5e3){var s={error:"DATA_TOO_LONG",message:"Data exceeds maximum length of 5000 characters",maxLength:5e3,currentLength:o.length};throw console.warn("VoiceSDK v2: Data too long (max 5000 characters)"),t.emit("dataInjectionError",s),new Error(s.message)}var a=t.generateCorrelationId(),c=n.timeout||1e4,l=n.source||"programmatic",d={t:"data_inject",data:o,correlationId:a,source:l,timestamp:Date.now()};return n.metadata&&(d.metadata=n.metadata),new Promise((A,e)=>{var n=setTimeout(()=>{t.pendingInjections.delete(a);var A={error:"TIMEOUT",message:"Data injection timeout - no response from server",correlationId:a,timeout:c};console.warn("VoiceSDK v2: Data injection timeout:",a),t.emit("dataInjectionError",A),e(new Error(A.message))},c);if(t.pendingInjections.set(a,{resolve:e=>{clearTimeout(n),A(e)},reject:A=>{clearTimeout(n),e(A)},timeout:n}),t.sendMessage(d))console.log("📤 VoiceSDK v2: Sent data_inject message:",{correlationId:a,dataLength:o.length,source:l});else{t.pendingInjections.delete(a),clearTimeout(n);var i={error:"SEND_FAILED",message:"Failed to send data injection message"};console.warn("VoiceSDK v2: Failed to send data injection message"),t.emit("dataInjectionError",i),e(new Error(i.message))}})})()}handleDataInjectAck(A){var e=A.correlationId;if(e){var t=this.pendingInjections.get(e);t?(this.pendingInjections.delete(e),t.resolve(A),this.emit("dataInjected",{correlationId:e,data:A.data,metadata:A.metadata}),console.log("✅ VoiceSDK v2: Data injection acknowledged:",e)):console.warn("VoiceSDK v2: data_inject_ack received for unknown correlationId:",e)}else console.warn("VoiceSDK v2: data_inject_ack received without correlationId")}handleDataInjectError(A){var e=A.correlationId;if(e){var t=this.pendingInjections.get(e);if(t){this.pendingInjections.delete(e);var n=new Error(A.message||"Data injection failed");n.error=A.error,n.correlationId=e,t.reject(n),this.emit("dataInjectionError",{error:A.error,message:A.message,correlationId:e}),console.warn("❌ VoiceSDK v2: Data injection error:",e,A.error)}else console.warn("VoiceSDK v2: data_inject_error received for unknown correlationId:",e)}else console.warn("VoiceSDK v2: data_inject_error received without correlationId")}handleTranscript(A){if(A.sentenceId&&A.text){var e=A.sentenceId,t={text:A.text,role:A.role||"assistant",sentenceId:e,final:!1!==A.final,timestamp:A.timestamp||Date.now()};this.transcriptQueue.push(t),console.log("📝 VoiceSDK v2: Received transcript for sentence",e,":",t.text),console.log(" Transcript queue length:",this.transcriptQueue.length),console.log(" Current playing sentence:",this.currentPlayingSentenceId),console.log("📝 VoiceSDK v2: Displaying transcript for completed sentence",e),this.emit("transcriptDisplay",t),this.currentPlayingSentenceId=e,this.emit("transcript",t)}else console.warn("⚠️ VoiceSDK v2: Invalid transcript message:",A)}handleBinaryMessage(A){var e=this;return CA(function*(){var t,n=t=A instanceof Blob?yield A.arrayBuffer():A;if(e.formatConverter&&e.formatConverter.needsConversion())try{n=yield e.formatConverter.convert(t),console.log("✅ VoiceSDK v2: Audio converted to requested format")}catch(A){console.error("❌ VoiceSDK v2: Format conversion failed:",A),console.warn(" Using backend format without conversion"),n=t}var o=e.formatConverter&&e.formatConverter.needsConversion()?e.requestedOutputFormat:e.outputAudioFormat||{container:e.config.outputContainer||"raw",encoding:e.config.outputEncoding||"pcm",sampleRate:e.config.outputSampleRate||16e3,bitDepth:e.config.outputBitDepth||16,channels:e.config.outputChannels||1},i=o.container||"raw",r=(o.encoding||"pcm").toLowerCase();if("raw"===i){var s=n;if("pcm"!==r){var a=e.audioPlayer.getCodec(r);if(a){var c=a.decode(new Uint8Array(n));s=c.buffer,console.log("🔄 VoiceSDK v2: Decoded ".concat(r.toUpperCase()," to PCM (").concat(c.byteLength," bytes)"))}else console.warn("⚠️ VoiceSDK v2: No codec for ".concat(r,", treating as PCM"))}e.audioPlayer.outputFormat||(console.warn("⚠️ VoiceSDK v2: outputFormat not set on AudioPlayer, setting from playbackFormat"),e.audioPlayer.setOutputFormat(o)),e.audioFrameCount++,e.audioPlayer.playChunk(s)}else e.audioFrameCount++,e.audioPlayer.playAudio(n)})()}sendMessage(A){if(!this.websocket||this.websocket.readyState!==WebSocket.OPEN)return console.warn("VoiceSDK v2: Cannot send message - not connected"),!1;try{var e=(new Date).toISOString(),t=this.websocket?this.websocket.readyState:"NO_WEBSOCKET",n=this.websocket?{0:"CONNECTING",1:"OPEN",2:"CLOSING",3:"CLOSED"}[t]:"NO_WEBSOCKET";if("client_tool_result"!==A.t&&"client_tool_error"!==A.t||(console.log("📤 VoiceSDK v2: [".concat(e,"] Sending tool ").concat(A.t)),console.log(" 🔌 WebSocket state: ".concat(n," (").concat(t,")")),console.log(" 📋 toolCallId: ".concat(A.toolCallId)),console.log(" 📋 conversationId: ".concat(A.conversationId||"null")),console.log(" 📋 toolName: ".concat(A.toolName)),"client_tool_result"===A.t?console.log(" 📋 result:",A.result):console.log(" 📋 error: ".concat(A.error,", errorCode: ").concat(A.errorCode)),console.log(" 📋 Full message:",JSON.stringify(A,null,2))),!this.websocket||this.websocket.readyState!==WebSocket.OPEN)return console.error("❌ VoiceSDK v2: Cannot send message - WebSocket not open (state: ".concat(n,")")),!1;var o=JSON.stringify(A);return this.websocket.send(o),"client_tool_result"!==A.t&&"client_tool_error"!==A.t||console.log("✅ VoiceSDK v2: [".concat(e,"] Tool ").concat(A.t," message sent successfully (").concat(o.length," bytes)")),!0}catch(A){return console.error("VoiceSDK v2: Error sending message:",A),this.emit("error",A),!1}}sendBinary(A){if(!this.websocket||this.websocket.readyState!==WebSocket.OPEN)return console.warn("VoiceSDK v2: Cannot send audio - not connected"),!1;try{return this.websocket.send(A),!0}catch(A){return console.error("VoiceSDK v2: Error sending audio:",A),this.emit("error",A),!1}}hangup(){if(this.websocket&&this.websocket.readyState===WebSocket.OPEN){console.log("📞 VoiceSDK v2: Hanging up call..."),this.clearStoredConversationId(),this.stopRecording(),this._releaseWakeLock(),this.audioPlayer&&this.stopAudioPlayback();try{this.sendMessage({t:"hangup"}),setTimeout(()=>{this.websocket&&this.websocket.readyState===WebSocket.OPEN&&(this.websocket.close(1e3,"User hangup"),this.websocket=null),this.isConnected=!1},100)}catch(A){console.error("VoiceSDK v2: Error sending hangup message:",A),this.websocket&&(this.websocket.close(1e3,"User hangup"),this.websocket=null),this.isConnected=!1}}}startRecording(){var A=this;return CA(function*(){if(!A.isConnected){var e=new Error("Not connected to voice server");throw A.emit("error",e),e}if(A.isRecording)return console.warn("VoiceSDK v2: Already recording"),!0;console.log("🎤 VoiceSDK v2: Starting recording...");try{if(console.log("🎤 VoiceSDK v2: Requesting microphone permission (mobile-friendly)..."),yield A.audioRecorder.start(),!A.isConnected||!A.websocket||A.websocket.readyState!==WebSocket.OPEN){try{yield A.audioRecorder.stop()}catch(A){}var t=new Error("Connection lost - server may have rejected the call");throw t.name="ServerRejected",t.isServerRejection=!0,t}return yield A.audioPlayer.resumeAudioContext(),A.sendMessage({t:"start_continuous_mode",ttpId:A.generateTtpId()}),A._requestWakeLock(),!0}catch(e){if(A.audioRecorder&&A.audioRecorder.isRecording)try{yield A.audioRecorder.stop()}catch(A){}if(e.isServerRejection||"ServerRejected"===e.name)return!1;if(console.error("❌ VoiceSDK v2: Failed to start recording:",e),"NotAllowedError"===e.name||"PermissionDeniedError"===e.name){var n=new Error("Microphone permission denied. Please allow microphone access in your browser settings and try again.");n.name=e.name,n.originalError=e,A.emit("error",n)}else A.emit("error",e);return!1}})()}stopRecording(){var A=this;return CA(function*(){if(!A.isRecording)return console.warn("VoiceSDK v2: Not recording"),!0;console.log("🛑 VoiceSDK v2: Stopping recording...");try{return A.sendMessage({t:"stop_continuous_mode",ttpId:A.generateTtpId()}),A.isRecording=!1,A.emit("recordingStopped"),console.log("🛑 VoiceSDK v2: Recording stopped (emitted before audioRecorder.stop())"),A._releaseWakeLock(),yield A.audioRecorder.stop(),A.stopAudioPlayback(),!0}catch(e){return console.error("VoiceSDK v2: Error stopping recording:",e),A.emit("error",e),!1}})()}toggleRecording(){var A=this;return CA(function*(){return A.isRecording?yield A.stopRecording():yield A.startRecording()})()}clearTranscriptState(){this.currentPlayingSentenceId=null,console.log("📝 VoiceSDK v2: Cleared transcript state")}_requestWakeLock(){var A=this;return CA(function*(){if("wakeLock"in navigator)if(null!==A.wakeLock||A._wakeLockRequesting)console.log("📱 VoiceSDK v2: Wake lock already active or being requested");else try{A._wakeLockRequesting=!0,A.wakeLock=yield navigator.wakeLock.request("screen"),console.log("📱 VoiceSDK v2: Screen wake lock activated - screen will stay on during call"),A.wakeLock.addEventListener("release",()=>{console.log("📱 VoiceSDK v2: Wake lock released by system"),A.wakeLock=null})}catch(e){console.warn("📱 VoiceSDK v2: Failed to request wake lock:",e.message),A.wakeLock=null}finally{A._wakeLockRequesting=!1}else console.log("📱 VoiceSDK v2: Wake Lock API not available in this browser")})()}_releaseWakeLock(){var A=this;return CA(function*(){if(null!==A.wakeLock)try{yield A.wakeLock.release(),A.wakeLock=null,console.log("📱 VoiceSDK v2: Screen wake lock released")}catch(e){console.warn("📱 VoiceSDK v2: Error releasing wake lock:",e.message),A.wakeLock=null}})()}stopAudioPlayback(){this.audioPlayer.stopImmediate(),this.clearTranscriptState()}handleBargeIn(){var A=this;return CA(function*(){A.stopAudioPlayback(),A.isRecording||(yield A.startRecording())})()}getStatus(){return{version:this.version,isConnected:this.isConnected,isRecording:this.isRecording,isPlaying:this.isPlaying,outputFormat:this.outputAudioFormat,conversationId:this.conversationId,audioPlayer:this.audioPlayer.getStatus(),audioRecorder:this.audioRecorder.getStatus()}}updateConfig(A){this.config=bA(bA({},this.config),A)}generateTtpId(){return"sdk_"+Math.random().toString(36).substr(2,9)+"_"+Date.now()}generateCorrelationId(){if("undefined"!=typeof crypto&&crypto.randomUUID)return crypto.randomUUID();this.injectionCounter++;var A=Date.now(),e=Math.random().toString(36).substr(2,9);return"inj_".concat(A,"_").concat(this.injectionCounter,"_").concat(e)}registerToolHandler(A,e){return this.clientToolsRegistry.registerHandler(A,e)}unregisterToolHandler(A){return this.clientToolsRegistry.unregisterHandler(A)}hasToolHandler(A){return this.clientToolsRegistry.hasHandler(A)}getRegisteredTools(){return this.clientToolsRegistry.getRegisteredTools()}destroy(){if(!this.isDestroyed){if(console.log("🗑️ VoiceSDK v2: Destroying..."),this.isDestroyed=!0,this.isRecording&&this.stopRecording(),this._releaseWakeLock(),this._wakeLockRequesting=!1,this.audioPlayer&&this.stopAudioPlayback(),this.websocket&&(this.websocket.close(),this.websocket=null),this.isConnected=!1,this.pendingInjections.size>0){console.warn("VoiceSDK v2: Rejecting ".concat(this.pendingInjections.size," pending data injections due to destroy"));var A=new Error("SDK destroyed - data injection cancelled");A.error="SDK_DESTROYED",this.pendingInjections.forEach((e,t)=>{clearTimeout(e.timeout),e.reject(A)}),this.pendingInjections.clear()}this.audioPlayer&&this.audioPlayer.destroy(),this.audioRecorder&&this.audioRecorder.destroy(),this.clientToolsRegistry&&this.clientToolsRegistry.getRegisteredTools().forEach(A=>this.clientToolsRegistry.unregisterHandler(A)),this.removeAllListeners()}}}xA(QA,"RESUME_STORAGE_KEY","voice_resume_state"),xA(QA,"RESUME_TTL_MS",1e4),xA(QA,"SUPPORTED_INPUT_ENCODINGS",["pcm","pcmu","pcma"]),xA(QA,"SUPPORTED_INPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),xA(QA,"SUPPORTED_INPUT_BIT_DEPTHS",[8,16,24]),xA(QA,"SUPPORTED_INPUT_CHANNELS",[1]),xA(QA,"SUPPORTED_OUTPUT_ENCODINGS",["pcm","pcmu","pcma"]),xA(QA,"SUPPORTED_OUTPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),xA(QA,"SUPPORTED_OUTPUT_BIT_DEPTHS",[8,16,24]),xA(QA,"SUPPORTED_OUTPUT_CHANNELS",[1]),xA(QA,"SUPPORTED_OUTPUT_CONTAINERS",["raw","wav"]);const FA=QA;function UA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function SA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function IA(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?SA(Object(t),!0).forEach(function(e){EA(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):SA(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function EA(A,e,t){return(e=function(A){var e=function(A){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==typeof e?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}class kA extends h{constructor(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super();var e=this.readScriptTagConfig();this.config=IA({baseWsUrl:"wss://backend.talktopc.com/chat/websocket",appId:A.appId||e.appId,agentId:A.agentId||e.agentId,conversationId:void 0!==A.conversationId?A.conversationId:this.getPersistedConversationId(),forceConversationId:A.forceConversationId,queue:[],inFlight:!1},A),this.fullResponseBuffer=""}readScriptTagConfig(){try{var A=Array.from(document.getElementsByTagName("script")).reverse().find(A=>A.dataset&&(A.dataset.appId||A.dataset.agentId)||A.src&&A.src.includes("agent-widget"));return A?{appId:A.dataset.appId,agentId:A.dataset.agentId}:{}}catch(A){return{}}}buildWebSocketUrl(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.baseWsUrl,e=new URLSearchParams;return this.config.appId&&e.append("appId",this.config.appId),this.config.agentId&&e.append("agentId",this.config.agentId),this.config.conversationId&&e.append("conversationId",this.config.conversationId),"".concat(A,"?").concat(e.toString())}sendMessage(A){var e,t=this;return(e=function*(){return new Promise((e,n)=>{if(A&&A.trim())if(t.config.appId&&t.config.agentId){var o={text:A,resolve:e,reject:n};t.config.inFlight?t.config.queue.push(o):t.executeTask(o)}else n(new Error("Missing appId or agentId"));else n(new Error("Message is empty"))})},function(){var A=this,t=arguments;return new Promise(function(n,o){var i=e.apply(A,t);function r(A){UA(i,n,o,r,s,"next",A)}function s(A){UA(i,n,o,r,s,"throw",A)}r(void 0)})})()}executeTask(A){if(this.config.inFlight=!0,this.fullResponseBuffer="",!this.config.conversationId){var e=this.getPersistedConversationId();e&&(this.config.conversationId=e,console.log("🔍 TextChatSDK hydrated conversationId from storage:",e))}var t=this.buildWebSocketUrl(this.config.baseWsUrl);"undefined"!=typeof __DEV__&&__DEV__&&console.log("[TTPAgentSDK] WebSocket URL:",t);var n=this.config.baseWsUrl.endsWith("/websocket")?this.config.baseWsUrl.replace(/\/websocket$/,""):"".concat(this.config.baseWsUrl,"/websocket"),o=this.buildWebSocketUrl(n),i=!1,r=!1,s=null,a=e=>{if(!r)try{var t={message:A.text},n=this.config.forceConversationId||this.config.conversationId;n&&(t.conversationId=n,this.config.forceConversationId&&!this.config.conversationId&&(this.config.conversationId=n,this.persistConversationId(n))),console.log("🔍 TextChatSDK sending payload:",t,"conversationId in config:",this.config.conversationId),e.send(JSON.stringify(t)),r=!0}catch(t){A.reject(t),this.emit("error",t);try{e.close()}catch(A){}}},c=A=>()=>{this.config.conversationId?a(A):s=setTimeout(()=>a(A),200)},l=e=>t=>{try{try{console.log("🔎 [TextChatSDK] WS <= raw:",t.data)}catch(A){}var n=JSON.parse(t.data);try{console.log("🔎 [TextChatSDK] WS <= parsed:",n)}catch(A){}if("hello"===n.type&&n.conversationId){if(console.log("🔍 TextChatSDK received conversationId:",n.conversationId),this.config.conversationId=n.conversationId,this.persistConversationId(n.conversationId),this.emit&&this.emit("conversationIdChanged",n.conversationId),!r&&e&&1===e.readyState){if(s)try{clearTimeout(s)}catch(A){}a(e)}return}if(!this.config.conversationId&&n.conversationId&&(console.log("🔍 TextChatSDK captured conversationId from message:",n.conversationId),this.config.conversationId=n.conversationId,this.persistConversationId(n.conversationId)),"chunk"===n.type&&"string"==typeof n.content)this.fullResponseBuffer+=n.content,this.emit("chunk",n.content);else if("done"===n.type){try{var o=n.text||n.content||n.answer||n.message||"";o&&!this.fullResponseBuffer&&(this.fullResponseBuffer=o)}catch(A){}!this.config.conversationId&&n.conversationId&&(console.log("🔍 TextChatSDK captured conversationId from done:",n.conversationId),this.config.conversationId=n.conversationId),this.persistConversationId(this.config.conversationId),this.emit("done",{text:this.fullResponseBuffer}),A.resolve({conversationId:this.config.conversationId,fullText:this.fullResponseBuffer});try{e.close()}catch(A){}}else if("error"===n.type){var i=new Error(n.message||"Server error");this.emit("error",i),A.reject(i);try{e.close()}catch(A){}}}catch(A){}},d=e=>{if(1008===e.code&&e.reason&&(e.reason.includes("Domain not whitelisted")||e.reason.includes("domain")||e.reason.includes("whitelist"))){var t=new Error("DOMAIN_NOT_WHITELISTED");return t.reason=e.reason,t.code=e.code,this.emit("domainError",t),A.reject(t),this.config.inFlight=!1,void this.drainQueue()}this.config.inFlight=!1,this.drainQueue()},u=new WebSocket(t);u.onopen=c(u),u.onmessage=l(u),u.onerror=(e=>t=>{if(!i){i=!0;try{e.close()}catch(A){}var n=new WebSocket(o);return n.onopen=c(n),n.onmessage=l(n),n.onerror=e=>{this.emit("error",e),A.reject(e)},void(n.onclose=d)}this.emit("error",t),A.reject(t)})(u),u.onclose=d}drainQueue(){if(0!==this.config.queue.length&&!this.config.inFlight){var A=this.config.queue.shift();this.executeTask(A)}}persistConversationId(A){try{A&&localStorage.setItem("ttp_text_chat_conversation_id",A)}catch(A){}}getPersistedConversationId(){try{return localStorage.getItem("ttp_text_chat_conversation_id")||null}catch(A){return null}}updateConfig(A){this.config=IA(IA({},this.config),A)}destroy(){this.config.queue=[],this.config.inFlight=!1,this.removeAllListeners()}}function HA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}const TA=new class extends h{constructor(){super(),this.connections=new Map,this.connectionCounts=new Map,this.creatingConnections=new Set}getConnection(A){var e,t=this;return(e=function*(){if(t.connections.has(A)){var e=t.connections.get(A);return t.connectionCounts.set(A,(t.connectionCounts.get(A)||0)+1),e}if(t.creatingConnections&&t.creatingConnections.has(A))return new Promise(e=>{var n=()=>{if(t.connections.has(A)){var o=t.connections.get(A);t.connectionCounts.set(A,(t.connectionCounts.get(A)||0)+1),e(o)}else setTimeout(n,50)};n()});t.creatingConnections.add(A);var n=new WebSocket(A);return t.connections.set(A,n),t.connectionCounts.set(A,1),n.addEventListener("open",e=>{t.creatingConnections.delete(A),t.emit("open",e,A)}),n.addEventListener("close",e=>{t.creatingConnections.delete(A),t.connections.delete(A),t.connectionCounts.delete(A),t.emit("close",e,A)}),n.addEventListener("error",e=>{t.creatingConnections.delete(A),t.emit("error",e,A)}),n.addEventListener("message",e=>{t.emit("message",e,A)}),n},function(){var A=this,t=arguments;return new Promise(function(n,o){var i=e.apply(A,t);function r(A){HA(i,n,o,r,s,"next",A)}function s(A){HA(i,n,o,r,s,"throw",A)}r(void 0)})})()}releaseConnection(A){if(this.connections.has(A)){var e=this.connectionCounts.get(A)||0,t=Math.max(0,e-1);if(this.connectionCounts.set(A,t),0===t){var n=this.connections.get(A);n&&n.readyState===WebSocket.OPEN&&n.close(1e3,"No more subscribers"),this.connections.delete(A),this.connectionCounts.delete(A)}}}forceClose(A){if(this.connections.has(A)){var e=this.connections.get(A);e&&e.readyState===WebSocket.OPEN&&e.close(1e3,"Force close"),this.connections.delete(A),this.connectionCounts.delete(A)}}getConnectionStatus(A){return this.connections.has(A)?{exists:!0,readyState:this.connections.get(A).readyState,subscribers:this.connectionCounts.get(A)||0}:{exists:!1,readyState:null,subscribers:0}}getAllConnections(){var A={};for(var[e,t]of this.connections.entries())A[e]={readyState:t.readyState,subscribers:this.connectionCounts.get(e)||0};return A}clearAll(){for(var[A,e]of this.connections.entries())e&&e.readyState===WebSocket.OPEN&&e.close(1e3,"Clear all");this.connections.clear(),this.connectionCounts.clear(),this.creatingConnections.clear()}};function DA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}class KA extends h{constructor(A){super(),this.config=A,this.ws=null,this.isConnected=!1,this.connectionId=null}connect(){var A,e=this;return(A=function*(){return new Promise((A,t)=>{try{e.connectionId=Date.now()+"_"+Math.random().toString(36).substr(2,9),e.connectResolve=A,e.connectReject=t;var n=e.config.signedUrl||e.config.websocketUrl;TA.getConnection(n,e.config).then(t=>{e.ws=t,e.setupEventListeners(),t.readyState===WebSocket.OPEN&&(e.isConnected=!0,e.emit("connected"),A(),e.connectResolve=null,e.connectReject=null)}).catch(A=>{console.error("🔌 WebSocketManager: Connection failed ".concat(e.connectionId),A),t(A),e.connectResolve=null,e.connectReject=null})}catch(A){console.error("🔌 WebSocketManager: Connection error ".concat(e.connectionId),A),t(A),e.connectResolve=null,e.connectReject=null}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){DA(i,n,o,r,s,"next",A)}function s(A){DA(i,n,o,r,s,"throw",A)}r(void 0)})})()}setupEventListeners(){if(this.ws){var A=(A,e)=>{e===(this.config.signedUrl||this.config.websocketUrl)&&(this.isConnected=!0,this.emit("connected"),this.connectResolve&&(this.connectResolve(),this.connectResolve=null,this.connectReject=null))},e=(A,e)=>{e===(this.config.signedUrl||this.config.websocketUrl)&&(this.isConnected=!1,this.emit("disconnected",A))},t=(A,e)=>{e===(this.config.signedUrl||this.config.websocketUrl)&&(this.emit("error",A),this.connectReject&&(this.connectReject(A),this.connectResolve=null,this.connectReject=null))},n=(A,e)=>{e===(this.config.signedUrl||this.config.websocketUrl)&&this.handleMessage(A)};TA.on("open",A),TA.on("close",e),TA.on("error",t),TA.on("message",n),this.eventHandlers={open:A,close:e,error:t,message:n}}}disconnect(){this.eventHandlers&&(TA.off("open",this.eventHandlers.open),TA.off("close",this.eventHandlers.close),TA.off("error",this.eventHandlers.error),TA.off("message",this.eventHandlers.message));var A=this.config.signedUrl||this.config.websocketUrl;A&&TA.releaseConnection(A),this.ws=null,this.isConnected=!1}sendMessage(A){if(this.isConnected&&this.ws)try{this.ws.send(JSON.stringify(A))}catch(A){console.warn("🔌 WebSocketManager: Failed to send message:",A.message)}}sendBinary(A){if(this.isConnected&&this.ws)try{this.ws.send(A)}catch(A){console.warn("🔌 WebSocketManager: Failed to send binary data:",A.message)}}handleMessage(A){if(A.data instanceof ArrayBuffer)this.emit("binaryAudio",A.data);else if(A.data instanceof Blob)A.data.arrayBuffer().then(A=>{this.emit("binaryAudio",A)}).catch(A=>{console.error("🔌 WebSocketManager: Error converting Blob to ArrayBuffer:",A)});else try{var e=JSON.parse(A.data);"barge_in_ack"!==e.t&&"stop_sending"!==e.t||this.emit("bargeIn",e),"stop_playing"===e.t&&this.emit("stopPlaying",e),this.emit("message",e)}catch(A){this.emit("error",A)}}getStatus(){return{isConnected:this.isConnected,readyState:this.ws?this.ws.readyState:null,connectionId:this.connectionId}}static getSingletonStatus(){return TA.getAllConnections()}static clearAllConnections(){TA.clearAll()}}function LA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function MA(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){LA(i,n,o,r,s,"next",A)}function s(A){LA(i,n,o,r,s,"throw",A)}r(void 0)})}}class RA extends h{constructor(A){super(),this.config=A,this.audioContext=null,this.audioQueue=[],this.isPlaying=!1,this.isProcessingQueue=!1,this.currentSource=null,this.audioContextReady=!1,this.initializeAudioContext().catch(()=>{})}initializeAudioContext(){var A=this;return MA(function*(){if(!A.audioContext||"closed"===A.audioContext.state)try{var e={sampleRate:A.config.sampleRate||A.config.outputSampleRate||44100};if(A.audioContext=new(window.AudioContext||window.webkitAudioContext)(e),"suspended"===A.audioContext.state&&(yield A.audioContext.resume()),"running"===A.audioContext.state)try{var t=A.audioContext.sampleRate,n=A.audioContext.createBuffer(1,.01*t,t),o=A.audioContext.createBufferSource();o.buffer=n,o.connect(A.audioContext.destination),o.start(0),o.stop(A.audioContext.currentTime+.01)}catch(A){console.debug("AudioPlayer: AudioContext warmup skipped:",A)}A.audioContextReady=!0}catch(e){console.warn("AudioPlayer: Failed to pre-initialize AudioContext:",e),A.audioContextReady=!1}})()}playAudio(A){try{var e=this.createAudioBlob(A);if(this.audioQueue.push(e),!this.isPlaying&&!this.isProcessingQueue&&!this.currentSource){var t=this.audioContextReady?0:50;setTimeout(()=>this.processQueue(),t)}}catch(A){this.emit("playbackError",A)}}createAudioBlob(A){var e=new Uint8Array(A);if(e.length>=4){if(82===e[0]&&73===e[1]&&70===e[2]&&70===e[3])return new Blob([A],{type:"audio/wav"});if(255===e[0]&&!(224&~e[1]))return new Blob([A],{type:"audio/mpeg"});if(79===e[0]&&103===e[1]&&103===e[2]&&83===e[3])return new Blob([A],{type:"audio/ogg"})}return new Blob([A],{type:"audio/wav"})}processQueue(){var A=this;return MA(function*(){if(!A.isProcessingQueue&&0!==A.audioQueue.length){A.isProcessingQueue=!0;var e=A.audioQueue.shift();if(e)try{var t=!A.isPlaying&&null===A.currentSource;A.audioContext&&"closed"!==A.audioContext.state||(yield A.initializeAudioContext());var n=A.audioContext;"suspended"===n.state&&(yield n.resume(),t&&(yield new Promise(A=>setTimeout(A,10)))),"running"!==n.state&&(console.warn("AudioPlayer: AudioContext not in running state:",n.state),"suspended"===n.state&&(yield n.resume(),yield new Promise(A=>setTimeout(A,10))));var o=yield e.arrayBuffer(),i=yield n.decodeAudioData(o),r=t&&!A.isPlaying&&null===A.currentSource,s=n.createBufferSource();s.buffer=i,s.connect(n.destination),A.currentSource=s,A.isPlaying=!0,r&&A.emit("playbackStarted"),s.onended=()=>{A.currentSource=null,A.isProcessingQueue=!1,A.audioQueue.length>0?setTimeout(()=>A.processQueue(),0):setTimeout(()=>{0!==A.audioQueue.length||A.currentSource||(A.isPlaying=!1,A.emit("playbackStopped"))},100)},s.start()}catch(e){A.currentSource=null,A.emit("playbackError",e),A.audioQueue.length>0?(A.isProcessingQueue=!1,setTimeout(()=>A.processQueue(),100)):(A.isPlaying=!1,A.isProcessingQueue=!1,A.emit("playbackStopped"))}else A.isProcessingQueue=!1}})()}stop(){this.stopImmediate()}stopImmediate(){var A=this.isPlaying||null!==this.currentSource;if(this.currentSource){try{this.currentSource.stop()}catch(A){}this.currentSource=null}this.isPlaying=!1,this.isProcessingQueue=!1,this.audioQueue=[],A&&this.emit("playbackStopped")}resumeAudioContext(){var A=this;return MA(function*(){if(A.audioContext&&"closed"!==A.audioContext.state){if("suspended"===A.audioContext.state)try{yield A.audioContext.resume(),console.log("✅ AudioPlayer: AudioContext resumed after mic permission")}catch(A){console.warn("⚠️ AudioPlayer: Failed to resume AudioContext:",A)}}else yield A.initializeAudioContext()})()}getStatus(){return{isPlaying:this.isPlaying,isProcessingQueue:this.isProcessingQueue,queueLength:this.audioQueue.length,audioContextState:this.audioContext?this.audioContext.state:"closed"}}destroy(){this.stop(),this.audioContext&&"closed"!==this.audioContext.state&&(this.audioContext.close(),this.audioContext=null),this.audioContextReady=!1}}var PA=i(848);function OA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function VA(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?OA(Object(t),!0).forEach(function(e){_A(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):OA(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function _A(A,e,t){return(e=function(A){var e=function(A){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==typeof e?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function NA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}const GA=n=>{var{signedUrl:o,websocketUrl:i,agentId:r,appId:s,voice:a="default",language:c="en",autoReconnect:l=!0,agentSettingsOverride:d=null,visualAssistant:u=null,onConnected:g,onDisconnected:p,onRecordingStarted:h,onRecordingStopped:B,onPlaybackStarted:m,onPlaybackStopped:f,onError:v,onMessage:w,onBargeIn:C,onStopPlaying:y,onStartConversation:b,onEndConversation:x,className:Q="",style:F={},children:U}=n,[S,I]=t(!1),[E,k]=t(!1),[H,T]=t(!1),[D,K]=t("Disconnected"),L=e(null);A(()=>{console.log("🎙️ VoiceButton: Creating VoiceSDK_v2 instance for ".concat(i||o)),L.current&&(console.log("🎙️ VoiceButton: Destroying existing VoiceSDK_v2 instance"),L.current.destroy(),L.current=null);var A=new FA({signedUrl:i||o,websocketUrl:i||o,agentId:r,appId:s,voice:a,language:c,autoReconnect:l,agentSettingsOverride:d,visualAssistant:u,onStartConversation:b,onEndConversation:x});return A.on("connected",()=>{I(!0),K("Connected"),null==g||g()}),A.on("disconnected",()=>{I(!1),K("Disconnected"),null==p||p()}),A.on("recordingStarted",()=>{k(!0),null==h||h()}),A.on("recordingStopped",()=>{k(!1),null==B||B()}),A.on("playbackStarted",()=>{T(!0),null==m||m()}),A.on("playbackStopped",()=>{T(!1),null==f||f()}),A.on("error",A=>{null==v||v(A)}),A.on("message",A=>{null==w||w(A)}),A.on("bargeIn",A=>{null==C||C(A)}),A.on("stopPlaying",A=>{null==y||y(A)}),L.current=A,A.connect(),()=>{var A=o||i;console.log("🎙️ VoiceButton: Cleaning up VoiceSDK instance for ".concat(A)),L.current&&(L.current.destroy(),L.current=null)}},[o,i,r,s,a,c,d,u]);var M=function(){var A,e=(A=function*(){if(L.current)try{yield L.current.toggleRecording()}catch(A){console.error("Error toggling recording:",A)}},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){NA(i,n,o,r,s,"next",A)}function s(A){NA(i,n,o,r,s,"throw",A)}r(void 0)})});return function(){return e.apply(this,arguments)}}(),R=(0,PA.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,PA.jsx)("div",{style:{fontSize:"20px"},children:E?"🔴":"🎤"}),(0,PA.jsx)("div",{children:E?"Stop Listening":"Start Listening"})]});return(0,PA.jsx)("button",{className:"voice-button ".concat(E?"recording":""," ").concat(Q),style:VA({padding:"12px 24px",border:"none",borderRadius:"8px",backgroundColor:E?"#dc3545":"#007bff",color:"white",cursor:"pointer",fontSize:"16px",fontWeight:"500",transition:"all 0.2s ease"},F),onClick:M,disabled:!S,children:U||R})};function WA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function jA(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){WA(i,n,o,r,s,"next",A)}function s(A){WA(i,n,o,r,s,"throw",A)}r(void 0)})}}function zA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function XA(A,e,t){return(e=function(A){var e=function(A){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==typeof e?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}class JA{constructor(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=function(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?zA(Object(t),!0).forEach(function(e){XA(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):zA(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}({websocketUrl:A.websocketUrl||"wss://speech.talktopc.com/ws/conv",agentId:A.agentId,voice:A.voice||"default",language:A.language||"en",container:A.container||document.body,buttonText:A.buttonText||"Start Listening",buttonClass:A.buttonClass||"voice-button"},A),this.isConnected=!1,this.isRecording=!1,this.isPlaying=!1;var e=this.options.websocketUrl||this.options.signedUrl;"undefined"!=typeof __DEV__&&__DEV__&&console.log("[TTPAgentSDK] WebSocket URL:",e),this.voiceSDK=new FA({signedUrl:e,websocketUrl:e,agentId:this.options.agentId,appId:this.options.appId,voice:this.options.voice,language:this.options.language,visualAssistant:this.options.visualAssistant}),this.setupEventListeners(),this.createButton(),this.connect()}setupEventListeners(){this.voiceSDK.on("connected",()=>{var A,e;this.isConnected=!0,this.updateButton(),null===(A=(e=this.options).onConnected)||void 0===A||A.call(e)}),this.voiceSDK.on("disconnected",()=>{var A,e;this.isConnected=!1,this.updateButton(),null===(A=(e=this.options).onDisconnected)||void 0===A||A.call(e)}),this.voiceSDK.on("recordingStarted",()=>{var A,e;this.isRecording=!0,this.updateButton(),null===(A=(e=this.options).onRecordingStarted)||void 0===A||A.call(e)}),this.voiceSDK.on("recordingStopped",()=>{var A,e;this.isRecording=!1,this.updateButton(),null===(A=(e=this.options).onRecordingStopped)||void 0===A||A.call(e)}),this.voiceSDK.on("playbackStarted",()=>{var A,e;this.isPlaying=!0,null===(A=(e=this.options).onPlaybackStarted)||void 0===A||A.call(e)}),this.voiceSDK.on("playbackStopped",()=>{var A,e;this.isPlaying=!1,null===(A=(e=this.options).onPlaybackStopped)||void 0===A||A.call(e)}),this.voiceSDK.on("error",A=>{var e,t;null===(e=(t=this.options).onError)||void 0===e||e.call(t,A)}),this.voiceSDK.on("message",A=>{var e,t;null===(e=(t=this.options).onMessage)||void 0===e||e.call(t,A)}),this.voiceSDK.on("bargeIn",A=>{var e,t;null===(e=(t=this.options).onBargeIn)||void 0===e||e.call(t,A)}),this.voiceSDK.on("stopPlaying",A=>{var e,t;null===(e=(t=this.options).onStopPlaying)||void 0===e||e.call(t,A)})}createButton(){this.button=document.createElement("button"),this.button.className=this.options.buttonClass,this.button.style.cssText="\n padding: 12px 24px;\n border: none;\n border-radius: 8px;\n background-color: #6c757d;\n color: white;\n cursor: pointer;\n font-size: 16px;\n font-weight: 500;\n transition: all 0.2s ease;\n display: flex;\n align-items: center;\n gap: 8px;\n ",this.button.addEventListener("click",()=>this.toggleRecording()),this.options.container.appendChild(this.button),this.updateButton()}updateButton(){if(this.button){var A=this.isRecording?"🔴":"🎤",e=this.isRecording?"Stop Listening":"Start Listening";this.button.innerHTML='\n <span style="font-size: 20px;">'.concat(A,"</span>\n <span>").concat(e,"</span>\n "),this.button.disabled=!this.isConnected,this.button.style.backgroundColor=this.isRecording?"#dc3545":this.isConnected?"#007bff":"#6c757d"}}connect(){var A=this;return jA(function*(){try{yield A.voiceSDK.connect()}catch(A){console.error("Failed to connect:",A)}})()}toggleRecording(){var A=this;return jA(function*(){if(A.voiceSDK)try{yield A.voiceSDK.toggleRecording()}catch(A){console.error("Error toggling recording:",A)}})()}getStatus(){return{isConnected:this.isConnected,isRecording:this.isRecording,isPlaying:this.isPlaying}}updateConfig(A){this.voiceSDK.updateConfig(A)}destroy(){this.button&&this.button.parentNode&&this.button.parentNode.removeChild(this.button),this.voiceSDK&&this.voiceSDK.destroy()}}function YA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function qA(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){YA(i,n,o,r,s,"next",A)}function s(A){YA(i,n,o,r,s,"throw",A)}r(void 0)})}}class ZA{constructor(A){console.log("🚀 AgentSDK v2.1.8 initialized with config:",A),this.config=A,this.voiceSDK=null,this.isConnected=!1,this.isListening=!1,this.wasListening=!1,this._resumeInfo=null,this.onConnected=()=>{},this.onDisconnected=()=>{},this.onError=A=>console.error("SDK Error:",A),this.onTranscript=A=>{},this.onAgentSpeaking=A=>{},this.onConversationStart=A.onConversationStart||(()=>{}),this.onConversationEnd=A.onConversationEnd||(()=>{}),this.onBargeIn=A.onBargeIn||(()=>{}),this.onAudioStartPlaying=A.onAudioStartPlaying||(()=>{}),this.onAudioStoppedPlaying=A.onAudioStoppedPlaying||(()=>{}),this.onSubtitleDisplay=A.onSubtitleDisplay||(()=>{})}checkResumeBeforeConnect(){if(void 0!==this._resumeChecked)return this._resumeInfo;try{var A,e=this.config.visualAssistant||(null===(A=this.config.agentSettingsOverride)||void 0===A?void 0:A.visualAssistant),t=new FA({signedUrl:"wss://placeholder",autoReconnect:!1,agentId:this.config.agentId,appId:this.config.appId,language:this.config.language||"en",visualAssistant:e,protocolVersion:2}).checkAndResume();return this._resumeChecked=!0,t?(console.log("🔄 [AGENT SDK] Found resume state before connect:",t),this._resumeInfo=t,t):(this._resumeInfo=null,null)}catch(A){return console.warn("⚠️ [AGENT SDK] Error checking resume:",A),this._resumeChecked=!0,this._resumeInfo=null,null}}connect(A){var e=this;return qA(function*(){try{var t;if(!A)throw new Error("signedUrl is required");e.voiceSDK&&(console.log("🔌 AgentSDK: Cleaning up existing connection"),e.voiceSDK.destroy(),e.voiceSDK=null);var n=e.config.visualAssistant||(null===(t=e.config.agentSettingsOverride)||void 0===t?void 0:t.visualAssistant);if(e.voiceSDK=new FA({signedUrl:A,autoReconnect:!1,agentId:e.config.agentId,appId:e.config.appId,language:e.config.language||"en",agentSettingsOverride:e.config.agentSettingsOverride,visualAssistant:n,protocolVersion:2,outputContainer:e.config.outputContainer||"raw",outputEncoding:e.config.outputEncoding||"pcm",outputSampleRate:e.config.outputSampleRate||44100,outputChannels:e.config.outputChannels||1,outputBitDepth:e.config.outputBitDepth||16}),e._resumeInfo&&(console.log("🔄 [AGENT SDK] Using stored resume info:",e._resumeInfo),console.log(" From:",e._resumeInfo.fromPage,"→ To:",e._resumeInfo.toPage)),e.voiceSDK.on("connected",()=>{e.isConnected=!0,e.onConnected()}),setTimeout(()=>{e.voiceSDK&&e.voiceSDK.isConnected&&!e.isConnected&&(e.isConnected=!0,e.onConnected())},10),e.voiceSDK.on("disconnected",A=>{if(e.isConnected=!1,A&&1008===A.code&&A.reason&&(A.reason.includes("Domain not whitelisted")||A.reason.includes("domain")||A.reason.includes("whitelist"))){var t=new Error("DOMAIN_NOT_WHITELISTED");t.reason=A.reason,t.code=A.code,e.onError(t)}if((e.isListening||e.wasListening)&&(console.log("🎤 [AGENT SDK] disconnected event - calling onConversationEnd hook (isListening:",e.isListening,", wasListening:",e.wasListening,")"),e.onConversationEnd&&"function"==typeof e.onConversationEnd))try{e.onConversationEnd(),console.log("🎤 [AGENT SDK] ✅ onConversationEnd hook called from disconnected event"),e.wasListening=!1}catch(A){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationEnd from disconnected:",A)}e.onDisconnected()}),e.voiceSDK.on("domainError",A=>{e.onError(A)}),e.voiceSDK.on("error",A=>{e.onError(A)}),e.voiceSDK.on("message",A=>{e.handleWebSocketMessage(A)}),e.voiceSDK.on("recordingStarted",()=>{if(e.isListening=!0,e.wasListening=!0,e.onConversationStart&&"function"==typeof e.onConversationStart)try{e.onConversationStart()}catch(A){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationStart:",A)}}),e.voiceSDK.on("recordingStopped",()=>{console.log("🎤 [AGENT SDK] recordingStopped event received");var A=e.isListening;if(e.isListening=!1,A&&e.onConversationEnd&&"function"==typeof e.onConversationEnd)try{console.log("🎤 [AGENT SDK] ✅ Calling onConversationEnd hook from recordingStopped"),e.onConversationEnd(),console.log("🎤 [AGENT SDK] ✅ onConversationEnd hook called successfully"),e.wasListening=!1}catch(A){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationEnd:",A)}}),e.voiceSDK.on("playbackStarted",()=>{e.onAgentSpeaking(!0),e.onAudioStartPlaying()}),e.voiceSDK.on("playbackStopped",()=>{e.onAgentSpeaking(!1),e.onAudioStoppedPlaying()}),e.voiceSDK.on("bargeIn",A=>{e.onBargeIn(A)}),e.voiceSDK.on("transcriptDisplay",A=>{console.log("📝 [AGENT SDK] transcriptDisplay event received:",A),A&&A.text&&(console.log("📝 [AGENT SDK] Calling onTranscript with text:",A.text),e.onTranscript&&"function"==typeof e.onTranscript?e.onTranscript(A.text):console.warn("📝 [AGENT SDK] ⚠️ onTranscript is not a function!",typeof e.onTranscript)),e.onSubtitleDisplay(A)}),e._pendingToolHandlers&&e._pendingToolHandlers.size>0)for(var[o,i]of(console.log("🔧 AgentSDK: Registering ".concat(e._pendingToolHandlers.size," pending tool handlers")),e._pendingToolHandlers))e.voiceSDK.registerToolHandler(o,i);yield e.voiceSDK.connect()}catch(A){throw e.onError(A),A}})()}handleWebSocketMessage(A){switch(A.t||A.type){case"connected":case"hello_ack":console.log("Session started successfully");break;case"user_transcript":this.onTranscript(A.user_transcription||A.text||A.transcript);break;case"agent_response":case"barge_in":case"stop_playing":default:break;case"error":this.onError(new Error(A.message||A.error||"Unknown error"))}}startListening(){var A=this;return qA(function*(){if(console.log("🎤 AgentSDK: startListening() called"),!A.voiceSDK)throw console.error("❌ AgentSDK: No voiceSDK instance available"),new Error("No voiceSDK instance available");try{console.log("🎤 AgentSDK: Starting recording..."),(yield A.voiceSDK.startRecording())&&console.log("✅ AgentSDK: Recording started successfully")}catch(A){if(A.isServerRejection||"ServerRejected"===A.name)throw A;throw console.error("❌ AgentSDK: Failed to start recording:",A),A}})()}stopListening(){this.voiceSDK&&this.voiceSDK.stopRecording()}hangup(){this.voiceSDK&&this.voiceSDK.hangup()}updateVariables(A){this.voiceSDK&&this.isConnected&&this.voiceSDK.sendMessage({t:"update_variables",variables:A})}disconnect(){this.voiceSDK&&(this.voiceSDK.destroy(),this.voiceSDK=null),this.isConnected=!1,this.isListening=!1}registerToolHandler(A,e){if(this.voiceSDK)return this.voiceSDK.registerToolHandler(A,e);this._pendingToolHandlers||(this._pendingToolHandlers=new Map),this._pendingToolHandlers.set(A,e),console.log("🔧 AgentSDK: Queued tool handler '".concat(A,"' for registration after connect"))}unregisterToolHandler(A){if(this.voiceSDK)return this.voiceSDK.unregisterToolHandler(A);this._pendingToolHandlers&&this._pendingToolHandlers.delete(A)}hasToolHandler(A){var e;return this.voiceSDK?this.voiceSDK.hasToolHandler(A):(null===(e=this._pendingToolHandlers)||void 0===e?void 0:e.has(A))||!1}getRegisteredTools(){return this.voiceSDK?this.voiceSDK.getRegisteredTools():this._pendingToolHandlers?Array.from(this._pendingToolHandlers.keys()):[]}}function $A(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function Ae(){var A=navigator.userAgent,e=/iPad|iPhone|iPod/.test(A)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,t=/Android/.test(A),n=/Mac/.test(A)&&!e,o=/Win/.test(A),i=/Chrome/.test(A)&&!/Edg|OPR/.test(A),r=/Safari/.test(A)&&!/Chrome/.test(A),s=/Firefox/.test(A),a=/Edg/.test(A),c=/SamsungBrowser/.test(A),l="unknown";e?l="safari":c?l="samsung":i?l="chrome":r?l="safari":s?l="firefox":a&&(l="edge");var d="unknown";return e?d="ios":t?d="android":n?d="mac":o&&(d="windows"),{platform:d,browser:l,isIOS:e,isAndroid:t,isMac:n,isWindows:o,isMobile:e||t,isDesktop:!e&&!t}}function ee(){return te.apply(this,arguments)}function te(){var A;return A=function*(){try{if(navigator.permissions&&navigator.permissions.query)return(yield navigator.permissions.query({name:"microphone"})).state}catch(A){console.log("⚠️ MicPermissionUtils: Permissions API not available or not supported for microphone")}return"unknown"},te=function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){$A(i,n,o,r,s,"next",A)}function s(A){$A(i,n,o,r,s,"throw",A)}r(void 0)})},te.apply(this,arguments)}function ne(A){var{platform:e,browser:t}=A,n={ios:{title:"Enable Microphone on iPhone/iPad",icon:"📱",steps:["Tap the <strong>lock icon 🔒</strong>, <strong>information icon ℹ️</strong>, or <strong>AA icon</strong> in the address bar","Tap <strong>Website Settings</strong> or <strong>Permissions</strong>","Find <strong>Microphone</strong> and set it to <strong>Allow</strong>","Return to this page and refresh"],altTitle:"Alternative Method",altSteps:["Open the <strong>Settings</strong> app on your device","Scroll down and tap <strong>Safari</strong> (or your browser app)",'Tap <strong>Microphone</strong> under "Settings for Websites"',"Set it to <strong>Allow</strong> or <strong>Ask</strong>","Return to this page and refresh"],note:"On iOS, you can also change permissions in the browser address bar or in device Settings.",canOpenSettings:!0,settingsButtonText:"Open Settings App"},android_chrome:{title:"Enable Microphone in Chrome",icon:"🤖",steps:["Tap the <strong>lock icon 🔒</strong>, <strong>information icon ℹ️</strong>, or <strong>settings icon ⋮</strong> in the address bar","Tap <strong>Permissions</strong>","Tap <strong>Microphone</strong>","Select <strong>Allow</strong>","The page will refresh automatically"],altTitle:"Alternative Method",altSteps:["Tap the <strong>⋮ menu</strong> (three dots)","Tap <strong>Settings → Site settings → Microphone</strong>","Find this website and set to <strong>Allow</strong>"],canOpenSettings:!0,settingsButtonText:"Open App Settings"},android_firefox:{title:"Enable Microphone in Firefox",icon:"🦊",steps:["Tap the <strong>lock icon 🔒</strong> or <strong>information icon ℹ️</strong> in the address bar","Tap <strong>Edit Site Permissions</strong>","Toggle <strong>Microphone</strong> to enabled","Refresh the page"],canOpenSettings:!1},android_samsung:{title:"Enable Microphone in Samsung Browser",icon:"📱",steps:["Tap the <strong>menu icon</strong> (three lines)","Tap <strong>Settings → Sites and downloads</strong>","Tap <strong>Site permissions → Microphone</strong>","Find this website and set to <strong>Allow</strong>","Return and refresh the page"],canOpenSettings:!1},desktop_chrome:{title:"Enable Microphone in Chrome",icon:"🌐",steps:["Click the <strong>lock icon 🔒</strong> or <strong>information icon ℹ️</strong> in the address bar (left side)","Find <strong>Microphone</strong> in the dropdown menu",'Change it from "Block" to <strong>Allow</strong>',"Click the <strong>Refresh</strong> button or press F5"],showAddressBarHint:!0,canOpenSettings:!1},desktop_safari:{title:"Enable Microphone in Safari",icon:"🧭",steps:["Click <strong>Safari</strong> in the menu bar (top of screen)","Click <strong>Settings for This Website...</strong>","Find <strong>Microphone</strong> in the popup","Change it to <strong>Allow</strong>","Close settings and refresh the page"],canOpenSettings:!1},desktop_firefox:{title:"Enable Microphone in Firefox",icon:"🦊",steps:["Click the <strong>lock icon 🔒</strong> in the address bar",'Click the <strong>X</strong> next to "Blocked" for Microphone',"Refresh the page (press F5)","Click <strong>Allow</strong> when prompted again"],note:"Firefox requires you to clear the block and then re-allow on the next prompt.",showAddressBarHint:!0,canOpenSettings:!1},desktop_edge:{title:"Enable Microphone in Edge",icon:"🌐",steps:["Click the <strong>lock icon 🔒</strong> in the address bar","Find <strong>Microphone</strong> in the permissions list","Change it to <strong>Allow</strong>","Refresh the page"],showAddressBarHint:!0,canOpenSettings:!1},unknown:{title:"Enable Microphone Access",icon:"🎤",steps:["Look for a <strong>lock icon 🔒</strong>, <strong>information icon ℹ️</strong>, or <strong>settings icon</strong> in your browser's address bar","Find the <strong>Microphone</strong> permission setting","Change it to <strong>Allow</strong>","Refresh this page"],canOpenSettings:!1}};return"ios"===e?n.ios:"android"===e?n["android_".concat(t)]||n.android_chrome:n["desktop_".concat(t)]||n.desktop_chrome}function oe(A){var{isIOS:e,isAndroid:t,browser:n}=A;if(e)try{return window.location.href="app-settings:",!0}catch(A){return console.warn("Could not open iOS settings:",A),!1}if(t&&"chrome"===n)try{return window.location.href="intent:#Intent;action=android.settings.APPLICATION_DETAILS_SETTINGS;data=package:com.android.chrome;end",!0}catch(A){return console.warn("Could not open Android settings:",A),!1}return!1}class ie{constructor(){this.overlay=null,this.modal=null}createOverlay(){var A=document.createElement("div");return A.className="mic-permission-overlay",A.style.cssText="\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.6);\n backdrop-filter: blur(4px);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n padding: 20px;\n animation: mic-fadeIn 0.2s ease-out;\n ",document.getElementById("mic-permission-styles")||this.injectStyles(),A}injectStyles(){if(!document.getElementById("mic-permission-styles")){var A=document.createElement("style");A.id="mic-permission-styles",A.textContent="\n @keyframes mic-fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n \n @keyframes mic-slideUp {\n from {\n opacity: 0;\n transform: translateY(20px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n \n @keyframes mic-bounce {\n 0%, 100% { transform: translateY(0); }\n 50% { transform: translateY(-5px); }\n }\n \n .mic-permission-overlay {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.6);\n backdrop-filter: blur(4px);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n padding: 20px;\n animation: mic-fadeIn 0.2s ease-out;\n }\n \n .mic-permission-modal {\n background: #ffffff;\n border-radius: 16px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n max-width: 480px;\n width: 100%;\n padding: 32px;\n position: relative;\n animation: mic-slideUp 0.3s ease-out;\n max-height: 90vh;\n overflow-y: auto;\n }\n \n .mic-permission-modal__close {\n position: absolute;\n top: 16px;\n right: 16px;\n background: none;\n border: none;\n font-size: 20px;\n cursor: pointer;\n color: #6b7280;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background 0.2s;\n }\n \n .mic-permission-modal__close:hover {\n background: #e5e7eb;\n }\n \n .mic-permission-modal__icon {\n font-size: 48px;\n text-align: center;\n margin-bottom: 16px;\n }\n \n .mic-permission-modal__title {\n font-size: 24px;\n font-weight: 700;\n color: #111827;\n margin: 0 0 12px;\n line-height: 1.3;\n text-align: center;\n }\n \n .mic-permission-modal__description {\n color: #6b7280;\n font-size: 16px;\n line-height: 1.6;\n margin: 0 0 20px;\n text-align: center;\n }\n \n .mic-permission-modal__highlight {\n display: flex;\n align-items: center;\n gap: 12px;\n background: linear-gradient(135deg, #dbeafe, #ede9fe);\n padding: 16px 20px;\n border-radius: 8px;\n margin-bottom: 20px;\n border: 1px solid #bfdbfe;\n }\n \n .mic-permission-modal__highlight-icon {\n font-size: 24px;\n animation: mic-bounce 1s infinite;\n }\n \n .mic-permission-modal__status {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background: #fef2f2;\n color: #ef4444;\n padding: 12px 16px;\n border-radius: 8px;\n margin-bottom: 20px;\n font-weight: 500;\n }\n \n .mic-permission-modal__note {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n background: #fffbeb;\n color: #92400e;\n padding: 12px 16px;\n border-radius: 8px;\n margin-bottom: 20px;\n font-size: 14px;\n line-height: 1.5;\n border: 1px solid #fde68a;\n }\n \n .mic-permission-modal__steps {\n margin-bottom: 20px;\n }\n \n .mic-permission-modal__steps h3 {\n font-size: 14px;\n font-weight: 600;\n color: #6b7280;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n margin: 0 0 12px;\n }\n \n .mic-permission-modal__steps ol {\n margin: 0;\n padding-left: 24px;\n counter-reset: step-counter;\n list-style: none;\n }\n \n .mic-permission-modal__steps li {\n position: relative;\n padding: 12px 0 12px 16px;\n border-left: 2px solid #e5e7eb;\n color: #111827;\n font-size: 15px;\n line-height: 1.5;\n counter-increment: step-counter;\n }\n \n .mic-permission-modal__steps li::before {\n content: counter(step-counter);\n position: absolute;\n left: -14px;\n top: 10px;\n width: 24px;\n height: 24px;\n background: #4f46e5;\n color: white;\n border-radius: 50%;\n font-size: 12px;\n font-weight: 600;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n .mic-permission-modal__steps li:last-child {\n border-left-color: transparent;\n }\n \n .mic-permission-modal__actions {\n display: flex;\n flex-direction: column;\n gap: 10px;\n margin-top: 24px;\n }\n \n .mic-permission-modal__btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n padding: 14px 24px;\n border-radius: 8px;\n font-size: 16px;\n font-weight: 600;\n cursor: pointer;\n transition: all 0.2s;\n border: none;\n width: 100%;\n }\n \n .mic-permission-modal__btn--primary {\n background: #4f46e5;\n color: white;\n }\n \n .mic-permission-modal__btn--primary:hover {\n background: #4338ca;\n transform: translateY(-1px);\n }\n \n .mic-permission-modal__btn--secondary {\n background: #e5e7eb;\n color: #111827;\n }\n \n .mic-permission-modal__btn--secondary:hover {\n background: #d1d5db;\n }\n \n .mic-permission-modal__footer {\n text-align: center;\n font-size: 13px;\n color: #6b7280;\n margin-top: 20px;\n margin-bottom: 0;\n }\n \n .mic-permission-modal__visual-guide {\n width: 100%;\n max-width: 380px;\n height: auto;\n margin: 20px auto;\n border-radius: 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\n display: block;\n }\n \n .mic-permission-modal__visual-guide-container {\n text-align: center;\n margin: 20px 0;\n }\n \n @media (max-width: 480px) {\n .mic-permission-modal {\n padding: 24px 20px;\n margin: 10px;\n max-height: 85vh;\n }\n \n .mic-permission-modal__title {\n font-size: 20px;\n }\n \n .mic-permission-modal__icon {\n font-size: 40px;\n }\n \n .mic-permission-modal__visual-guide {\n max-width: 100%;\n }\n }\n ",document.head.appendChild(A)}}close(){this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.overlay=null,this.modal=null}show(){this.overlay&&this.modal&&document.body.appendChild(this.overlay)}}function re(A,e){var t=new ie,n=t.createOverlay(),o=Ae(),i=document.createElement("div");return i.className="mic-permission-modal",i.innerHTML='\n <div class="mic-permission-modal__icon">🎤</div>\n <h2 class="mic-permission-modal__title">Enable Your Microphone</h2>\n <p class="mic-permission-modal__description">\n To start a voice call with our agent, we need access to your microphone.\n </p>\n <div class="mic-permission-modal__highlight">\n <span class="mic-permission-modal__highlight-icon">👆</span>\n <span>Please click <strong>"Allow"</strong> on the next popup</span>\n </div>\n '.concat(o.isIOS?'\n <div class="mic-permission-modal__note">\n <span>ℹ️</span>\n <span>On iPhone/iPad, you may need to allow microphone access in your device Settings.</span>\n </div>\n ':"",'\n <div class="mic-permission-modal__actions">\n <button class="mic-permission-modal__btn mic-permission-modal__btn--primary" data-action="accept">\n Continue\n </button>\n <button class="mic-permission-modal__btn mic-permission-modal__btn--secondary" data-action="cancel">\n Not Now\n </button>\n </div>\n '),n.appendChild(i),t.overlay=n,t.modal=i,i.querySelector('[data-action="accept"]').addEventListener("click",()=>{t.close(),A()}),i.querySelector('[data-action="cancel"]').addEventListener("click",()=>{t.close(),e()}),n.addEventListener("click",A=>{A.target===n&&(t.close(),e())}),t.show(),t}function se(A,e){var t,n,o,i=new ie,r=i.createOverlay(),s=Ae(),a=ne(s),c=document.createElement("div");c.className="mic-permission-modal";var l="";a.altSteps&&a.altSteps.length>0&&(l='\n <div style="margin-top: 20px; border-top: 1px solid #e5e7eb; padding-top: 16px;">\n <button class="mic-permission-modal__alt-toggle" style="background: none; border: none; color: #4f46e5; font-size: 14px; font-weight: 500; cursor: pointer; padding: 0; margin-bottom: 12px;">\n ▼ '.concat(a.altTitle||"Alternative method",'\n </button>\n <ol style="margin: 0; padding-left: 20px; display: none;">\n ').concat(a.altSteps.map(A=>'<li style="padding: 8px 0; font-size: 14px; color: #6b7280;">'.concat(A,"</li>")).join(""),"\n </ol>\n </div>\n "));var d=function(A){var{platform:e,browser:t}=A,n=document.getElementsByTagName("script"),o="";for(var i of n){var r=i.src;if(r&&(r.includes("agent-widget.js")||r.includes("ttp-agent-sdk")||r.includes("ttp-sdk-front")))try{new URL(r),o=r.substring(0,r.lastIndexOf("/"));break}catch(A){var s=r.match(/^(.*\/)[^\/]+$/);if(s){o=s[1];break}}}var a;if(a="ios"===e?"ios-settings.svg":"android"===e?"android-chrome.svg":"chrome"===t?"desktop-chrome.svg":"safari"===t?"desktop-safari.svg":"firefox"===t?"desktop-firefox.svg":"edge"===t?"desktop-edge.svg":"desktop-chrome.svg",!o||""===o||o.startsWith("/")){for(var c of n){var l=c.src;if(l&&(l.includes("cdn.talktopc.com")||l.includes("talktopc.com"))){if(l.includes("/ttp-agent-sdk/")||l.includes("/ttp-sdk-front/")){var d=l.match(/(https?:\/\/[^\/]+(?:\/[^\/]+)*)/);if(d){o=d[1].replace(/\/[^\/]+\.js$/,"");break}}if(!o&&(l.includes("cdn.talktopc.com")||l.includes("talktopc.com"))){o="https://cdn.talktopc.com/ttp-agent-sdk";break}}}if(!o||""===o)if(window.location.hostname.includes("cdn.talktopc.com")||window.location.hostname.includes("talktopc.com"))o="https://cdn.talktopc.com/ttp-agent-sdk";else{var u=window.location.pathname.split("/");u.pop(),(o=window.location.origin+u.join("/"))&&o!==window.location.origin||(o=window.location.origin)}}o=o.replace(/\/$/,"");var g="".concat(o,"/shared/mic-permission-assets/").concat(a);return"undefined"!=typeof console&&console.log&&console.log("[MicPermission] Visual guide path:",g,"Base path:",o,"Platform:",e,"Browser:",t),g}(s);c.innerHTML='\n <button class="mic-permission-modal__close" data-action="close">✕</button>\n <div style="display: flex; align-items: center; gap: 12px; margin-bottom: 20px;">\n <span style="font-size: 32px;">'.concat(a.icon,'</span>\n <h2 class="mic-permission-modal__title" style="text-align: left; margin: 0;">').concat(a.title,'</h2>\n </div>\n <div class="mic-permission-modal__status">\n <span>🚫</span>\n <span>Microphone access is currently blocked</span>\n </div>\n ').concat(a.note?'\n <div class="mic-permission-modal__note">\n <span>ℹ️</span>\n <span>'.concat(a.note,"</span>\n </div>\n "):"",'\n <div class="mic-permission-modal__visual-guide-container">\n <img src="').concat(d,'" alt="Visual guide for enabling microphone" class="mic-permission-modal__visual-guide" \n onerror="console.error(\'[MicPermission] Failed to load image:\', this.src); this.style.display=\'none\';" \n onload="console.log(\'[MicPermission] Image loaded successfully:\', this.src);" />\n </div>\n <div class="mic-permission-modal__steps">\n <h3>Follow these steps:</h3>\n <ol>\n ').concat(a.steps.map(A=>"<li>".concat(A,"</li>")).join(""),"\n </ol>\n </div>\n ").concat(l,'\n <div class="mic-permission-modal__actions">\n ').concat(a.canOpenSettings?'\n <button class="mic-permission-modal__btn mic-permission-modal__btn--primary" data-action="open-settings">\n '.concat(a.settingsButtonText||"Open Settings","\n </button>\n "):"","\n ").concat(a.showAddressBarHint?'\n <button class="mic-permission-modal__btn mic-permission-modal__btn--primary" data-action="show-hint">\n Show Me Where\n </button>\n ':"",'\n <button class="mic-permission-modal__btn mic-permission-modal__btn--secondary" data-action="refresh">\n 🔄 Refresh Page\n </button>\n </div>\n <p class="mic-permission-modal__footer">\n After enabling microphone access, return here and click "Refresh Page"\n </p>\n '),r.appendChild(c),i.overlay=r,i.modal=c,null===(t=c.querySelector('[data-action="close"]'))||void 0===t||t.addEventListener("click",()=>{i.close(),A()}),null===(n=c.querySelector('[data-action="open-settings"]'))||void 0===n||n.addEventListener("click",()=>{oe(s)}),null===(o=c.querySelector('[data-action="refresh"]'))||void 0===o||o.addEventListener("click",()=>{window.location.reload()});var u=c.querySelector('[data-action="show-hint"]');u&&u.addEventListener("click",()=>{i.close(),A(),function(){var A=document.getElementById("mic-address-bar-hint");A&&A.remove(),Ae();var e=document.getElementsByTagName("script"),t="";for(var n of e){var o=n.src;if(o&&(o.includes("agent-widget.js")||o.includes("ttp-agent-sdk")||o.includes("ttp-sdk-front")))try{new URL(o),t=o.substring(0,o.lastIndexOf("/"));break}catch(A){var i=o.match(/^(.*\/)[^\/]+$/);if(i){t=i[1];break}}}if(!t||""===t||t.startsWith("/")){for(var r of e){var s=r.src;if(s&&(s.includes("cdn.talktopc.com")||s.includes("talktopc.com"))){if(s.includes("/ttp-agent-sdk/")||s.includes("/ttp-sdk-front/")){var a=s.match(/(https?:\/\/[^\/]+(?:\/[^\/]+)*)/);if(a){t=a[1].replace(/\/[^\/]+\.js$/,"");break}}if(!t&&(s.includes("cdn.talktopc.com")||s.includes("talktopc.com"))){t="https://cdn.talktopc.com/ttp-agent-sdk";break}}}if(!t||""===t)if(window.location.hostname.includes("cdn.talktopc.com")||window.location.hostname.includes("talktopc.com"))t="https://cdn.talktopc.com/ttp-agent-sdk";else{var c=window.location.pathname.split("/");c.pop(),(t=window.location.origin+c.join("/"))&&t!==window.location.origin||(t=window.location.origin)}}t=t.replace(/\/$/,"");var l="".concat(t,"/shared/mic-permission-assets/address-bar-hint.svg"),d=document.createElement("div");d.id="mic-address-bar-hint",d.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n z-index: 10001;\n padding: 10px 20px;\n pointer-events: none;\n animation: mic-fadeIn 0.3s ease-out;\n display: flex;\n justify-content: center;\n ";var u=document.createElement("div");u.style.cssText="\n display: flex;\n align-items: center;\n gap: 12px;\n background: #f59e0b;\n color: white;\n padding: 12px 20px;\n border-radius: 0 0 8px 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n pointer-events: all;\n animation: mic-slideDown 0.3s ease-out;\n max-width: 540px;\n ";var g=document.createElement("div");g.style.cssText="\n flex-shrink: 0;\n ";var p=document.createElement("img");p.src=l,p.alt="Address bar hint",p.style.cssText="\n width: auto;\n height: 80px;\n display: block;\n ",p.onerror=()=>{g.style.display="none"},g.appendChild(p);var h=document.createElement("div");h.style.cssText="\n display: flex;\n flex-direction: column;\n gap: 4px;\n flex: 1;\n ";var B=document.createElement("div");B.style.cssText="\n font-size: 15px;\n font-weight: 500;\n ",B.innerHTML="Click the <strong>lock icon 🔒</strong>, <strong>information icon ℹ️</strong>, or <strong>settings icon ⋮</strong> in the address bar to enable microphone";var m=document.createElement("button");if(m.style.cssText="\n background: rgba(255, 255, 255, 0.2);\n border: none;\n color: white;\n width: 28px;\n height: 28px;\n border-radius: 50%;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n transition: background 0.2s;\n flex-shrink: 0;\n ",m.textContent="✕",m.addEventListener("click",()=>{d.remove()}),m.addEventListener("mouseenter",()=>{m.style.background="rgba(255, 255, 255, 0.3)"}),m.addEventListener("mouseleave",()=>{m.style.background="rgba(255, 255, 255, 0.2)"}),!document.getElementById("mic-address-bar-hint-styles")){var f=document.createElement("style");f.id="mic-address-bar-hint-styles",f.textContent="\n @keyframes mic-slideDown {\n from {\n opacity: 0;\n transform: translateY(-100%);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n \n @keyframes mic-pointUp {\n 0%, 100% {\n transform: translate(0, 0);\n }\n 50% {\n transform: translate(-5px, -5px);\n }\n }\n ",document.head.appendChild(f)}h.appendChild(B),u.appendChild(g),u.appendChild(h),u.appendChild(m),d.appendChild(u),document.body.appendChild(d),setTimeout(()=>{d.parentNode&&(d.style.opacity="0",d.style.transition="opacity 0.3s ease-out",setTimeout(()=>{d.parentNode&&d.remove()},300))},1e4)}()});var g=c.querySelector(".mic-permission-modal__alt-toggle");if(g&&a.altSteps){var p=g.nextElementSibling;p&&(p.style.display="none",g.addEventListener("click",()=>{"none"===p.style.display?(p.style.display="block",g.innerHTML="▼ ".concat(a.altTitle||"Alternative method")):(p.style.display="none",g.innerHTML="▶ ".concat(a.altTitle||"Alternative method"))}))}return r.addEventListener("click",e=>{e.target===r&&(i.close(),A())}),i.show(),i}function ae(A){var e=new ie,t=e.createOverlay(),n=document.createElement("div");return n.className="mic-permission-modal",n.innerHTML='\n <div class="mic-permission-modal__icon">🎤❌</div>\n <h2 class="mic-permission-modal__title">No Microphone Found</h2>\n <p class="mic-permission-modal__description">\n We couldn\'t detect a microphone on your device. Please make sure:\n </p>\n <ul style="list-style: none; padding: 0; margin: 0 0 24px;">\n <li style="padding: 10px 0 10px 32px; position: relative; color: #111827; border-bottom: 1px solid #e5e7eb;">\n <span style="position: absolute; left: 0; font-size: 18px;">☐</span>\n Your microphone is properly connected\n </li>\n <li style="padding: 10px 0 10px 32px; position: relative; color: #111827; border-bottom: 1px solid #e5e7eb;">\n <span style="position: absolute; left: 0; font-size: 18px;">☐</span>\n Your microphone is not muted at the hardware level\n </li>\n <li style="padding: 10px 0 10px 32px; position: relative; color: #111827;">\n <span style="position: absolute; left: 0; font-size: 18px;">☐</span>\n No other app is exclusively using the microphone\n </li>\n </ul>\n <div class="mic-permission-modal__actions">\n <button class="mic-permission-modal__btn mic-permission-modal__btn--primary" data-action="retry">\n Retry\n </button>\n <button class="mic-permission-modal__btn mic-permission-modal__btn--secondary" data-action="close">\n Close\n </button>\n </div>\n ',t.appendChild(n),e.overlay=t,e.modal=n,n.querySelector('[data-action="retry"]').addEventListener("click",()=>{window.location.reload()}),n.querySelector('[data-action="close"]').addEventListener("click",()=>{e.close(),A()}),t.addEventListener("click",n=>{n.target===t&&(e.close(),A())}),e.show(),e}class ce{constructor(A){this.voiceInterface=A,this.config=A.config}t(A){return this.voiceInterface.t(A)}getText(A,e){return this.voiceInterface.getText(A,e)}getTooltip(A){return this.voiceInterface.getTooltip(A)}generateHTML(){return this.voiceInterface.isMobile?this.generateMobileHTML():'<div class="voice-interface" id="voiceInterface">\n \x3c!-- Before Call State --\x3e\n <div id="voiceIdleState">\n <div class="voice-avatar" id="voiceAvatar">🤖</div>\n <div class="voice-status">\n <div class="voice-status-title">'.concat(this.getText("startCallTitle","clickToStartCall"),'</div>\n <div class="voice-status-subtitle">').concat(this.getText("startCallSubtitle","realTimeVoice"),'</div>\n </div>\n <button class="start-call-btn" id="startCallBtn">\n <svg width="32" height="32" viewBox="0 0 24 24" fill="currentColor">\n <path d="M20.01 15.38c-1.23 0-2.42-.2-3.53-.56-.35-.12-.74-.03-1.01.24l-1.57 1.97c-2.83-1.35-5.48-3.9-6.89-6.83l1.95-1.66c.27-.28.35-.67.24-1.02-.37-1.11-.56-2.3-.56-3.53 0-.54-.45-.99-.99-.99H4.19C3.65 3 3 3.24 3 3.99 3 13.28 10.73 21 20.01 21c.71 0 .99-.63.99-1.18v-3.45c0-.54-.45-.99-.99-.99z"/>\n </svg>\n <span>').concat(this.getText("startCallButtonText","startCall"),'</span>\n </button>\n </div>\n \x3c!-- During Call State - Desktop View --\x3e\n <div id="voiceActiveState" style="display: none;">\n \x3c!-- Original Multi-Row Voice Section (shown when history is collapsed) --\x3e\n <div class="desktop-voice-section" id="desktopVoiceSection">\n \x3c!-- Timer --\x3e\n <div class="desktop-timer">\n <div class="timer-dot"></div>\n <span id="desktopTimerText">00:00</span>\n </div>\n\n \x3c!-- Main Waveform --\x3e\n <div class="desktop-main-waveform" id="desktopMainWaveform">\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n </div>\n\n \x3c!-- Status --\x3e\n <div class="desktop-status" id="desktopStatus">\n <div class="status-dot"></div>\n <span id="desktopStatusText">').concat(this.t("listening")||"Listening...",'</span>\n </div>\n\n \x3c!-- Controls --\x3e\n <div class="desktop-controls">\n <button class="desktop-control-btn secondary" id="desktopMuteBtn" title="').concat(this.getTooltip("mute"),'">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" class="desktop-mic-icon">\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" y1="19" x2="12" y2="23"/>\n </svg>\n <svg fill="none" viewBox="0 0 24 24" class="desktop-mic-off-icon" style="display: none; position: absolute;">\n \x3c!-- Original mic icon (same as normal state) --\x3e\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2" stroke="currentColor" stroke-width="2" fill="none"/>\n <line x1="12" y1="19" x2="12" y2="23" stroke="currentColor" stroke-width="2"/>\n \x3c!-- Red circle surrounding the icon --\x3e\n <circle cx="12" cy="12" r="11.8" fill="none" stroke="#ef4444" stroke-width="2"/>\n \x3c!-- Red diagonal strike line --\x3e\n <line x1="4" y1="4" x2="20" y2="20" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round"/>\n </svg>\n </button>\n <button class="desktop-control-btn danger" id="desktopEndCallBtn" title="').concat(this.getTooltip("endCall"),'">\n <svg fill="none" stroke="currentColor" stroke-width="1.8" viewBox="0 0 24 24" style="overflow: visible;">\n <path d="M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 16.92z" transform="rotate(135 12 12)"/>\n </svg>\n </button>\n <button class="desktop-control-btn secondary" id="desktopSpeakerBtn" title="').concat(this.getTooltip("speaker"),'">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" class="desktop-speaker-icon">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <path d="M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07"/>\n </svg>\n <svg fill="none" viewBox="0 0 24 24" class="desktop-speaker-off-icon" style="display: none; position: absolute;">\n \x3c!-- Original speaker icon (same as normal state) --\x3e\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M19.07 4.93a10 10 0 010 14.14" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M15.54 8.46a5 5 0 010 7.07" stroke="currentColor" stroke-width="2" fill="none"/>\n \x3c!-- Red circle surrounding the icon --\x3e\n <circle cx="12" cy="12" r="11.8" fill="none" stroke="#ef4444" stroke-width="2"/>\n \x3c!-- Red diagonal strike line --\x3e\n <line x1="4" y1="4" x2="20" y2="20" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round"/>\n </svg>\n </button>\n </div>\n </div>\n\n \x3c!-- Compact Voice Section - Single Row Layout (shown only when history is expanded) --\x3e\n <div class="compact-voice-section" id="compactVoiceSection" style="display: none;">\n \x3c!-- Left side: Avatar + Info --\x3e\n <div class="compact-left">\n \x3c!-- Avatar container with waveform --\x3e\n <div class="compact-avatar" id="desktopAvatarCompact">\n \x3c!-- Main Waveform - Scaled down for compact view --\x3e\n <div class="desktop-main-waveform" id="desktopMainWaveformCompact">\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n </div>\n </div>\n \n \x3c!-- Timer and Status stacked vertically --\x3e\n <div class="compact-info">\n <div class="compact-timer" id="desktopTimerCompact">\n <span class="timer-dot"></span>\n <span id="compactTimerText">00:00</span>\n </div>\n <div class="compact-status" id="desktopStatusCompact">\n <span class="status-dot"></span>\n <span id="compactStatusText">').concat(this.t("listening")||"Listening",'</span>\n </div>\n </div>\n </div>\n \n \x3c!-- Right side: Control buttons (reuse same IDs, handlers will work for both) --\x3e\n <div class="compact-controls">\n <button class="compact-control-btn secondary" id="desktopMuteBtnCompact" title="').concat(this.getTooltip("mute"),'">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" class="desktop-mic-icon">\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" y1="19" x2="12" y2="23"/>\n </svg>\n <svg fill="none" viewBox="0 0 24 24" class="desktop-mic-off-icon" style="display: none; position: absolute;">\n \x3c!-- Original mic icon (same as normal state) --\x3e\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2" stroke="currentColor" stroke-width="2" fill="none"/>\n <line x1="12" y1="19" x2="12" y2="23" stroke="currentColor" stroke-width="2"/>\n \x3c!-- Red circle surrounding the icon --\x3e\n <circle cx="12" cy="12" r="11.8" fill="none" stroke="#ef4444" stroke-width="2"/>\n \x3c!-- Red diagonal strike line --\x3e\n <line x1="4" y1="4" x2="20" y2="20" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round"/>\n </svg>\n </button>\n <button class="compact-control-btn danger" id="desktopEndCallBtnCompact" title="').concat(this.getTooltip("endCall"),'">\n <svg fill="none" stroke="currentColor" stroke-width="1.8" viewBox="0 0 24 24" style="overflow: visible;">\n <path d="M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 16.92z" transform="rotate(135 12 12)"/>\n </svg>\n </button>\n <button class="compact-control-btn secondary" id="desktopSpeakerBtnCompact" title="').concat(this.getTooltip("speaker"),'">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" class="desktop-speaker-icon">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <path d="M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07"/>\n </svg>\n <svg fill="none" viewBox="0 0 24 24" class="desktop-speaker-off-icon" style="display: none; position: absolute;">\n \x3c!-- Original speaker icon (same as normal state) --\x3e\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M19.07 4.93a10 10 0 010 14.14" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M15.54 8.46a5 5 0 010 7.07" stroke="currentColor" stroke-width="2" fill="none"/>\n \x3c!-- Red circle surrounding the icon --\x3e\n <circle cx="12" cy="12" r="11.8" fill="none" stroke="#ef4444" stroke-width="2"/>\n \x3c!-- Red diagonal strike line --\x3e\n <line x1="4" y1="4" x2="20" y2="20" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round"/>\n </svg>\n </button>\n </div>\n </div>\n\n \x3c!-- Conversation Panel --\x3e\n <div class="desktop-conversation-panel collapsed" id="desktopConversationPanel">\n \x3c!-- Header --\x3e\n <div class="conversation-header" id="conversationHeader">\n <span class="conversation-label">').concat(this.t("conversation")||"Conversation",'</span>\n <span class="conversation-toggle">\n <span id="conversationToggleText">Show history</span>\n <svg width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">\n <path d="M6 9l6 6 6-6"/>\n </svg>\n </span>\n </div>\n\n \x3c!-- Collapsed: Live transcript only (2 lines) --\x3e\n <div class="live-transcript-collapsed" id="liveTranscriptCollapsed">\n <div class="live-indicator">\n <div class="live-dot"></div>\n <span>Live</span>\n </div>\n <div class="live-text-collapsed muted" id="liveTextCollapsed">\n ').concat(this.t("transcriptWillAppear")||"Transcript will appear here...",'<span class="typing-cursor"></span>\n </div>\n </div>\n\n \x3c!-- Expanded: Full conversation history --\x3e\n <div class="conversation-history" id="conversationHistory">\n <div class="conversation-messages" id="conversationMessages">\n \x3c!-- Messages will be rendered here --\x3e\n </div>\n \n \x3c!-- Live message at bottom --\x3e\n <div class="live-message-row" id="liveMessageRow" style="display: none;">\n <div class="message-avatar assistant">\n <div class="orb"></div>\n </div>\n <div class="message-bubble">\n <span class="live-badge">Live</span>\n <span id="liveMessageText"></span><span class="typing-cursor"></span>\n </div>\n </div>\n </div>\n\n \x3c!-- Text Input --\x3e\n <div class="voice-text-input-area">\n <div class="voice-input-wrapper">\n <input type="text" class="voice-text-input" id="voiceTextInput" placeholder="').concat(this.getText("inputPlaceholder","typeMessage")||"Type a message...",'">\n <button class="voice-send-btn" id="voiceSendBtn">\n <svg width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">\n <line x1="22" y1="2" x2="11" y2="13"/>\n <polygon points="22 2 15 22 11 13 2 9 22 2"/>\n </svg>\n </button>\n </div>\n <div class="voice-input-hint" id="voiceInputHint">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>\n </svg>\n ').concat(this.getText("voiceActiveHint","voiceActive")||"Voice is still active • Type or speak","\n </div>\n </div>\n </div>\n </div>\n </div>")}generateMobileHTML(){return'<div class="voice-interface mobile-voice-interface" id="voiceInterface">\n \x3c!-- Before Call State (same as desktop) --\x3e\n <div id="voiceIdleState">\n <div class="voice-avatar" id="voiceAvatar">🤖</div>\n <div class="voice-status">\n <div class="voice-status-title">'.concat(this.getText("startCallTitle","clickToStartCall"),'</div>\n <div class="voice-status-subtitle">').concat(this.getText("startCallSubtitle","realTimeVoice"),'</div>\n </div>\n <button class="start-call-btn" id="startCallBtn">\n <svg width="32" height="32" viewBox="0 0 24 24" fill="currentColor">\n <path d="M20.01 15.38c-1.23 0-2.42-.2-3.53-.56-.35-.12-.74-.03-1.01.24l-1.57 1.97c-2.83-1.35-5.48-3.9-6.89-6.83l1.95-1.66c.27-.28.35-.67.24-1.02-.37-1.11-.56-2.3-.56-3.53 0-.54-.45-.99-.99-.99H4.19C3.65 3 3 3.24 3 3.99 3 13.28 10.73 21 20.01 21c.71 0 .99-.63.99-1.18v-3.45c0-.54-.45-.99-.99-.99z"/>\n </svg>\n <span>').concat(this.getText("startCallButtonText","startCall"),'</span>\n </button>\n </div>\n \n \x3c!-- Mobile Active Call State - Hidden placeholder (actual bar will be appended to body) --\x3e\n <div id="voiceActiveState" class="mobile-active-state" style="display: none;">\n \x3c!-- Duration Badge --\x3e\n <div class="mobile-duration-badge" id="mobileDurationBadge">\n <div class="mobile-duration-dot"></div>\n <span id="mobileDurationText">00:00</span>\n </div>\n \n \x3c!-- Main Bar --\x3e\n <div class="mobile-voice-bar">\n \x3c!-- Top Row: Status, Waveform, Controls --\x3e\n <div class="mobile-top-row">\n \x3c!-- Status Indicator --\x3e\n <div class="mobile-status-indicator">\n <div class="mobile-status-dot" id="mobileStatusDot"></div>\n <span class="mobile-status-text" id="mobileStatusText">Listening...</span>\n </div>\n \n \x3c!-- Centered Waveform --\x3e\n <div class="mobile-waveform-center" id="mobileWaveform">\n ').concat(Array(8).fill(0).map((A,e)=>'<div class="mobile-waveform-bar" data-index="'.concat(e,'"></div>')).join(""),'\n </div>\n \n \x3c!-- Controls --\x3e\n <div class="mobile-controls">\n <button class="mobile-control-btn" id="mobileMuteBtn" aria-label="Mute microphone">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-mic-icon">\n <path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" x2="12" y1="19" y2="22"/>\n </svg>\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-mic-off-icon" style="display: none;">\n <line x1="2" x2="22" y1="2" y2="22"/>\n <path d="M18.89 13.23A7.12 7.12 0 0 0 19 12v-2"/>\n <path d="M5 10v2a7 7 0 0 0 12 5"/>\n <path d="M15 9.34V5a3 3 0 0 0-5.68-1.33"/>\n <path d="M9 9v3a3 3 0 0 0 5.12 2.12"/>\n <line x1="12" x2="12" y1="19" y2="22"/>\n </svg>\n </button>\n \n <button class="mobile-control-btn" id="mobileSpeakerBtn" aria-label="Toggle speaker">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-speaker-icon">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>\n </svg>\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-speaker-off-icon" style="display: none;">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <line x1="22" x2="16" y1="9" y2="15"/>\n <line x1="16" x2="22" y1="9" y2="15"/>\n </svg>\n </button>\n \n <button class="mobile-end-call-btn" id="mobileEndCallBtn" aria-label="End call">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"/>\n <line x1="22" x2="2" y1="2" y2="22"/>\n </svg>\n </button>\n </div>\n </div>\n \n \x3c!-- Bottom Row: Transcript (expandable) --\x3e\n <button class="mobile-transcript-row" id="mobileTranscriptRow">\n <p class="mobile-transcript-text" id="mobileTranscriptText">').concat(this.t("transcriptWillAppear"),'</p>\n <div class="mobile-transcript-footer">\n <span class="mobile-expand-hint">tap to expand & type</span>\n <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="opacity: 0.6;">\n <path d="M7 17L17 7M17 7H7M17 7V17"/>\n </svg>\n </div>\n </button>\n </div>\n </div>\n \n \x3c!-- Expanded Transcript Overlay --\x3e\n <div class="mobile-transcript-overlay" id="mobileTranscriptOverlay" style="display: none;">\n <div class="mobile-expanded-transcript" id="mobileExpandedTranscript">\n \x3c!-- Header --\x3e\n <div class="mobile-transcript-header">\n <div class="mobile-header-left">\n <div class="mobile-header-status">\n <div class="mobile-header-status-dot"></div>\n <span class="mobile-header-status-text" id="mobileHeaderStatusText">Listening...</span>\n <span class="mobile-header-duration" id="mobileHeaderDuration">00:00</span>\n </div>\n <span class="mobile-transcript-label">CONVERSATION</span>\n </div>\n <button class="mobile-close-transcript-btn" id="mobileCloseTranscriptBtn">\n <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 6L6 18M6 6l12 12"/>\n </svg>\n </button>\n </div>\n \n \x3c!-- Messages Container --\x3e\n <div class="mobile-messages-container" id="mobileMessagesContainer">\n \x3c!-- Messages will be dynamically added here --\x3e\n </div>\n \n \x3c!-- Text Input Area --\x3e\n <div class="mobile-input-area">\n <div class="mobile-input-wrapper">\n <input\n type="text"\n placeholder="Type a message..."\n id="mobileTextInput"\n class="mobile-text-input"\n />\n <button class="mobile-send-btn" id="mobileSendBtn" disabled>\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"/>\n </svg>\n </button>\n </div>\n <p class="mobile-input-hint">🎙️ Voice is still active • Type or speak</p>\n </div>\n </div>\n </div>\n </div>')}}class le{constructor(A){this.voiceInterface=A,this.config=A.config}generateCSS(){var A,e=this.config.avatarBackgroundColor||"#667eea",t=this.config.avatarActiveBackgroundColor||this.config.avatarBackgroundColor||"#667eea",n=this.config.statusTitleColor||"#1e293b",o=this.config.statusSubtitleColor||"#64748b",i=this.config.statusDotColor||"#10b981",r=(this.config.statusText,this.config.startCallButtonColor||"#667eea"),s=this.config.startCallButtonTextColor||"#FFFFFF",a=this.config.transcriptBackgroundColor||"#FFFFFF",c=this.config.transcriptTextColor||"#1e293b",l=this.config.transcriptLabelColor||"#94a3b8",d=this.config.controlButtonColor||"#FFFFFF",u=this.config.liveTranscriptTextColor||this.config.transcriptTextColor||"#64748b",g=this.config.liveTranscriptFontSize||"14px",p=this.config.controlButtonSecondaryColor||"#64748b",h=this.config.liveIndicatorDotColor||"#10b981",B=this.config.liveIndicatorTextColor||"#10b981",m=this.config.micButtonColor||d,f=this.config.speakerButtonColor||d,v=this.config.endCallButtonColor||"#ef4444",w=this.config.sendButtonColor||(null===(A=this.config.text)||void 0===A?void 0:A.sendButtonColor)||this.config.voiceSendButtonColor||"#7C3AED",C=" !important";return"\n /* Voice Interface Styles - Ultra-compact for Wix iframes */\n .voice-interface { \n display: none".concat(C,"; \n flex: 1; \n flex-direction: column;\n align-items: stretch; \n justify-content: flex-start; \n padding: 0; \n background: linear-gradient(180deg, #f8fafc 0%, #e0e7ff 100%);\n overflow: hidden;\n min-height: 0;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n }\n .voice-interface.active { display: flex").concat(C,'; }\n \n /* Voice States - Better scaling gaps */\n #voiceIdleState {\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n min-height: 0;\n justify-content: center;\n overflow: hidden;\n flex: 1;\n box-sizing: border-box;\n gap: clamp(6px, 1.5vh, 12px);\n }\n \n #voiceActiveState {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n width: 100%;\n height: 100%;\n min-height: 0;\n justify-content: flex-start;\n overflow: hidden;\n flex: 1;\n box-sizing: border-box;\n gap: 0;\n padding: 0;\n }\n \n #voiceActiveState[style*="display: none"] {\n display: none !important;\n }\n \n /* Voice Avatar - Scales better from small to large */\n .voice-avatar,\n .voice-avatar-active {\n width: clamp(80px, 18vh, 160px);\n height: clamp(80px, 18vh, 160px);\n aspect-ratio: 1;\n border-radius: 50%;\n background: linear-gradient(135deg, ').concat(e," 0%, ").concat(t," 100%);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: clamp(40px, 9vh, 80px);\n margin: 0;\n box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);\n transition: all 0.3s ease;\n flex-shrink: 0;\n position: relative;\n }\n \n .voice-avatar-active {\n animation: avatarPulse 2s ease-in-out infinite;\n }\n \n @keyframes avatarPulse {\n 0%, 100% { \n transform: scale(1);\n }\n 50% { \n transform: scale(1.05);\n }\n }\n \n .voice-avatar-active.speaking {\n animation: avatarSpeak 0.5s ease-in-out infinite;\n }\n \n @keyframes avatarSpeak {\n 0%, 100% { transform: scale(1); }\n 50% { transform: scale(1.08); }\n }\n \n /* Voice Rings Animation */\n .voice-rings {\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n }\n \n .voice-ring {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n border: 2px solid rgba(102, 126, 234, 0.3);\n border-radius: 50%;\n opacity: 0;\n animation: ringExpand 2s ease-out infinite;\n }\n \n .voice-ring:nth-child(2) { animation-delay: 0.5s; }\n .voice-ring:nth-child(3) { animation-delay: 1s; }\n \n @keyframes ringExpand {\n 0% {\n width: 100%;\n height: 100%;\n opacity: 0.6;\n }\n 100% {\n width: 160%;\n height: 160%;\n opacity: 0;\n }\n }\n \n /* Voice Status - Scales with container */\n .voice-status {\n text-align: center;\n margin: 0;\n flex-shrink: 0;\n min-height: 0;\n }\n \n .voice-status-title {\n font-size: clamp(12px, 3vh, 20px);\n font-weight: 600;\n color: ").concat(n,";\n margin-bottom: clamp(2px, 0.5vh, 4px);\n line-height: 1.2;\n }\n \n .voice-status-subtitle {\n font-size: clamp(10px, 2vh, 14px);\n color: ").concat(o,";\n line-height: 1.2;\n }\n \n /* Start Call Button - Scales with container */\n .start-call-btn {\n margin: 0;\n width: min(280px, 70vw)").concat(C,";\n height: clamp(48px, 8vh, 64px)").concat(C,";\n border-radius: clamp(24px, 4vh, 32px)").concat(C,";\n border: none").concat(C,";\n background: ").concat(r).concat(C,";\n color: ").concat(s).concat(C,";\n font-size: clamp(14px, 2.5vh, 18px)").concat(C,";\n font-weight: 600").concat(C,";\n cursor: pointer").concat(C,";\n display: flex").concat(C,";\n align-items: center").concat(C,";\n justify-content: center").concat(C,";\n gap: clamp(8px, 1.5vh, 12px);\n box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);\n transition: all 0.3s ease;\n flex-shrink: 0;\n }\n \n .start-call-btn svg {\n display: block").concat(C,";\n visibility: visible").concat(C,";\n opacity: 1").concat(C,";\n width: auto").concat(C,";\n height: auto").concat(C,";\n }\n \n .start-call-btn svg {\n width: clamp(22px, 4vh, 32px);\n height: clamp(22px, 4vh, 32px);\n }\n \n .start-call-btn:hover {\n transform: translateY(-2px);\n box-shadow: 0 12px 28px rgba(102, 126, 234, 0.5);\n }\n \n .start-call-btn:active {\n transform: translateY(-1px);\n }\n .start-call-btn:disabled {\n cursor: not-allowed").concat(C,";\n opacity: 0.6").concat(C,";\n }\n \n /* Connecting Spinner */\n .connecting-spinner {\n display: inline-block;\n width: 16px;\n height: 16px;\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top-color: ").concat(s,";\n border-radius: 50%;\n animation: spin 1s linear infinite;\n margin-right: 8px;\n vertical-align: middle;\n }\n \n @keyframes spin {\n to { transform: rotate(360deg); }\n }\n\n \n /* Voice Transcript - Scales with container */\n .voice-transcript {\n background: ").concat(a,";\n padding: clamp(6px, 1.5vh, 12px);\n border-radius: 10px;\n width: min(360px, calc(100% - 40px));\n margin: 0;\n min-height: clamp(80px, 15vh, 120px);\n max-height: clamp(100px, 18vh, 140px);\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);\n flex-shrink: 1;\n overflow-y: auto;\n overflow-x: hidden;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n }\n \n .transcript-label {\n font-size: clamp(8px, 1.4vh, 11px);\n color: ").concat(l,";\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.3px;\n margin-bottom: clamp(3px, 0.6vh, 6px);\n flex-shrink: 0;\n word-wrap: break-word;\n }\n \n .transcript-text {\n font-size: clamp(11px, 2vh, 15px);\n color: ").concat(c,";\n line-height: 1.4;\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n word-wrap: break-word;\n overflow-wrap: break-word;\n }\n \n .transcript-text.empty {\n color: #cbd5e1;\n font-style: italic;\n }\n \n /* Voice Text Input Area - Type while on voice call */\n .voice-text-input-area {\n width: 100%;\n padding: 14px 16px;\n margin: 0;\n flex-shrink: 0;\n background: #ffffff;\n border-top: 1px solid rgba(0, 0, 0, 0.06);\n box-sizing: border-box;\n }\n \n .voice-input-wrapper {\n display: flex;\n align-items: center;\n gap: 10px;\n background: #f1f5f9;\n border-radius: 12px;\n padding: 4px 4px 4px 14px;\n border: 1px solid transparent;\n transition: all 0.2s ease;\n }\n \n .voice-input-wrapper:focus-within {\n background: #fff;\n border-color: #a855f7;\n box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);\n }\n \n .voice-text-input {\n flex: 1;\n border: none;\n outline: none;\n font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;\n font-size: 14px;\n color: ").concat(u).concat(C,";\n background: transparent;\n padding: 10px 0;\n }\n \n .voice-text-input::placeholder {\n color: #94a3b8;\n }\n \n .voice-send-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 38px;\n height: 38px;\n border-radius: 10px;\n border: none;\n background: ").concat(w).concat(C,";\n color: #fff;\n cursor: pointer;\n transition: transform 0.2s ease;\n flex-shrink: 0;\n }\n \n .voice-send-btn:hover:not(:disabled) {\n transform: scale(1.05);\n }\n \n .voice-send-btn:active:not(:disabled) {\n transform: scale(0.95);\n }\n \n .voice-send-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n transform: none;\n }\n \n .voice-send-btn svg {\n width: 16px;\n height: 16px;\n }\n \n .voice-input-hint {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 5px;\n margin-top: 10px;\n font-size: 11px;\n color: #64748b;\n transition: color 0.2s ease;\n }\n \n .voice-input-hint svg {\n width: 12px;\n height: 12px;\n color: #10b981;\n }\n \n /* Text input status states */\n .voice-input-hint--sending {\n color: #666;\n }\n \n .voice-input-hint--success {\n color: #28a745;\n }\n \n .voice-input-hint--queued {\n color: #ffc107;\n }\n \n .voice-input-hint--error {\n color: #dc3545;\n }\n \n /* Disabled input styling */\n .voice-text-input:disabled,\n #mobileTextInput:disabled {\n background-color: #f5f5f5;\n cursor: not-allowed;\n }\n \n .voice-send-btn:disabled,\n #mobileSendBtn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n \n /* Voice Controls - Scales with container */\n .voice-controls {\n display: flex;\n gap: clamp(8px, 1.8vh, 14px);\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n margin: 0;\n padding-top: 0;\n }\n \n .voice-control-btn {\n width: clamp(48px, 9vh, 72px)").concat(C,";\n height: clamp(48px, 9vh, 72px)").concat(C,";\n min-width: clamp(48px, 9vh, 72px)").concat(C,";\n min-height: clamp(48px, 9vh, 72px)").concat(C,";\n max-width: clamp(48px, 9vh, 72px)").concat(C,";\n max-height: clamp(48px, 9vh, 72px)").concat(C,";\n aspect-ratio: 1").concat(C,";\n border-radius: 50%").concat(C,";\n border: none").concat(C,";\n cursor: pointer").concat(C,";\n display: flex").concat(C,";\n align-items: center").concat(C,";\n justify-content: center").concat(C,";\n transition: all 0.2s;\n position: relative").concat(C,";\n flex-shrink: 0;\n overflow: hidden").concat(C,";\n padding: 0").concat(C,";\n margin: 0").concat(C,";\n box-sizing: border-box").concat(C,";\n }\n \n .voice-control-btn svg {\n width: 48%").concat(C,";\n height: 48%").concat(C,";\n min-width: 48%").concat(C,";\n min-height: 48%").concat(C,";\n max-width: 48%").concat(C,";\n max-height: 48%").concat(C,";\n display: block").concat(C,";\n visibility: visible").concat(C,";\n opacity: 1").concat(C,";\n margin: 0").concat(C,";\n padding: 0").concat(C,";\n position: relative").concat(C,";\n flex-shrink: 0").concat(C,";\n }\n \n .voice-control-btn.primary {\n width: clamp(54px, 10vh, 80px)").concat(C,";\n height: clamp(54px, 10vh, 80px)").concat(C,";\n min-width: clamp(54px, 10vh, 80px)").concat(C,";\n min-height: clamp(54px, 10vh, 80px)").concat(C,";\n max-width: clamp(54px, 10vh, 80px)").concat(C,";\n max-height: clamp(54px, 10vh, 80px)").concat(C,";\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%)").concat(C,";\n color: white").concat(C,";\n box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);\n }\n \n .voice-control-btn.primary:hover {\n transform: scale(1.05);\n }\n \n .voice-control-btn.primary.active {\n background: ").concat(v).concat(C,";\n animation: recordingPulse 1.5s ease-in-out infinite;\n }\n .voice-control-btn.primary.active svg {\n fill: white").concat(C,";\n }\n \n /* More specific selectors for WordPress compatibility */\n #endCallBtn.voice-control-btn.primary.active,\n #muteBtn.voice-control-btn.secondary,\n #speakerBtn.voice-control-btn.secondary {\n border-radius: 50% !important;\n width: clamp(48px, 9vh, 72px) !important;\n height: clamp(48px, 9vh, 72px) !important;\n min-width: clamp(48px, 9vh, 72px) !important;\n min-height: clamp(48px, 9vh, 72px) !important;\n max-width: clamp(48px, 9vh, 72px) !important;\n max-height: clamp(48px, 9vh, 72px) !important;\n aspect-ratio: 1 !important;\n overflow: hidden !important;\n }\n \n #endCallBtn.voice-control-btn.primary.active {\n width: clamp(54px, 10vh, 80px) !important;\n height: clamp(54px, 10vh, 80px) !important;\n min-width: clamp(54px, 10vh, 80px) !important;\n min-height: clamp(54px, 10vh, 80px) !important;\n max-width: clamp(54px, 10vh, 80px) !important;\n max-height: clamp(54px, 10vh, 80px) !important;\n }\n \n \n /* Microphone button specific background color */\n #muteBtn.voice-control-btn.secondary {\n background: ").concat(m).concat(C,";\n }\n \n /* Speaker button specific background color */\n #speakerBtn.voice-control-btn.secondary {\n background: ").concat(f).concat(C,";\n }\n \n #endCallBtn.voice-control-btn.primary.active svg,\n #muteBtn.voice-control-btn.secondary svg,\n #speakerBtn.voice-control-btn.secondary svg {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 48% !important;\n height: 48% !important;\n margin: 0 !important;\n padding: 0 !important;\n position: relative !important;\n }\n \n @keyframes recordingPulse {\n 0%, 100% { \n box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);\n }\n 50% { \n box-shadow: 0 6px 24px rgba(239, 68, 68, 0.7);\n }\n }\n \n .voice-control-btn.secondary {\n background: ").concat(d).concat(C,";\n color: ").concat(p).concat(C,";\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);\n width: clamp(48px, 9vh, 72px)").concat(C,";\n height: clamp(48px, 9vh, 72px)").concat(C,";\n min-width: clamp(48px, 9vh, 72px)").concat(C,";\n min-height: clamp(48px, 9vh, 72px)").concat(C,";\n max-width: clamp(48px, 9vh, 72px)").concat(C,";\n max-height: clamp(48px, 9vh, 72px)").concat(C,";\n }\n \n .voice-control-btn.secondary:hover {\n background: #f8fafc").concat(C,";\n transform: scale(1.05);\n }\n \n .voice-control-btn.secondary.muted {\n background: #f3f4f6").concat(C,";\n }\n \n .voice-control-btn.secondary.muted .mute-icon {\n stroke: #9ca3af !important;\n }\n \n .voice-control-btn.secondary svg {\n width: 48%").concat(C,";\n height: 48%").concat(C,";\n display: block").concat(C,";\n visibility: visible").concat(C,";\n opacity: 1").concat(C,";\n margin: 0").concat(C,";\n padding: 0").concat(C,";\n position: relative").concat(C,";\n }\n \n .voice-timer {\n position: absolute;\n bottom: clamp(-18px, -3vh, -24px);\n font-size: clamp(9px, 1.6vh, 12px);\n color: #64748b;\n font-weight: 500;\n white-space: nowrap;\n }\n \n /* ===== DESKTOP VOICE SECTION - New Design ===== */\n .desktop-voice-section {\n padding: 16px 20px;\n background: linear-gradient(180deg, #ffffff 0%, rgba(168, 85, 247, 0.04) 100%);\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 12px;\n box-sizing: border-box;\n text-align: center;\n }\n \n /* Ensure all children are centered */\n .desktop-voice-section > * {\n margin-left: auto;\n margin-right: auto;\n }\n \n .desktop-timer {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 5px 10px;\n background: rgba(0, 0, 0, 0.05);\n border-radius: 20px;\n font-family: 'JetBrains Mono', 'Courier New', monospace;\n font-size: 11px;\n color: #64748b;\n margin: 0 auto;\n }\n \n .desktop-timer .timer-dot {\n width: 5px;\n height: 5px;\n background: #ef4444;\n border-radius: 50%;\n animation: timerPulse 1s ease-in-out infinite;\n }\n \n @keyframes timerPulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.4; }\n }\n \n .desktop-avatar-container {\n margin-bottom: 12px;\n }\n \n .desktop-avatar-large {\n width: 80px !important;\n height: 80px !important;\n border-radius: 20px !important;\n margin: 0 auto 12px !important;\n box-shadow: 0 8px 24px rgba(168, 85, 247, 0.35) !important;\n background: linear-gradient(135deg, ").concat(e," 0%, ").concat(t,' 100%) !important;\n }\n \n .desktop-waveform {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n height: 36px;\n width: 100%;\n }\n \n .desktop-waveform-bar {\n width: 4px;\n background: rgba(255, 255, 255, 0.9);\n border-radius: 2px;\n animation: waveformAnimation 0.8s ease-in-out infinite;\n }\n \n .desktop-waveform-bar[data-index="0"] { height: 14px; animation-delay: 0s; }\n .desktop-waveform-bar[data-index="1"] { height: 26px; animation-delay: 0.1s; }\n .desktop-waveform-bar[data-index="2"] { height: 36px; animation-delay: 0.2s; }\n .desktop-waveform-bar[data-index="3"] { height: 22px; animation-delay: 0.3s; }\n .desktop-waveform-bar[data-index="4"] { height: 16px; animation-delay: 0.4s; }\n \n @keyframes waveformAnimation {\n 0%, 100% { transform: scaleY(0.5); }\n 50% { transform: scaleY(1); }\n }\n \n .desktop-waveform.paused .desktop-waveform-bar {\n animation-play-state: paused;\n }\n\n /* New main waveform (used in updated template) */\n .desktop-main-waveform {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 3px;\n height: 48px;\n width: 100%;\n max-width: 200px;\n margin: 0 auto;\n padding: 0 20px;\n }\n\n .desktop-main-waveform .waveform-bar {\n width: 3px;\n background: #a855f7;\n border-radius: 2px;\n height: 8px;\n animation: waveformAnimation 0.8s ease-in-out infinite;\n }\n\n .desktop-main-waveform .waveform-bar:nth-child(1) { height: 12px; animation-delay: 0s; }\n .desktop-main-waveform .waveform-bar:nth-child(2) { height: 20px; animation-delay: 0.05s; }\n .desktop-main-waveform .waveform-bar:nth-child(3) { height: 28px; animation-delay: 0.1s; }\n .desktop-main-waveform .waveform-bar:nth-child(4) { height: 36px; animation-delay: 0.15s; }\n .desktop-main-waveform .waveform-bar:nth-child(5) { height: 44px; animation-delay: 0.2s; }\n .desktop-main-waveform .waveform-bar:nth-child(6) { height: 50px; animation-delay: 0.25s; }\n .desktop-main-waveform .waveform-bar:nth-child(7) { height: 54px; animation-delay: 0.3s; }\n .desktop-main-waveform .waveform-bar:nth-child(8) { height: 56px; animation-delay: 0.35s; }\n .desktop-main-waveform .waveform-bar:nth-child(9) { height: 54px; animation-delay: 0.4s; }\n .desktop-main-waveform .waveform-bar:nth-child(10) { height: 50px; animation-delay: 0.45s; }\n .desktop-main-waveform .waveform-bar:nth-child(11) { height: 44px; animation-delay: 0.5s; }\n .desktop-main-waveform .waveform-bar:nth-child(12) { height: 36px; animation-delay: 0.55s; }\n .desktop-main-waveform .waveform-bar:nth-child(13) { height: 28px; animation-delay: 0.6s; }\n .desktop-main-waveform .waveform-bar:nth-child(14) { height: 20px; animation-delay: 0.65s; }\n .desktop-main-waveform .waveform-bar:nth-child(15) { height: 12px; animation-delay: 0.7s; }\n\n .desktop-status {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 5px;\n font-size: 12px;\n color: ').concat(n,";\n font-weight: 500;\n width: 100%;\n text-align: center;\n margin: 0 auto;\n }\n \n .desktop-status .status-dot {\n width: 5px;\n height: 5px;\n background: ").concat(i,";\n border-radius: 50%;\n animation: statusPulse 1.5s ease-in-out infinite;\n }\n \n @keyframes statusPulse {\n 0%, 100% { transform: scale(1); opacity: 1; }\n 50% { transform: scale(1.15); opacity: 0.8; }\n }\n \n .desktop-live-waveform {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 3px;\n height: 48px;\n margin-bottom: 20px;\n }\n \n .desktop-live-bar {\n width: 3px;\n background: linear-gradient(180deg, ").concat(e,", ").concat(t,");\n border-radius: 2px;\n transition: height 0.1s ease;\n height: 8px;\n }\n \n .desktop-controls {\n display: flex;\n gap: 8px;\n align-items: center;\n justify-content: center;\n width: 100%;\n margin: 0 auto;\n }\n \n .desktop-control-btn {\n width: 46px;\n height: 46px;\n border-radius: 50%;\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n .desktop-control-btn svg {\n width: 20px;\n height: 20px;\n }\n \n .desktop-mic-icon,\n .desktop-speaker-icon {\n width: 20px !important;\n height: 20px !important;\n display: block;\n flex-shrink: 0;\n }\n \n .desktop-control-btn.secondary.muted .desktop-mic-icon,\n .desktop-control-btn.secondary.muted .desktop-speaker-icon {\n width: 20px !important;\n height: 20px !important;\n }\n \n \n .desktop-control-btn.secondary:hover {\n background: rgba(0, 0, 0, 0.1);\n color: #1e293b;\n transform: scale(1.05);\n }\n .desktop-control-btn.secondary.muted {\n background: #f3f4f6;\n color: #9ca3af;\n }\n \n .desktop-control-btn.secondary.muted .desktop-mic-icon,\n .desktop-control-btn.secondary.muted .desktop-speaker-icon {\n stroke: #9ca3af;\n }\n \n .desktop-control-btn.secondary {\n position: relative;\n }\n \n \n /* Desktop microphone button background color */\n #desktopMuteBtn.desktop-control-btn.secondary,\n #desktopMuteBtnCompact.compact-control-btn.secondary {\n background: ").concat(m).concat(C,";\n }\n \n /* Desktop speaker button background color */\n #desktopSpeakerBtn.desktop-control-btn.secondary,\n #desktopSpeakerBtnCompact.compact-control-btn.secondary {\n background: ").concat(f).concat(C,";\n }\n .desktop-mic-off-icon,\n .desktop-speaker-off-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 46px;\n height: 46px;\n transform: translate(-50%, -50%);\n z-index: 10;\n }\n .desktop-control-btn.danger {\n width: 50px;\n height: 50px;\n background: ").concat(v).concat(C,";\n color: #ffffff;\n box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);\n overflow: visible;\n }\n \n .desktop-control-btn.danger svg {\n width: 20px;\n height: 20px;\n overflow: visible;\n }\n \n .desktop-control-btn.danger:hover {\n transform: scale(1.06);\n box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);\n }\n \n .desktop-control-btn.danger:hover {\n transform: scale(1.06);\n box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);\n }\n \n \n /* ===== COMPACT VOICE SECTION (Single-row layout) ===== */\n .compact-voice-section {\n padding: 10px 14px;\n background: linear-gradient(180deg, #ffffff, rgba(168, 85, 247, 0.04));\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.06);\n min-height: 62px;\n flex-shrink: 0;\n }\n \n .compact-left {\n display: flex;\n align-items: center;\n gap: 10px;\n }\n \n .compact-avatar {\n width: 42px;\n height: 42px;\n min-width: 42px;\n min-height: 42px;\n border-radius: 12px;\n background: transparent;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n overflow: visible;\n position: relative;\n }\n \n /* Waveform container in compact avatar - ensure it's visible */\n .compact-avatar .desktop-main-waveform {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 2px;\n height: 100%;\n width: 100%;\n padding: 4px;\n transform: scale(0.75);\n transform-origin: center;\n }\n \n /* Ensure waveform bars are visible and animated in compact mode */\n .compact-avatar .desktop-main-waveform .waveform-bar {\n width: 2px;\n min-width: 2px;\n background: #a855f7;\n border-radius: 1px;\n flex-shrink: 0;\n animation: waveformAnimation 0.8s ease-in-out infinite;\n }\n \n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(1) { height: 6px; animation-delay: 0s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(2) { height: 10px; animation-delay: 0.05s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(3) { height: 14px; animation-delay: 0.1s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(4) { height: 18px; animation-delay: 0.15s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(5) { height: 22px; animation-delay: 0.2s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(6) { height: 26px; animation-delay: 0.25s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(7) { height: 28px; animation-delay: 0.3s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(8) { height: 30px; animation-delay: 0.35s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(9) { height: 28px; animation-delay: 0.4s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(10) { height: 26px; animation-delay: 0.45s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(11) { height: 22px; animation-delay: 0.5s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(12) { height: 18px; animation-delay: 0.55s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(13) { height: 14px; animation-delay: 0.6s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(14) { height: 10px; animation-delay: 0.65s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(15) { height: 6px; animation-delay: 0.7s; }\n\n }\n \n .compact-info {\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n \n .compact-timer {\n display: flex;\n align-items: center;\n gap: 5px;\n font-family: 'JetBrains Mono', 'Courier New', monospace;\n font-size: 13px;\n font-weight: 600;\n color: ").concat(u).concat(C,";\n }\n \n .compact-timer .timer-dot {\n width: 6px;\n height: 6px;\n background: #ef4444;\n border-radius: 50%;\n animation: timerPulse 1s ease-in-out infinite;\n }\n \n .compact-status {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 11px;\n color: ").concat(n,";\n }\n \n .compact-status .status-dot {\n width: 5px;\n height: 5px;\n background: ").concat(i,";\n border-radius: 50%;\n animation: statusPulse 1.5s ease-in-out infinite;\n }\n \n @keyframes statusPulse {\n 0%, 100% { opacity: 1; transform: scale(1); }\n 50% { opacity: 0.7; transform: scale(1.1); }\n }\n \n .compact-controls {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n \n .compact-control-btn {\n width: 36px;\n height: 36px;\n min-width: 36px;\n min-height: 36px;\n border-radius: 50%;\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: all 0.2s ease;\n padding: 0;\n position: relative;\n }\n \n .compact-control-btn svg {\n width: 16px;\n height: 16px;\n }\n \n .compact-control-btn.secondary {\n background: #f1f5f9;\n color: #64748b;\n }\n \n \n /* Compact speaker button background color */\n #desktopSpeakerBtnCompact.compact-control-btn.secondary {\n background: ").concat(f).concat(C,";\n }\n /* Compact microphone button background color */\n #desktopMuteBtnCompact.compact-control-btn.secondary {\n background: ").concat(m).concat(C,";\n }\n \n .compact-control-btn.secondary:hover {\n background: #e2e8f0;\n color: #475569;\n }\n \n .compact-control-btn.secondary.muted {\n background: rgba(239, 68, 68, 0.1);\n color: #ef4444;\n }\n \n \n .compact-control-btn.secondary.muted .desktop-mic-icon,\n .compact-control-btn.secondary.muted .desktop-speaker-icon {\n stroke: #ef4444;\n }\n \n .compact-control-btn.secondary.muted .desktop-mic-off-icon,\n .compact-control-btn.secondary.muted .desktop-speaker-off-icon {\n width: 46px;\n height: 46px;\n }\n\n .compact-control-btn.danger {\n width: 40px;\n height: 40px;\n min-width: 40px;\n min-height: 40px;\n background: ").concat(v).concat(C,";\n color: white;\n box-shadow: 0 3px 10px rgba(239, 68, 68, 0.35);\n }\n \n .compact-control-btn.danger:hover {\n transform: scale(1.05);\n box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45);\n }\n \n .compact-control-btn.danger svg {\n width: 18px;\n height: 18px;\n overflow: visible;\n }\n \n/* ===== CONVERSATION PANEL ===== */\n .desktop-conversation-panel {\n border-top: 1px solid rgba(0, 0, 0, 0.06);\n width: 100%;\n display: flex;\n flex-direction: column;\n min-height: 0;\n overflow: hidden;\n flex: 1;\n }\n \n .conversation-header {\n padding: 10px 16px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n background: #fafafa;\n cursor: pointer;\n flex-shrink: 0;\n border-bottom: 1px solid rgba(0, 0, 0, 0.04);\n transition: background 0.2s ease;\n }\n \n .conversation-header:hover {\n background: #f5f5f5;\n }\n \n .conversation-label {\n font-size: 11px;\n font-weight: 600;\n color: #64748b;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n }\n \n .conversation-toggle {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 11px;\n color: #94a3b8;\n font-weight: 500;\n }\n \n .conversation-toggle svg {\n transition: transform 0.2s ease;\n }\n \n .conversation-header.expanded .conversation-toggle svg {\n transform: rotate(180deg);\n }\n \n /* ===== COLLAPSED: Live Transcript Only (2 lines) ===== */\n .live-transcript-collapsed {\n padding: 12px 16px;\n background: #fafafa;\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex-shrink: 0;\n min-height: 50px;\n }\n \n .live-indicator {\n display: flex;\n align-items: center;\n gap: 5px;\n font-size: 9px;\n font-weight: 700;\n color: ").concat(B).concat(C,";\n text-transform: uppercase;\n letter-spacing: 0.08em;\n }\n \n .live-indicator .live-dot {\n height: 5px;\n width: 5px;\n background: ").concat(h).concat(C,";\n border-radius: 50%;\n animation: statusPulse 1.5s ease-in-out infinite;\n }\n \n .live-text-collapsed {\n font-size: ").concat(g).concat(C,";\n color: ").concat(u).concat(C,";\n line-height: 1.5;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n \n .live-text-collapsed.muted {\n color: #94a3b8;\n font-style: italic;\n }\n \n .typing-cursor {\n display: inline-block;\n width: 2px;\n height: 14px;\n background: #a855f7;\n margin-left: 2px;\n animation: blink 1s step-end infinite;\n vertical-align: middle;\n }\n \n @keyframes blink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0; }\n }\n \n /* ===== EXPANDED: Full Conversation History ===== */\n .conversation-history {\n flex: 1;\n flex-direction: column;\n gap: 10px;\n overflow-y: auto;\n padding: 14px 16px;\n min-height: 0;\n }\n .conversation-history.visible {\n display: flex;\n }\n\n .conversation-messages {\n display: flex;\n flex-direction: column;\n gap: 10px;\n }\n\n /* Message Rows */\n .message-row {\n display: flex;\n gap: 8px;\n animation: msgIn 0.25s ease;\n }\n \n @keyframes msgIn {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes slideIn {\n from { opacity: 0; transform: translateY(-10px); }\n to { opacity: 1; transform: translateY(0); }\n }\n \n @keyframes slideOut {\n from { opacity: 1; transform: translateY(0); }\n to { opacity: 0; transform: translateY(-10px); }\n }\n \n .message-row.user {\n flex-direction: row-reverse;\n }\n \n .message-avatar {\n width: 28px;\n height: 28px;\n border-radius: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .message-avatar.assistant {\n background: linear-gradient(135deg, #c084fc, #a855f7);\n }\n\n .message-avatar.assistant .orb {\n width: 12px;\n height: 12px;\n background: rgba(255, 255, 255, 0.9);\n border-radius: 50%;\n }\n\n .message-avatar.user {\n background: linear-gradient(135deg, #64748b, #475569);\n color: #fff;\n font-size: 11px;\n font-weight: 600;\n }\n\n .message-bubble {\n max-width: 80%;\n padding: 9px 13px;\n border-radius: 12px;\n font-size: 13px;\n line-height: 1.5;\n }\n \n .message-row.assistant .message-bubble {\n background: #fff;\n color: ").concat(u).concat(C,";\n border: 1px solid rgba(0, 0, 0, 0.06);\n border-bottom-left-radius: 4px;\n }\n \n .message-row.user .message-bubble {\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);\n color: #fff;\n border-bottom-right-radius: 4px;\n }\n \n /* Live message at bottom of history */\n .live-message-row {\n display: flex;\n gap: 8px;\n padding-top: 8px;\n border-top: 1px dashed rgba(0, 0, 0, 0.08);\n margin-top: auto;\n }\n \n .live-message-row .message-bubble {\n background: #fff;\n border: 1px solid rgba(16, 185, 129, 0.3);\n color: ").concat(u).concat(C,";\n position: relative;\n border-radius: 14px;\n border-bottom-left-radius: 4px;\n }\n \n .live-message-row .live-badge {\n position: absolute;\n top: -8px;\n left: 10px;\n background: #10b981;\n color: #fff;\n font-size: 8px;\n font-weight: 700;\n padding: 2px 6px;\n border-radius: 4px;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n }\n \n /* Hide/show based on expanded state */\n .desktop-conversation-panel.collapsed .conversation-history {\n display: none;\n }\n \n .desktop-conversation-panel.collapsed .live-transcript-collapsed {\n display: flex;\n }\n \n .desktop-conversation-panel.expanded .conversation-history {\n display: flex;\n max-height: 400px;\n }\n \n .desktop-conversation-panel.expanded .live-transcript-collapsed {\n display: none;\n }\n \n /* ===== DARK MODE SUPPORT ===== */\n @media (prefers-color-scheme: dark) {\n .desktop-voice-section {\n background: linear-gradient(180deg, #1e1e2e 0%, rgba(168, 85, 247, 0.08) 100%);\n }\n\n .desktop-timer {\n color: #94a3b8;\n }\n\n .desktop-status {\n color: #34d399;\n }\n\n .desktop-status .status-dot {\n \n .desktop-control-btn.secondary.muted {\n background: rgba(255, 255, 255, 0.1);\n color: #9ca3af;\n \n .compact-voice-section {\n background: linear-gradient(180deg, #1e1e2e 0%, rgba(168, 85, 247, 0.08) 100%);\n border-bottom: 1px solid rgba(255, 255, 255, 0.08);\n }\n \n .compact-timer {\n color: #e2e8f0;\n }\n \n .compact-status {\n color: #34d399;\n }\n \n .compact-status .status-dot {\n background: #34d399;\n }\n \n .compact-control-btn.secondary {\n background: rgba(255, 255, 255, 0.08);\n color: #94a3b8;\n }\n \n .compact-control-btn.secondary:hover {\n background: rgba(255, 255, 255, 0.15);\n color: #e2e8f0;\n }\n \n .compact-control-btn.secondary.muted {\n background: rgba(239, 68, 68, 0.2);\n color: #f87171;\n }\n\n }\n \n .desktop-control-btn.secondary.muted svg {\n \n .desktop-control-btn.secondary {\n position: relative;\n }\n \n /* Desktop microphone button background color */\n #desktopMuteBtn.desktop-control-btn.secondary,\n #desktopMuteBtnCompact.compact-control-btn.secondary {\n background: ").concat(m).concat(C,";\n }\n \n .desktop-mic-off-icon,\n .desktop-speaker-off-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 20px;\n height: 20px;\n }\n \n .desktop-control-btn.secondary.muted {\n background: #f3f4f6;\n color: #9ca3af;\n }\n \n .desktop-control-btn.secondary.muted svg {\n \n .desktop-control-btn.secondary {\n position: relative;\n }\n \n /* Desktop microphone button background color */\n #desktopMuteBtn.desktop-control-btn.secondary,\n #desktopMuteBtnCompact.compact-control-btn.secondary {\n background: ").concat(m).concat(C,";\n }\n \n .desktop-mic-off-icon,\n .desktop-speaker-off-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 20px;\n height: 20px;\n }\n stroke: #9ca3af;\n }\n stroke: #9ca3af;\n }\n background: #34d399;\n }\n\n .desktop-control-btn.secondary {\n background: rgba(255, 255, 255, 0.08);\n color: #94a3b8;\n }\n\n .desktop-control-btn.secondary:hover {\n background: rgba(255, 255, 255, 0.15);\n color: #e2e8f0;\n }\n\n .desktop-conversation-panel {\n border-top: 1px solid rgba(255, 255, 255, 0.08);\n }\n\n .conversation-header {\n background: #1a1a2e;\n }\n\n .conversation-header:hover {\n background: #252540;\n }\n\n .conversation-label {\n color: #94a3b8;\n }\n\n .conversation-toggle {\n color: #64748b;\n }\n\n .live-transcript-preview {\n background: #1a1a2e;\n }\n .live-indicator {\n color: ").concat(B).concat(C,";\n }\n .live-indicator .live-dot {\n background: ").concat(h).concat(C,";\n }\n\n .live-text {\n color: #e2e8f0;\n }\n\n .live-text.muted {\n color: #64748b;\n }\n\n .conversation-history {\n background: #1a1a2e;\n }\n\n .conversation-msg.assistant .conversation-msg-bubble {\n background: #252540;\n color: #e2e8f0;\n border: 1px solid rgba(255, 255, 255, 0.08);\n }\n\n .voice-text-input-area {\n background: #1a1a2e;\n }\n\n .voice-text-input {\n background: #252540 !important;\n color: #e2e8f0 !important;\n border-color: rgba(255, 255, 255, 0.1) !important;\n }\n\n .voice-text-input::placeholder {\n color: #64748b !important;\n }\n\n .voice-text-input:focus {\n border-color: ").concat(e," !important;\n box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2) !important;\n }\n\n .voice-input-hint {\n color: #64748b !important;\n }\n\n .voice-send-btn {\n background: ").concat(w," !important;\n }\n\n .voice-send-btn:disabled {\n background: #374151 !important;\n color: #4b5563 !important;\n }\n }\n\n /* Mobile optimization */\n @media (max-width: 768px) {\n .voice-interface {\n padding: 6px 10px;\n }\n }\n \n @media (max-width: 480px) {\n .voice-interface {\n padding: 5px 8px;\n }\n }\n \n /* Mobile Voice Call UI - Shared styles (also used in generateMobileCSS) */\n ").concat(this._getSharedMobileCSS(C),"\n ")}_getSharedMobileCSS(A){return"\n .mobile-duration-dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background-color: #ef4444;\n animation: mobilePulse 1.5s ease-in-out infinite;\n }\n\n @keyframes mobilePulse {\n 0%, 100% { opacity: 1; transform: scale(1); }\n 50% { opacity: 0.5; transform: scale(0.95); }\n }\n\n .mobile-voice-bar {\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 14px;\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #c084fc 100%);\n border-radius: 24px 24px 0 0;\n box-shadow: 0 -8px 32px rgba(124, 58, 237, 0.5), 0 -2px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.2);\n width: 100%;\n max-width: 100%;\n pointer-events: auto;\n }\n\n .mobile-top-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n position: relative;\n }\n\n .mobile-status-indicator {\n display: flex;\n align-items: center;\n gap: 5px;\n min-width: 85px;\n }\n\n .mobile-status-dot {\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background-color: #22c55e;\n box-shadow: 0 0 8px #22c55e;\n transition: all 0.3s ease;\n }\n\n .mobile-status-text {\n font-size: 11px;\n font-weight: 700;\n color: rgba(255,255,255,0.95);\n text-transform: uppercase;\n letter-spacing: 0.3px;\n }\n\n .mobile-waveform-center {\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 3px;\n height: 24px;\n }\n\n .mobile-waveform-bar {\n width: 4px;\n height: 4px;\n background-color: #fff;\n border-radius: 2px;\n transition: height 0.15s ease;\n box-shadow: 0 0 8px rgba(255,255,255,0.5);\n }\n\n .mobile-controls {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n\n .mobile-control-btn {\n display: flex".concat(A,";\n align-items: center").concat(A,";\n justify-content: center").concat(A,";\n width: 32px").concat(A,";\n height: 32px").concat(A,";\n min-width: 32px").concat(A,";\n min-height: 32px").concat(A,";\n max-width: 32px").concat(A,";\n max-height: 32px").concat(A,";\n border-radius: 50%").concat(A,";\n border: none").concat(A,";\n cursor: pointer").concat(A,";\n transition: all 0.2s ease;\n background-color: rgba(255,255,255,0.15)").concat(A,";\n position: relative").concat(A,";\n overflow: hidden").concat(A,";\n padding: 0").concat(A,";\n margin: 0").concat(A,";\n box-sizing: border-box").concat(A,";\n }\n\n .mobile-control-btn:hover {\n background-color: rgba(255,255,255,0.25)").concat(A,";\n }\n\n .mobile-control-btn.muted {\n background-color: rgba(239, 68, 68, 0.3)").concat(A,";\n }\n\n .mobile-control-btn svg {\n position: absolute").concat(A,";\n top: 50%").concat(A,";\n left: 50%").concat(A,";\n transform: translate(-50%, -50%)").concat(A,";\n display: block").concat(A,";\n visibility: visible").concat(A,";\n opacity: 1").concat(A,";\n width: 15px").concat(A,";\n height: 15px").concat(A,";\n margin: 0").concat(A,";\n padding: 0").concat(A,";\n }\n\n .mobile-mic-off-icon,\n .mobile-speaker-off-icon {\n display: none !important;\n }\n\n .mobile-control-btn.muted .mobile-mic-icon,\n .mobile-control-btn.muted .mobile-speaker-icon {\n display: none !important;\n }\n\n .mobile-control-btn.muted .mobile-mic-off-icon,\n .mobile-control-btn.muted .mobile-speaker-off-icon {\n display: block !important;\n }\n\n .mobile-end-call-btn {\n display: flex").concat(A,";\n align-items: center").concat(A,";\n justify-content: center").concat(A,";\n width: 36px").concat(A,";\n height: 36px").concat(A,";\n min-width: 36px").concat(A,";\n min-height: 36px").concat(A,";\n max-width: 36px").concat(A,";\n max-height: 36px").concat(A,";\n border-radius: 50%").concat(A,";\n border: none").concat(A,";\n cursor: pointer").concat(A,";\n background-color: #ef4444").concat(A,";\n box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);\n transition: all 0.2s ease;\n overflow: hidden").concat(A,";\n padding: 0").concat(A,";\n margin: 0").concat(A,";\n box-sizing: border-box").concat(A,";\n }\n\n .mobile-end-call-btn svg {\n display: block").concat(A,";\n visibility: visible").concat(A,";\n opacity: 1").concat(A,";\n width: 15px").concat(A,";\n height: 15px").concat(A,";\n margin: 0").concat(A,";\n padding: 0").concat(A,";\n position: relative").concat(A,";\n }\n\n /* ID-specific selectors for WordPress compatibility */\n #mobileMuteBtn.mobile-control-btn,\n #mobileSpeakerBtn.mobile-control-btn,\n #mobileEndCallBtn.mobile-end-call-btn {\n border-radius: 50% !important;\n overflow: hidden !important;\n }\n \n /* Mobile microphone button background color */\n #mobileMuteBtn.mobile-control-btn {\n background: ").concat(this.config.micButtonColor||this.config.controlButtonColor||"#FFFFFF").concat(A,";\n }\n\n #mobileMuteBtn.mobile-control-btn,\n #mobileSpeakerBtn.mobile-control-btn {\n width: 32px !important;\n height: 32px !important;\n min-width: 32px !important;\n min-height: 32px !important;\n max-width: 32px !important;\n max-height: 32px !important;\n }\n\n #mobileEndCallBtn.mobile-end-call-btn {\n width: 36px !important;\n height: 36px !important;\n min-width: 36px !important;\n min-height: 36px !important;\n max-width: 36px !important;\n max-height: 36px !important;\n }\n\n #mobileMuteBtn.mobile-control-btn svg,\n #mobileSpeakerBtn.mobile-control-btn svg,\n #mobileEndCallBtn.mobile-end-call-btn svg {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 15px !important;\n height: 15px !important;\n margin: 0 !important;\n padding: 0 !important;\n }\n\n .mobile-end-call-btn:hover {\n transform: scale(1.05);\n }\n\n .mobile-transcript-row {\n width: 100%;\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 10px 12px;\n background: rgba(255,255,255,0.18);\n border-radius: 14px;\n border: none;\n cursor: pointer;\n text-align: left;\n backdrop-filter: blur(4px);\n transition: background 0.2s ease;\n }\n\n .mobile-transcript-row:hover {\n background: rgba(255,255,255,0.25);\n }\n\n .mobile-transcript-text {\n margin: 0;\n font-size: 13px;\n color: #fff;\n line-height: 1.4;\n font-weight: 500;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .mobile-transcript-footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .mobile-expand-hint {\n font-size: 10px;\n color: rgba(255,255,255,0.6);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n font-weight: 600;\n }\n\n .mobile-transcript-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0,0,0,0.6);\n display: flex;\n align-items: flex-end;\n padding: 12px;\n z-index: 100000;\n pointer-events: auto;\n }\n\n .mobile-expanded-transcript {\n width: 100%;\n max-height: 75%;\n background: #fff;\n border-radius: 24px 24px 16px 16px;\n overflow: hidden;\n box-shadow: 0 -8px 40px rgba(0,0,0,0.3);\n display: flex;\n flex-direction: column;\n }\n\n .mobile-transcript-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 14px 16px;\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);\n flex-shrink: 0;\n }\n\n .mobile-header-left {\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n\n .mobile-header-status {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n\n .mobile-header-status-dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background-color: #22c55e;\n box-shadow: 0 0 6px #22c55e;\n }\n\n .mobile-header-status-text {\n font-size: 10px;\n font-weight: 700;\n color: rgba(255,255,255,0.9);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n }\n\n .mobile-header-duration {\n font-size: 10px;\n font-weight: 600;\n color: rgba(255,255,255,0.7);\n margin-left: 8px;\n }\n\n .mobile-transcript-label {\n font-size: 11px;\n font-weight: 800;\n color: rgba(255,255,255,0.7);\n letter-spacing: 1px;\n }\n\n .mobile-close-transcript-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n border: none;\n background: rgba(255,255,255,0.2);\n color: #fff;\n cursor: pointer;\n }\n\n .mobile-close-transcript-btn:hover {\n background: rgba(255,255,255,0.3);\n }\n\n .mobile-messages-container {\n flex: 1;\n padding: 16px;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n\n .mobile-message-bubble {\n max-width: 85%;\n padding: 12px 16px;\n border-radius: 18px;\n font-size: 14px;\n line-height: 1.5;\n word-wrap: break-word;\n }\n\n .mobile-message-bubble.assistant {\n align-self: flex-start;\n background-color: #f3f4f6;\n color: #374151;\n border-bottom-left-radius: 4px;\n }\n\n .mobile-message-bubble.user {\n align-self: flex-end;\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);\n color: #fff;\n border-bottom-right-radius: 4px;\n }\n\n .mobile-input-area {\n padding: 12px 16px 16px;\n border-top: 1px solid #e5e7eb;\n background: #f9fafb;\n flex-shrink: 0;\n }\n\n .mobile-input-wrapper {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 4px 4px 16px;\n background: #fff;\n border-radius: 24px;\n border: 2px solid #e5e7eb;\n }\n\n .mobile-text-input {\n flex: 1;\n border: none;\n outline: none;\n font-size: 14px;\n color: #374151;\n background: transparent;\n padding: 10px 0;\n }\n\n .mobile-text-input::placeholder {\n color: #9ca3af;\n }\n\n .mobile-send-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n border-radius: 50%;\n border: none;\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);\n color: #fff;\n cursor: pointer;\n transition: all 0.2s ease;\n }\n\n .mobile-send-btn:hover:not(:disabled) {\n transform: scale(1.05);\n }\n\n .mobile-send-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .mobile-input-hint {\n margin: 8px 0 0;\n font-size: 11px;\n color: #9ca3af;\n text-align: center;\n transition: color 0.2s ease;\n }\n\n /* Mobile text input status states */\n .mobile-input-hint--sending {\n color: #666;\n }\n\n .mobile-input-hint--success {\n color: #28a745;\n }\n\n .mobile-input-hint--queued {\n color: #ffc107;\n }\n\n .mobile-input-hint--error {\n color: #dc3545;\n }\n\n /* Disabled mobile input styling */\n #mobileTextInput:disabled {\n background-color: #f5f5f5;\n cursor: not-allowed;\n }\n\n #mobileSendBtn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n ")}generateMobileCSS(){var A=!1===this.config.useShadowDOM?" !important":"";return"\n /* Mobile Voice Call UI - Container positioning */\n #mobile-voice-call-bar-container {\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 99999;\n font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;\n padding: 0 12px 12px;\n pointer-events: none;\n }\n\n .mobile-duration-badge {\n position: absolute;\n top: -28px;\n left: 50%;\n transform: translateX(-50%);\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 5px 14px;\n background: rgba(0,0,0,0.75);\n border-radius: 20px;\n font-size: 12px;\n font-weight: 700;\n color: #fff;\n backdrop-filter: blur(8px);\n z-index: 10;\n pointer-events: auto;\n }\n\n /* Shared mobile styles */\n ".concat(this._getSharedMobileCSS(A),"\n ")}}class de{constructor(A){this.voiceInterface=A,this.config=A.config,this.conversationMessages=[],this.currentLiveMessage=null}t(A){return this.voiceInterface.t(A)}escapeHtml(A){return this.voiceInterface.escapeHtml(A)}updateTranscript(A){if(console.log("📝 [TRANSCRIPT] updateTranscript() called with text:",A?A.substring(0,50)+"...":"null/empty"),this.voiceInterface.isMobile){var e=document.getElementById("mobileTranscriptText");e&&(e.textContent=A),this.voiceInterface.messages.length>0&&"assistant"===this.voiceInterface.messages[this.voiceInterface.messages.length-1].type?this.voiceInterface.messages[this.voiceInterface.messages.length-1].text=A:this.voiceInterface.messages.push({type:"assistant",text:A});var t=document.getElementById("mobileMessagesContainer");if(t){var n=t.querySelector(".mobile-message-bubble.assistant:last-child");n?n.textContent=A:this.voiceInterface.addMobileMessage("assistant",A)}}else{var o=this.voiceInterface.shadowRoot.getElementById("liveTextCollapsed");if(o)if(A&&A.trim()){o.textContent=A,o.classList.remove("muted");var i=document.createElement("span");i.className="typing-cursor",o.appendChild(i)}else o.textContent=this.t("transcriptWillAppear")||"Transcript will appear here...",o.classList.add("muted");if(A&&A.trim()?(this.currentLiveMessage&&"assistant"===this.currentLiveMessage.role&&A.startsWith(this.currentLiveMessage.content)?this.currentLiveMessage.content=A:(this.currentLiveMessage&&this.finalizeLiveMessage(),this.currentLiveMessage={role:"assistant",content:A}),this.updateLiveMessageRow()):(this.currentLiveMessage=null,this.updateLiveMessageRow()),this.voiceInterface.conversationExpanded){var r=this.voiceInterface.shadowRoot.getElementById("conversationHistory");r&&setTimeout(()=>{r.scrollTop=r.scrollHeight},10)}}}toggleConversationPanel(){if(!this.voiceInterface.isMobile){this.voiceInterface.conversationExpanded=!this.voiceInterface.conversationExpanded;var A=this.voiceInterface.shadowRoot.getElementById("desktopConversationPanel"),e=this.voiceInterface.shadowRoot.getElementById("conversationHeader"),t=this.voiceInterface.shadowRoot.getElementById("conversationToggleText"),n=this.voiceInterface.shadowRoot.querySelector(".voice-interface");if(A){var o,i=this.voiceInterface.shadowRoot.getElementById("desktopVoiceSection"),r=this.voiceInterface.shadowRoot.getElementById("compactVoiceSection");this.voiceInterface.conversationExpanded?(A.classList.remove("collapsed"),A.classList.add("expanded"),e&&e.classList.add("expanded"),t&&(t.textContent="Hide history"),n&&n.classList.add("expanded"),i&&(i.style.display="none"),r&&(r.style.display="flex"),console.log("📝 [TRANSCRIPT] Expanding panel, rendering",(null===(o=this.conversationMessages)||void 0===o?void 0:o.length)||0,"messages"),this.renderConversationMessages()):(A.classList.remove("expanded"),A.classList.add("collapsed"),e&&e.classList.remove("expanded"),t&&(t.textContent="Show history"),n&&n.classList.remove("expanded"),i&&(i.style.display=""),r&&(r.style.display="none"))}}}finalizeLiveMessage(){this.currentLiveMessage&&this.currentLiveMessage.content&&this.currentLiveMessage.content.trim()&&(this.conversationMessages||(this.conversationMessages=[]),this.conversationMessages.push({role:this.currentLiveMessage.role,content:this.currentLiveMessage.content}),console.log("📝 [TRANSCRIPT] Finalized live message:",this.currentLiveMessage.role,this.currentLiveMessage.content.substring(0,50)+"..."),this.currentLiveMessage=null,this.voiceInterface.conversationExpanded&&this.renderConversationMessages())}addConversationMessage(A,e){if(!this.voiceInterface.isMobile&&e&&e.trim()){if(this.currentLiveMessage&&this.finalizeLiveMessage(),this.conversationMessages||(this.conversationMessages=[]),"user"!==A)return this.currentLiveMessage={role:A,content:e},this.updateLiveMessageRow(),void console.log("📝 [TRANSCRIPT] Assistant message set as live (via addConversationMessage)");this.conversationMessages.push({role:A,content:e}),console.log("📝 [TRANSCRIPT] User message added to history"),this.voiceInterface.conversationExpanded&&this.renderConversationMessages()}}updateLiveMessageRow(){var A=this.voiceInterface.shadowRoot.getElementById("liveMessageRow"),e=this.voiceInterface.shadowRoot.getElementById("liveMessageText"),t=null==A?void 0:A.querySelector(".message-avatar");if(A&&e)if(this.currentLiveMessage&&this.currentLiveMessage.content&&this.currentLiveMessage.content.trim()){t&&("user"===this.currentLiveMessage.role?(t.textContent="U",t.className="message-avatar user"):(t.innerHTML='<div class="orb"></div>',t.className="message-avatar assistant")),e.textContent=this.currentLiveMessage.content,A.style.display="flex";var n=e.querySelector(".typing-cursor")||document.createElement("span");n.className="typing-cursor",e.querySelector(".typing-cursor")||e.appendChild(n)}else A.style.display="none"}clearConversationMessages(){this.conversationMessages=[],this.currentLiveMessage=null;var A=this.voiceInterface.shadowRoot.getElementById("liveMessageRow");A&&(A.style.display="none")}renderConversationMessages(){var A=this.voiceInterface.shadowRoot.getElementById("conversationMessages");if(A){if(!this.conversationMessages||0===this.conversationMessages.length)return console.log("📝 [TRANSCRIPT] No messages to render"),void(A.innerHTML="");var e=[...this.conversationMessages];if(this.currentLiveMessage&&e.length>0){var t=e[e.length-1];t.role===this.currentLiveMessage.role&&t.content===this.currentLiveMessage.content&&(e=e.slice(0,-1))}console.log("📝 [TRANSCRIPT] Rendering",e.length,"messages (live message excluded)"),A.innerHTML=e.map(A=>{var e="user"===A.role;return'\n <div class="message-row '.concat(A.role,'">\n <div class="message-avatar ').concat(A.role,'">\n ').concat(e?"U":'<div class="orb"></div>','\n </div>\n <div class="message-bubble">').concat(this.escapeHtml(A.content),"</div>\n </div>\n ")}).join("");var n=this.voiceInterface.shadowRoot.getElementById("conversationHistory");n&&setTimeout(()=>{n.scrollTop=n.scrollHeight},10)}else console.warn("📝 [TRANSCRIPT] conversationMessages container not found")}}class ue{constructor(A){this.voiceInterface=A,this.config=A.config,this.shadowRoot=A.shadowRoot,this._textInjectTimeout=null,this._mobileTextInjectTimeout=null,this._statusClearTimeout=null,this._mobileStatusClearTimeout=null,this._originalHintText=null,this._originalMobileHintText=null,this._textInjectAckHandler=null}t(A){return this.voiceInterface.t(A)}setupTextInjectAckHandler(){var A;null!==(A=this.voiceInterface.sdk)&&void 0!==A&&A.voiceSDK&&(this._textInjectAckHandler&&this.voiceInterface.sdk.voiceSDK.off("textInjectAck",this._textInjectAckHandler),this._textInjectAckHandler=A=>{this.handleTextInjectAck(A)},this.voiceInterface.sdk.voiceSDK.on("textInjectAck",this._textInjectAckHandler))}cleanup(){this._textInjectTimeout&&(clearTimeout(this._textInjectTimeout),this._textInjectTimeout=null),this._mobileTextInjectTimeout&&(clearTimeout(this._mobileTextInjectTimeout),this._mobileTextInjectTimeout=null),this._statusClearTimeout&&(clearTimeout(this._statusClearTimeout),this._statusClearTimeout=null),this._mobileStatusClearTimeout&&(clearTimeout(this._mobileStatusClearTimeout),this._mobileStatusClearTimeout=null),this._originalHintText=null,this._originalMobileHintText=null}handleTextInjectAck(A){var e,t;this._textInjectTimeout&&(clearTimeout(this._textInjectTimeout),this._textInjectTimeout=null),this._mobileTextInjectTimeout&&(clearTimeout(this._mobileTextInjectTimeout),this._mobileTextInjectTimeout=null);var n=this.shadowRoot.getElementById("voiceTextInput"),o=this.shadowRoot.getElementById("voiceSendBtn");n&&(n.disabled=!1),o&&(o.disabled=!(null!=n&&null!==(e=n.value)&&void 0!==e&&e.trim()));var i=document.getElementById("mobileTextInput"),r=document.getElementById("mobileSendBtn");if(i&&(i.disabled=!1),r&&(r.disabled=!(null!=i&&null!==(t=i.value)&&void 0!==t&&t.trim())),A.success){var s,a=null===(s=A.message)||void 0===s?void 0:s.toLowerCase().includes("queued"),c=a?"queued":"success",l=a?"Message queued":"Message sent";this.voiceInterface.isMobile?this.showMobileTextInputStatus(c,l):this.showDesktopTextInputStatus(c,l)}else{var d=A.message||"Failed to send";this.voiceInterface.isMobile?this.showMobileTextInputStatus("error",d):this.showDesktopTextInputStatus("error",d)}}sendDesktopTextMessage(){var A=this.shadowRoot.getElementById("voiceTextInput"),e=this.shadowRoot.getElementById("voiceSendBtn");if(A&&e){var t=A.value.trim();t&&this._sendTextMessage(t,A,e,!1)}else console.warn("VoiceInterface: Missing UI elements for desktop text send")}sendMobileTextMessage(){var A=document.getElementById("mobileTextInput"),e=document.getElementById("mobileSendBtn");A&&e?this._sendTextMessage(A.value,A,e,!0):console.warn("VoiceInterface: Missing UI elements for mobile text send")}_sendTextMessage(A,e,t,n){var o;if(this.voiceInterface.isActive&&null!==(o=this.voiceInterface.sdk)&&void 0!==o&&o.voiceSDK){var i=null==A?void 0:A.trim();if(i){e.value="",t&&(t.disabled=!0),this.showTextInputStatus(n?"mobile":"desktop","sending","Sending...");try{if(this.voiceInterface.sdk.voiceSDK.sendMessage({t:"text_inject",text:i})){var r=setTimeout(()=>{n?this._mobileTextInjectTimeout=null:this._textInjectTimeout=null,e.disabled=!1,t&&(t.disabled=!1),this.showTextInputStatus(n?"mobile":"desktop","error","No response")},5e3);n?this._mobileTextInjectTimeout=r:this._textInjectTimeout=r,n?this.voiceInterface.addMobileMessage("user",i):this.voiceInterface.addConversationMessage("user",i)}else e.disabled=!1,t&&(t.disabled=!1),this.showTextInputStatus(n?"mobile":"desktop","error","Failed to send")}catch(A){console.error("Error sending text message:",A),e.disabled=!1,t&&(t.disabled=!1),this.showTextInputStatus(n?"mobile":"desktop","error","Error sending")}}else this.showTextInputStatus(n?"mobile":"desktop","error","Enter text first")}else console.warn("VoiceInterface: Cannot send text - call not active")}showTextInputStatus(A,e,t){"mobile"===A?this.showMobileTextInputStatus(e,t):this.showDesktopTextInputStatus(e,t)}showDesktopTextInputStatus(A,e){var t=this.shadowRoot.querySelector(".voice-input-hint");t&&(this._originalHintText||(this._originalHintText=t.textContent),t.classList.remove("voice-input-hint--sending","voice-input-hint--success","voice-input-hint--queued","voice-input-hint--error"),"sending"===A?(t.classList.add("voice-input-hint--sending"),t.textContent=e||"Sending..."):"success"===A?(t.classList.add("voice-input-hint--success"),t.textContent=e||"Sent",this.clearTextInputStatusAfterDelay(3e3)):"queued"===A?(t.classList.add("voice-input-hint--queued"),t.textContent=e||"Queued"):"error"===A?(t.classList.add("voice-input-hint--error"),t.textContent=e||"Error",this.clearTextInputStatusAfterDelay(3e3)):"clear"===A&&(t.textContent=this._originalHintText||this.t("voiceActive")||"Voice is still active • Type or speak",this._originalHintText=null))}showMobileTextInputStatus(A,e){var t=document.querySelector(".mobile-input-hint");t&&(this._originalMobileHintText||(this._originalMobileHintText=t.textContent),t.classList.remove("mobile-input-hint--sending","mobile-input-hint--success","mobile-input-hint--queued","mobile-input-hint--error"),"sending"===A?(t.classList.add("mobile-input-hint--sending"),t.textContent=e||"Sending..."):"success"===A?(t.classList.add("mobile-input-hint--success"),t.textContent=e||"Sent",this.clearMobileTextInputStatusAfterDelay(3e3)):"queued"===A?(t.classList.add("mobile-input-hint--queued"),t.textContent=e||"Queued"):"error"===A?(t.classList.add("mobile-input-hint--error"),t.textContent=e||"Error",this.clearMobileTextInputStatusAfterDelay(3e3)):"clear"===A&&(t.textContent=this._originalMobileHintText||"🎙️ Voice is still active • Type or speak",this._originalMobileHintText=null))}clearTextInputStatusAfterDelay(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;this._statusClearTimeout&&clearTimeout(this._statusClearTimeout),this._statusClearTimeout=setTimeout(()=>{this.showDesktopTextInputStatus("clear"),this._statusClearTimeout=null},A)}clearMobileTextInputStatusAfterDelay(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;this._mobileStatusClearTimeout&&clearTimeout(this._mobileStatusClearTimeout),this._mobileStatusClearTimeout=setTimeout(()=>{this.showMobileTextInputStatus("clear"),this._mobileStatusClearTimeout=null},A)}}class ge{constructor(A){this.voiceInterface=A,this.config=A.config,this.shadowRoot=A.shadowRoot}setupEventHandlers(A){var e=this.shadowRoot.getElementById("startCallBtn"),t=this.shadowRoot.getElementById("desktopEndCallBtn"),n=this.shadowRoot.getElementById("desktopMuteBtn"),o=this.shadowRoot.getElementById("desktopSpeakerBtn"),i=this.shadowRoot.getElementById("desktopEndCallBtnCompact"),r=this.shadowRoot.getElementById("desktopMuteBtnCompact"),s=this.shadowRoot.getElementById("desktopSpeakerBtnCompact");if(e&&(e.onclick=()=>this.voiceInterface.startVoiceCall()),t&&(t.onclick=()=>this.voiceInterface.endVoiceCall()),n&&(n.onclick=()=>this.voiceInterface.toggleMute()),o&&(o.onclick=()=>this.voiceInterface.toggleSpeaker()),i&&(i.onclick=()=>this.voiceInterface.endVoiceCall()),r&&(r.onclick=()=>this.voiceInterface.toggleMute()),s&&(s.onclick=()=>this.voiceInterface.toggleSpeaker()),!this.voiceInterface.isMobile){var a=this.shadowRoot.getElementById("voiceTextInput"),c=this.shadowRoot.getElementById("voiceSendBtn");a&&(a.addEventListener("input",()=>{c&&(c.disabled=!a.value.trim())}),a.addEventListener("keypress",A=>{"Enter"===A.key&&!A.shiftKey&&a.value.trim()&&(A.preventDefault(),c&&!c.disabled&&c.click())})),c&&(c.onclick=()=>{this.voiceInterface.sendDesktopTextMessage()});var l=this.shadowRoot.getElementById("conversationHeader");l&&l.addEventListener("click",()=>{this.voiceInterface.transcript.toggleConversationPanel()})}}setupMobileEventHandlers(){if(this.voiceInterface.isMobile){var A=document.getElementById("mobileMuteBtn"),e=document.getElementById("mobileSpeakerBtn"),t=document.getElementById("mobileEndCallBtn"),n=document.getElementById("mobileTranscriptRow"),o=document.getElementById("mobileCloseTranscriptBtn"),i=document.getElementById("mobileTextInput"),r=document.getElementById("mobileSendBtn");A&&(A.onclick=()=>this.voiceInterface.toggleMute()),e&&(e.onclick=()=>this.voiceInterface.toggleSpeaker()),t&&(t.onclick=()=>this.voiceInterface.endVoiceCall()),n&&(n.onclick=()=>{this.voiceInterface.expandMobileTranscript()}),o&&(o.onclick=()=>{this.voiceInterface.collapseMobileTranscript()}),i&&(i.addEventListener("input",()=>{r&&(r.disabled=!i.value.trim())}),i.addEventListener("keypress",A=>{"Enter"===A.key&&!A.shiftKey&&i.value.trim()&&(A.preventDefault(),r&&!r.disabled&&r.click())})),r&&(r.onclick=()=>{this.voiceInterface.sendMobileTextMessage()})}}}class pe{constructor(A){this.voiceInterface=A,this.config=A.config,this.shadowRoot=A.shadowRoot,this._liveWaveformInterval=null}t(A){return this.voiceInterface.t(A)}adjustSizesForContainer(){var A=this.shadowRoot.getElementById("voiceInterface");if(A){var e,t,n,o,i,r,s=A.clientHeight||A.offsetHeight||400,a=A.clientWidth||A.offsetWidth||400;s<=350?(e=80,t=80,n=48,o=54,i=6,r=12):s<=450?(e=100,t=100,n=56,o=62,i=8,r=14):s<=550?(e=120,t=120,n=64,o=70,i=10,r=16):s<=700?(e=140,t=140,n=72,o=78,i=12,r=18):(e=160,t=160,n=80,o=86,i=14,r=20);var c=this.shadowRoot.querySelector(".voice-avatar, .voice-avatar-active");c&&(c.style.width="".concat(e,"px"),c.style.height="".concat(e,"px"),c.style.fontSize="".concat(.5*e,"px"));var l=this.shadowRoot.querySelector(".voice-status-title"),d=this.shadowRoot.querySelector(".voice-status-subtitle");l&&(l.style.fontSize="".concat(r,"px")),d&&(d.style.fontSize="".concat(Math.max(10,r-4),"px"));var u=this.shadowRoot.querySelector(".voice-transcript");u&&(u.style.minHeight="".concat(t,"px"),u.style.maxHeight="".concat(t,"px"),u.style.height="".concat(t,"px"),u.style.width="min(360px, ".concat(a-40,"px)"),u.style.boxSizing="border-box");var g=this.shadowRoot.querySelector(".transcript-label");g&&(g.style.fontSize="".concat(Math.max(8,r-4),"px"));var p=this.shadowRoot.querySelector(".transcript-text");p&&(p.style.fontSize="".concat(Math.max(10,r-2),"px"));var h=this.shadowRoot.querySelector(".voice-text-input-area");if(h){var B=h.querySelector(".voice-input-wrapper"),m=h.querySelector(".voice-text-input"),f=h.querySelector(".voice-send-btn"),v=h.querySelector(".voice-input-hint");if(B&&f){var w=Math.max(32,Math.min(40,.7*n));f.style.width="".concat(w,"px"),f.style.height="".concat(w,"px");var C=f.querySelector("svg");if(C){var y=Math.max(14,Math.min(18,.45*w));C.style.width="".concat(y,"px"),C.style.height="".concat(y,"px")}}m&&(m.style.fontSize="".concat(Math.max(11,Math.min(14,r)),"px"),m.style.padding="".concat(Math.max(6,Math.min(10,Math.floor(.15*n))),"px 0")),v&&(v.style.fontSize="".concat(Math.max(8,Math.min(11,r-4)),"px"),v.style.marginTop="".concat(Math.max(3,Math.min(6,Math.floor(.6*i))),"px"))}this.shadowRoot.querySelectorAll(".voice-control-btn.secondary").forEach(A=>{A.style.width="".concat(n,"px"),A.style.height="".concat(n,"px");var e=A.querySelector("svg");if(e){var t=.65*n;e.style.setProperty("width","".concat(t,"px"),"important"),e.style.setProperty("height","".concat(t,"px"),"important"),e.style.setProperty("min-width","".concat(t,"px"),"important"),e.style.setProperty("min-height","".concat(t,"px"),"important")}});var b=this.shadowRoot.querySelector(".voice-control-btn.primary");if(b){b.style.width="".concat(o,"px"),b.style.height="".concat(o,"px");var x=b.querySelector("svg");if(x){var Q=.7*o;x.style.setProperty("width","".concat(Q,"px"),"important"),x.style.setProperty("height","".concat(Q,"px"),"important"),x.style.setProperty("min-width","".concat(Q,"px"),"important"),x.style.setProperty("min-height","".concat(Q,"px"),"important")}}var F=this.shadowRoot.querySelector(".start-call-btn");if(F){var U,S;s<=350?(U=48,S=14):s<=450?(U=52,S=15):s<=550?(U=58,S=17):s<=700?(U=62,S=18):(U=64,S=18),F.style.height="".concat(U,"px"),F.style.fontSize="".concat(S,"px");var I=F.querySelector("svg");if(I){var E=Math.max(22,.5*U);I.style.width="".concat(E,"px"),I.style.height="".concat(E,"px")}}}}startDesktopWaveformAnimation(){if(!this.voiceInterface.isMobile){var A=this.shadowRoot.getElementById("desktopWaveform");A&&(A.classList.remove("paused"),this.updateDesktopStatus())}}stopDesktopWaveformAnimation(){if(!this.voiceInterface.isMobile){var A=this.shadowRoot.getElementById("desktopWaveform");A&&A.classList.add("paused")}}updateDesktopStatus(){if(!this.voiceInterface.isMobile){var A=this.shadowRoot.getElementById("compactStatusText")||this.shadowRoot.getElementById("desktopStatusText");if(A){var e,t=this.config.statusText;e=t||(this.voiceInterface.isActive&&!this.voiceInterface.isMicMuted?this.t("listening"):this.t("connected")),A.textContent=e;var n=this.shadowRoot.getElementById("desktopStatusText");n&&n!==A&&(n.textContent=e)}}}updateLiveWaveform(A){if(!this.voiceInterface.isMobile){var e=this.shadowRoot.getElementById("desktopLiveWaveform");e&&e.querySelectorAll(".desktop-live-bar").forEach((e,t)=>{if(A){var n=40*Math.random()+8;e.style.height="".concat(n,"px")}else e.style.height="8px"})}}showError(A){var e=this.shadowRoot.getElementById("transcriptText");e&&(e.textContent="".concat(this.t("error"),": ").concat(A),e.classList.remove("empty"))}showDomainError(){console.log("🚫 Showing domain error in widget UI...");var A=this.shadowRoot.getElementById("voiceIdleState");if(A){var e=A.querySelector(".voice-status-title"),t=A.querySelector(".voice-status-subtitle"),n=A.querySelector("#startCallBtn"),o=this.t("domainNotValidated"),i=this.t("domainErrorMessage");console.log("🚫 Domain error title:",o),console.log("🚫 Domain error message:",i),e?(e.textContent=o,e.style.color="#991B1B",e.style.fontSize="20px",e.style.fontWeight="600",e.style.marginLeft="20px",e.style.marginRight="20px",e.style.textAlign="center",console.log("✅ Updated statusTitle with domain error")):console.warn("⚠️ .voice-status-title element not found"),t?(t.textContent=i,t.style.color="#991B1B",t.style.fontSize="16px",t.style.marginLeft="20px",t.style.marginRight="20px",t.style.marginTop="12px",t.style.textAlign="center",t.style.lineHeight="1.5",console.log("✅ Updated statusSubtitle with domain error")):console.warn("⚠️ .voice-status-subtitle element not found"),n?(n.style.display="none",console.log("✅ Hidden start call button")):console.warn("⚠️ #startCallBtn element not found");var r=A.querySelector("#domainErrorBackBtn");if(r)r.style.display="flex";else{(r=document.createElement("button")).id="domainErrorBackBtn",r.className="domain-error-back-btn",r.innerHTML='\n <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" style="margin-right: 8px;">\n <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/>\n </svg>\n <span>'.concat(this.t("back")||"Back","</span>\n ");var s=A.querySelector(".voice-status");s&&s.parentNode?s.parentNode.insertBefore(r,s.nextSibling):t&&t.parentNode?t.parentNode.insertBefore(r,t.nextSibling):A.appendChild(r),r.style.cssText="\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 24px auto 0;\n padding: 12px 24px;\n background-color: #7C3AED;\n color: white;\n border: none;\n border-radius: 8px;\n font-size: 16px;\n font-weight: 500;\n cursor: pointer;\n transition: background-color 0.2s;\n max-width: 200px;\n ",r.addEventListener("mouseenter",()=>{r.style.backgroundColor="#6D28D9"}),r.addEventListener("mouseleave",()=>{r.style.backgroundColor="#7C3AED"}),r.onclick=()=>{console.log("🔙 Domain error back button clicked"),this.voiceInterface.isShowingDomainError=!1,this.voiceInterface.resetConnectingState(),r&&r.parentNode&&r.parentNode.removeChild(r),this.voiceInterface.config.onShowLanding&&"function"==typeof this.voiceInterface.config.onShowLanding&&this.voiceInterface.config.onShowLanding()},console.log("✅ Created domain error back button")}A.style.display="flex",console.log("✅ Domain error displayed in widget UI");var a=this.shadowRoot.getElementById("transcriptText");if(a){var c=this.t("domainNotValidated"),l=this.t("domainErrorMessage");a.innerHTML='<div style="font-weight: 600; font-size: 16px; margin-bottom: 8px; color: #991B1B;">'.concat(c,'</div><div style="font-size: 14px; color: #991B1B; line-height: 1.5;">').concat(l,"</div>"),a.classList.remove("empty")}}else console.warn("⚠️ voiceIdleState element not found, cannot show domain error")}showBackButtonWarning(){var A=this.shadowRoot.getElementById("transcriptText"),e=this.shadowRoot.getElementById("liveTextCollapsed");if(A){var t=A.textContent,n=A.innerHTML;A.innerHTML='\n <div style="font-weight: 600; font-size: 16px; margin-bottom: 8px; color: #92400e; display: flex; align-items: center; gap: 8px;">\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="flex-shrink: 0;">\n <path d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>\n </svg>\n Please end the call first\n </div>\n <div style="font-size: 14px; color: #92400e; line-height: 1.5;">\n You need to end the current call before going back.\n </div>\n ',A.classList.remove("empty"),setTimeout(()=>{A&&(A.innerHTML=n,A.textContent=t,t&&""!==t.trim()||A.classList.add("empty"))},5e3)}else if(e){var o=e.textContent;e.innerHTML='\n <span style="color: #92400e; font-weight: 600;">⚠️ Please end the call first - You need to end the current call before going back.</span>\n ',setTimeout(()=>{e&&(e.textContent=o)},5e3)}}startLiveWaveformInterval(){this.voiceInterface.isMobile||(this._liveWaveformInterval&&clearInterval(this._liveWaveformInterval),this._liveWaveformInterval=setInterval(()=>{this.updateLiveWaveform(this.voiceInterface.isActive&&!this.voiceInterface.isMicMuted)},100))}stopLiveWaveformInterval(){this._liveWaveformInterval&&(clearInterval(this._liveWaveformInterval),this._liveWaveformInterval=null)}cleanup(){this.stopLiveWaveformInterval(),this.stopDesktopWaveformAnimation()}}class he{constructor(A){this.voiceInterface=A,this.config=A.config,this.waveformBars=[.3,.5,.8,.4,.6,.9,.5,.7],this.waveformInterval=null,this.isTranscriptExpanded=!1,this.voiceInterface.messages||(this.voiceInterface.messages=[])}t(A){return this.voiceInterface.t(A)}createMobileMinimizedBar(){var A=document.getElementById("mobile-voice-call-bar-container");if(A&&A.remove(),!document.getElementById("mobile-voice-call-bar-styles")){var e=document.createElement("style");e.id="mobile-voice-call-bar-styles",e.textContent=this.voiceInterface.styles.generateMobileCSS(),document.head.appendChild(e)}var t=document.createElement("div");t.id="mobile-voice-call-bar-container",t.innerHTML='\n \x3c!-- Duration Badge --\x3e\n <div class="mobile-duration-badge" id="mobileDurationBadge">\n <div class="mobile-duration-dot"></div>\n <span id="mobileDurationText">00:00</span>\n </div>\n \n \x3c!-- Main Bar --\x3e\n <div class="mobile-voice-bar">\n \x3c!-- Top Row: Status, Waveform, Controls --\x3e\n <div class="mobile-top-row">\n \x3c!-- Status Indicator --\x3e\n <div class="mobile-status-indicator">\n <div class="mobile-status-dot" id="mobileStatusDot"></div>\n <span class="mobile-status-text" id="mobileStatusText">'.concat(this.t("listening"),'</span>\n </div>\n \n \x3c!-- Centered Waveform --\x3e\n <div class="mobile-waveform-center" id="mobileWaveform">\n ').concat(Array(8).fill(0).map((A,e)=>'<div class="mobile-waveform-bar" data-index="'.concat(e,'"></div>')).join(""),'\n </div>\n \n \x3c!-- Controls --\x3e\n <div class="mobile-controls">\n <button class="mobile-control-btn" id="mobileMuteBtn" aria-label="Mute microphone">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-mic-icon">\n <path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" x2="12" y1="19" y2="22"/>\n </svg>\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-mic-off-icon" style="display: none;">\n <line x1="2" x2="22" y1="2" y2="22"/>\n <path d="M18.89 13.23A7.12 7.12 0 0 0 19 12v-2"/>\n <path d="M5 10v2a7 7 0 0 0 12 5"/>\n <path d="M15 9.34V5a3 3 0 0 0-5.68-1.33"/>\n <path d="M9 9v3a3 3 0 0 0 5.12 2.12"/>\n <line x1="12" x2="12" y1="19" y2="22"/>\n </svg>\n </button>\n \n <button class="mobile-control-btn" id="mobileSpeakerBtn" aria-label="Toggle speaker">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-speaker-icon">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>\n </svg>\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-speaker-off-icon" style="display: none;">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <line x1="22" x2="16" y1="9" y2="15"/>\n <line x1="16" x2="22" y1="9" y2="15"/>\n </svg>\n </button>\n \n <button class="mobile-end-call-btn" id="mobileEndCallBtn" aria-label="End call">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"/>\n <line x1="22" x2="2" y1="2" y2="22"/>\n </svg>\n </button>\n </div>\n </div>\n \n \x3c!-- Bottom Row: Transcript (expandable) --\x3e\n <button class="mobile-transcript-row" id="mobileTranscriptRow">\n <p class="mobile-transcript-text" id="mobileTranscriptText">').concat(this.t("transcriptWillAppear"),'</p>\n <div class="mobile-transcript-footer">\n <span class="mobile-expand-hint">tap to expand & type</span>\n <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="opacity: 0.6;">\n <path d="M7 17L17 7M17 7H7M17 7V17"/>\n </svg>\n </div>\n </button>\n </div>\n \n \x3c!-- Expanded Transcript Overlay --\x3e\n <div class="mobile-transcript-overlay" id="mobileTranscriptOverlay" style="display: none;">\n <div class="mobile-expanded-transcript" id="mobileExpandedTranscript">\n \x3c!-- Header --\x3e\n <div class="mobile-transcript-header">\n <div class="mobile-header-left">\n <div class="mobile-header-status">\n <div class="mobile-header-status-dot"></div>\n <span class="mobile-header-status-text" id="mobileHeaderStatusText">').concat(this.t("listening"),'</span>\n <span class="mobile-header-duration" id="mobileHeaderDuration">00:00</span>\n </div>\n <span class="mobile-transcript-label">CONVERSATION</span>\n </div>\n <button class="mobile-close-transcript-btn" id="mobileCloseTranscriptBtn">\n <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 6L6 18M6 6l12 12"/>\n </svg>\n </button>\n </div>\n \n \x3c!-- Messages Container --\x3e\n <div class="mobile-messages-container" id="mobileMessagesContainer">\n \x3c!-- Messages will be dynamically added here --\x3e\n </div>\n \n \x3c!-- Text Input Area --\x3e\n <div class="mobile-input-area">\n <div class="mobile-input-wrapper">\n <input\n type="text"\n placeholder="Type a message..."\n id="mobileTextInput"\n class="mobile-text-input"\n />\n <button class="mobile-send-btn" id="mobileSendBtn" disabled>\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"/>\n </svg>\n </button>\n </div>\n <p class="mobile-input-hint">🎙️ ').concat(this.t("voiceActive")||"Voice is still active"," • ").concat(this.t("typeOrSpeak")||"Type or speak","</p>\n </div>\n </div>\n </div>\n "),document.body.appendChild(t);var n=document.getElementById("mobileMuteBtn"),o=document.getElementById("mobileSpeakerBtn"),i=document.getElementById("mobileEndCallBtn");if(n){n.style.cssText="\n width: 32px !important;\n height: 32px !important;\n min-width: 32px !important;\n min-height: 32px !important;\n max-width: 32px !important;\n max-height: 32px !important;\n aspect-ratio: 1 !important;\n border-radius: 50% !important;\n overflow: hidden !important;\n padding: 0 !important;\n margin: 0 !important;\n box-sizing: border-box !important;\n ";var r=n.querySelector(".mobile-mic-icon"),s=n.querySelector(".mobile-mic-off-icon");r&&(r.style.cssText="\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 15px !important;\n height: 15px !important;\n margin: 0 !important;\n padding: 0 !important;\n position: absolute !important;\n top: 50% !important;\n left: 50% !important;\n transform: translate(-50%, -50%) !important;\n "),s&&(s.style.cssText="\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n position: absolute !important;\n top: 50% !important;\n left: 50% !important;\n transform: translate(-50%, -50%) !important;\n ")}if(o){o.style.cssText="\n width: 32px !important;\n height: 32px !important;\n min-width: 32px !important;\n min-height: 32px !important;\n max-width: 32px !important;\n max-height: 32px !important;\n aspect-ratio: 1 !important;\n border-radius: 50% !important;\n overflow: hidden !important;\n padding: 0 !important;\n margin: 0 !important;\n box-sizing: border-box !important;\n ";var a=o.querySelector(".mobile-speaker-icon"),c=o.querySelector(".mobile-speaker-off-icon");a&&(a.style.cssText="\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 15px !important;\n height: 15px !important;\n margin: 0 !important;\n padding: 0 !important;\n position: absolute !important;\n top: 50% !important;\n left: 50% !important;\n transform: translate(-50%, -50%) !important;\n "),c&&(c.style.cssText="\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n position: absolute !important;\n top: 50% !important;\n left: 50% !important;\n transform: translate(-50%, -50%) !important;\n ")}if(i){i.style.cssText="\n width: 36px !important;\n height: 36px !important;\n min-width: 36px !important;\n min-height: 36px !important;\n max-width: 36px !important;\n max-height: 36px !important;\n aspect-ratio: 1 !important;\n border-radius: 50% !important;\n overflow: hidden !important;\n padding: 0 !important;\n margin: 0 !important;\n box-sizing: border-box !important;\n ";var l=i.querySelector("svg");l&&(l.style.cssText="\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 15px !important;\n height: 15px !important;\n margin: 0 !important;\n padding: 0 !important;\n ")}this.voiceInterface.setupMobileEventHandlers()}removeMobileMinimizedBar(){var A=document.getElementById("mobile-voice-call-bar-container");A&&A.remove()}expandMobileTranscript(){var A=document.getElementById("mobileTranscriptOverlay");if(A){A.style.display="flex",this.isTranscriptExpanded=!0;var e=document.getElementById("mobileTextInput");e&&setTimeout(()=>e.focus(),100);var t=document.getElementById("mobileMessagesContainer");t&&setTimeout(()=>{t.scrollTop=t.scrollHeight},100)}}collapseMobileTranscript(){var A=document.getElementById("mobileTranscriptOverlay");A&&(A.style.display="none",this.isTranscriptExpanded=!1)}updateMobileStatus(A){var e=document.getElementById("mobileStatusText"),t=document.getElementById("mobileHeaderStatusText"),n=document.getElementById("mobileStatusDot");if(e||t){var o=this.config.statusText,i="",r="#6b7280";o?(i=o,r=this.config.statusDotColor||"#10b981"):"connecting"===A?(i=this.t("connecting")||"Connecting...",r="#3b82f6"):"listening"===A||"recording"===A?(i=this.t("listening")||"Listening...",r="#22c55e"):"speaking"===A?(i=this.t("speaking")||"Speaking...",r="#a855f7"):(i=this.t("paused")||"Paused",r="#facc15"),e&&(e.textContent=i),t&&(t.textContent=i),n&&(n.style.backgroundColor=r,n.style.boxShadow="paused"===A?"none":"0 0 8px ".concat(r))}}addMobileMessage(A,e){this.voiceInterface.messages.push({type:A,text:e});var t=document.getElementById("mobileMessagesContainer");if(t){var n=document.createElement("div");n.className="mobile-message-bubble ".concat(A),n.textContent=e,t.appendChild(n),t.scrollTop=t.scrollHeight}}startWaveformAnimation(){this.waveformInterval&&clearInterval(this.waveformInterval);var A=document.getElementById("mobileWaveform");A&&(this.waveformInterval=setInterval(()=>{A.querySelectorAll(".mobile-waveform-bar").forEach((A,e)=>{var t=60*Math.random()+10;A.style.height="".concat(t,"px")})},100))}stopWaveformAnimation(){this.waveformInterval&&(clearInterval(this.waveformInterval),this.waveformInterval=null);var A=document.getElementById("mobileWaveform");A&&A.querySelectorAll(".mobile-waveform-bar").forEach(A=>{A.style.height="10px"})}cleanup(){this.stopWaveformAnimation(),this.collapseMobileTranscript(),this.removeMobileMinimizedBar(),this.voiceInterface.messages=[]}}function Be(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function me(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){Be(i,n,o,r,s,"next",A)}function s(A){Be(i,n,o,r,s,"throw",A)}r(void 0)})}}class fe{constructor(A){var e;this.config=A,this.audioStream=null,this.callStartTime=null,this.callTimerInterval=null,this.sdk=null,this.isActive=!1,this.isShowingDomainError=!1,this.shadowRoot=A.shadowRoot||document,this.textSDK=A.textSDK||null,this.deviceInfo=Ae(),this.isMobile=this.deviceInfo.isMobile,this.conversationExpanded=!1,this.isMicMuted=!1,this.isSpeakerMuted=!1;var t=A.visualAssistant||(null===(e=A.agentSettingsOverride)||void 0===e?void 0:e.visualAssistant);this.sdk=new ZA({agentId:A.agentId,appId:A.appId,signedUrl:A.signedUrl,agentSettingsOverride:A.agentSettingsOverride,visualAssistant:t,variables:A.variables||{},language:A.language||"en",outputContainer:A.outputContainer,outputEncoding:A.outputEncoding,outputSampleRate:A.outputSampleRate,outputChannels:A.outputChannels,outputBitDepth:A.outputBitDepth,onConversationStart:A.onConversationStart,onConversationEnd:A.onConversationEnd,onBargeIn:A.onBargeIn,onAudioStartPlaying:A.onAudioStartPlaying,onAudioStoppedPlaying:A.onAudioStoppedPlaying,onSubtitleDisplay:A.onSubtitleDisplay}),this.templates=new ce(this),this.styles=new le(this),this.transcript=new de(this),this.textHandlers=new ue(this),this.handlers=new ge(this),this.desktop=new pe(this),this.mobile=new he(this),this.setupSDKEventHandlers(),this.checkAndHandleResume()}getVoiceSDK(){var A;return(null===(A=this.sdk)||void 0===A?void 0:A.voiceSDK)||null}checkAndHandleResume(){if(void 0!==this._resumeInfo)return console.log("🔄 [VOICE INTERFACE] Returning cached resume info:",this._resumeInfo),this._resumeInfo;var A=this.sdk.checkResumeBeforeConnect();return this._resumeInfo=A,A?(console.log("🔄 [WIDGET] Auto-resuming call:",A),console.log(" From:",A.fromPage,"→ To:",A.toPage),this.config.onResume&&this.config.onResume(A),A):null}setupSDKEventHandlers(){var A=this;this.sdk.onTranscript=A=>{console.log("📝 [VOICE INTERFACE] onTranscript called with text:",A),this.updateTranscript(A)},this.sdk.onAgentSpeaking=A=>{var e=this.shadowRoot.getElementById("voiceAvatarActive");e&&(A?(e.classList.add("speaking"),this.isMobile?(this.updateMobileStatus("speaking"),this.startWaveformAnimation()):(this.updateDesktopStatus(),this.startDesktopWaveformAnimation())):(e.classList.remove("speaking"),this.isMobile?(this.updateMobileStatus("listening"),this.startWaveformAnimation()):(this.updateDesktopStatus(),this.startDesktopWaveformAnimation())))},this.sdk.onDisconnected=function(){var e=me(function*(e){console.log("🔌 WebSocket disconnected, hanging up call..."),e&&(1008===e.code&&e.reason&&(e.reason.includes("Domain not whitelisted")||e.reason.includes("domain")||e.reason.includes("whitelist"))||1008===e.code&&e.reason&&e.reason.includes("localhost"))?(console.error("❌ Domain not whitelisted - WebSocket closed:",e.code,e.reason),yield A.endCallOnServerRejection()):A.isActive&&(A.isActive=!1,A.endVoiceCall())});return function(A){return e.apply(this,arguments)}}(),this.sdk.onError=function(){var e=me(function*(e){if(e&&("DOMAIN_NOT_WHITELISTED"===e.message||e.message&&e.message.includes("Domain not whitelisted")))return console.error("❌ Voice SDK Error: Domain not whitelisted:",e),void(yield A.endCallOnServerRejection());e.isServerRejection||"ServerRejected"===e.name||(console.error("❌ Voice SDK Error:",e),A.showError(e.message||e))});return function(A){return e.apply(this,arguments)}}()}setupTextInjectAckHandler(){return this.textHandlers.setupTextInjectAckHandler()}handleTextInjectAck(A){return this.textHandlers.handleTextInjectAck(A)}sendDesktopTextMessage(){return this.textHandlers.sendDesktopTextMessage()}sendMobileTextMessage(){return this.textHandlers.sendMobileTextMessage()}t(A){var e,t,n=this.config.language||"en";return((null===(e=this.config.translations)||void 0===e?void 0:e[n])||(null===(t=this.config.translations)||void 0===t?void 0:t.en)||{})[A]||A}getText(A,e){return void 0!==this.config[A]&&null!==this.config[A]?this.config[A]:this.t(e)}getTooltip(A){var e,t=null===(e=this.config.tooltips)||void 0===e?void 0:e[A];return null!=t?t:{mute:this.t("mute"),speaker:this.t("speaker"),endCall:this.t("endCall")}[A]||""}_updateTimerElements(A,e){var t=this.shadowRoot.getElementById("voiceTimer");t&&(t.textContent=A);var n=this.shadowRoot.getElementById("desktopTimerText"),o=this.shadowRoot.getElementById("compactTimerText");if(n&&(n.textContent=A),o&&(o.textContent=A),!o&&!n&&e<2e3){console.warn("⚠️ Timer elements not found - compactTimerText:",!!o,"desktopTimerText:",!!n,"elapsed:",e);var i=this.shadowRoot.querySelectorAll('[id*="Timer"], [id*="timer"]');console.log("Found timer-like elements:",Array.from(i).map(A=>A.id))}if(this.isMobile){var r=document.getElementById("mobileDurationText"),s=document.getElementById("mobileHeaderDuration");r&&(r.textContent=A),s&&(s.textContent=A)}}generateHTML(){return this.templates.generateHTML()}generateMobileHTML(){return this.templates.generateMobileHTML()}generateCSS(){return this.styles.generateCSS()}setupEventHandlers(A){return this.handlers.setupEventHandlers(A)}setupMobileEventHandlers(){return this.handlers.setupMobileEventHandlers()}adjustSizesForContainer(){return this.desktop.adjustSizesForContainer()}startDesktopWaveformAnimation(){return this.desktop.startDesktopWaveformAnimation()}stopDesktopWaveformAnimation(){return this.desktop.stopDesktopWaveformAnimation()}updateDesktopStatus(){return this.desktop.updateDesktopStatus()}updateLiveWaveform(A){return this.desktop.updateLiveWaveform(A)}showError(A){return this.desktop.showError(A)}showDomainError(){return this.desktop.showDomainError()}startVoiceCall(){var A=this;return me(function*(){if(A.isActive)console.log("⚠️ Voice call already active");else{console.log("🎤 Starting voice call...");var e=yield ee();if(console.log("📋 Current permission state: ".concat(e)),"denied"===e)throw console.log("🚫 Permission is denied, showing blocked modal..."),A.resetConnectingState(),Ae(),se(()=>{console.log("Blocked modal closed")}),new Error("Microphone permission denied");if("prompt"===e||"unknown"===e)return console.log("📋 Permission is in prompt state, showing pre-prompt modal..."),new Promise((e,t)=>{re(me(function*(){console.log("✅ Pre-prompt accepted, proceeding with voice call...");try{yield A.proceedWithVoiceCall(),e()}catch(A){t(A)}}),()=>{console.log("❌ Pre-prompt cancelled"),A.resetConnectingState(),t(new Error("Call cancelled by user"))})});yield A.proceedWithVoiceCall()}})()}proceedWithVoiceCall(){var A=this;return me(function*(){try{if(null!==A._resumeInfo&&void 0!==A._resumeInfo)console.log("🔄 Resume call detected - preserving conversation history");else{console.log("🆕 New call detected - clearing conversation history"),A.transcript.clearConversationMessages(),A.conversationExpanded=!1;var e=A.shadowRoot.getElementById("desktopConversationPanel"),t=A.shadowRoot.getElementById("conversationHeader"),n=A.shadowRoot.getElementById("conversationToggleText"),o=A.shadowRoot.querySelector(".voice-interface"),i=A.shadowRoot.getElementById("desktopVoiceSection"),r=A.shadowRoot.getElementById("compactVoiceSection");e&&(e.classList.remove("expanded"),e.classList.add("collapsed")),t&&t.classList.remove("expanded"),n&&(n.textContent="Show history"),o&&o.classList.remove("expanded"),i&&(i.style.display=""),r&&(r.style.display="none")}if(A.isMobile){var s=A.shadowRoot.getElementById("voiceIdleState");s&&(s.style.display="none");var a=A.shadowRoot.getElementById("text-chat-panel");if(a)a.classList.remove("open"),a.style.display="none",console.log("✅ Widget panel hidden (waiting for permission)");else{var c=document.getElementById("text-chat-panel");c&&(c.classList.remove("open"),c.style.display="none",console.log("✅ Widget panel hidden (waiting for permission, fallback)"))}console.log("📱 Mobile device - requesting mic permission before connecting...");try{var l=A.config.outputSampleRate||44100;(yield navigator.mediaDevices.getUserMedia({audio:{sampleRate:l,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}})).getTracks().forEach(A=>A.stop()),console.log("✅ Mobile: Microphone permission granted - proceeding with connection");var d=A.shadowRoot.getElementById("text-chat-button");if(d)d.style.display="none",console.log("✅ Floating button hidden (permission granted)");else{var u=document.getElementById("text-chat-button");u&&(u.style.display="none",console.log("✅ Floating button hidden (permission granted, fallback)"))}}catch(S){console.error("❌ Mobile: Permission denied before connecting:",S),A.resetConnectingState(),document.getElementById("mobile-voice-call-bar-container")&&A.removeMobileMinimizedBar();var g=A.shadowRoot.getElementById("text-chat-button");if(g)g.style.display="";else{var p=document.getElementById("text-chat-button");p&&(p.style.display="")}var h=A.shadowRoot.getElementById("voiceIdleState");h&&(h.style.display="flex");var B=A.shadowRoot.getElementById("text-chat-panel");if(B)B.style.display="";else{var m=document.getElementById("text-chat-panel");m&&(m.style.display="")}return Ae(),void se(()=>{A.resetUIState()})}}else{A.resetConnectingState();var f=A.shadowRoot.getElementById("voiceIdleState"),v=A.shadowRoot.getElementById("voiceActiveState");f&&(f.style.display="none"),v&&(v.style.display="flex")}var w=A.shadowRoot.getElementById("voiceInterface");setTimeout(()=>A.adjustSizesForContainer(),50),w&&(w.scrollTop=0);var C=A.config.signedUrl||(A.config.agentId&&A.config.appId?"wss://speech.talktopc.com/ws/conv?agentId=".concat(A.config.agentId,"&appId=").concat(A.config.appId):null);if(!C)throw new Error("signedUrl or agentId+appId required for voice calls");if(console.log("🔗 Got signed URL:",C),A.sdk&&A.sdk.isConnected){console.log("🔄 SDK already connected, disconnecting for clean retry...");try{A.sdk.disconnect(),yield new Promise(A=>setTimeout(A,100))}catch(A){console.warn("Warning: Error disconnecting existing connection:",A)}}var y=yield A.sdk.connect(C);console.log("✅ Connected to WebSocket, connected:",y),A.setupTextInjectAckHandler();var b=!1,x=A.sdk.onError,Q=A.sdk.onDisconnected;A.sdk.onError=e=>{e&&("DOMAIN_NOT_WHITELISTED"===e.message||e.message&&e.message.includes("Domain not whitelisted"))&&(b=!0,console.log("🚫 Server rejected connection before starting audio capture")),x&&x.call(A.sdk,e)},A.sdk.onDisconnected=e=>{e&&1008===e.code&&e.reason&&(e.reason.includes("Domain not whitelisted")||e.reason.includes("domain")||e.reason.includes("whitelist"))&&(b=!0,console.log("🚫 Server disconnected due to domain error before starting audio capture")),Q&&Q.call(A.sdk,e)};for(var F=0;F<50;){if(b)throw console.log("🚫 Server rejected connection, aborting audio capture"),new Error("DOMAIN_NOT_WHITELISTED");if(A.sdk.isConnected&&A.sdk.voiceSDK&&A.sdk.voiceSDK.isConnected&&A.sdk.voiceSDK.websocket&&A.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN){A.isMobile&&A.updateMobileStatus("listening");break}yield new Promise(A=>setTimeout(A,100)),F++}if(b)throw A.sdk.onError=x,A.sdk.onDisconnected=Q,console.log("🚫 Server rejected connection, aborting audio capture"),new Error("DOMAIN_NOT_WHITELISTED");if(!(A.sdk.isConnected&&A.sdk.voiceSDK&&A.sdk.voiceSDK.isConnected&&A.sdk.voiceSDK.websocket&&A.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN))throw A.sdk.onError=x,A.sdk.onDisconnected=Q,console.warn("⚠️ Connection lost before starting audio capture"),new Error("Connection lost before starting audio capture");if(A.sdk.onError=x,A.sdk.onDisconnected=Q,A.sdk.isConnected&&A.sdk.voiceSDK&&A.sdk.voiceSDK.websocket&&A.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN){console.log("✅ WebSocket ready, starting listening..."),A.isMobile&&A.updateMobileStatus("listening");try{if(yield A.sdk.startListening(),!(A.sdk.isConnected&&A.sdk.voiceSDK&&A.sdk.voiceSDK.isConnected&&A.sdk.voiceSDK.websocket&&A.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN)){var U;if(null!==(U=A.sdk.voiceSDK)&&void 0!==U&&U.isRecording)try{yield A.sdk.voiceSDK.stopRecording()}catch(A){}var S=new Error("Connection lost - server may have rejected the call");throw S.name="ServerRejected",S.isServerRejection=!0,S}console.log("🎤 Started listening - permission granted"),A.isActive=!0,A.isMobile?(document.getElementById("mobile-voice-call-bar-container")?console.log("📱 Mobile device - bar already exists, updating status"):(console.log("📱 Mobile device - permission granted, creating minimized bar"),A.createMobileMinimizedBar()),0===A.messages.length&&A.messages.push({type:"assistant",text:A.t("transcriptWillAppear")}),A.startWaveformAnimation(),A.updateMobileStatus("listening")):(A.startDesktopWaveformAnimation(),A.updateDesktopStatus(),A.desktop.startLiveWaveformInterval())}catch(S){if(S.isServerRejection||"ServerRejected"===S.name)throw A.resetConnectingState(),S;if(console.error("❌ Failed to start listening - permission denied or error:",S),A.resetConnectingState(),A.isMobile){document.getElementById("mobile-voice-call-bar-container")&&A.removeMobileMinimizedBar();var I=A.shadowRoot.getElementById("voiceIdleState");I&&(I.style.display="flex");var E=A.shadowRoot.getElementById("text-chat-panel");if(E)E.style.display="";else{var k=document.getElementById("text-chat-panel");k&&(k.style.display="")}var H=A.shadowRoot.getElementById("text-chat-button");if(H)H.style.display="";else{var T=document.getElementById("text-chat-button");T&&(T.style.display="")}}throw S}A.callStartTime=Date.now(),console.log("⏱️ Starting call timer at",new Date(A.callStartTime).toISOString());var D=()=>{if(A.callStartTime){var e=Date.now()-A.callStartTime,t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3),o="".concat(t.toString().padStart(2,"0"),":").concat(n.toString().padStart(2,"0"));A._updateTimerElements(o,e)}else console.warn("⚠️ Timer update called but callStartTime is not set")};setTimeout(()=>{console.log("⏱️ Starting timer interval"),D(),A.callTimerInterval=setInterval(D,1e3)},100)}else{if(b)throw console.log("🚫 Server rejected connection, aborting audio capture"),new Error("DOMAIN_NOT_WHITELISTED");if(!(A.sdk.isConnected&&A.sdk.voiceSDK&&A.sdk.voiceSDK.isConnected&&A.sdk.voiceSDK.websocket&&A.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN))throw console.warn("⚠️ Connection not valid, aborting audio capture"),new Error("Connection lost before starting audio capture");console.warn("⚠️ Connection not fully ready, but trying to start listening anyway...");try{yield A.sdk.startListening(),console.log("🎤 Started listening - permission granted"),A.isActive=!0,A.isMobile?(document.getElementById("mobile-voice-call-bar-container")?console.log("📱 Mobile device - bar already exists, updating status"):(console.log("📱 Mobile device - permission granted, creating minimized bar"),A.createMobileMinimizedBar()),0===A.messages.length&&A.messages.push({type:"assistant",text:A.t("transcriptWillAppear")}),A.startWaveformAnimation(),A.updateMobileStatus("listening")):(A.startDesktopWaveformAnimation(),A.updateDesktopStatus(),A.desktop.startLiveWaveformInterval())}catch(S){if(S.isServerRejection||"ServerRejected"===S.name)throw A.resetConnectingState(),S;if(console.error("❌ Failed to start listening - permission denied or error:",S),A.resetConnectingState(),A.isMobile){document.getElementById("mobile-voice-call-bar-container")&&A.removeMobileMinimizedBar();var K=A.shadowRoot.getElementById("voiceIdleState");K&&(K.style.display="flex");var L=A.shadowRoot.getElementById("text-chat-panel");if(L)L.style.display="";else{var M=document.getElementById("text-chat-panel");M&&(M.style.display="")}var R=A.shadowRoot.getElementById("text-chat-button");if(R)R.style.display="";else{var P=document.getElementById("text-chat-button");P&&(P.style.display="")}}throw S}A.callStartTime=Date.now(),console.log("⏱️ Starting call timer at",new Date(A.callStartTime).toISOString());var O=()=>{if(A.callStartTime){var e=Date.now()-A.callStartTime,t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3),o="".concat(t.toString().padStart(2,"0"),":").concat(n.toString().padStart(2,"0"));A._updateTimerElements(o,e)}else console.warn("⚠️ Timer update called but callStartTime is not set")};setTimeout(()=>{console.log("⏱️ Starting timer interval"),O(),A.callTimerInterval=setInterval(O,1e3)},100)}console.log("✅ Voice call started successfully")}catch(S){if(S.isServerRejection||"ServerRejected"===S.name||console.error("❌ Error starting voice call:",S),A.resetConnectingState(),A.isActive=!1,A.callTimerInterval&&(clearInterval(A.callTimerInterval),A.callTimerInterval=null),A.sdk&&A.sdk.isConnected)try{A.sdk.disconnect()}catch(A){console.warn("Error disconnecting SDK on error:",A)}"NotAllowedError"===S.name||"PermissionDeniedError"===S.name?(Ae(),se(()=>{A.resetUIState()})):"NotFoundError"===S.name||"DevicesNotFoundError"===S.name?ae(()=>{A.resetUIState()}):S&&("DOMAIN_NOT_WHITELISTED"===S.message||S.message&&S.message.includes("Domain not whitelisted"))?yield A.endCallOnServerRejection():(A.showError(S.message||S),A.resetUIState())}})()}resetUIState(){if(this.resetConnectingState(),this.isMobile){this.removeMobileMinimizedBar(),this.stopWaveformAnimation(),this.messages=[];var A=this.shadowRoot.getElementById("text-chat-panel");if(A)A.style.display="";else{var e=document.getElementById("text-chat-panel");e&&(e.style.display="")}}var t=this.shadowRoot.getElementById("voiceIdleState"),n=this.shadowRoot.getElementById("voiceActiveState");t&&(t.style.display="flex"),n&&(n.style.display="none")}endCallOnServerRejection(){var A=this;return me(function*(){console.log("🚫 Server rejected call - ending call and stopping audio capture/VAD..."),console.log("🚫 Calling endCallOnServerRejection() - will show domain error message");var e=A.shadowRoot.getElementById("voiceInterface"),t=A.shadowRoot.getElementById("landingScreen");if(e&&(e.classList.add("active"),console.log("✅ Made voice interface visible")),t&&(t.classList.remove("active"),console.log("✅ Hid landing screen")),A.config.onShowVoice&&"function"==typeof A.config.onShowVoice&&(console.log("🚫 Calling onShowVoice callback to ensure voice interface is visible..."),A.config.onShowVoice()),A.sdk){try{var n,o,i=null===(n=A.sdk.voiceSDK)||void 0===n?void 0:n.audioRecorder;if(A.sdk.isListening||(null===(o=A.sdk.voiceSDK)||void 0===o?void 0:o.isRecording)||i&&i.isRecording||i&&null!==i.audioWorkletNode||i){if(console.log("🛑 Stopping audio capture/VAD..."),null!=i&&i.audioWorkletNode){console.log("🛑 Sending stop message to AudioWorklet to stop VAD...");try{i.audioWorkletNode.port.postMessage({type:"stop"}),yield new Promise(A=>setTimeout(A,150))}catch(A){console.warn("Error sending stop message to AudioWorklet:",A)}}if(A.sdk.voiceSDK&&"function"==typeof A.sdk.voiceSDK.stopRecording)try{yield A.sdk.voiceSDK.stopRecording(),console.log("✅ stopRecording() completed")}catch(A){console.warn("Error calling stopRecording:",A)}else if(A.sdk.stopListening)try{A.sdk.stopListening(),yield new Promise(A=>setTimeout(A,200))}catch(A){console.warn("Error calling stopListening:",A)}if(i&&"function"==typeof i.stop)try{yield i.stop(),console.log("✅ AudioRecorder.stop() completed")}catch(A){console.warn("Error calling AudioRecorder.stop():",A)}console.log("✅ Audio capture/VAD stopped")}null!=i&&i.mediaStream&&(console.log("🛑 Force stopping media stream tracks (backup cleanup)..."),i.mediaStream.getTracks().forEach(A=>{"ended"!==A.readyState&&(A.stop(),console.log("✅ Force stopped track:",A.kind))})),A.audioStream&&(console.log("🛑 Stopping stored audio stream..."),A.audioStream.getTracks().forEach(A=>{"ended"!==A.readyState&&A.stop()}),A.audioStream=null),A.sdk.hangup()}catch(e){console.warn("Error stopping listening on server rejection:",e);try{var r;null!==(r=A.sdk.voiceSDK)&&void 0!==r&&null!==(r=r.audioRecorder)&&void 0!==r&&r.mediaStream&&A.sdk.voiceSDK.audioRecorder.mediaStream.getTracks().forEach(A=>A.stop()),A.audioStream&&(A.audioStream.getTracks().forEach(A=>A.stop()),A.audioStream=null)}catch(A){console.warn("Error force-stopping media streams:",A)}}if(A.sdk.isConnected)try{A.sdk.disconnect()}catch(A){console.warn("Error disconnecting SDK on server rejection:",A)}}A.isActive=!1,A.config.onCallEnd&&A.config.onCallEnd,A.callTimerInterval&&(clearInterval(A.callTimerInterval),A.callTimerInterval=null);var s=A.shadowRoot.getElementById("voiceActiveState"),a=A.shadowRoot.getElementById("voiceIdleState");if(s&&(s.style.display="none"),a&&(a.style.display="flex",A.isShowingDomainError=!0,console.log("🚫 Setting isShowingDomainError flag to true"),console.log("🚫 Calling showDomainError() to display domain error in widget..."),A.showDomainError(),console.log("🚫 showDomainError() completed, isShowingDomainError:",A.isShowingDomainError)),A.isMobile){var c=A.shadowRoot.getElementById("text-chat-panel");if(c)c.style.display="";else{var l=document.getElementById("text-chat-panel");l&&(l.style.display="")}var d=A.shadowRoot.getElementById("text-chat-button");if(d)d.style.display="";else{var u=document.getElementById("text-chat-button");u&&(u.style.display="")}A.removeMobileMinimizedBar(),A.stopWaveformAnimation()}})()}endVoiceCall(){var A;if(console.log("🔴 Ending voice call..."),this._resumeInfo=null,this.sdk&&this.isActive&&(this.sdk.stopListening(),this.sdk.hangup(),this.isActive=!1),this.audioStream&&(this.audioStream.getTracks().forEach(A=>A.stop()),this.audioStream=null),this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null),this._textInjectTimeout&&(clearTimeout(this._textInjectTimeout),this._textInjectTimeout=null),this._statusClearTimeout&&(clearTimeout(this._statusClearTimeout),this._statusClearTimeout=null),this._mobileTextInjectTimeout&&(clearTimeout(this._mobileTextInjectTimeout),this._mobileTextInjectTimeout=null),this._mobileStatusClearTimeout&&(clearTimeout(this._mobileStatusClearTimeout),this._mobileStatusClearTimeout=null),null!==(A=this.sdk)&&void 0!==A&&A.voiceSDK&&this.textHandlers._textInjectAckHandler&&(this.sdk.voiceSDK.off("textInjectAck",this.textHandlers._textInjectAckHandler),this.textHandlers._textInjectAckHandler=null),this._originalHintText=null,this._originalMobileHintText=null,this.isMobile||(this.stopDesktopWaveformAnimation(),this.desktop.stopLiveWaveformInterval(),this.transcript.clearConversationMessages(),this.conversationExpanded=!1),this.isMobile){this.stopWaveformAnimation(),this.collapseMobileTranscript(),this.removeMobileMinimizedBar(),this.messages=[];var e=this.shadowRoot.getElementById("text-chat-panel");if(e)e.style.display="";else{var t=document.getElementById("text-chat-panel");t&&(t.style.display="")}}var n=this.shadowRoot.getElementById("text-chat-button");if(n)n.style.display="",console.log("✅ Floating button restored (call ended)");else{var o=document.getElementById("text-chat-button");o&&(o.style.display="",console.log("✅ Floating button restored (call ended, fallback)"))}var i=this.shadowRoot.getElementById("voiceActiveState");if(i&&(i.style.display="none"),"function"==typeof this.config.onVoiceCallButtonClick)try{this.config.onVoiceCallButtonClick({timestamp:Date.now(),widgetState:"end"})}catch(A){console.error("Error in onVoiceCallButtonClick callback:",A)}if(this.config.onCallEnd)this.config.onCallEnd();else{var r=this.shadowRoot.getElementById("voiceIdleState");r&&(r.style.display="flex"),setTimeout(()=>this.adjustSizesForContainer(),50)}var s=this.shadowRoot.getElementById("transcriptText");if(s&&(s.textContent=this.t("transcriptWillAppear"),s.classList.add("empty")),this.isMobile){var a=document.getElementById("mobileTranscriptText");a&&(a.textContent=this.t("transcriptWillAppear"))}var c=this.shadowRoot.getElementById("voiceAvatarActive");c&&c.classList.remove("speaking"),console.log("✅ Voice call ended")}showConnectingState(){var A=this.shadowRoot.getElementById("voiceIdleState"),e=this.shadowRoot.getElementById("voiceActiveState");if(A){var t=A.querySelector(".voice-status-title"),n=A.querySelector(".voice-status-subtitle"),o=A.querySelector("#startCallBtn");if(t&&(t.textContent=this.t("connecting")),n&&(n.textContent=this.t("connectingSubtitle")),o){o.disabled=!0,o.style.opacity="0.6",o.style.cursor="not-allowed";var i=o.querySelector("span");if(i){var r=document.createElement("span");r.className="connecting-spinner",i.textContent="",i.appendChild(r),i.appendChild(document.createTextNode(" "+this.t("connecting")))}}A.style.display="flex"}e&&(e.style.display="none")}resetConnectingState(){if(this.isShowingDomainError)console.log("🚫 resetConnectingState() called but domain error is displayed - skipping reset");else{var A=this.shadowRoot.getElementById("voiceIdleState");if(A){var e=A.querySelector("#domainErrorBackBtn");e&&e.parentNode&&e.parentNode.removeChild(e);var t=A.querySelector(".voice-status-title"),n=A.querySelector(".voice-status-subtitle"),o=A.querySelector("#startCallBtn");if(t&&(t.textContent=this.getText("startCallTitle","clickToStartCall"),t.style.color="",t.style.fontSize="",t.style.fontWeight="",t.style.marginLeft="",t.style.marginRight="",t.style.textAlign=""),n&&(n.textContent=this.getText("startCallSubtitle","realTimeVoice"),n.style.color="",n.style.fontSize="",n.style.marginLeft="",n.style.marginRight="",n.style.marginTop="",n.style.textAlign="",n.style.lineHeight=""),o){o.disabled=!1,o.style.opacity="",o.style.cursor="",o.style.display="";var i=o.querySelector("span");i&&(i.textContent=this.getText("startCallButtonText","startCall"))}}}}updateTranscript(A){return this.transcript.updateTranscript(A)}toggleConversationPanel(){return this.transcript.toggleConversationPanel()}addConversationMessage(A,e){return this.transcript.addConversationMessage(A,e)}renderConversationMessages(){return this.transcript.renderConversationMessages()}escapeHtml(A){var e=document.createElement("div");return e.textContent=A,e.innerHTML}toggleMute(){if(this.sdk&&this.isActive){var A=null;if(this.sdk.voiceSDK&&this.sdk.voiceSDK.audioRecorder&&this.sdk.voiceSDK.audioRecorder.mediaStream&&(A=this.sdk.voiceSDK.audioRecorder.mediaStream.getAudioTracks()[0]),!A&&this.audioStream&&(A=this.audioStream.getAudioTracks()[0]),A){A.enabled=!A.enabled,this.isMicMuted=!A.enabled;var e=this.shadowRoot.getElementById("desktopMuteBtn"),t=this.shadowRoot.getElementById("desktopMuteBtnCompact");if(this.isMobile||this.updateDesktopStatus(),e){var n=e.querySelector(".desktop-mic-icon"),o=e.querySelector(".desktop-mic-off-icon");n&&o&&(A.enabled?(e.classList.remove("muted"),n.style.display="block",o.style.display="none"):(e.classList.add("muted"),n.style.display="none",o.style.display="block"))}if(t){var i=t.querySelector(".desktop-mic-icon"),r=t.querySelector(".desktop-mic-off-icon");i&&r&&(A.enabled?(t.classList.remove("muted"),i.style.display="block",r.style.display="none"):(t.classList.add("muted"),i.style.display="none",r.style.display="block"))}if(this.isMobile){var s=document.getElementById("mobileMuteBtn"),a=null==s?void 0:s.querySelector(".mobile-mic-icon"),c=null==s?void 0:s.querySelector(".mobile-mic-off-icon");s&&a&&c&&(A.enabled?(s.classList.remove("muted"),a.style.cssText="display: block !important; visibility: visible !important; opacity: 1 !important; width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important;",c.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;"):(s.classList.add("muted"),a.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;",c.style.cssText="display: block !important; visibility: visible !important; opacity: 1 !important; width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important;"))}console.log(A.enabled?"🔊 Unmuted":"🔇 Muted")}else console.warn("⚠️ No audio track available for mute toggle")}}toggleSpeaker(){if(this.sdk&&this.isActive){if(this.isSpeakerMuted=!this.isSpeakerMuted,this.sdk.voiceSDK&&this.sdk.voiceSDK.audioPlayer?(this.sdk.voiceSDK.audioPlayer.setMuted(this.isSpeakerMuted),console.log("🔊 Speaker toggle:",this.isSpeakerMuted?"muted":"unmuted")):console.warn("⚠️ Cannot toggle speaker - audioPlayer not available"),!this.isMobile){var A=this.shadowRoot.getElementById("desktopSpeakerBtn"),e=this.shadowRoot.getElementById("desktopSpeakerBtnCompact");if(A){var t=A.querySelector(".desktop-speaker-icon"),n=A.querySelector(".desktop-speaker-off-icon");t&&n&&(this.isSpeakerMuted?(A.classList.add("muted"),t.style.display="none",n.style.display="block"):(A.classList.remove("muted"),t.style.display="block",n.style.display="none"))}if(e){var o=e.querySelector(".desktop-speaker-icon"),i=e.querySelector(".desktop-speaker-off-icon");o&&i&&(this.isSpeakerMuted?(e.classList.add("muted"),o.style.display="none",i.style.display="block"):(e.classList.remove("muted"),o.style.display="block",i.style.display="none"))}}if(this.isMobile){var r=document.getElementById("mobileSpeakerBtn"),s=null==r?void 0:r.querySelector(".mobile-speaker-icon"),a=null==r?void 0:r.querySelector(".mobile-speaker-off-icon");r&&s&&a&&(this.isSpeakerMuted?(r.classList.add("muted"),s.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;",a.style.cssText="display: block !important; visibility: visible !important; opacity: 1 !important; width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important;"):(r.classList.remove("muted"),s.style.cssText="display: block !important; visibility: visible !important; opacity: 1 !important; width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important;",a.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;"))}}}updateMobileStatus(A){return this.mobile.updateMobileStatus(A)}createMobileMinimizedBar(){return this.mobile.createMobileMinimizedBar()}removeMobileMinimizedBar(){return this.mobile.removeMobileMinimizedBar()}expandMobileTranscript(){return this.mobile.expandMobileTranscript()}collapseMobileTranscript(){return this.mobile.collapseMobileTranscript()}addMobileMessage(A,e){return this.mobile.addMobileMessage(A,e)}startWaveformAnimation(){return this.mobile.startWaveformAnimation()}stopWaveformAnimation(){return this.mobile.stopWaveformAnimation()}destroy(){this.isActive&&this.endVoiceCall(),this.audioStream&&(this.audioStream.getTracks().forEach(A=>A.stop()),this.audioStream=null),this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null),this.sdk&&(this.sdk.disconnect(),this.sdk=null)}}function ve(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function we(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){ve(i,n,o,r,s,"next",A)}function s(A){ve(i,n,o,r,s,"throw",A)}r(void 0)})}}class Ce{constructor(A,e){this.config=A,this.sdk=e,this.streamingEl=null,this.hasStartedStreaming=!1,this.isActive=!1,this.shadowRoot=A.shadowRoot||document,this.eventHandlers={autoResize:null,keydown:null},this.eventHandlersSetup=!1}t(A){var e,t,n=this.config.language||"en";return((null===(e=this.config.translations)||void 0===e?void 0:e[n])||(null===(t=this.config.translations)||void 0===t?void 0:t.en)||{})[A]||A}generateHTML(){var A,e,t,n,o,i,r,s,a,c=this.config.inputPlaceholder||(null===(A=this.config.panel)||void 0===A?void 0:A.inputPlaceholder)||this.t("typeMessage")||"Type your message...";return'<div class="text-interface" id="textInterface">\n <div class="messages-container" id="messagesContainer">\n <div class="empty-state">\n <div class="empty-state-icon">💬</div>\n <div class="empty-state-title">'.concat(this.t("hello"),'</div>\n <div class="empty-state-text">').concat(this.t("sendMessage"),'</div>\n </div>\n </div>\n <div class="input-container">\n <div class="input-wrapper" style="flex:1;">\n <textarea class="message-input" id="messageInput" placeholder="').concat(c,'" rows="1" dir="').concat(this.config.direction||"ltr",'"></textarea>\n </div>\n <button class="send-button" id="sendButton" aria-label="').concat(this.t("sendMessageAria"),'">').concat(this.config.sendButtonText||"➤","</button>\n ").concat(null!==(e=this.config.sendButtonHint)&&void 0!==e&&e.text||null!==(t=this.config.panel)&&void 0!==t&&null!==(t=t.sendButtonHint)&&void 0!==t&&t.text?'\n <div class="send-button-hint" style="color: '.concat((null===(n=this.config.sendButtonHint)||void 0===n?void 0:n.color)||(null===(o=this.config.panel)||void 0===o||null===(o=o.sendButtonHint)||void 0===o?void 0:o.color)||"#6B7280","; font-size: ").concat((null===(i=this.config.sendButtonHint)||void 0===i?void 0:i.fontSize)||(null===(r=this.config.panel)||void 0===r||null===(r=r.sendButtonHint)||void 0===r?void 0:r.fontSize)||"12px",'; text-align: center; margin-top: 4px;">\n ').concat((null===(s=this.config.sendButtonHint)||void 0===s?void 0:s.text)||(null===(a=this.config.panel)||void 0===a||null===(a=a.sendButtonHint)||void 0===a?void 0:a.text),"\n </div>\n "):"","\n </div>\n </div>")}generateCSS(){var A,e,t,n,o,i,r,s,a,c,l,d,u,g=this.config.messages,p=(this.config.panel,this.config.animation,this.config.sendButtonColor||(null===(A=this.config.panel)||void 0===A?void 0:A.sendButtonColor)||"#7C3AED"),h=this.config.sendButtonHoverColor||(null===(e=this.config.panel)||void 0===e?void 0:e.sendButtonHoverColor)||"#6D28D9",B=this.config.sendButtonTextColor||(null===(t=this.config.panel)||void 0===t?void 0:t.sendButtonTextColor)||"#FFFFFF",m=(this.config.inputPlaceholder||null===(n=this.config.panel)||void 0===n||n.inputPlaceholder,this.config.inputBorderColor||(null===(o=this.config.panel)||void 0===o?void 0:o.inputBorderColor)||"#E5E7EB"),f=this.config.inputFocusColor||(null===(i=this.config.panel)||void 0===i?void 0:i.inputFocusColor)||"#7C3AED",v=this.config.inputBackgroundColor||(null===(r=this.config.panel)||void 0===r?void 0:r.inputBackgroundColor)||"#FFFFFF",w=this.config.inputTextColor||(null===(s=this.config.panel)||void 0===s?void 0:s.inputTextColor)||"#1F2937",C=this.config.inputFontSize||(null===(a=this.config.panel)||void 0===a?void 0:a.inputFontSize)||"14px",y=this.config.inputBorderRadius||(null===(c=this.config.panel)||void 0===c?void 0:c.inputBorderRadius)||20,b=this.config.inputPadding||(null===(l=this.config.panel)||void 0===l?void 0:l.inputPadding)||"6px 14px",x=!1===this.config.useShadowDOM?" !important":"";return"\n /* Messages container using new classes */\n #messagesContainer { \n flex: 1; \n overflow-y: auto; \n overflow-x: hidden; \n padding: 20px; \n background: #f8fafc; \n display: flex; \n flex-direction: column; \n gap: 16px; \n min-height: 0; \n }\n .empty-state { \n flex: 1; \n display: flex; \n flex-direction: column; \n align-items: center; \n justify-content: center; \n gap: 12px; \n color: #64748b; \n text-align: center; \n padding: 20px; \n }\n .empty-state-icon { font-size: 48px; opacity: 0.3; }\n .empty-state-title { font-size: 20px; font-weight: 700; color: #334155; }\n .empty-state-text { font-size: 13px; max-width: 280px; }\n\n .text-interface { \n display: none".concat(x,"; \n flex: 1; \n flex-direction: column; \n min-height: 0; \n overflow: hidden; \n }\n .text-interface.active { display: flex").concat(x,"; }\n \n .message { \n display: flex; \n gap: 8px; \n padding: 4px 0; \n max-width: 100%; \n align-items: center; \n }\n .message.edge-left { flex-direction: row; }\n .message.edge-right { flex-direction: row-reverse; }\n .message-bubble { \n padding: 12px; \n border-radius: ").concat(g.borderRadius,"px").concat(x,"; \n max-width: 80%; \n font-size: ").concat(g.fontSize,"; \n word-wrap: break-word; \n text-align: ").concat("rtl"===this.config.direction?"right":"left","; \n direction: ").concat(this.config.direction||"ltr",";\n }\n .message.user .message-bubble { \n background: ").concat(g.userBackgroundColor).concat(x,"; \n color: ").concat(g.userTextColor||g.textColor).concat(x,"; \n }\n .message.agent .message-bubble { \n background: ").concat(g.agentBackgroundColor).concat(x,"; \n color: ").concat(g.agentTextColor||g.textColor).concat(x,"; \n }\n .message.user { \n align-self: ").concat("rtl"===this.config.direction?"flex-start":"flex-end","; \n }\n .message.agent { \n align-self: ").concat("rtl"===this.config.direction?"flex-end":"flex-start","; \n }\n .message .message-bubble { \n text-align: ").concat("rtl"===this.config.direction?"right":"left"," !important; \n }\n ").concat("rtl"===this.config.direction?"\n .message-bubble {\n text-align: right !important;\n }\n ":"","\n .message-avatar { \n width: 20px; \n height: 20px; \n display: flex; \n align-items: center; \n justify-content: center; \n flex-shrink: 0; \n color: inherit; \n font-size: 18px; \n line-height: 1; \n background: transparent; \n border: none; \n }\n .message-avatar.user { background: transparent; }\n .message-avatar.agent { background: transparent; }\n \n .message.system {\n background: ").concat(g.systemBackgroundColor,";\n align-self: flex-start;\n }\n .message.error {\n background: ").concat(g.errorBackgroundColor,";\n align-self: flex-start;\n }\n \n .input-container {\n display: flex;\n gap: 8px;\n padding: 12px 16px;\n background: #FFFFFF;\n border-top: 1px solid #E5E7EB;\n align-items: center;\n flex-shrink: 0;\n flex-direction: ").concat("rtl"===this.config.direction?"row-reverse":"row",";\n }\n \n .input-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n }\n \n .message-input {\n width: 100%;\n min-height: 32px;\n max-height: 120px;\n padding: ").concat(b,";\n border: 1px solid ").concat(m,";\n border-radius: ").concat(y,"px;\n font-size: ").concat(C,";\n font-family: inherit;\n line-height: 1.3;\n resize: none;\n overflow-y: auto;\n background: ").concat(v,";\n color: ").concat(w,";\n vertical-align: top;\n margin: 0;\n display: block;\n white-space: pre-wrap;\n word-wrap: break-word;\n text-align: ").concat("rtl"===this.config.direction?"right":"left",";\n direction: ").concat(this.config.direction||"ltr",";\n -webkit-appearance: none;\n appearance: none;\n box-sizing: border-box;\n }\n \n .message-input:focus {\n outline: none;\n border-color: ").concat(f,";\n background: ").concat("#FFFFFF"===v?"#FFFFFF":v,";\n box-shadow: 0 0 0 3px ").concat(f,"33;\n }\n \n .message-input::placeholder {\n color: #9CA3AF;\n text-align: ").concat("rtl"===this.config.direction?"right":"left",";\n }\n \n .send-button {\n width: 40px;\n height: 40px;\n border-radius: 50%;\n border: none;\n background: ").concat(p,";\n color: ").concat(B,";\n font-size: ").concat(this.config.sendButtonFontSize||(null===(d=this.config.panel)||void 0===d?void 0:d.sendButtonFontSize)||"18px",";\n font-weight: ").concat(this.config.sendButtonFontWeight||(null===(u=this.config.panel)||void 0===u?void 0:u.sendButtonFontWeight)||"500",";\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n transition: all 0.2s ease;\n box-shadow: 0 4px 12px rgba(124, 60, 237, 0.3);\n }\n \n .send-button:hover:not(:disabled) {\n background: ").concat(h,";\n transform: scale(1.05);\n box-shadow: 0 6px 16px rgba(124, 60, 237, 0.4);\n }\n \n .send-button-hint {\n width: 100%;\n text-align: center;\n margin-top: 4px;\n }\n \n .send-button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n \n .typing-indicator {\n display: inline-flex;\n gap: 4px;\n align-items: center;\n }\n \n .typing-dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: #64748b;\n animation: typingDot 1.4s ease-in-out infinite;\n }\n \n .typing-dot:nth-child(2) { animation-delay: 0.2s; }\n .typing-dot:nth-child(3) { animation-delay: 0.4s; }\n \n @keyframes typingDot {\n 0%, 60%, 100% { transform: translateY(0); opacity: 0.7; }\n 30% { transform: translateY(-8px); opacity: 1; }\n }\n \n .error-message {\n padding: 12px;\n background: ").concat(g.errorBackgroundColor,";\n border-radius: ").concat(g.borderRadius,"px;\n color: #991B1B;\n font-size: ").concat(g.fontSize,";\n margin: 8px 0;\n }\n \n @media (max-width: 768px) {\n #messagesContainer {\n padding: 12px;\n gap: 12px;\n }\n \n .message-bubble {\n max-width: 85%;\n font-size: 14px;\n padding: 10px;\n }\n \n .text-input-container {\n padding: 10px;\n gap: 8px;\n }\n \n #text-chat-input {\n font-size: 16px !important; /* Prevents iOS zoom on focus */\n padding: 10px 14px;\n min-height: 44px;\n }\n \n #text-chat-send {\n min-width: 56px;\n min-height: 44px;\n width: 56px;\n height: 44px;\n }\n \n .empty-state-icon {\n font-size: 40px;\n }\n \n .empty-state-title {\n font-size: 18px;\n }\n \n .empty-state-text {\n font-size: 12px;\n }\n }\n \n @media (max-width: 480px) {\n #messagesContainer {\n padding: 10px;\n gap: 10px;\n }\n \n .message-bubble {\n max-width: 90%;\n font-size: 13px;\n padding: 8px;\n }\n \n .text-input-container {\n padding: 8px;\n }\n \n #text-chat-input {\n font-size: 16px !important;\n padding: 8px 12px;\n }\n }\n ")}setupEventHandlers(){var A=this.shadowRoot.getElementById("sendButton"),e=this.shadowRoot.getElementById("messageInput"),t=this.shadowRoot.getElementById("newChatBtn");if(A&&(A.onclick=()=>this.sendMessage()),t&&(t.onclick=()=>this.startNewChat()),this.updateInputAttributes(),e){e.style.height="32px",e.style.overflow="hidden";var n=()=>{e.style.height="auto";var A=Math.min(e.scrollHeight,120);e.style.height=A+"px",e.style.overflowY=A>=120?"auto":"hidden",A>=120&&setTimeout(()=>{e.scrollTop=e.scrollHeight},0)};e.addEventListener("input",n),e.addEventListener("keydown",A=>{"Enter"!==A.key||A.shiftKey?"Enter"===A.key&&A.shiftKey&&setTimeout(n,0):(A.preventDefault(),this.sendMessage())})}}startNewChat(){try{localStorage.removeItem("ttp_text_chat_conversation_id")}catch(A){}this.sdk&&(this.sdk.config.conversationId=null);var A=this.shadowRoot.getElementById("messagesContainer");A&&(A.innerHTML='\n <div class="empty-state">\n <div class="empty-state-icon">💬</div>\n <div class="empty-state-title">'.concat(this.t("hello"),'</div>\n <div class="empty-state-text">').concat(this.t("sendMessage"),"</div>\n </div>"));var e=this.shadowRoot.getElementById("messageInput");e&&e.focus()}updateInputAttributes(){var A=this.shadowRoot.getElementById("messageInput");if(A){var e,t=this.config.inputPlaceholder||(null===(e=this.config.panel)||void 0===e?void 0:e.inputPlaceholder)||this.t("typeMessage")||"Type your message...";A.placeholder=t,A.dir=this.config.direction||"ltr",A.style.textAlign="rtl"===this.config.direction?"right":"left"}}show(){var A=this.shadowRoot.getElementById("textInterface");A&&A.classList.add("active"),setTimeout(()=>{var A=this.shadowRoot.getElementById("messageInput");A&&A.focus()},50)}hide(){var A=this.shadowRoot.getElementById("textInterface");A&&A.classList.remove("active")}startChat(){var A=this;return we(function*(){A.isActive=!0,A.updateSendButtonState()})()}sendMessage(){var A=this;return we(function*(){var e=A.shadowRoot.getElementById("messageInput"),t=e.value.trim();if(t){A.isActive||(yield A.startChat()),A.addMessage("user",t),e.value="",e.style.height="32px",e.style.overflow="hidden";try{A.beginStreaming(),yield A.sdk.sendMessage(t)}catch(e){console.error("❌ Failed to send message:",e),e&&("DOMAIN_NOT_WHITELISTED"===e.message||e.message&&e.message.includes("Domain not whitelisted"))||A.showError(e),A.stopStreamingState()}}})()}updateSendButtonState(){var A=this.shadowRoot.getElementById("sendButton");A&&(A.disabled=!this.isActive)}addMessage(A,e){var t,n,o=this.shadowRoot.getElementById("messagesContainer");if(o){var i=o.querySelector(".empty-state");i&&i.remove();var r=document.createElement("div"),s="rtl"===this.config.direction?"user"===A?"edge-left":"edge-right":"user"===A?"edge-right":"edge-left";r.className="message ".concat(A," ").concat(s);var a=document.createElement("div");a.className="message-avatar ".concat(A);var c="user"===A?(null===(t=this.config.messages)||void 0===t?void 0:t.userAvatarIcon)||"👤":(null===(n=this.config.messages)||void 0===n?void 0:n.agentAvatarIcon)||"🤖";a.textContent=c;var l=document.createElement("div");l.className="message-bubble",l.textContent=e,r.appendChild(a),r.appendChild(l),o.appendChild(r),o.scrollTop=o.scrollHeight}}beginStreaming(){var A,e=this.shadowRoot.getElementById("messagesContainer");if(e){this.stopStreamingState();var t=document.createElement("div"),n="rtl"===this.config.direction?"edge-right":"edge-left";t.className="message agent ".concat(n),t.id="agent-streaming";var o=document.createElement("div");o.className="message-avatar agent",o.textContent=(null===(A=this.config.messages)||void 0===A?void 0:A.agentAvatarIcon)||"🤖";var i=document.createElement("div");i.className="message-bubble",i.innerHTML='<span class="typing-indicator"><span class="typing-dot"></span><span class="typing-dot"></span><span class="typing-dot"></span></span>',t.appendChild(o),t.appendChild(i),e.appendChild(t),this.streamingEl=i,this.hasStartedStreaming=!1,e.scrollTop=e.scrollHeight}}appendStreamingChunk(A){if(this.streamingEl){this.hasStartedStreaming||(this.streamingEl.textContent="",this.hasStartedStreaming=!0),this.streamingEl.textContent+=A;var e=this.shadowRoot.getElementById("messagesContainer");e&&(e.scrollTop=e.scrollHeight)}}finalizeStreaming(A){if(this.streamingEl){this.streamingEl.textContent=A||this.streamingEl.textContent;var e=this.shadowRoot.getElementById("agent-streaming");e&&(e.id=""),this.streamingEl=null}this.updateSendButtonState()}stopStreamingState(){var A=this.shadowRoot.getElementById("agent-streaming");A&&A.remove(),this.streamingEl=null,this.hasStartedStreaming=!1}showError(A){var e=this.shadowRoot.getElementById("messagesContainer");if(e){if(A&&("DOMAIN_NOT_WHITELISTED"===A.message||"string"==typeof A&&A.includes("DOMAIN_NOT_WHITELISTED")||A.message&&A.message.includes("Domain not whitelisted")||"string"==typeof A&&A.includes("Domain not whitelisted"))){var t,n=document.createElement("div");n.className="error-message",n.style.cssText="padding: 16px; margin: 12px; border-radius: 8px; background: "+((null===(t=this.config.messages)||void 0===t?void 0:t.errorBackgroundColor)||"#FEE2E2")+";";var o=document.createElement("div");o.style.cssText="font-weight: 600; font-size: 16px; margin-bottom: 8px; color: #991B1B;",o.textContent=this.t("domainNotValidated");var i=document.createElement("div");i.style.cssText="font-size: 14px; color: #991B1B; line-height: 1.5;",i.textContent=this.t("domainErrorMessage"),n.appendChild(o),n.appendChild(i),e.appendChild(n)}else{var r=document.createElement("div");r.className="error-message",r.textContent="string"==typeof A?A:(null==A?void 0:A.message)||A,e.appendChild(r)}e.scrollTop=e.scrollHeight}}setActive(A){this.isActive=A,this.updateSendButtonState()}}class ye{constructor(A){this.config=A,this.translations=A.translations||{},this.shadowRoot=A.shadowRoot}t(A){var e=this.config.language||"en";return(this.translations[e]||this.translations.en||{})[A]||A}generateHTML(){var A,e=this.config.landing||{};return A="image"===e.logoType&&e.logoImageUrl?'<img src="'.concat(e.logoImageUrl,'" alt="Logo" style="max-width: 44px; max-height: 44px; object-fit: contain; border: none; outline: none;">'):'<span class="landing-avatar-emoji">'.concat(e.logoIcon||e.logo||"🤖","</span>"),'\n <div class="landing-screen" id="landingScreen">\n \x3c!-- Avatar --\x3e\n <div class="landing-avatar">\n '.concat(A,'\n </div>\n\n \x3c!-- Title --\x3e\n <h2 class="landing-title">').concat(e.title||this.t("landingTitle"),'</h2>\n <p class="landing-subtitle">').concat(e.subtitle||this.t("landingSubtitle")||"Choose your preferred method",'</p>\n\n \x3c!-- Mode Selection - Side by Side --\x3e\n <div class="mode-selection">\n \x3c!-- Voice Call Option --\x3e\n <button class="mode-card" id="mode-card-voice">\n <div class="mode-card-icon">\n <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" y1="19" x2="12" y2="23"/>\n <line x1="8" y1="23" x2="16" y2="23"/>\n </svg>\n </div>\n <span class="mode-card-title">').concat(e.voiceCardTitle||this.t("voiceCall"),'</span>\n </button>\n\n \x3c!-- Text Chat Option --\x3e\n <button class="mode-card" id="mode-card-text">\n <div class="mode-card-icon">\n <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"/>\n </svg>\n </div>\n <span class="mode-card-title">').concat(e.textCardTitle||this.t("textChat"),"</span>\n </button>\n </div>\n </div>\n ")}generateCSS(){var A=this.config.landing||{},e=(this.config.animation,!1===this.config.useShadowDOM?" !important":"");return"\n /* ===== LANDING SCREEN - New Design ===== */\n .landing-screen { \n display: none".concat(e,"; \n flex: 1; \n padding: 32px 24px; \n background: ").concat(A.backgroundColor||"linear-gradient(180deg, #ffffff 0%, rgba(168, 85, 247, 0.03) 100%)","; \n align-items: center; \n justify-content: flex-start; \n flex-direction: column; \n gap: 0; \n overflow-y: auto; \n min-height: 0;\n text-align: center;\n }\n \n .landing-screen.active { \n display: flex").concat(e,"; \n }\n\n /* Avatar - Richer purple gradient */\n .landing-avatar {\n width: 88px;\n height: 88px;\n border-radius: 22px;\n margin-bottom: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n ").concat((()=>{if("image"===A.logoType){if(!1!==A.logoBackgroundEnabled){var e=A.logoBackgroundColor||A.avatarBackground||"linear-gradient(135deg, #667eea 0%, #764ba2 100%)";return"background: ".concat(e,"; box-shadow: 0 8px 28px rgba(102, 126, 234, 0.35); border: none;")}return"background: transparent; box-shadow: none; border: none; outline: none;"}var t=A.avatarBackground||"linear-gradient(135deg, #667eea 0%, #764ba2 100%)";return"background: ".concat(t,"; box-shadow: 0 8px 28px rgba(102, 126, 234, 0.35); border: none;")})(),"\n }\n \n .landing-avatar img {\n border: none !important;\n outline: none !important;\n }\n\n .landing-avatar-emoji {\n font-size: 44px;\n line-height: 1;\n }\n\n /* Title & Subtitle */\n .landing-title { \n font-size: 20px; \n color: ").concat(A.titleColor||"#1e1b4b","; \n font-weight: 600; \n margin-bottom: 6px; \n text-align: center;\n line-height: 1.3;\n }\n\n .landing-subtitle {\n font-size: 14px;\n color: ").concat(A.subtitleColor||"#64748b",";\n margin-bottom: 28px;\n text-align: center;\n }\n\n /* Mode Selection - Side by Side */\n .mode-selection { \n display: flex; \n gap: 12px; \n width: 100%; \n justify-content: center; \n }\n\n .mode-card { \n flex: 1; \n max-width: 160px; \n padding: 20px 16px;\n background: ").concat(A.modeCardBackgroundColor||"#ffffff","; \n border: 1px solid ").concat(A.modeCardBorderColor||"rgba(0, 0, 0, 0.06)","; \n border-radius: 18px; \n cursor: pointer; \n display: flex; \n flex-direction: column; \n align-items: center; \n gap: 12px; \n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); \n box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); \n font-family: inherit;\n }\n\n .mode-card:hover { \n transform: translateY(-4px); \n box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2); \n border-color: rgba(124, 58, 237, 0.3); \n }\n\n .mode-card:active {\n transform: translateY(-2px);\n }\n\n /* Mode Card Icon - Vibrant purple gradient */\n .mode-card-icon { \n width: 56px; \n height: 56px; \n display: flex; \n align-items: center; \n justify-content: center; \n border-radius: 16px; \n background: ").concat(A.modeCardIconBackgroundColor||"linear-gradient(135deg, #7c3aed, #a855f7)","; \n color: #fff; \n box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);\n }\n\n .mode-card-icon svg {\n width: 26px;\n height: 26px;\n stroke: white;\n fill: none;\n }\n\n .mode-card-title { \n color: ").concat(A.modeCardTitleColor||"#1e1b4b","; \n font-weight: 600; \n font-size: 14px;\n text-align: center;\n }\n\n /* Mobile Responsive */\n @media (max-width: 768px) {\n .landing-screen {\n padding: 24px 16px;\n }\n\n .landing-avatar {\n width: 72px;\n height: 72px;\n border-radius: 18px;\n margin-bottom: 16px;\n }\n\n .landing-avatar-emoji {\n font-size: 36px;\n }\n\n .landing-title {\n font-size: 18px;\n }\n\n .landing-subtitle {\n font-size: 13px;\n margin-bottom: 20px;\n }\n\n .mode-selection {\n gap: 10px;\n }\n\n .mode-card {\n padding: 16px 12px;\n max-width: 140px;\n }\n\n .mode-card-icon {\n width: 48px;\n height: 48px;\n border-radius: 14px;\n }\n\n .mode-card-icon svg {\n width: 22px;\n height: 22px;\n }\n\n .mode-card-title {\n font-size: 13px;\n }\n }\n\n @media (max-width: 380px) {\n .mode-selection {\n flex-direction: column;\n align-items: center;\n }\n\n .mode-card {\n max-width: 100%;\n width: 100%;\n flex-direction: row;\n padding: 14px 18px;\n gap: 14px;\n }\n\n .mode-card-icon {\n flex-shrink: 0;\n }\n\n .mode-card-title {\n text-align: left;\n }\n }\n ")}show(){var A,e=null===(A=this.shadowRoot)||void 0===A?void 0:A.getElementById("landingScreen");e&&e.classList.add("active")}hide(){var A,e=null===(A=this.shadowRoot)||void 0===A?void 0:A.getElementById("landingScreen");e&&e.classList.remove("active")}setupEventHandlers(){var A,e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null===(A=this.shadowRoot)||void 0===A?void 0:A.getElementById("mode-card-voice"),o=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("mode-card-text");n&&t.onSelectVoice&&(n.onclick=t.onSelectVoice),o&&t.onSelectText&&(o.onclick=t.onSelectText)}}const be={en:{landingTitle:"How would you like to communicate?",landingSubtitle:"Choose your preferred method",voiceCall:"Voice Call",textChat:"Text Chat",clickToStartCall:"Click to Start Call",realTimeVoice:"Real-time voice conversation",startCall:"Start Call",connecting:"Connecting...",connectingSubtitle:"Please wait",listening:"Listening...",speakFreely:"Speak freely",liveTranscript:"Live Transcript",transcriptWillAppear:"Transcript will appear here during the call...",mute:"Mute",speaker:"Speaker",endCall:"End Call",hello:"Hello! How can I help?",sendMessage:"Send a message to get started",online:"Online",newChat:"New Chat",back:"Back",close:"Close",error:"Error",typeMessage:"Type your message...",sendMessageAria:"Send message",domainNotValidated:"Domain not validated",domainErrorMessage:"This domain is not whitelisted. Please contact the administrator to whitelist your website URL."},he:{landingTitle:"איך תרצה לתקשר?",landingSubtitle:"בחר את השיטה המועדפת עליך",voiceCall:"שיחה קולית",textChat:"צ'אט טקסט",clickToStartCall:"לחץ להתחלת שיחה",realTimeVoice:"שיחה קולית בזמן אמת",startCall:"התחל שיחה",connecting:"מתחבר...",connectingSubtitle:"אנא המתן",listening:"מקשיב...",speakFreely:"דבר בחופשיות",liveTranscript:"תמלול בזמן אמת",transcriptWillAppear:"התמלול יופיע כאן במהלך השיחה...",mute:"השתק",speaker:"רמקול",endCall:"סיים שיחה",hello:"שלום! איך אפשר לעזור?",sendMessage:"שלח הודעה או עבור למצב קולי לשיחה בזמן אמת",online:"מקוון",newChat:"צ'אט חדש",back:"חזור",close:"סגור",error:"שגיאה",typeMessage:"הקלד הודעה...",sendMessageAria:"שלח הודעה",domainNotValidated:"דומיין לא מאומת",domainErrorMessage:"דומיין זה לא ברשימת המורשים. אנא פנה למנהל המערכת כדי להוסיף את כתובת האתר שלך לרשימה."},ar:{landingTitle:"كيف تريد التواصل؟",landingSubtitle:"اختر الطريقة المفضلة لديك",voiceCall:"مكالمة صوتية",textChat:"دردشة نصية",clickToStartCall:"انقر لبدء المكالمة",realTimeVoice:"محادثة صوتية في الوقت الفعلي",startCall:"ابدأ المكالمة",connecting:"جارٍ الاتصال...",connectingSubtitle:"يرجى الانتظار",listening:"الاستماع...",speakFreely:"تكلم بحرية",liveTranscript:"نص مباشر",transcriptWillAppear:"سيظهر النص هنا أثناء المكالمة...",mute:"كتم الصوت",speaker:"مكبر الصوت",endCall:"إنهاء المكالمة",hello:"مرحبا! كيف يمكنني المساعدة؟",sendMessage:"أرسل رسالة للبدء",online:"متصل",newChat:"محادثة جديدة",back:"رجوع",close:"إغلاق",error:"خطأ",typeMessage:"اكتب رسالة...",sendMessageAria:"إرسال رسالة",domainNotValidated:"النطاق غير معتمد",domainErrorMessage:"هذا النطاق غير مسموح به. يرجى الاتصال بالمسؤول لإضافة عنوان موقع الويب الخاص بك إلى القائمة."},ru:{landingTitle:"Как вы хотите общаться?",landingSubtitle:"Выберите предпочтительный способ",voiceCall:"Голосовой звонок",textChat:"Текстовый чат",clickToStartCall:"Нажмите, чтобы начать звонок",realTimeVoice:"Голосовой разговор в реальном времени",startCall:"Начать звонок",connecting:"Подключение...",connectingSubtitle:"Пожалуйста, подождите",listening:"Слушаю...",speakFreely:"Говорите свободно",liveTranscript:"Живая транскрипция",transcriptWillAppear:"Транскрипция появится здесь во время звонка...",mute:"Отключить звук",speaker:"Динамик",endCall:"Завершить звонок",hello:"Привет! Как я могу помочь?",sendMessage:"Отправьте сообщение для начала",online:"В сети",newChat:"Новый чат",back:"Назад",close:"Закрыть",error:"Ошибка",typeMessage:"Введите сообщение...",sendMessageAria:"Отправить сообщение",domainNotValidated:"Домен не проверен",domainErrorMessage:"Этот домен не в белом списке. Пожалуйста, свяжитесь с администратором, чтобы добавить URL вашего веб-сайта в список."},es:{landingTitle:"¿Cómo te gustaría comunicarte?",landingSubtitle:"Elige tu método preferido",voiceCall:"Llamada de voz",textChat:"Chat de texto",clickToStartCall:"Haz clic para iniciar la llamada",realTimeVoice:"Conversación de voz en tiempo real",startCall:"Iniciar llamada",connecting:"Conectando...",connectingSubtitle:"Por favor espere",listening:"Escuchando...",speakFreely:"Habla libremente",liveTranscript:"Transcripción en vivo",transcriptWillAppear:"La transcripción aparecerá aquí durante la llamada...",mute:"Silenciar",speaker:"Altavoz",endCall:"Terminar llamada",hello:"¡Hola! ¿Cómo puedo ayudarte?",sendMessage:"Envía un mensaje para comenzar",online:"En línea",newChat:"Nuevo chat",back:"Atrás",close:"Cerrar",error:"Error",typeMessage:"Escribe un mensaje...",sendMessageAria:"Enviar mensaje",domainNotValidated:"Dominio no validado",domainErrorMessage:"Este dominio no está en la lista blanca. Por favor, contacte al administrador para agregar la URL de su sitio web a la lista."},fr:{landingTitle:"Comment souhaitez-vous communiquer?",landingSubtitle:"Choisissez votre méthode préférée",voiceCall:"Appel vocal",textChat:"Chat texte",clickToStartCall:"Cliquez pour démarrer l'appel",realTimeVoice:"Conversation vocale en temps réel",startCall:"Démarrer l'appel",connecting:"Connexion...",connectingSubtitle:"Veuillez patienter",listening:"Écoute...",speakFreely:"Parlez librement",liveTranscript:"Transcripción en direct",transcriptWillAppear:"La transcription apparaîtra ici pendant l'appel...",mute:"Muet",speaker:"Haut-parleur",endCall:"Terminer l'appel",hello:"Bonjour! Comment puis-je vous aider?",sendMessage:"Envoyez un message pour commencer",online:"En ligne",newChat:"Nouveau chat",back:"Retour",close:"Fermer",error:"Erreur",typeMessage:"Tapez votre message...",sendMessageAria:"Envoyer un message",domainNotValidated:"Domaine non validé",domainErrorMessage:"Ce domaine n'est pas sur la liste blanche. Veuillez contacter l'administrateur pour ajouter l'URL de votre site Web à la liste."},de:{landingTitle:"Wie möchten Sie kommunizieren?",landingSubtitle:"Wählen Sie Ihre bevorzugte Methode",voiceCall:"Sprachanruf",textChat:"Text-Chat",clickToStartCall:"Klicken Sie, um den Anruf zu starten",realTimeVoice:"Sprachanruf in Echtzeit",startCall:"Anruf starten",connecting:"Verbinden...",connectingSubtitle:"Bitte warten",listening:"Hören...",speakFreely:"Sprechen Sie frei",liveTranscript:"Live-Transkription",transcriptWillAppear:"Die Transkription erscheint hier während des Anrufs...",mute:"Stumm",speaker:"Lautsprecher",endCall:"Anruf beenden",hello:"Hallo! Wie kann ich helfen?",sendMessage:"Senden Sie eine Nachricht zum Starten",online:"Online",newChat:"Neuer Chat",back:"Zurück",close:"Schließen",error:"Fehler",typeMessage:"Geben Sie eine Nachricht ein...",sendMessageAria:"Nachricht senden",domainNotValidated:"Domain nicht validiert",domainErrorMessage:"Diese Domain steht nicht auf der Whitelist. Bitte kontaktieren Sie den Administrator, um die URL Ihrer Website zur Liste hinzuzufügen."}};function xe(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function Qe(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){xe(i,n,o,r,s,"next",A)}function s(A){xe(i,n,o,r,s,"throw",A)}r(void 0)})}}function Fe(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function Ue(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?Fe(Object(t),!0).forEach(function(e){Se(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):Fe(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function Se(A,e,t){return(e=function(A){var e=function(A){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==typeof e?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}class Ie{constructor(){var A,e,t,n,o,i,r,s,a,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=this.mergeWithDefaults(c),this.sdk=new kA(this.config),this.isOpen=!1,this.isActive=!1,this.translations=be,this.currentView="landing",this.isStartingCall=!1,this.shadowRoot=null,this.container=null,this._pendingClientTools=null,this.config.useShadowDOM?(this.createShadowHost(),this.container=this.shadowRoot):(this.createRegularContainer(),this.container=this.regularContainer,this.shadowRoot=document);var l=Ue(Ue(Ue({},this.config),this.config.voice),{},{inputPlaceholder:(null===(A=this.config.text)||void 0===A?void 0:A.inputPlaceholder)||this.config.inputPlaceholder||"Type your message...",sendButtonColor:(null===(e=this.config.text)||void 0===e?void 0:e.sendButtonColor)||this.config.sendButtonColor||"#7C3AED",language:(null===(t=this.config.voice)||void 0===t?void 0:t.language)||this.config.language||"en",signedUrl:this.config.signedUrl,agentSettingsOverride:this.config.agentSettingsOverride,visualAssistant:this.config.visualAssistant,translations:this.translations,shadowRoot:this.shadowRoot,textSDK:this.sdk,outputContainer:(null===(n=this.config.voice)||void 0===n?void 0:n.outputContainer)||"raw",outputEncoding:(null===(o=this.config.voice)||void 0===o?void 0:o.outputEncoding)||"pcm",outputSampleRate:(null===(i=this.config.voice)||void 0===i?void 0:i.outputSampleRate)||44100,outputChannels:(null===(r=this.config.voice)||void 0===r?void 0:r.outputChannels)||1,outputBitDepth:(null===(s=this.config.voice)||void 0===s?void 0:s.outputBitDepth)||16,onConversationStart:this.config.onConversationStart,onConversationEnd:this.config.onConversationEnd,onBargeIn:this.config.onBargeIn,onAudioStartPlaying:this.config.onAudioStartPlaying,onAudioStoppedPlaying:this.config.onAudioStoppedPlaying,onSubtitleDisplay:this.config.onSubtitleDisplay,onVoiceCallButtonClick:this.config.onVoiceCallButtonClick,onCallEnd:()=>{var A,e,t=null===(A=this.voiceInterface)||void 0===A||null===(A=A.shadowRoot)||void 0===A?void 0:A.getElementById("voiceIdleState");if(t&&"none"!==t.style.display){var n=t.querySelector(".voice-status-title");if(n){var o,i=n.textContent.trim();if(i===(null===(o=this.voiceInterface)||void 0===o?void 0:o.t("domainNotValidated"))||i.includes("Domain not")||i.includes("not whitelisted"))return void console.log("🚫 Domain error is displayed - NOT returning to landing screen from onCallEnd")}}"unified"===((null===(e=this.config.behavior)||void 0===e?void 0:e.mode)||"unified")&&this.showLanding()},onShowVoice:()=>{this.showVoice()},onShowLanding:()=>{this.showLanding()},onErrorToast:(A,e)=>{this.showErrorToast(A,e)}});this.voiceInterface=new fe(l);var d=Ue(Ue(Ue({},this.config),this.config.text),{},{translations:this.translations,shadowRoot:this.shadowRoot});if(this.textInterface=new Ce(d,this.sdk),"unified"===((null===(a=this.config.behavior)||void 0===a?void 0:a.mode)||"unified")){var u=Ue(Ue({},this.config),{},{translations:this.translations,shadowRoot:this.shadowRoot});this.landingScreen=new ye(u)}else this.landingScreen=null;if(this.createWidget(),this.setupEventHandlers(),this.config.behavior.startOpen||this.config.behavior.autoOpen){var g,p=null===(g=this.shadowRoot)||void 0===g?void 0:g.getElementById("text-chat-panel");p&&(this.isOpen=!0,p.classList.add("open"))}this.checkAndHandleResume()}checkAndHandleResume(){var A=this.voiceInterface.checkAndHandleResume();A&&(console.log("🔄 [WIDGET] Auto-resuming call from page navigation"),console.log(" From:",A.fromPage,"→ To:",A.toPage),this.open(),this.showVoice(),this.currentView="voice",setTimeout(()=>{this.startVoiceCall().then(()=>{console.log("✅ [WIDGET] Auto-resumed call successfully")}).catch(A=>{var e;console.error("❌ [WIDGET] Failed to auto-resume call:",A),"unified"===((null===(e=this.config.behavior)||void 0===e?void 0:e.mode)||"unified")&&this.showLanding()})},100))}open(){var A;if(!this.isOpen){var e=null===(A=this.shadowRoot)||void 0===A?void 0:A.getElementById("text-chat-panel");e&&(this.isOpen=!0,e.classList.add("open"))}}mergeWithDefaults(A){var e,t,n,o,i,r,s,a,c,l,d,u,g,p,h,B,m,f,v,w,C,y,b,x,Q,F,U,S,I,E,k,H,T,D,K,L,M,R,P,O,V,_,N,G,W,j,z,X,J,Y,q,Z,$,AA,eA,tA,nA,oA,iA,rA,sA,aA,cA,lA,dA,uA,gA,pA,hA,BA,mA,fA,vA,wA,CA,yA,bA,xA,QA,FA,UA,SA,IA,EA,kA,HA,TA,DA,KA,LA,MA,RA,PA,OA,VA,_A,NA,GA,WA,jA,zA,XA,JA,YA,qA,ZA,$A,Ae,ee,te,ne,oe,ie,re,se,ae,ce,le,de,ue,ge,pe,he,Be,me,fe,ve,we,Ce,ye,be,xe,Qe,Fe,Se,Ie,Ee,ke,He,Te=A.position||"bottom-right";if("string"==typeof Te){var De=Te.split("-");Te={vertical:De[0]||"bottom",horizontal:De[1]||"right",offset:A.positionOffset||{x:20,y:20}}}var Ke,Le,Me=A.primaryColor||(null===(e=A.button)||void 0===e?void 0:e.primaryColor)||(null===(t=A.button)||void 0===t?void 0:t.backgroundColor)||"#FFFFFF";return Ue({agentId:A.agentId,appId:A.appId,signedUrl:A.signedUrl,agentSettingsOverride:A.agentSettingsOverride,demo:!1!==A.demo,direction:A.direction||"ltr",language:A.language||"en",icon:Ue({type:(null===(n=A.icon)||void 0===n?void 0:n.type)||"custom",customImage:(null===(o=A.icon)||void 0===o?void 0:o.customImage)||"https://talktopc.com/logo192.png",emoji:(null===(i=A.icon)||void 0===i?void 0:i.emoji)||"🎤",text:(null===(r=A.icon)||void 0===r?void 0:r.text)||"AI",size:(null===(s=A.icon)||void 0===s?void 0:s.size)||"medium",backgroundColor:(null===(a=A.icon)||void 0===a?void 0:a.backgroundColor)||"#FFFFFF"},A.icon),position:Ue({vertical:Te.vertical||"bottom",horizontal:Te.horizontal||"right",offset:Te.offset||{x:20,y:20}},"object"==typeof A.position?A.position:{}),button:Ue({size:(null===(c=A.button)||void 0===c?void 0:c.size)||"medium",shape:(null===(l=A.button)||void 0===l?void 0:l.shape)||"circle",backgroundColor:(null===(d=A.button)||void 0===d?void 0:d.backgroundColor)||(null===(u=A.icon)||void 0===u?void 0:u.backgroundColor)||"#FFFFFF",hoverColor:(null===(g=A.button)||void 0===g?void 0:g.hoverColor)||"#D3D3D3",shadow:!1!==(null===(p=A.button)||void 0===p?void 0:p.shadow),shadowColor:(null===(h=A.button)||void 0===h?void 0:h.shadowColor)||"rgba(0,0,0,0.15)",primaryColor:(null===(B=A.button)||void 0===B?void 0:B.backgroundColor)||(null===(m=A.icon)||void 0===m?void 0:m.backgroundColor)||"#FFFFFF"},A.button),panel:Ue({width:(null===(f=A.panel)||void 0===f?void 0:f.width)||360,height:(null===(v=A.panel)||void 0===v?void 0:v.height)||500,borderRadius:(null===(w=A.panel)||void 0===w?void 0:w.borderRadius)||24,backgroundColor:(null===(C=A.panel)||void 0===C?void 0:C.backgroundColor)||"#FFFFFF",backdropFilter:(null===(y=A.panel)||void 0===y?void 0:y.backdropFilter)||null,border:(null===(b=A.panel)||void 0===b?void 0:b.border)||"1px solid #E5E7EB"},A.panel),voice:Ue({micButtonColor:(null===(x=A.voice)||void 0===x?void 0:x.micButtonColor)||(null===(Q=A.panel)||void 0===Q?void 0:Q.micButtonColor)||Me,micButtonActiveColor:(null===(F=A.voice)||void 0===F?void 0:F.micButtonActiveColor)||(null===(U=A.panel)||void 0===U?void 0:U.micButtonActiveColor)||"#EF4444",micButtonHint:Ue(Ue({text:(null===(S=A.voice)||void 0===S||null===(S=S.micButtonHint)||void 0===S?void 0:S.text)||(null===(I=A.panel)||void 0===I||null===(I=I.micButtonHint)||void 0===I?void 0:I.text)||"Click the button to start voice conversation",color:(null===(E=A.voice)||void 0===E||null===(E=E.micButtonHint)||void 0===E?void 0:E.color)||(null===(k=A.panel)||void 0===k||null===(k=k.micButtonHint)||void 0===k?void 0:k.color)||"#6B7280",fontSize:(null===(H=A.voice)||void 0===H||null===(H=H.micButtonHint)||void 0===H?void 0:H.fontSize)||(null===(T=A.panel)||void 0===T||null===(T=T.micButtonHint)||void 0===T?void 0:T.fontSize)||"12px"},null===(D=A.voice)||void 0===D?void 0:D.micButtonHint),null===(K=A.panel)||void 0===K?void 0:K.micButtonHint),avatarBackgroundColor:(null===(L=A.voice)||void 0===L?void 0:L.avatarBackgroundColor)||"#667eea",avatarActiveBackgroundColor:(null===(M=A.voice)||void 0===M?void 0:M.avatarActiveBackgroundColor)||"#667eea",statusTitleColor:(null===(R=A.voice)||void 0===R?void 0:R.statusTitleColor)||"#1e293b",statusSubtitleColor:(null===(P=A.voice)||void 0===P?void 0:P.statusSubtitleColor)||"#64748b",statusDotColor:(null===(O=A.voice)||void 0===O?void 0:O.statusDotColor)||"#10b981",statusText:(null===(V=A.voice)||void 0===V?void 0:V.statusText)||null,startCallButtonColor:(null===(_=A.voice)||void 0===_?void 0:_.startCallButtonColor)||"#667eea",startCallButtonTextColor:(null===(N=A.voice)||void 0===N?void 0:N.startCallButtonTextColor)||"#FFFFFF",startCallTitle:(null===(G=A.voice)||void 0===G?void 0:G.startCallTitle)||null,startCallSubtitle:(null===(W=A.voice)||void 0===W?void 0:W.startCallSubtitle)||null,startCallButtonText:(null===(j=A.voice)||void 0===j?void 0:j.startCallButtonText)||null,transcriptBackgroundColor:(null===(z=A.voice)||void 0===z?void 0:z.transcriptBackgroundColor)||"#FFFFFF",transcriptTextColor:(null===(X=A.voice)||void 0===X?void 0:X.transcriptTextColor)||"#1e293b",transcriptLabelColor:(null===(J=A.voice)||void 0===J?void 0:J.transcriptLabelColor)||"#94a3b8",controlButtonColor:(null===(Y=A.voice)||void 0===Y?void 0:Y.controlButtonColor)||"#FFFFFF",controlButtonSecondaryColor:(null===(q=A.voice)||void 0===q?void 0:q.controlButtonSecondaryColor)||"#64748b",endCallButtonColor:(null===(Z=A.voice)||void 0===Z?void 0:Z.endCallButtonColor)||"#ef4444",language:(null===($=A.voice)||void 0===$?void 0:$.language)||A.language||"en"},A.voice),text:Ue({sendButtonColor:(null===(AA=A.text)||void 0===AA?void 0:AA.sendButtonColor)||(null===(eA=A.panel)||void 0===eA?void 0:eA.sendButtonColor)||"#7C3AED",sendButtonHoverColor:(null===(tA=A.text)||void 0===tA?void 0:tA.sendButtonHoverColor)||(null===(nA=A.panel)||void 0===nA?void 0:nA.sendButtonHoverColor)||"#6D28D9",sendButtonActiveColor:(null===(oA=A.text)||void 0===oA?void 0:oA.sendButtonActiveColor)||(null===(iA=A.panel)||void 0===iA?void 0:iA.sendButtonActiveColor)||"#6D28D9",sendButtonText:(null===(rA=A.text)||void 0===rA?void 0:rA.sendButtonText)||(null===(sA=A.panel)||void 0===sA?void 0:sA.sendButtonText)||"➤",sendButtonTextColor:(null===(aA=A.text)||void 0===aA?void 0:aA.sendButtonTextColor)||(null===(cA=A.panel)||void 0===cA?void 0:cA.sendButtonTextColor)||"#FFFFFF",sendButtonFontSize:(null===(lA=A.text)||void 0===lA?void 0:lA.sendButtonFontSize)||(null===(dA=A.panel)||void 0===dA?void 0:dA.sendButtonFontSize)||"18px",sendButtonFontWeight:(null===(uA=A.text)||void 0===uA?void 0:uA.sendButtonFontWeight)||(null===(gA=A.panel)||void 0===gA?void 0:gA.sendButtonFontWeight)||"500",sendButtonHint:Ue(Ue({text:(null===(pA=A.text)||void 0===pA||null===(pA=pA.sendButtonHint)||void 0===pA?void 0:pA.text)||(null===(hA=A.panel)||void 0===hA||null===(hA=hA.sendButtonHint)||void 0===hA?void 0:hA.text)||"",color:(null===(BA=A.text)||void 0===BA||null===(BA=BA.sendButtonHint)||void 0===BA?void 0:BA.color)||(null===(mA=A.panel)||void 0===mA||null===(mA=mA.sendButtonHint)||void 0===mA?void 0:mA.color)||"#6B7280",fontSize:(null===(fA=A.text)||void 0===fA||null===(fA=fA.sendButtonHint)||void 0===fA?void 0:fA.fontSize)||(null===(vA=A.panel)||void 0===vA||null===(vA=vA.sendButtonHint)||void 0===vA?void 0:vA.fontSize)||"12px"},null===(wA=A.text)||void 0===wA?void 0:wA.sendButtonHint),null===(CA=A.panel)||void 0===CA?void 0:CA.sendButtonHint),inputPlaceholder:(null===(yA=A.text)||void 0===yA?void 0:yA.inputPlaceholder)||(null===(bA=A.panel)||void 0===bA?void 0:bA.inputPlaceholder)||"Type your message...",inputBorderColor:(null===(xA=A.text)||void 0===xA?void 0:xA.inputBorderColor)||(null===(QA=A.panel)||void 0===QA?void 0:QA.inputBorderColor)||"#E5E7EB",inputFocusColor:(null===(FA=A.text)||void 0===FA?void 0:FA.inputFocusColor)||(null===(UA=A.panel)||void 0===UA?void 0:UA.inputFocusColor)||"#7C3AED",inputBackgroundColor:(null===(SA=A.text)||void 0===SA?void 0:SA.inputBackgroundColor)||(null===(IA=A.panel)||void 0===IA?void 0:IA.inputBackgroundColor)||"#FFFFFF",inputTextColor:(null===(EA=A.text)||void 0===EA?void 0:EA.inputTextColor)||(null===(kA=A.panel)||void 0===kA?void 0:kA.inputTextColor)||"#1F2937",inputFontSize:(null===(HA=A.text)||void 0===HA?void 0:HA.inputFontSize)||(null===(TA=A.panel)||void 0===TA?void 0:TA.inputFontSize)||"14px",inputBorderRadius:(null===(DA=A.text)||void 0===DA?void 0:DA.inputBorderRadius)||(null===(KA=A.panel)||void 0===KA?void 0:KA.inputBorderRadius)||20,inputPadding:(null===(LA=A.text)||void 0===LA?void 0:LA.inputPadding)||(null===(MA=A.panel)||void 0===MA?void 0:MA.inputPadding)||"6px 14px"},A.text),landing:(Le={},A.landing&&Object.keys(A.landing).forEach(e=>{var t=A.landing[e];(null!=t&&""!==t||!1===t)&&(Le[e]=t)}),Ue({backgroundColor:Le.backgroundColor||"linear-gradient(180deg, #f8fafc 0%, #e0e7ff 100%)",logo:Le.logo||"🤖",title:Le.title||null,titleColor:Le.titleColor||"#1e293b",modeCardBackgroundColor:Le.modeCardBackgroundColor||"#FFFFFF",modeCardBorderColor:Le.modeCardBorderColor||"#E2E8F0",modeCardHoverBorderColor:Le.modeCardHoverBorderColor||"#7C3AED",modeCardIconBackgroundColor:Le.modeCardIconBackgroundColor||"#7C3AED",modeCardTitleColor:Le.modeCardTitleColor||"#111827",voiceCardIcon:Le.voiceCardIcon||"🎤",textCardIcon:Le.textCardIcon||"💬",voiceCardTitle:Le.voiceCardTitle||null,textCardTitle:Le.textCardTitle||null},Le)),header:(Ke={},A.header&&Object.keys(A.header).forEach(e=>{var t=A.header[e];e.startsWith("onlineIndicator")?null!=t&&(Ke[e]=t):null!=t&&""!==t&&(Ke[e]=t)}),Ue({title:Ke.title||"Chat Assistant",showTitle:!1!==Ke.showTitle,backgroundColor:Ke.backgroundColor||"#7C3AED",textColor:Ke.textColor||"#FFFFFF",showCloseButton:!1!==Ke.showCloseButton},Ke)),footer:Ue({show:!1!==(null===(RA=A.footer)||void 0===RA?void 0:RA.show),backgroundColor:(null===(PA=A.footer)||void 0===PA?void 0:PA.backgroundColor)||"#f9fafb",textColor:(null===(OA=A.footer)||void 0===OA?void 0:OA.textColor)||"#9ca3af",hoverColor:(null===(VA=A.footer)||void 0===VA?void 0:VA.hoverColor)||"#7C3AED"},A.footer),tooltips:Ue({newChat:(null===(_A=A.tooltips)||void 0===_A?void 0:_A.newChat)||null,back:(null===(NA=A.tooltips)||void 0===NA?void 0:NA.back)||null,close:(null===(GA=A.tooltips)||void 0===GA?void 0:GA.close)||null,mute:(null===(WA=A.tooltips)||void 0===WA?void 0:WA.mute)||null,speaker:(null===(jA=A.tooltips)||void 0===jA?void 0:jA.speaker)||null,endCall:(null===(zA=A.tooltips)||void 0===zA?void 0:zA.endCall)||null},A.tooltips),messages:Ue({userBackgroundColor:(null===(XA=A.messages)||void 0===XA?void 0:XA.userBackgroundColor)||"#E5E7EB",agentBackgroundColor:(null===(JA=A.messages)||void 0===JA?void 0:JA.agentBackgroundColor)||"#F3F4F6",systemBackgroundColor:(null===(YA=A.messages)||void 0===YA?void 0:YA.systemBackgroundColor)||"#DCFCE7",errorBackgroundColor:(null===(qA=A.messages)||void 0===qA?void 0:qA.errorBackgroundColor)||"#FEE2E2",textColor:(null===(ZA=A.messages)||void 0===ZA?void 0:ZA.textColor)||"#1F2937",userTextColor:(null===($A=A.messages)||void 0===$A?void 0:$A.userTextColor)||(null===(Ae=A.messages)||void 0===Ae?void 0:Ae.textColor)||"#1F2937",agentTextColor:(null===(ee=A.messages)||void 0===ee?void 0:ee.agentTextColor)||(null===(te=A.messages)||void 0===te?void 0:te.textColor)||"#1F2937",userAvatarIcon:(null===(ne=A.messages)||void 0===ne?void 0:ne.userAvatarIcon)||"👤",agentAvatarIcon:(null===(oe=A.messages)||void 0===oe?void 0:oe.agentAvatarIcon)||"🤖",fontSize:(null===(ie=A.messages)||void 0===ie?void 0:ie.fontSize)||"14px",borderRadius:(null===(re=A.messages)||void 0===re?void 0:re.borderRadius)||16},A.messages),animation:Ue({enableHover:!1!==(null===(se=A.animation)||void 0===se?void 0:se.enableHover),enablePulse:!1!==(null===(ae=A.animation)||void 0===ae?void 0:ae.enablePulse),enableSlide:!1!==(null===(ce=A.animation)||void 0===ce?void 0:ce.enableSlide),duration:(null===(le=A.animation)||void 0===le?void 0:le.duration)||.3},A.animation),promptAnimation:Ue({enabled:!0===(null===(de=A.promptAnimation)||void 0===de?void 0:de.enabled),text:(null===(ue=A.promptAnimation)||void 0===ue?void 0:ue.text)||"Try me!",backgroundColor:(null===(ge=A.promptAnimation)||void 0===ge?void 0:ge.backgroundColor)||"linear-gradient(135deg, #7c3aed, #4f46e5)",textColor:(null===(pe=A.promptAnimation)||void 0===pe?void 0:pe.textColor)||"#ffffff",animationType:(null===(he=A.promptAnimation)||void 0===he?void 0:he.animationType)||"bounce",showShimmer:!1!==(null===(Be=A.promptAnimation)||void 0===Be?void 0:Be.showShimmer),showPulseRings:!1!==(null===(me=A.promptAnimation)||void 0===me?void 0:me.showPulseRings),hideAfterClick:!1!==(null===(fe=A.promptAnimation)||void 0===fe?void 0:fe.hideAfterClick),hideAfterSeconds:void 0!==(null===(ve=A.promptAnimation)||void 0===ve?void 0:ve.hideAfterSeconds)?A.promptAnimation.hideAfterSeconds:null,position:(null===(we=A.promptAnimation)||void 0===we?void 0:we.position)||"top"},A.promptAnimation),behavior:Ue({autoOpen:(null===(Ce=A.behavior)||void 0===Ce?void 0:Ce.autoOpen)||!1,startOpen:(null===(ye=A.behavior)||void 0===ye?void 0:ye.startOpen)||!1,hidden:(null===(be=A.behavior)||void 0===be?void 0:be.hidden)||!1,autoConnect:(null===(xe=A.behavior)||void 0===xe?void 0:xe.autoConnect)||!1,showWelcomeMessage:!1!==(null===(Qe=A.behavior)||void 0===Qe?void 0:Qe.showWelcomeMessage),welcomeMessage:(null===(Fe=A.behavior)||void 0===Fe?void 0:Fe.welcomeMessage)||"Hello! How can I help you today?",enableVoiceMode:void 0===(null===(Se=A.behavior)||void 0===Se?void 0:Se.enableVoiceMode)||A.behavior.enableVoiceMode,mode:(null===(Ie=A.behavior)||void 0===Ie?void 0:Ie.mode)||"unified"},A.behavior),accessibility:Ue({ariaLabel:(null===(Ee=A.accessibility)||void 0===Ee?void 0:Ee.ariaLabel)||"Chat Assistant",ariaDescription:(null===(ke=A.accessibility)||void 0===ke?void 0:ke.ariaDescription)||"Click to open chat assistant",keyboardNavigation:!1!==(null===(He=A.accessibility)||void 0===He?void 0:He.keyboardNavigation)},A.accessibility),customStyles:A.customStyles||"",useShadowDOM:!1!==A.useShadowDOM,variables:A.variables||{},forceConversationId:A.forceConversationId,visualAssistant:A.visualAssistant,onConversationStart:A.onConversationStart,onConversationEnd:A.onConversationEnd,onBargeIn:A.onBargeIn,onAudioStartPlaying:A.onAudioStartPlaying,onAudioStoppedPlaying:A.onAudioStoppedPlaying,onSubtitleDisplay:A.onSubtitleDisplay,onVoiceCallButtonClick:A.onVoiceCallButtonClick,primaryColor:Me},"string"==typeof A.position?{positionString:A.position}:{})}setupEventHandlers(){this.sdk.on("domainError",A=>{this.textInterface.showError(A),this.textInterface.stopStreamingState()}),this.sdk.on("error",A=>{A&&("DOMAIN_NOT_WHITELISTED"===A.message||A.message&&A.message.includes("Domain not whitelisted"))||(this.textInterface.showError(A.message||A),this.textInterface.stopStreamingState())}),this.sdk.on("chunk",A=>{this.textInterface.appendStreamingChunk(A)}),this.sdk.on("done",A=>{var{text:e}=A;this.textInterface.finalizeStreaming(e)})}createShadowHost(){var A=document.getElementById("ttp-widget-shadow-host");A&&A.remove();var e=document.createElement("div");e.id="ttp-widget-shadow-host",e.style.cssText="position: fixed; z-index: 10000; pointer-events: none; top: 0; left: 0; width: 100%; height: 100%; overflow: visible;",this.shadowRoot=e.attachShadow({mode:"open"}),document.body.appendChild(e)}createRegularContainer(){var A=document.getElementById("ttp-widget-container");A&&A.remove();var e=document.createElement("div");e.id="ttp-widget-container",e.style.cssText="position: fixed; z-index: 10000; pointer-events: none; top: 0; left: 0; width: 100%; height: 100%; overflow: visible;",document.body.appendChild(e),this.regularContainer=e}createWidget(){this.container||(this.config.useShadowDOM?(this.createShadowHost(),this.container=this.shadowRoot):(this.createRegularContainer(),this.container=this.regularContainer,this.shadowRoot=document));var A;A=this.config.useShadowDOM?"\n :host {\n all: initial;\n display: block;\n pointer-events: none;\n }\n img {\n max-width: none !important;\n }\n #text-chat-button img {\n width: 28px !important;\n height: 28px !important;\n }\n #text-chat-button {\n pointer-events: auto;\n }\n #text-chat-panel {\n pointer-events: auto;\n }\n ":'\n /* Reset only problematic inherited styles, not all styles */\n #text-chat-button,\n #text-chat-panel,\n #text-chat-panel * {\n box-sizing: border-box;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n }\n \n /* Prevent theme CSS from affecting images */\n #text-chat-button img,\n #text-chat-panel img {\n max-width: none !important;\n width: auto;\n height: auto;\n }\n \n #text-chat-button img {\n width: 28px !important;\n height: 28px !important;\n }\n \n /* Ensure button and panel can receive clicks */\n #text-chat-button,\n #text-chat-panel {\n pointer-events: auto;\n }\n \n /* Reset any inherited text styles that might break layout */\n #text-chat-panel {\n text-align: left;\n line-height: normal;\n letter-spacing: normal;\n word-spacing: normal;\n text-transform: none;\n text-indent: 0;\n text-shadow: none;\n white-space: normal;\n }\n \n /* Ensure flexbox works properly */\n #text-chat-panel .widget-shell,\n #text-chat-panel .panel-inner,\n #text-chat-panel .widget-container,\n #text-chat-panel .landing-screen,\n #text-chat-panel .voice-interface,\n #text-chat-panel .text-interface,\n #text-chat-panel .widget-header,\n #text-chat-panel .mode-selection {\n display: flex;\n }\n \n #text-chat-panel .widget-shell,\n #text-chat-panel .panel-inner,\n #text-chat-panel .widget-container,\n #text-chat-panel .landing-screen,\n #text-chat-panel .voice-interface,\n #text-chat-panel .text-interface {\n flex-direction: column;\n }\n \n #text-chat-panel .mode-selection {\n flex-direction: row;\n }\n \n /* Ensure proper stacking */\n #text-chat-button {\n z-index: 10001 !important;\n }\n \n #text-chat-panel {\n z-index: 10000 !important;\n }\n ';var e=this.generateWidgetHTML();if(this.config.useShadowDOM){var t="\n <style>".concat(A,"</style>\n ").concat(e,"\n ");this.shadowRoot.innerHTML=t}else this.injectStylesIntoHead(A),this.container.innerHTML=e;this.setupWidgetEvents();var n=this.shadowRoot.getElementById("text-chat-panel");n?this.config.behavior.startOpen||this.config.behavior.autoOpen?(this.isOpen=!0,n.classList.add("open"),this.hidePrompt()):this.showPrompt():setTimeout(()=>{this.showPrompt()},100),setTimeout(()=>{this.isOpen?this.hidePrompt():this.showPrompt()},200)}injectStylesIntoHead(A){var e,t,n=document.getElementById("ttp-widget-styles");n&&n.remove();var o={small:50,medium:60,large:70,xl:80}[null===(e=this.config.button)||void 0===e?void 0:e.size]||60,i={small:20,medium:28,large:36,xl:44}[null===(t=this.config.icon)||void 0===t?void 0:t.size]||28,r=this.generatePositionStyles(),s=this.generateCSS(r,o,i),a=document.createElement("style");a.id="ttp-widget-styles",a.textContent=A+"\n"+s,this.config.customStyles&&(a.textContent+="\n"+this.config.customStyles),document.head.appendChild(a)}generateWidgetHTML(){this.config.position;var A,e=this.config.button,t=this.config.icon,n=(this.config.panel,this.config.header),o=(this.config.animation,{small:50,medium:60,large:70,xl:80}[e.size]||60),i={small:20,medium:28,large:36,xl:44}[t.size]||28,r=this.generatePositionStyles(),s=this.generateIconHTML(i),a=(null===(A=this.config.behavior)||void 0===A?void 0:A.mode)||"unified",c="unified"===a,l="unified"===a||"voice-only"===a,d="unified"===a||"text-only"===a,u=A=>{var e=this.config.language||"en";return(this.translations[e]||this.translations.en)[A]||A},g=A=>{var e,t=null===(e=this.config.tooltips)||void 0===e?void 0:e[A];return null!=t?t:{newChat:u("newChat"),back:u("back"),close:u("close"),mute:u("mute"),speaker:u("speaker"),endCall:u("endCall")}[A]||""},p=this.config.useShadowDOM?"\n <style>\n ".concat(this.generateCSS(r,o,i),"\n ").concat(this.config.customStyles,"\n </style>\n "):"",h=this.config.promptAnimation||{},B=!0===h.enabled,m=B?this.generatePromptBubbleHTML(h,o):"";return console.log("📝 generateWidgetHTML - promptAnimation:",{hasConfig:!!this.config.promptAnimation,promptConfig:h,enabled:h.enabled,isPromptEnabled:B,willGenerateHTML:!!m}),"\n ".concat(p,"\n \n ").concat(this.config.behavior.hidden?"":'\n <div id="text-chat-button-container">\n '.concat(m,"\n ").concat(B&&!1!==h.showPulseRings?this.generatePulseRingsHTML(h):"",'\n <button id="text-chat-button" \n aria-label="').concat(this.config.accessibility.ariaLabel,'"\n aria-description="').concat(this.config.accessibility.ariaDescription,'">\n ').concat(s,"\n </button>\n </div>\n "),'\n \n <div id="text-chat-panel">\n <div class="widget-shell">\n <div class="panel-inner widget-container" style="direction: ').concat(this.config.direction,';">\n <div class="widget-header" style="background: ').concat(n.backgroundColor||"#7C3AED"," !important; color: ").concat(n.textColor||"#FFFFFF",' !important;">\n <div>\n ').concat(n.showTitle?'<div class="header-title">'.concat(n.title,"</div>"):"",'\n <div class="header-status" style="color: ').concat(n.onlineIndicatorColor||"rgba(255,255,255,0.7)",' !important;">\n <span class="status-dot" style="background: ').concat(n.onlineIndicatorDotColor||"#10b981",' !important;"></span>\n <span>').concat(void 0!==n.onlineIndicatorText&&null!==n.onlineIndicatorText?n.onlineIndicatorText:u("online"),'</span>\n </div>\n </div>\n \n <div style="display: flex; gap: 6px; align-items: center; position: relative; z-index: 1;">\n \x3c!-- New Chat Button (hide on landing screen, show otherwise) --\x3e\n <button class="header-icon new-chat-btn" id="newChatBtn" title="').concat(g("newChat"),'" style="').concat(c?"display: none;":"",'">\n <span style="font-size: 18px; font-weight: bold;">+</span>\n </button>\n \n \x3c!-- Back Button (only show in unified mode) --\x3e\n ').concat("unified"===a?'<button class="header-icon back-btn" id="backBtn" title="'.concat(g("back"),'" style="display: none;">\n <span style="font-size: 16px;">‹</span>\n </button>'):"","\n \n \x3c!-- Close Button --\x3e\n ").concat(n.showCloseButton?'<button class="header-icon close-btn" id="closeBtn" title="'+g("close")+'"><span style="font-size: 18px; font-weight: bold;">×</span></button>':"","\n </div>\n </div>\n\n ").concat(c&&this.landingScreen?this.landingScreen.generateHTML():"","\n\n ").concat(l?this.voiceInterface.generateHTML():"","\n ").concat(d?this.textInterface.generateHTML():"","\n ").concat(this.generateFooterHTML(),"\n </div>\n </div>\n </div>\n ")}generateFooterHTML(){if(!this.config.footer.show)return"";var A=encodeURIComponent(window.location.hostname||"widget"),e="https://talktopc.com?ref=widget&source=".concat(A);return'\n <div class="widget-footer" style="\n padding: 10px 16px;\n text-align: center;\n border-top: 1px solid rgba(0,0,0,0.06);\n font-size: 11px;\n color: #64748b;\n background: #fff;\n flex-shrink: 0;\n ">\n <div class="powered-by" style="\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n ">\n <svg viewBox="0 0 24 24" fill="currentColor" style="width: 11px; height: 11px; color: #f59e0b;">\n <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/>\n </svg>\n Powered by <a href="'.concat(e,'" target="_blank" rel="noopener noreferrer" style="color: #a855f7; text-decoration: none; font-weight: 500;" onmouseover="this.style.color=\'#9333ea\'" onmouseout="this.style.color=\'#a855f7\'">TalkToPC</a>\n </div>\n </div>\n ')}generatePositionStyles(){var A=this.config.position,e=A.offset||{x:20,y:20},t="";return"top"===A.vertical?t+="top: ".concat(e.y,"px;"):"bottom"===A.vertical?t+="bottom: ".concat(e.y,"px;"):"center"===A.vertical&&(t+="top: 50%; transform: translateY(-50%);"),"left"===A.horizontal?t+="left: ".concat(e.x,"px;"):"right"===A.horizontal?t+="right: ".concat(e.x,"px;"):"center"===A.horizontal&&(t+="left: 50%; transform: translateX(-50%);"),t}generateIconHTML(A){var e=this.config.icon;switch(e.type){case"custom":return'<img src="'.concat(e.customImage,'" alt="Chat Assistant" style="width: ').concat(A,"px; height: ").concat(A,'px; object-fit: contain;" />');case"emoji":return'<span style="font-size: '.concat(A,'px; line-height: 1;">').concat(e.emoji,"</span>");case"text":return'<span style="font-size: '.concat(Math.floor(.6*A),'px; font-weight: bold; color: white;">').concat(e.text,"</span>");case"microphone":default:return'<svg viewBox="0 0 24 24" style="width: '.concat(A,"px; height: ").concat(A,'px; fill: white;">\n <path d="M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"/>\n <path d="M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"/>\n </svg>');case"chat":return'<svg viewBox="0 0 24 24" style="width: '.concat(A,"px; height: ").concat(A,'px; fill: white;">\n <path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/>\n </svg>')}}generatePromptBubbleHTML(A,e){var t="#7c3aed";if(A.backgroundColor&&A.backgroundColor.includes("gradient")){var n=A.backgroundColor.match(/#[0-9a-fA-F]{6}/);n&&(t=n[0])}else t=A.backgroundColor;var o="none"===A.animationType?"":"animation-".concat(A.animationType),i=A.showShimmer?'<div class="prompt-bubble-shimmer"></div>':"";return'\n <div class="prompt-bubble '.concat(A.position," ").concat(o,'" \n id="prompt-bubble"\n role="tooltip"\n style="--prompt-bubble-bg-color: ').concat(t,';">\n <div class="prompt-bubble-content" \n style="background: ').concat(A.backgroundColor,"; color: ").concat(A.textColor,';">\n ').concat(i,'\n <span style="position: relative; z-index: 1;">').concat(A.text,'</span>\n </div>\n <div class="prompt-bubble-arrow"></div>\n </div>\n ')}generatePulseRingsHTML(A){var e="#7c3aed";if(A.backgroundColor&&A.backgroundColor.includes("gradient")){var t=A.backgroundColor.match(/#[0-9a-fA-F]{6}/);t&&(e=t[0])}else e=A.backgroundColor;return'\n <div class="prompt-pulse-rings" id="prompt-pulse-rings">\n <div class="prompt-pulse-ring" style="background-color: '.concat(e,'33;"></div>\n <div class="prompt-pulse-ring" style="background-color: ').concat(e,'1a;"></div>\n </div>\n ')}generateCSS(A,e,t){var n,o,i,r,s,a=this.config.button,c=this.config.icon,l=this.config.panel,d=this.config.header,u=(this.config.messages,this.config.animation),g=(null===(n=this.config.behavior)||void 0===n?void 0:n.mode)||"unified",p="unified"===g,h="unified"===g||"voice-only"===g,B="unified"===g||"text-only"===g,m=!1===this.config.useShadowDOM?" !important":"";return'\n /* MOBILE FIRST - Default styles for all devices */\n #text-chat-widget {\n position: fixed !important;\n z-index: 10000;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n /* Mobile defaults */\n right: 10px;\n bottom: 10px;\n left: auto;\n top: auto;\n }\n \n /* Desktop positioning (only on larger screens) */\n @media (min-width: 769px) {\n #text-chat-widget {\n '.concat(A,"\n right: ").concat("right"===this.config.position.horizontal?"20px":"auto",";\n left: ").concat("left"===this.config.position.horizontal?"20px":"auto",";\n bottom: ").concat("bottom"===this.config.position.vertical?"20px":"auto",";\n top: ").concat("top"===this.config.position.vertical?"20px":"auto",";\n }\n }\n \n /* Mobile override (force mobile positioning) */\n @media (max-width: 768px) {\n #text-chat-widget {\n right: 10px !important;\n bottom: 10px !important;\n left: auto !important;\n top: auto !important;\n transform: none !important;\n }\n }\n \n @media (max-width: 480px) {\n #text-chat-widget {\n right: 8px !important;\n bottom: 8px !important;\n left: auto !important;\n top: auto !important;\n }\n }\n \n #text-chat-button {\n position: relative;\n width: ").concat(e,"px;\n height: ").concat(e,"px;\n margin: 0;\n flex-shrink: 0;\n border-radius: ").concat("circle"===a.shape?"50%":"square"===a.shape?"0":"12px",";\n background: ").concat(a.backgroundColor||c.backgroundColor||"#7C3AED",";\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all ").concat(u.duration,"s ease;\n box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);\n touch-action: manipulation;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n user-select: none;\n min-width: 44px;\n min-height: 44px;\n z-index: 1;\n }\n \n @media (max-width: 768px) {\n #text-chat-widget {\n right: 10px !important;\n bottom: 10px !important;\n left: auto !important;\n top: auto !important;\n transform: none !important;\n }\n \n #text-chat-button-container {\n width: 56px !important;\n height: 56px !important;\n }\n \n #text-chat-button {\n width: 56px !important;\n height: 56px !important;\n min-width: 56px !important;\n min-height: 56px !important;\n max-width: 56px !important;\n max-height: 56px !important;\n }\n \n #text-chat-panel {\n position: fixed !important;\n left: 10px !important;\n right: 10px !important;\n bottom: 92px !important; /* 56px button + 20px gap + 16px footer */\n top: 60px !important; /* Add top spacing */\n width: auto !important;\n max-width: none !important;\n height: auto !important; /* Change from max-height to auto */\n max-height: none !important; /* Remove max-height */\n transform: none !important;\n margin: 0 !important;\n }\n \n #text-chat-panel .widget-header {\n padding: 10px 14px;\n min-height: 56px;\n }\n \n #text-chat-panel .header-title {\n font-size: 15px;\n }\n \n #text-chat-panel .header-icon {\n width: 40px;\n height: 40px;\n min-width: 40px;\n min-height: 40px;\n }\n \n #text-chat-input {\n font-size: 16px !important; /* Prevents iOS zoom on focus */\n padding: 12px 16px !important;\n min-height: 48px !important;\n }\n \n #text-chat-send {\n min-width: 48px !important;\n min-height: 48px !important;\n width: 48px !important;\n height: 48px !important;\n }\n \n .landing-screen {\n padding: 16px;\n }\n \n .landing-logo {\n font-size: 40px;\n }\n \n .landing-title {\n font-size: 18px;\n margin-bottom: 16px;\n }\n \n .mode-selection {\n flex-direction: column;\n gap: 12px;\n align-items: center;\n }\n \n .mode-card {\n max-width: 100%;\n width: 100%;\n padding: 16px;\n }\n \n .mode-card-icon {\n width: 50px;\n height: 50px;\n font-size: 28px;\n }\n \n .mode-card-title {\n font-size: 14px;\n }\n }\n \n @media (max-width: 480px) {\n #text-chat-widget {\n right: 8px !important;\n bottom: 8px !important;\n left: auto !important;\n top: auto !important;\n }\n \n #text-chat-button-container {\n width: 54px !important;\n height: 54px !important;\n }\n \n #text-chat-button {\n width: 54px !important;\n height: 54px !important;\n min-width: 54px !important;\n min-height: 54px !important;\n }\n \n #text-chat-panel {\n left: 8px !important;\n right: 8px !important;\n bottom: 86px !important; /* 54px button + 20px gap + 12px footer */\n top: 50px !important; /* Add top spacing for very small screens */\n height: auto !important;\n max-height: none !important;\n }\n \n #text-chat-panel .widget-header {\n padding: 8px 12px;\n min-height: 52px;\n }\n \n #text-chat-panel .header-title {\n font-size: 14px;\n }\n \n .landing-logo {\n font-size: 36px;\n }\n \n .landing-title {\n font-size: 16px;\n }\n }\n \n ").concat(u.enableHover?"\n #text-chat-button:hover {\n ".concat(a.hoverColor?"background: ".concat(a.hoverColor,";"):"","\n transform: scale(1.05);\n box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);\n }\n "):"","\n \n /* Prompt Animation Keyframes */\n @keyframes widget-shimmer {\n 0% { transform: translateX(-100%); }\n 100% { transform: translateX(200%); }\n }\n \n @keyframes widget-ripple {\n 0% { transform: scale(1); opacity: 0.6; }\n 100% { transform: scale(2.5); opacity: 0; }\n }\n \n @keyframes widget-float {\n 0%, 100% { transform: translateX(-50%) translateY(0); }\n 50% { transform: translateX(-50%) translateY(-8px); }\n }\n \n @keyframes widget-bounce {\n 0%, 100% { transform: translateX(-50%) translateY(0); }\n 50% { transform: translateX(-50%) translateY(-10px); }\n }\n \n @keyframes widget-pulse-ring {\n 0% { transform: scale(1); opacity: 0.4; }\n 100% { transform: scale(1.8); opacity: 0; }\n }\n \n /* Prompt Bubble Container */\n #text-chat-button-container {\n position: fixed;\n ").concat("bottom"===this.config.position.vertical?"bottom: ".concat((null===(o=this.config.position.offset)||void 0===o?void 0:o.y)||20,"px;"):"top: ".concat((null===(i=this.config.position.offset)||void 0===i?void 0:i.y)||20,"px;"),"\n ").concat("right"===this.config.position.horizontal?"right: ".concat((null===(r=this.config.position.offset)||void 0===r?void 0:r.x)||20,"px;"):"left: ".concat((null===(s=this.config.position.offset)||void 0===s?void 0:s.x)||20,"px;"),"\n width: ").concat(e,"px;\n height: ").concat(e,"px;\n z-index: 10001;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n @media (max-width: 768px) {\n #text-chat-button-container {\n right: 10px !important;\n bottom: 10px !important;\n left: auto !important;\n top: auto !important;\n }\n }\n \n @media (max-width: 480px) {\n #text-chat-button-container {\n right: 8px !important;\n bottom: 8px !important;\n left: auto !important;\n top: auto !important;\n }\n }\n \n /* Prompt Bubble Styles */\n .prompt-bubble {\n position: absolute;\n z-index: 10002;\n pointer-events: none;\n white-space: nowrap;\n }\n \n .prompt-bubble.top {\n bottom: calc(100% + 18px);\n left: 50%;\n transform: translateX(-50%);\n }\n \n .prompt-bubble.left {\n right: calc(100% + 12px);\n top: 50%;\n transform: translateY(-50%);\n }\n \n .prompt-bubble.right {\n left: calc(100% + 12px);\n top: 50%;\n transform: translateY(-50%);\n }\n \n /* Ensure animations preserve horizontal centering for top position */\n .prompt-bubble.top.animation-bounce {\n animation: widget-bounce 1s ease-in-out infinite;\n transform: translateX(-50%); /* Keep centering */\n }\n \n .prompt-bubble.top.animation-float {\n animation: widget-float 2s ease-in-out infinite;\n transform: translateX(-50%); /* Keep centering */\n }\n \n .prompt-bubble.top.animation-pulse {\n animation: pulse 2s ease-in-out infinite;\n transform: translateX(-50%); /* Keep centering */\n }\n \n .prompt-bubble-content {\n position: relative;\n padding: 8px 16px;\n border-radius: 20px;\n font-weight: 500;\n font-size: 14px;\n box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);\n overflow: hidden;\n }\n \n .prompt-bubble-shimmer {\n position: absolute;\n inset: 0;\n background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);\n animation: widget-shimmer 2s infinite;\n }\n \n .prompt-bubble.animation-bounce {\n animation: widget-bounce 1s ease-in-out infinite;\n }\n \n .prompt-bubble.animation-pulse {\n animation: pulse 2s ease-in-out infinite;\n }\n \n .prompt-bubble.animation-float {\n animation: widget-float 2s ease-in-out infinite;\n }\n \n /* Ensure top-positioned bubbles maintain horizontal centering during animations */\n .prompt-bubble.top.animation-bounce,\n .prompt-bubble.top.animation-float,\n .prompt-bubble.top.animation-pulse {\n /* Animation keyframes already include translateX(-50%) for centering */\n }\n \n /* Prompt Bubble Arrow */\n .prompt-bubble-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border: 8px solid transparent;\n }\n \n .prompt-bubble.top .prompt-bubble-arrow {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n border-top-color: var(--prompt-bubble-bg-color, #7c3aed);\n border-bottom: none;\n margin-left: 0;\n }\n \n .prompt-bubble.left .prompt-bubble-arrow {\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n border-left-color: var(--prompt-bubble-bg-color, #7c3aed);\n border-right: none;\n }\n \n .prompt-bubble.right .prompt-bubble-arrow {\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n border-right-color: var(--prompt-bubble-bg-color, #7c3aed);\n border-left: none;\n }\n \n /* Pulse Rings */\n .prompt-pulse-rings {\n position: absolute;\n inset: 0;\n border-radius: 50%;\n pointer-events: none;\n }\n \n .prompt-pulse-ring {\n position: absolute;\n inset: 0;\n border-radius: 50%;\n animation: widget-pulse-ring 2s ease-out infinite;\n }\n \n .prompt-pulse-ring:nth-child(2) {\n animation-delay: 0.5s;\n }\n \n /* Mobile adjustments for prompt bubble */\n @media (max-width: 768px) {\n .prompt-bubble-content {\n font-size: 12px;\n padding: 6px 12px;\n }\n \n .prompt-bubble.top {\n bottom: calc(100% + 14px);\n }\n \n .prompt-bubble.left,\n .prompt-bubble.right {\n display: none; /* Hide side prompts on mobile */\n }\n }\n \n #text-chat-panel {\n display: none").concat(m,";\n position: fixed;\n bottom: calc(").concat(e,"px + 20px + 20px); /* Button + gap + reduced footer offset */\n ").concat("right"===this.config.position.horizontal?"right: 20px;":"left: 20px;","\n width: ").concat(l.width,"px;\n max-width: calc(100vw - 40px);\n height: ").concat(l.height,"px;\n max-height: calc(100vh - ").concat(e,"px - 40px - 20px); /* Account for footer height */\n background: transparent;\n border-radius: ").concat(l.borderRadius,"px;\n border: none;\n flex-direction: column;\n overflow: hidden;\n ").concat(l.backdropFilter?"backdrop-filter: ".concat(l.backdropFilter,";"):"","\n ").concat(u.enableSlide?"transition: all ".concat(u.duration,"s ease;"):"","\n box-sizing: border-box;\n }\n \n #text-chat-panel.open {\n display: flex").concat(m,";\n ").concat(u.enableSlide?"transform: translateY(0); opacity: 1;":"","\n }\n\n /* Shell for gradient border/background */\n .widget-shell { width: 100%; height: 100%; padding: 0; border-radius: ").concat(l.borderRadius,"px; background: transparent; box-shadow: 0 20px 60px rgba(0,0,0,0.15); overflow: hidden; display: flex; flex-direction: column; box-sizing: border-box; }\n .panel-inner { width: 100%; height: 100%; background: #ffffff; border-radius: ").concat(l.borderRadius,"px; border: ").concat(l.border,"; overflow: hidden; display:flex; flex-direction: column; padding: 0; box-sizing: border-box; max-width: 100%; }\n\n /* New structure styles matching provided design */\n #text-chat-panel .widget-container {\n width: 100%; height: 100%; background: #FFFFFF; overflow: visible; display: flex; flex-direction: column; border-radius: ").concat(l.borderRadius,"px;\n container-type: size;\n }\n \n /* Ensure content areas can scroll when height is constrained */\n #text-chat-panel .widget-container > .landing-screen,\n #text-chat-panel .widget-container > .voice-interface,\n #text-chat-panel .widget-container > .text-interface {\n flex: 1;\n overflow-y: auto;\n overflow-x: visible; /* Change from hidden to visible */\n }\n \n /* Header should not scroll */\n #text-chat-panel .widget-header {\n padding: 14px 16px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-top-left-radius: ").concat(l.borderRadius,"px;\n border-top-right-radius: ").concat(l.borderRadius,"px;\n flex-shrink: 0;\n box-sizing: border-box;\n position: relative;\n overflow: hidden;\n background: ").concat(d.backgroundColor||"#7C3AED").concat(m,";\n color: ").concat(d.textColor||"#FFFFFF").concat(m,";\n }\n \n #text-chat-panel .widget-header::before {\n content: '';\n position: absolute;\n top: -50%;\n right: -20%;\n width: 180px;\n height: 180px;\n background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);\n pointer-events: none;\n }\n \n #text-chat-panel .widget-header > div:first-child {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 4px;\n position: relative;\n z-index: 1;\n }\n \n #text-chat-panel .header-title { font-size: 15px; font-weight: 600; margin: 0; }\n #text-chat-panel .header-status { display: flex; align-items: center; gap: 5px; font-size: 12px; margin: 0; }\n #text-chat-panel .status-dot { width: 6px; height: 6px; border-radius: 50%; animation: pulse 2s ease-in-out infinite; }\n /* Online indicator customization - inline styles take precedence */\n @keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.15); opacity: 0.8; } }\n /* Header icon buttons */\n .header-icon {\n background: rgba(255, 255, 255, 0.1);\n border: none;\n color: white;\n width: 34px;\n height: 34px;\n min-width: 34px;\n min-height: 34px;\n border-radius: 10px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background 0.2s;\n flex-shrink: 0;\n font-size: 16px;\n padding: 0;\n box-sizing: border-box;\n position: relative;\n z-index: 1;\n }\n \n .header-icon:hover {\n background: rgba(255, 255, 255, 0.2);\n }\n \n .header-icon svg {\n pointer-events: none;\n stroke: white;\n fill: none;\n }\n \n .back-btn.visible {\n display: flex !important;\n }\n\n ").concat(p&&this.landingScreen?this.landingScreen.generateCSS():"","\n\n ").concat(h?this.voiceInterface.generateCSS():"","\n ").concat(B?this.textInterface.generateCSS():"","\n \n /* Footer Branding */\n .widget-footer {\n box-sizing: border-box;\n }\n \n .footer-brand-link {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n }\n \n .footer-brand-link:hover {\n opacity: 0.9;\n }\n \n @media (max-width: 768px) {\n .widget-footer {\n height: 32px;\n }\n .widget-footer span {\n font-size: 10px;\n }\n .widget-footer span:last-child {\n font-size: 8px;\n }\n }\n \n #text-chat-send-hint {\n text-align: center;\n line-height: 1.4;\n }\n \n .agent-thinking {\n font-style: italic;\n color: #6B7280;\n }\n ")}setupWidgetEvents(){var A,e=this;if(this.shadowRoot){this.setupPromptAnimation();var t=this.shadowRoot.getElementById("text-chat-button");t&&(t.onclick=()=>{this.config.promptAnimation.hideAfterClick&&this.hidePrompt(),this.togglePanel()});var n=this.shadowRoot.getElementById("closeBtn");n&&(n.onclick=()=>{this._doTogglePanel()});var o,i=(null===(A=this.config.behavior)||void 0===A?void 0:A.mode)||"unified",r="unified"===i,s="unified"===i||"voice-only"===i,a="unified"===i||"text-only"===i,c=this.shadowRoot.getElementById("backBtn"),l=this.shadowRoot.getElementById("landingScreen"),d=this.shadowRoot.getElementById("textInterface"),u=this.shadowRoot.getElementById("voiceInterface");c&&(c.onclick=()=>{var A,e,t;if(null!==(A=this.voiceInterface)&&void 0!==A&&A.isShowingDomainError)return console.log("🔙 Back button clicked - clearing domain error and returning to landing"),this.voiceInterface.isShowingDomainError=!1,null!==(t=this.voiceInterface)&&void 0!==t&&t.resetConnectingState&&this.voiceInterface.resetConnectingState(),void this.showLanding();null!==(e=this.voiceInterface)&&void 0!==e&&e.isActive?this.showBackButtonWarning():this.showLanding()}),r&&this.landingScreen?(this.landingScreen.setupEventHandlers({onSelectVoice:(o=Qe(function*(){if(e.isStartingCall)console.log("⚠️ Call already starting, ignoring duplicate click");else{if("function"==typeof e.config.onVoiceCallButtonClick)try{e.config.onVoiceCallButtonClick({timestamp:Date.now(),widgetState:"start"})}catch(A){console.error("Error in onVoiceCallButtonClick callback:",A)}e.isStartingCall=!0;try{var A,t,n,o;if(e.showVoice(),null!==(A=e.voiceInterface)&&void 0!==A&&A.showConnectingState&&e.voiceInterface.showConnectingState(),null!==(t=e.voiceInterface)&&void 0!==t&&t.isMobile&&null!==(n=e.voiceInterface)&&void 0!==n&&n.createMobileMinimizedBar){var i,r=(null===(i=e.shadowRoot)||void 0===i?void 0:i.getElementById("text-chat-button"))||document.getElementById("text-chat-button");r&&(r.style.display="none"),e.voiceInterface.createMobileMinimizedBar(),e.voiceInterface.updateMobileStatus("connecting"),yield new Promise(A=>requestAnimationFrame(()=>requestAnimationFrame(A)))}if(yield e.startVoiceCall(),null!==(o=e.voiceInterface)&&void 0!==o&&o.isActive)console.log("✅ Voice call started successfully");else{var s,a,c;console.warn("⚠️ startVoiceCall() returned but call is not active");var l=null===(s=e.voiceInterface)||void 0===s||null===(s=s.shadowRoot)||void 0===s?void 0:s.getElementById("voiceIdleState"),d=!1;if(l&&"none"!==l.style.display){var u=l.querySelector(".voice-status-title");if(u){var g,p=u.textContent.trim(),h=null===(g=e.voiceInterface)||void 0===g?void 0:g.t("domainNotValidated");console.log("🔍 Checking for domain error - titleText:",p,"domainErrorTitle:",h),(p===h||p.includes("Domain not")||p.includes("not whitelisted"))&&(d=!0,console.log("🚫 Domain error detected - staying on voice interface, NOT returning to landing"))}}if(d)return e.currentView="voice",e.showVoice(),void console.log("✅ Staying on voice interface with domain error displayed");console.log("⚠️ Not a domain error - returning to landing screen"),null!==(a=e.voiceInterface)&&void 0!==a&&a.resetConnectingState&&e.voiceInterface.resetConnectingState(),"unified"===((null===(c=e.config.behavior)||void 0===c?void 0:c.mode)||"unified")&&e.showLanding()}}catch(A){var B,m,f,v;if(A.isServerRejection||"ServerRejected"===A.name)return void(null!==(v=e.voiceInterface)&&void 0!==v&&v.resetConnectingState&&e.voiceInterface.resetConnectingState());if(console.error("❌ Failed to start voice call:",A),null!==(B=e.voiceInterface)&&void 0!==B&&B.resetConnectingState&&e.voiceInterface.resetConnectingState(),null!==(m=e.voiceInterface)&&void 0!==m&&m.isMobile){var w,C;document.getElementById("mobile-voice-call-bar-container")&&null!==(w=e.voiceInterface)&&void 0!==w&&w.removeMobileMinimizedBar&&e.voiceInterface.removeMobileMinimizedBar();var y=(null===(C=e.shadowRoot)||void 0===C?void 0:C.getElementById("text-chat-button"))||document.getElementById("text-chat-button");y&&(y.style.display="")}"Call cancelled by user"!==A.message&&e.showErrorToast(A.message||"Failed to start voice call. Please try again.","error"),"unified"===((null===(f=e.config.behavior)||void 0===f?void 0:f.mode)||"unified")&&e.showLanding()}finally{e.isStartingCall=!1}}}),function(){return o.apply(this,arguments)}),onSelectText:()=>this.showText()}),"text"===this.currentView?(l&&l.classList.remove("active"),d&&d.classList.add("active"),u&&u.classList.remove("active"),c&&"unified"===i&&c.classList.add("visible"),g&&(g.style.display="")):"voice"===this.currentView?(l&&l.classList.remove("active"),d&&d.classList.remove("active"),u&&u.classList.add("active"),c&&"unified"===i&&c.classList.add("visible"),g&&(g.style.display="none")):(this.currentView="landing",l&&l.classList.add("active"),d&&d.classList.remove("active"),u&&u.classList.remove("active"),c&&"unified"===i&&c.classList.remove("visible"))):"voice-only"===i?(u&&u.classList.add("active"),d&&d.classList.remove("active"),l&&l.classList.remove("active")):"text-only"===i&&(d&&d.classList.add("active"),u&&u.classList.remove("active"),l&&l.classList.remove("active")),s&&(console.log("⚙️ Setting up voice interface event handlers"),this.voiceInterface.setupEventHandlers()),a&&(console.log("⚙️ Setting up text interface event handlers"),this.textInterface.setupEventHandlers());var g=this.shadowRoot.getElementById("newChatBtn");g&&(g.onclick=()=>this.textInterface.startNewChat(),r&&(g.style.display="none")),this.config.accessibility.keyboardNavigation&&this.setupKeyboardNavigation()}}startNewChat(){this.textInterface.startNewChat()}showLanding(){var A;if(this.shadowRoot){var e=null===(A=this.voiceInterface)||void 0===A||null===(A=A.shadowRoot)||void 0===A?void 0:A.getElementById("voiceIdleState");if(e&&"none"!==e.style.display){var t=e.querySelector(".voice-status-title");if(t){var n,o=t.textContent.trim();if(o===(null===(n=this.voiceInterface)||void 0===n?void 0:n.t("domainNotValidated"))||o.includes("Domain not")||o.includes("not whitelisted"))return void console.log("🚫 showLanding() called but domain error is displayed - preventing return to landing")}}if("unified"===(this.config.behavior.mode||"unified")){this.currentView="landing";var i=this.shadowRoot.getElementById("landingScreen"),r=this.shadowRoot.getElementById("textInterface"),s=this.shadowRoot.getElementById("voiceInterface"),a=this.shadowRoot.getElementById("backBtn"),c=this.shadowRoot.getElementById("newChatBtn");i&&i.classList.add("active"),r&&r.classList.remove("active"),s&&s.classList.remove("active"),a&&a.classList.remove("visible"),c&&(c.style.display="none")}}}showText(){if(this.shadowRoot){this.currentView="text";var A=this.shadowRoot.getElementById("landingScreen"),e=this.shadowRoot.getElementById("voiceInterface"),t=this.shadowRoot.getElementById("backBtn"),n=this.shadowRoot.getElementById("newChatBtn");A&&A.classList.remove("active"),e&&e.classList.remove("active"),this.textInterface.show();var o=this.config.behavior.mode||"unified";t&&"unified"===o&&t.classList.add("visible"),n&&(n.style.display="")}}showVoice(){if(this.shadowRoot){this.currentView="voice";var A=this.shadowRoot.getElementById("landingScreen"),e=this.shadowRoot.getElementById("textInterface"),t=this.shadowRoot.getElementById("voiceInterface"),n=this.shadowRoot.getElementById("backBtn"),o=this.shadowRoot.getElementById("newChatBtn");A&&A.classList.remove("active"),e&&e.classList.remove("active"),t&&t.classList.add("active");var i=this.config.behavior.mode||"unified";n&&"unified"===i&&n.classList.add("visible"),o&&(o.style.display="none")}}setupKeyboardNavigation(){document.addEventListener("keydown",A=>{"Escape"===A.key&&this.isOpen&&this.togglePanel()})}setupPromptAnimation(){var A=this;if(this.shadowRoot){var e=this.config.promptAnimation||{},t=!0===e.enabled;if(console.log("🎨 setupPromptAnimation called:",{hasPromptConfig:!!this.config.promptAnimation,promptConfig:e,enabled:e.enabled,isPromptEnabled:t,isOpen:this.isOpen}),!t)return console.log("❌ Prompt disabled, hiding"),void this.hidePrompt();if(this.isOpen?this.hidePrompt():this.showPrompt(),!this.isOpen&&null!==e.hideAfterSeconds&&e.hideAfterSeconds>0&&(this.promptAutoHideTimer=setTimeout(()=>{this.hidePrompt()},1e3*e.hideAfterSeconds)),this.voiceInterface&&this.voiceInterface.sdk){var n=this.config.onConversationStart;this.config.onConversationStart=function(){var e=A.shadowRoot.getElementById("prompt-pulse-rings");e&&(e.style.display="none"),n&&n(...arguments)},this.voiceInterface.sdk.voiceSDK&&this.voiceInterface.sdk.voiceSDK.on("recordingStarted",()=>{var A=this.shadowRoot.getElementById("prompt-pulse-rings");A&&(A.style.display="none")})}}}hidePrompt(){if(this.shadowRoot){this.promptAutoHideTimer&&(clearTimeout(this.promptAutoHideTimer),this.promptAutoHideTimer=null);var A=this.shadowRoot.getElementById("prompt-bubble");A||this.shadowRoot===document||(A=document.getElementById("prompt-bubble")),A&&(A.style.display="none",A.style.visibility="hidden");var e=this.shadowRoot.getElementById("prompt-pulse-rings");e||this.shadowRoot===document||(e=document.getElementById("prompt-pulse-rings")),e&&(e.style.display="none",e.style.visibility="hidden")}}showPrompt(){if(this.shadowRoot){var A=this.config.promptAnimation||{},e=!1!==A.enabled;if(console.log("👁️ showPrompt called:",{hasPromptConfig:!!this.config.promptAnimation,promptConfig:A,enabled:A.enabled,isPromptEnabled:e,shadowRoot:!!this.shadowRoot}),e){var t=()=>{var e=this.shadowRoot.getElementById("prompt-bubble");if(e||this.shadowRoot===document||(e=document.getElementById("prompt-bubble")),e?(e.style.display="block",e.style.visibility="visible",e.style.opacity="1",console.log("✅ Prompt bubble shown:",e)):console.warn("⚠️ Prompt bubble not found in shadowRoot or document"),!1!==A.showPulseRings){var t=this.shadowRoot.getElementById("prompt-pulse-rings");t||this.shadowRoot===document||(t=document.getElementById("prompt-pulse-rings")),t&&(t.style.display="block",t.style.visibility="visible",t.style.opacity="1")}};t();var n=this.shadowRoot.getElementById("prompt-bubble"),o=!1!==A.showPulseRings?this.shadowRoot.getElementById("prompt-pulse-rings"):null;n&&(!1===A.showPulseRings||o)||(setTimeout(()=>{t()},100),setTimeout(()=>{t()},500)),null!==A.hideAfterSeconds&&A.hideAfterSeconds>0&&(this.promptAutoHideTimer&&clearTimeout(this.promptAutoHideTimer),this.promptAutoHideTimer=setTimeout(()=>{this.hidePrompt()},1e3*A.hideAfterSeconds))}else console.log("❌ Prompt not enabled, skipping show")}}togglePanel(){this.shadowRoot&&this._doTogglePanel()}_doTogglePanel(){if(this.shadowRoot){this.isOpen=!this.isOpen;var A=this.shadowRoot.getElementById("text-chat-panel");A&&A.classList.toggle("open"),this.isOpen?(this.hidePrompt(),setTimeout(()=>{var A=this.shadowRoot.getElementById("messageInput");A&&A.focus()},100)):(this.showPrompt(),setTimeout(()=>{var A,e=this.shadowRoot.getElementById("prompt-bubble");e&&"none"===e.style.display&&(e.style.display="block");var t=this.shadowRoot.getElementById("prompt-pulse-rings");t&&!1!==(null===(A=this.config.promptAnimation)||void 0===A?void 0:A.showPulseRings)&&"none"===t.style.display&&(t.style.display="block")},100)),this.isOpen&&!this.isActive&&this.config.behavior.autoConnect&&this.startChat()}}showErrorToast(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error",t=document.createElement("div");t.className="widget-toast widget-toast-".concat(e),t.textContent=A;var n="error"===e?"#ef4444":"warning"===e?"#f59e0b":"#3b82f6";if(Object.assign(t.style,{position:"fixed",bottom:"20px",left:"50%",transform:"translateX(-50%)",backgroundColor:n,color:"white",padding:"12px 24px",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",zIndex:"10000",fontSize:"14px",fontWeight:"500",maxWidth:"90%",textAlign:"center",animation:"slideUp 0.3s ease-out",fontFamily:"inherit"}),!document.getElementById("widget-toast-styles")){var o=document.createElement("style");o.id="widget-toast-styles",o.textContent="\n @keyframes slideUp {\n from {\n opacity: 0;\n transform: translateX(-50%) translateY(20px);\n }\n to {\n opacity: 1;\n transform: translateX(-50%) translateY(0);\n }\n }\n @keyframes slideDown {\n from {\n opacity: 1;\n transform: translateX(-50%) translateY(0);\n }\n to {\n opacity: 0;\n transform: translateX(-50%) translateY(20px);\n }\n }\n ",document.head.appendChild(o)}(this.shadowRoot||document.body).appendChild(t),setTimeout(()=>{t.style.animation="slideDown 0.3s ease-out",setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t)},300)},4e3)}showConfirmModal(A){var{title:e="Confirm",message:t="Are you sure?",confirmText:n="Confirm",cancelText:o="Cancel",confirmButtonClass:i="primary",onConfirm:r,onCancel:s}=A,a=document.createElement("div");a.className="widget-modal-overlay",a.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n ";var c=document.createElement("div");c.className="widget-confirm-modal",c.style.cssText="\n background: white;\n border-radius: 12px;\n padding: 24px;\n max-width: 400px;\n width: 90%;\n box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);\n ";var l="danger"===i?"widget-modal-btn--danger":"widget-modal-btn--primary";c.innerHTML='\n <h3 style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600; color: #1e293b;">'.concat(e,'</h3>\n <p style="margin: 0 0 24px 0; color: #64748b; font-size: 14px; line-height: 1.5;">').concat(t,'</p>\n <div style="display: flex; gap: 12px; justify-content: flex-end;">\n <button class="widget-modal-btn widget-modal-btn--cancel" data-action="cancel" style="\n padding: 10px 20px;\n border: 1px solid #e2e8f0;\n background: white;\n color: #64748b;\n border-radius: 8px;\n cursor: pointer;\n font-size: 14px;\n font-weight: 500;\n ">\n ').concat(o,'\n </button>\n <button class="widget-modal-btn ').concat(l,'" data-action="confirm" style="\n padding: 10px 20px;\n border: none;\n background: ').concat("danger"===i?"#ef4444":"#7c3aed",';\n color: white;\n border-radius: 8px;\n cursor: pointer;\n font-size: 14px;\n font-weight: 500;\n ">\n ').concat(n,"\n </button>\n </div>\n "),a.appendChild(c),(this.shadowRoot||document.body).appendChild(a),c.querySelector('[data-action="confirm"]').onclick=()=>{a.remove(),null==r||r()},c.querySelector('[data-action="cancel"]').onclick=()=>{a.remove(),null==s||s()},a.onclick=A=>{A.target===a&&(a.remove(),null==s||s())}}startChat(){var A=this;return Qe(function*(){A.isActive=!0,A.textInterface.setActive(!0)})()}sendMessage(){var A=this;return Qe(function*(){yield A.textInterface.sendMessage()})()}updateSendButtonState(){this.textInterface.updateSendButtonState()}showBackButtonWarning(){var A,e;null!==(A=this.voiceInterface)&&void 0!==A&&A.isActive&&null!==(e=this.voiceInterface.desktop)&&void 0!==e&&e.showBackButtonWarning&&this.voiceInterface.desktop.showBackButtonWarning()}getSignedUrl(){var A=this;return Qe(function*(){if(A.config.signedUrl)return A.config.signedUrl;if(!A.config.agentId)throw new Error("agentId is required when signedUrl is not provided");var e=A.config.websocketUrl||"wss://backend.talktopc.com/ws/conv",t=new URLSearchParams;t.append("agentId",A.config.agentId),A.config.appId&&t.append("appId",A.config.appId),!1!==A.config.demo&&t.append("demo","true");var n="".concat(e,"?").concat(t.toString());return"undefined"!=typeof __DEV__&&__DEV__&&console.log("[TTPAgentSDK] WebSocket URL:",n),n})()}addMessage(A,e){this.textInterface.addMessage(A,e)}beginStreaming(){this.textInterface.beginStreaming()}appendStreamingChunk(A){this.textInterface.appendStreamingChunk(A)}finalizeStreaming(A){this.textInterface.finalizeStreaming(A)}stopStreamingState(){this.textInterface.stopStreamingState()}showError(A){this.textInterface.showError(A)}updateStatus(A){}updateConfig(A){var e,t,n,o,i,r,s,a,c,l,d=Ue({},this.config);A.panel&&(d.panel=Ue(Ue({},this.config.panel),A.panel)),A.voice&&(d.voice=Ue(Ue({},this.config.voice),A.voice),A.voice.micButtonHint&&(d.voice.micButtonHint=Ue(Ue({},null===(c=this.config.voice)||void 0===c?void 0:c.micButtonHint),A.voice.micButtonHint))),A.text&&(d.text=Ue(Ue({},this.config.text),A.text),A.text.sendButtonHint&&(d.text.sendButtonHint=Ue(Ue({},null===(l=this.config.text)||void 0===l?void 0:l.sendButtonHint),A.text.sendButtonHint))),void 0!==A.language&&(d.language=A.language),void 0!==A.language&&(["he","ar"].includes(A.language)?d.direction="rtl":void 0===A.direction&&(d.direction="ltr")),A.translations&&(d.translations=A.translations,this.translations=A.translations),A.button&&(d.button=Ue(Ue({},this.config.button),A.button)),A.header&&(d.header=Ue(Ue({},this.config.header),A.header)),A.icon&&(d.icon=Ue(Ue({},this.config.icon),A.icon)),A.messages&&(d.messages=Ue(Ue({},this.config.messages),A.messages)),A.animation&&(d.animation=Ue(Ue({},this.config.animation),A.animation)),A.behavior&&(d.behavior=Ue(Ue({},this.config.behavior),A.behavior)),A.accessibility&&(d.accessibility=Ue(Ue({},this.config.accessibility),A.accessibility)),A.tooltips&&(d.tooltips=Ue(Ue({},this.config.tooltips),A.tooltips)),A.landing&&(d.landing=Ue(Ue({},this.config.landing),A.landing)),A.footer&&(d.footer=Ue(Ue({},this.config.footer),A.footer)),void 0!==A.direction&&void 0===d.direction&&(d.direction=A.direction),void 0!==A.primaryColor&&(d.primaryColor=A.primaryColor),d.onConversationStart=void 0!==A.onConversationStart?A.onConversationStart:this.config.onConversationStart,d.onConversationEnd=void 0!==A.onConversationEnd?A.onConversationEnd:this.config.onConversationEnd,d.onBargeIn=void 0!==A.onBargeIn?A.onBargeIn:this.config.onBargeIn,d.onAudioStartPlaying=void 0!==A.onAudioStartPlaying?A.onAudioStartPlaying:this.config.onAudioStartPlaying,d.onAudioStoppedPlaying=void 0!==A.onAudioStoppedPlaying?A.onAudioStoppedPlaying:this.config.onAudioStoppedPlaying,d.onSubtitleDisplay=void 0!==A.onSubtitleDisplay?A.onSubtitleDisplay:this.config.onSubtitleDisplay,d.onVoiceCallButtonClick=void 0!==A.onVoiceCallButtonClick?A.onVoiceCallButtonClick:this.config.onVoiceCallButtonClick,void 0!==A.useShadowDOM&&(d.useShadowDOM=A.useShadowDOM),Object.keys(A).forEach(e=>{["panel","button","header","footer","icon","messages","direction","voice","text","animation","behavior","accessibility","language","tooltips","landing","primaryColor","useShadowDOM","onConversationStart","onConversationEnd","onBargeIn","onAudioStartPlaying","onAudioStoppedPlaying","onSubtitleDisplay","onVoiceCallButtonClick"].includes(e)||(d[e]=A[e])}),null===(e=this.config)||void 0===e||e.language;var u=!1!==(null===(t=this.config)||void 0===t?void 0:t.useShadowDOM);if(this.config=this.mergeWithDefaults(d),!1!==this.config.useShadowDOM===u&&this.container){var g=document.getElementById("ttp-widget-shadow-host");g&&!this.config.useShadowDOM&&g.remove();var p=document.getElementById("ttp-widget-container");if(p&&this.config.useShadowDOM&&p.remove(),this.config.useShadowDOM)if(this.shadowRoot)this.container=this.shadowRoot;else{var h=document.getElementById("ttp-widget-shadow-host");h?(this.shadowRoot=h.shadowRoot,this.container=this.shadowRoot):(this.createShadowHost(),this.container=this.shadowRoot)}else{if(this.regularContainer)this.container=this.regularContainer;else{var B=document.getElementById("ttp-widget-container");B?(this.regularContainer=B,this.container=B):(this.createRegularContainer(),this.container=this.regularContainer)}this.shadowRoot=document}}else{var m=document.getElementById("ttp-widget-shadow-host");m&&m.remove();var f=document.getElementById("ttp-widget-container");if(f&&f.remove(),!1===u){var v=document.getElementById("ttp-widget-styles");v&&v.remove()}this.config.useShadowDOM?(this.createShadowHost(),this.container=this.shadowRoot):(this.createRegularContainer(),this.container=this.regularContainer,this.shadowRoot=document)}var w=this.config.language||"en",C=Ue(Ue(Ue({},this.config),this.config.voice),{},{language:w,translations:this.translations,shadowRoot:this.shadowRoot,signedUrl:this.config.signedUrl,agentSettingsOverride:this.config.agentSettingsOverride,visualAssistant:this.config.visualAssistant,outputContainer:(null===(n=this.config.voice)||void 0===n?void 0:n.outputContainer)||"raw",outputEncoding:(null===(o=this.config.voice)||void 0===o?void 0:o.outputEncoding)||"pcm",outputSampleRate:(null===(i=this.config.voice)||void 0===i?void 0:i.outputSampleRate)||44100,outputChannels:(null===(r=this.config.voice)||void 0===r?void 0:r.outputChannels)||1,outputBitDepth:(null===(s=this.config.voice)||void 0===s?void 0:s.outputBitDepth)||16,onConversationStart:this.config.onConversationStart,onConversationEnd:this.config.onConversationEnd,onBargeIn:this.config.onBargeIn,onAudioStartPlaying:this.config.onAudioStartPlaying,onAudioStoppedPlaying:this.config.onAudioStoppedPlaying,onSubtitleDisplay:this.config.onSubtitleDisplay});this.voiceInterface=new fe(C);var y=Ue(Ue(Ue({},this.config),this.config.text),{},{language:w,translations:this.translations,shadowRoot:this.shadowRoot});if(this.textInterface=new Ce(y,this.sdk),"unified"===((null===(a=this.config.behavior)||void 0===a?void 0:a.mode)||"unified")){var b=Ue(Ue({},this.config),{},{translations:this.translations,shadowRoot:this.shadowRoot});this.landingScreen=new ye(b)}else this.landingScreen=null;this.createWidget(),this.textInterface&&this.textInterface.updateInputAttributes&&this.textInterface.updateInputAttributes()}destroy(){this.promptAutoHideTimer&&(clearTimeout(this.promptAutoHideTimer),this.promptAutoHideTimer=null);var A=document.getElementById("ttp-widget-shadow-host");A&&A.remove();var e=document.getElementById("ttp-widget-container");e&&e.remove();var t=document.getElementById("ttp-widget-styles");t&&t.remove(),this.sdk&&this.sdk.destroy(),this.voiceInterface&&this.voiceInterface.destroy()}startVoiceCall(){var A=this;return Qe(function*(){yield A.voiceInterface.startVoiceCall(),A._flushPendingClientTools()})()}endVoiceCall(){this.voiceInterface.endVoiceCall()}toggleMute(){this.voiceInterface.toggleMute()}toggleSpeaker(){this.voiceInterface.toggleSpeaker()}injectData(A){var e=arguments,t=this;return Qe(function*(){var n,o=e.length>1&&void 0!==e[1]?e[1]:{};if(!A||!A.trim())throw console.warn("TTPChatWidget: Cannot inject empty data"),new Error("Cannot inject empty data");if(!t.voiceInterface||!t.voiceInterface.isActive)throw console.warn("TTPChatWidget: Cannot inject data - voice call is not active"),new Error("Voice call is not active");var i=null===(n=t.voiceInterface)||void 0===n?void 0:n.getVoiceSDK();if(!i)throw console.warn("TTPChatWidget: VoiceSDK not available"),new Error("VoiceSDK not available");try{return yield i.injectData(A,Ue(Ue({},o),{},{source:o.source||"widget_programmatic"}))}catch(A){throw A}})()}registerToolHandler(A,e){var t;return null!==(t=this.voiceInterface)&&void 0!==t&&t.sdk?this.voiceInterface.sdk.registerToolHandler(A,e):(this._pendingClientTools=this._pendingClientTools||[],this._pendingClientTools.push({name:A,handler:e}),console.warn("TTPChatWidget: Tool handler queued - voice interface SDK not ready yet"),this._flushPendingClientTools(),this)}unregisterToolHandler(A){var e;return null!==(e=this.voiceInterface)&&void 0!==e&&e.sdk?this.voiceInterface.sdk.unregisterToolHandler(A):(this._pendingClientTools&&(this._pendingClientTools=this._pendingClientTools.filter(e=>e.name!==A)),this)}hasToolHandler(A){var e;return!(null===(e=this.voiceInterface)||void 0===e||!e.sdk)&&this.voiceInterface.sdk.hasToolHandler(A)}getRegisteredTools(){var A;return null!==(A=this.voiceInterface)&&void 0!==A&&A.sdk?this.voiceInterface.sdk.getRegisteredTools():this._pendingClientTools?this._pendingClientTools.map(A=>A.name):[]}_flushPendingClientTools(){var A;this._pendingClientTools&&null!==(A=this.voiceInterface)&&void 0!==A&&A.sdk&&(this._pendingClientTools.forEach(A=>{var{name:e,handler:t}=A;this.voiceInterface.sdk.registerToolHandler(e,t)}),this._pendingClientTools=null,console.log("TTPChatWidget: Flushed pending client tools"))}registerClientTool(A,e){return this.registerToolHandler(A,e)}unregisterClientTool(A){return this.unregisterToolHandler(A)}hasClientTool(A){return this.hasToolHandler(A)}getRegisteredClientTools(){return this.getRegisteredTools()}}console.log("[TTP SDK] ✅ Sandbox Deployment Test - v2.33.9-SANDBOX (with NEW conversation panel: collapsed/expanded states & compact design)");var Ee="2.18.0";const ke={VoiceSDK_v2:FA,TextChatSDK:kA,WebSocketManager:KA,AudioRecorder:C,AudioPlayer:RA,EventEmitter:h,VoiceButton:GA,VanillaVoiceButton:JA,AgentSDK:ZA,TTPChatWidget:Ie,VERSION:Ee};export{ZA as AgentSDK,RA as AudioPlayer,C as AudioRecorder,h as EventEmitter,s as MicPermissionModals,r as MicPermissionUtils,Ie as TTPChatWidget,kA as TextChatSDK,Ee as VERSION,JA as VanillaVoiceButton,GA as VoiceButton,FA as VoiceSDK_v2,KA as WebSocketManager,ke as default};
2
+ import{useEffect as A,useRef as e,useState as t}from"react";var n={354:function(A){A.exports=function(){var A=function(e,t){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,e){A.__proto__=e}||function(A,e){for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&(A[t]=e[t])},A(e,t)};function e(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}A(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var t=function(){return t=Object.assign||function(A){for(var e,t=1,n=arguments.length;t<n;t++)for(var o in e=arguments[t])Object.prototype.hasOwnProperty.call(e,o)&&(A[o]=e[o]);return A},t.apply(this,arguments)};function n(A,e,t,n){return new(t||(t=Promise))(function(o,i){function r(A){try{a(n.next(A))}catch(A){i(A)}}function s(A){try{a(n.throw(A))}catch(A){i(A)}}function a(A){var e;A.done?o(A.value):(e=A.value,e instanceof t?e:new t(function(A){A(e)})).then(r,s)}a((n=n.apply(A,e||[])).next())})}function o(A,e){var t,n,o,i,r={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;r;)try{if(t=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return r.label++,{value:i[1],done:!1};case 5:r.label++,n=i[1],i=[0];continue;case 7:i=r.ops.pop(),r.trys.pop();continue;default:if(!((o=(o=r.trys).length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){r=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){r.label=i[1];break}if(6===i[0]&&r.label<o[1]){r.label=o[1],o=i;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(i);break}o[2]&&r.ops.pop(),r.trys.pop();continue}i=e.call(A,r)}catch(A){i=[6,A],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function i(A,e,t){if(t||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return A.concat(n||e)}for(var r=function(){function A(A,e,t,n){this.left=A,this.top=e,this.width=t,this.height=n}return A.prototype.add=function(e,t,n,o){return new A(this.left+e,this.top+t,this.width+n,this.height+o)},A.fromClientRect=function(e,t){return new A(t.left+e.windowBounds.left,t.top+e.windowBounds.top,t.width,t.height)},A.fromDOMRectList=function(e,t){var n=Array.from(t).find(function(A){return 0!==A.width});return n?new A(n.left+e.windowBounds.left,n.top+e.windowBounds.top,n.width,n.height):A.EMPTY},A.EMPTY=new A(0,0,0,0),A}(),s=function(A,e){return r.fromClientRect(A,e.getBoundingClientRect())},a=function(A){for(var e=[],t=0,n=A.length;t<n;){var o=A.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var i=A.charCodeAt(t++);56320==(64512&i)?e.push(((1023&o)<<10)+(1023&i)+65536):(e.push(o),t--)}else e.push(o)}return e},c=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var n=[],o=-1,i="";++o<t;){var r=A[o];r<=65535?n.push(r):(r-=65536,n.push(55296+(r>>10),r%1024+56320)),(o+1===t||n.length>16384)&&(i+=String.fromCharCode.apply(String,n),n.length=0)}return i},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",d="undefined"==typeof Uint8Array?[]:new Uint8Array(256),u=0;u<64;u++)d[l.charCodeAt(u)]=u;for(var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p="undefined"==typeof Uint8Array?[]:new Uint8Array(256),h=0;h<64;h++)p[g.charCodeAt(h)]=h;for(var B=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},m=function(){function A(A,e,t,n,o,i){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=n,this.index=o,this.data=i}return A.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A<this.highStart)return e=2080+(A>>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",v="undefined"==typeof Uint8Array?[]:new Uint8Array(256),w=0;w<64;w++)v[f.charCodeAt(w)]=w;var C=10,y=13,b=15,x=17,Q=18,F=19,U=20,S=21,I=22,E=24,k=25,H=26,T=27,D=28,K=30,L=32,M=33,R=34,P=35,O=37,V=38,_=39,N=40,G=42,W=[9001,65288],j="×",z="÷",X=function(A){var e,t,n,o=function(A){var e,t,n,o,i,r=.75*A.length,s=A.length,a=0;"="===A[A.length-1]&&(r--,"="===A[A.length-2]&&r--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(r):new Array(r),l=Array.isArray(c)?c:new Uint8Array(c);for(e=0;e<s;e+=4)t=p[A.charCodeAt(e)],n=p[A.charCodeAt(e+1)],o=p[A.charCodeAt(e+2)],i=p[A.charCodeAt(e+3)],l[a++]=t<<2|n>>4,l[a++]=(15&n)<<4|o>>2,l[a++]=(3&o)<<6|63&i;return c}(A),i=Array.isArray(o)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=4)t.push(A[n+3]<<24|A[n+2]<<16|A[n+1]<<8|A[n]);return t}(o):new Uint32Array(o),r=Array.isArray(o)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=2)t.push(A[n+1]<<8|A[n]);return t}(o):new Uint16Array(o),s=B(r,12,i[4]/2),a=2===i[5]?B(r,(24+i[4])/2):(e=i,t=Math.ceil((24+i[4])/4),e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,t,n)));return new m(i[0],i[1],i[2],i[3],s,a)}("KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdbB2MHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB2kH0gZwB64EdQB1AHUAdQB1AHUAdQB1AHUHfQdgAIUHjQd1AHUAlQedB2AAYAClB6sHYACzB7YHvgfGB3UAzgfWBzMB3gfmB1EB7gf1B/0HlQENAQUIDQh1ABUIHQglCBcDLQg1CD0IRQhNCEEDUwh1AHUAdQBbCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIaQhjCGQIZQhmCGcIaAhpCGMIZAhlCGYIZwhoCGkIYwhkCGUIZghnCGgIcAh3CHoIMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIgggwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3ELdwt/CzAAMACHC4sLkwubC58Lpwt1AK4Ltgt1APsDMAAwADAAMAAwADAAMAAwAL4LwwvLC9IL1wvdCzAAMADlC+kL8Qv5C/8LSQswADAAMAAwADAAMAAwADAAMAAHDDAAMAAwADAAMAAODBYMHgx1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1ACYMMAAwADAAdQB1AHUALgx1AHUAdQB1AHUAdQA2DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AD4MdQBGDHUAdQB1AHUAdQB1AEkMdQB1AHUAdQB1AFAMMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQBYDHUAdQB1AF8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUA+wMVBGcMMAAwAHwBbwx1AHcMfwyHDI8MMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAYABgAJcMMAAwADAAdQB1AJ8MlQClDDAAMACtDCwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB7UMLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AA0EMAC9DDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAsBywHLAcsBywHLAcsBywHLQcwAMEMyAwsBywHLAcsBywHLAcsBywHLAcsBywHzAwwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwAHUAdQB1ANQM2QzhDDAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMABgAGAAYABgAGAAYABgAOkMYADxDGAA+AwADQYNYABhCWAAYAAODTAAMAAwADAAFg1gAGAAHg37AzAAMAAwADAAYABgACYNYAAsDTQNPA1gAEMNPg1LDWAAYABgAGAAYABgAGAAYABgAGAAUg1aDYsGVglhDV0NcQBnDW0NdQ15DWAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAlQCBDZUAiA2PDZcNMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAnw2nDTAAMAAwADAAMAAwAHUArw23DTAAMAAwADAAMAAwADAAMAAwADAAMAB1AL8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAB1AHUAdQB1AHUAdQDHDTAAYABgAM8NMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA1w11ANwNMAAwAD0B5A0wADAAMAAwADAAMADsDfQN/A0EDgwOFA4wABsOMAAwADAAMAAwADAAMAAwANIG0gbSBtIG0gbSBtIG0gYjDigOwQUuDsEFMw7SBjoO0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGQg5KDlIOVg7SBtIGXg5lDm0OdQ7SBtIGfQ6EDooOjQ6UDtIGmg6hDtIG0gaoDqwO0ga0DrwO0gZgAGAAYADEDmAAYAAkBtIGzA5gANIOYADaDokO0gbSBt8O5w7SBu8O0gb1DvwO0gZgAGAAxA7SBtIG0gbSBtIGYABgAGAAYAAED2AAsAUMD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHJA8sBywHLAcsBywHLAccDywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywPLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAc0D9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAccD9IG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIGFA8sBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AHgAeAFAATwBAAE8ATwBPAEAATwBQAFAATwBQAB4AHgAeAB4AHgAeAB0AHQAdAB0AHgAdAB4ADgBQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgBQAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAkACQAJAAkACQAJAAkABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAFAAHgAeAB4AKwArAFAAUABQAFAAGABQACsAKwArACsAHgAeAFAAHgBQAFAAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAaABoAHgAXABcAHQAVABUAHgAeAB4AHgAeAB4AGAAWABEAFQAVABUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ADQAeAA0ADQANAA0AHgANAA0ADQAHAB4AHgAeAB4AKwAEAAQABAAEAAQABAAEAAQABAAEAFAAUAArACsATwBQAFAAUABQAFAAHgAeAB4AFgARAE8AUABPAE8ATwBPAFAAUABQAFAAUAAeAB4AHgAWABEAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArABsAGwAbABsAGwAbABsAGgAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGgAbABsAGwAbABoAGwAbABoAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbABsAGwAbAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAHgAeAFAAGgAeAB0AHgBQAB4AGgAeAB4AHgAeAB4AHgAeAB4AHgBPAB4AUAAbAB4AHgBQAFAAUABQAFAAHgAeAB4AHQAdAB4AUAAeAFAAHgBQAB4AUABPAFAAUAAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAHgBQAFAAUABQAE8ATwBQAFAAUABQAFAATwBQAFAATwBQAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAUABQAFAATwBPAE8ATwBPAE8ATwBPAE8ATwBQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABPAB4AHgArACsAKwArAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHQAdAB4AHgAeAB0AHQAeAB4AHQAeAB4AHgAdAB4AHQAbABsAHgAdAB4AHgAeAB4AHQAeAB4AHQAdAB0AHQAeAB4AHQAeAB0AHgAdAB0AHQAdAB0AHQAeAB0AHgAeAB4AHgAeAB0AHQAdAB0AHgAeAB4AHgAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB4AHgAeAB0AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAeAB0AHQAdAB0AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAdAB4AHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAWABEAHgAeAB4AHgAeAB4AHQAeAB4AHgAeAB4AHgAeACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAWABEAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAFAAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAeAB4AHQAdAB0AHQAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB0AHQAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB0AHQAeAB4AHQAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AHQAdAB0AHgAeAB0AHgAeAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlAB4AHQAdAB4AHgAdAB4AHgAeAB4AHQAdAB4AHgAeAB4AJQAlAB0AHQAlAB4AJQAlACUAIAAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAeAB4AHgAeAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHgAdAB0AHQAeAB0AJQAdAB0AHgAdAB0AHgAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHQAdAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAdAB0AHQAdACUAHgAlACUAJQAdACUAJQAdAB0AHQAlACUAHQAdACUAHQAdACUAJQAlAB4AHQAeAB4AHgAeAB0AHQAlAB0AHQAdAB0AHQAdACUAJQAlACUAJQAdACUAJQAgACUAHQAdACUAJQAlACUAJQAlACUAJQAeAB4AHgAlACUAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB0AHgAeAB4AFwAXABcAFwAXABcAHgATABMAJQAeAB4AHgAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARABYAEQAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAWABEAFgARABYAEQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAWABEAFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AFgARAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAdAB0AHQAdAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcAVwBXAFcAUQBXAFcAVwBXAFcAVwBRAFEAKwArAAQABAAVABUARwBHAFcAFQBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBRAFcAVwBXAFcAVwBXAFEAUQBXAFcAVwBXABUAUQBHAEcAVwArACsAKwArACsAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwAlACUAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACsAKwArACsAKwArACsAKwArACsAKwArAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAUQBRAFEAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBPAE8ATwBPAE8ATwBPAE8AJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAKwArAFAAKwArAFAAUAArACsAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUAArAFAAUABQAFAAUABQAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAHgAeAFAAUABQAFAAUAArAFAAKwArACsAUABQAFAAUABQAFAAUAArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA=="),J=[K,36],Y=[1,2,3,5],q=[C,8],Z=[T,H],$=Y.concat(q),AA=[V,_,N,R,P],eA=[b,y],tA=function(A,e,t,n){var o=n[t];if(Array.isArray(A)?-1!==A.indexOf(o):A===o)for(var i=t;i<=n.length;){if((a=n[++i])===e)return!0;if(a!==C)break}if(o===C)for(i=t;i>0;){var r=n[--i];if(Array.isArray(A)?-1!==A.indexOf(r):A===r)for(var s=t;s<=n.length;){var a;if((a=n[++s])===e)return!0;if(a!==C)break}if(r!==C)break}return!1},nA=function(A,e){for(var t=A;t>=0;){var n=e[t];if(n!==C)return n;t--}return 0},oA=function(A,e,t,n,o){if(0===t[n])return j;var i=n-1;if(Array.isArray(o)&&!0===o[i])return j;var r=i-1,s=i+1,a=e[i],c=r>=0?e[r]:0,l=e[s];if(2===a&&3===l)return j;if(-1!==Y.indexOf(a))return"!";if(-1!==Y.indexOf(l))return j;if(-1!==q.indexOf(l))return j;if(8===nA(i,e))return z;if(11===X.get(A[i]))return j;if((a===L||a===M)&&11===X.get(A[s]))return j;if(7===a||7===l)return j;if(9===a)return j;if(-1===[C,y,b].indexOf(a)&&9===l)return j;if(-1!==[x,Q,F,E,D].indexOf(l))return j;if(nA(i,e)===I)return j;if(tA(23,I,i,e))return j;if(tA([x,Q],S,i,e))return j;if(tA(12,12,i,e))return j;if(a===C)return z;if(23===a||23===l)return j;if(16===l||16===a)return z;if(-1!==[y,b,S].indexOf(l)||14===a)return j;if(36===c&&-1!==eA.indexOf(a))return j;if(a===D&&36===l)return j;if(l===U)return j;if(-1!==J.indexOf(l)&&a===k||-1!==J.indexOf(a)&&l===k)return j;if(a===T&&-1!==[O,L,M].indexOf(l)||-1!==[O,L,M].indexOf(a)&&l===H)return j;if(-1!==J.indexOf(a)&&-1!==Z.indexOf(l)||-1!==Z.indexOf(a)&&-1!==J.indexOf(l))return j;if(-1!==[T,H].indexOf(a)&&(l===k||-1!==[I,b].indexOf(l)&&e[s+1]===k)||-1!==[I,b].indexOf(a)&&l===k||a===k&&-1!==[k,D,E].indexOf(l))return j;if(-1!==[k,D,E,x,Q].indexOf(l))for(var d=i;d>=0;){if((u=e[d])===k)return j;if(-1===[D,E].indexOf(u))break;d--}if(-1!==[T,H].indexOf(l))for(d=-1!==[x,Q].indexOf(a)?r:i;d>=0;){var u;if((u=e[d])===k)return j;if(-1===[D,E].indexOf(u))break;d--}if(V===a&&-1!==[V,_,R,P].indexOf(l)||-1!==[_,R].indexOf(a)&&-1!==[_,N].indexOf(l)||-1!==[N,P].indexOf(a)&&l===N)return j;if(-1!==AA.indexOf(a)&&-1!==[U,H].indexOf(l)||-1!==AA.indexOf(l)&&a===T)return j;if(-1!==J.indexOf(a)&&-1!==J.indexOf(l))return j;if(a===E&&-1!==J.indexOf(l))return j;if(-1!==J.concat(k).indexOf(a)&&l===I&&-1===W.indexOf(A[s])||-1!==J.concat(k).indexOf(l)&&a===Q)return j;if(41===a&&41===l){for(var g=t[i],p=1;g>0&&41===e[--g];)p++;if(p%2!=0)return j}return a===L&&l===M?j:z},iA=function(A,e){e||(e={lineBreak:"normal",wordBreak:"normal"});var t=function(A,e){void 0===e&&(e="strict");var t=[],n=[],o=[];return A.forEach(function(A,i){var r=X.get(A);if(r>50?(o.push(!0),r-=50):o.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(A))return n.push(i),t.push(16);if(4===r||11===r){if(0===i)return n.push(i),t.push(K);var s=t[i-1];return-1===$.indexOf(s)?(n.push(n[i-1]),t.push(s)):(n.push(i),t.push(K))}return n.push(i),31===r?t.push("strict"===e?S:O):r===G||29===r?t.push(K):43===r?A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(O):t.push(K):void t.push(r)}),[n,t,o]}(A,e.lineBreak),n=t[0],o=t[1],i=t[2];"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(o=o.map(function(A){return-1!==[k,K,G].indexOf(A)?O:A}));var r="keep-all"===e.wordBreak?i.map(function(e,t){return e&&A[t]>=19968&&A[t]<=40959}):void 0;return[n,o,r]},rA=function(){function A(A,e,t,n){this.codePoints=A,this.required="!"===e,this.start=t,this.end=n}return A.prototype.slice=function(){return c.apply(void 0,this.codePoints.slice(this.start,this.end))},A}(),sA=45,aA=43,cA=-1,lA=function(A){return A>=48&&A<=57},dA=function(A){return lA(A)||A>=65&&A<=70||A>=97&&A<=102},uA=function(A){return 10===A||9===A||32===A},gA=function(A){return function(A){return function(A){return A>=97&&A<=122}(A)||function(A){return A>=65&&A<=90}(A)}(A)||function(A){return A>=128}(A)||95===A},pA=function(A){return gA(A)||lA(A)||A===sA},hA=function(A){return A>=0&&A<=8||11===A||A>=14&&A<=31||127===A},BA=function(A,e){return 92===A&&10!==e},mA=function(A,e,t){return A===sA?gA(e)||BA(e,t):!!gA(A)||!(92!==A||!BA(A,e))},fA=function(A,e,t){return A===aA||A===sA?!!lA(e)||46===e&&lA(t):lA(46===A?e:A)},vA=function(A){var e=0,t=1;A[e]!==aA&&A[e]!==sA||(A[e]===sA&&(t=-1),e++);for(var n=[];lA(A[e]);)n.push(A[e++]);var o=n.length?parseInt(c.apply(void 0,n),10):0;46===A[e]&&e++;for(var i=[];lA(A[e]);)i.push(A[e++]);var r=i.length,s=r?parseInt(c.apply(void 0,i),10):0;69!==A[e]&&101!==A[e]||e++;var a=1;A[e]!==aA&&A[e]!==sA||(A[e]===sA&&(a=-1),e++);for(var l=[];lA(A[e]);)l.push(A[e++]);var d=l.length?parseInt(c.apply(void 0,l),10):0;return t*(o+s*Math.pow(10,-r))*Math.pow(10,a*d)},wA={type:2},CA={type:3},yA={type:4},bA={type:13},xA={type:8},QA={type:21},FA={type:9},UA={type:10},SA={type:11},IA={type:12},EA={type:14},kA={type:23},HA={type:1},TA={type:25},DA={type:24},KA={type:26},LA={type:27},MA={type:28},RA={type:29},PA={type:31},OA={type:32},VA=function(){function A(){this._value=[]}return A.prototype.write=function(A){this._value=this._value.concat(a(A))},A.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==OA;)A.push(e),e=this.consumeToken();return A},A.prototype.consumeToken=function(){var A=this.consumeCodePoint();switch(A){case 34:return this.consumeStringToken(34);case 35:var e=this.peekCodePoint(0),t=this.peekCodePoint(1),n=this.peekCodePoint(2);if(pA(e)||BA(t,n)){var o=mA(e,t,n)?2:1;return{type:5,value:this.consumeName(),flags:o}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),bA;break;case 39:return this.consumeStringToken(39);case 40:return wA;case 41:return CA;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),EA;break;case aA:if(fA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 44:return yA;case sA:var i=A,r=this.peekCodePoint(0),s=this.peekCodePoint(1);if(fA(i,r,s))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(mA(i,r,s))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(r===sA&&62===s)return this.consumeCodePoint(),this.consumeCodePoint(),DA;break;case 46:if(fA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 47:if(42===this.peekCodePoint(0))for(this.consumeCodePoint();;){var a=this.consumeCodePoint();if(42===a&&47===(a=this.consumeCodePoint()))return this.consumeToken();if(a===cA)return this.consumeToken()}break;case 58:return KA;case 59:return LA;case 60:if(33===this.peekCodePoint(0)&&this.peekCodePoint(1)===sA&&this.peekCodePoint(2)===sA)return this.consumeCodePoint(),this.consumeCodePoint(),TA;break;case 64:var l=this.peekCodePoint(0),d=this.peekCodePoint(1),u=this.peekCodePoint(2);if(mA(l,d,u))return{type:7,value:this.consumeName()};break;case 91:return MA;case 92:if(BA(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case 93:return RA;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),xA;break;case 123:return SA;case 125:return IA;case 117:case 85:var g=this.peekCodePoint(0),p=this.peekCodePoint(1);return g!==aA||!dA(p)&&63!==p||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),FA;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),QA;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),UA;break;case cA:return OA}return uA(A)?(this.consumeWhiteSpace(),PA):lA(A)?(this.reconsumeCodePoint(A),this.consumeNumericToken()):gA(A)?(this.reconsumeCodePoint(A),this.consumeIdentLikeToken()):{type:6,value:c(A)}},A.prototype.consumeCodePoint=function(){var A=this._value.shift();return void 0===A?-1:A},A.prototype.reconsumeCodePoint=function(A){this._value.unshift(A)},A.prototype.peekCodePoint=function(A){return A>=this._value.length?-1:this._value[A]},A.prototype.consumeUnicodeRangeToken=function(){for(var A=[],e=this.consumeCodePoint();dA(e)&&A.length<6;)A.push(e),e=this.consumeCodePoint();for(var t=!1;63===e&&A.length<6;)A.push(e),e=this.consumeCodePoint(),t=!0;if(t)return{type:30,start:parseInt(c.apply(void 0,A.map(function(A){return 63===A?48:A})),16),end:parseInt(c.apply(void 0,A.map(function(A){return 63===A?70:A})),16)};var n=parseInt(c.apply(void 0,A),16);if(this.peekCodePoint(0)===sA&&dA(this.peekCodePoint(1))){this.consumeCodePoint(),e=this.consumeCodePoint();for(var o=[];dA(e)&&o.length<6;)o.push(e),e=this.consumeCodePoint();return{type:30,start:n,end:parseInt(c.apply(void 0,o),16)}}return{type:30,start:n,end:n}},A.prototype.consumeIdentLikeToken=function(){var A=this.consumeName();return"url"===A.toLowerCase()&&40===this.peekCodePoint(0)?(this.consumeCodePoint(),this.consumeUrlToken()):40===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:19,value:A}):{type:20,value:A}},A.prototype.consumeUrlToken=function(){var A=[];if(this.consumeWhiteSpace(),this.peekCodePoint(0)===cA)return{type:22,value:""};var e=this.peekCodePoint(0);if(39===e||34===e){var t=this.consumeStringToken(this.consumeCodePoint());return 0===t.type&&(this.consumeWhiteSpace(),this.peekCodePoint(0)===cA||41===this.peekCodePoint(0))?(this.consumeCodePoint(),{type:22,value:t.value}):(this.consumeBadUrlRemnants(),kA)}for(;;){var n=this.consumeCodePoint();if(n===cA||41===n)return{type:22,value:c.apply(void 0,A)};if(uA(n))return this.consumeWhiteSpace(),this.peekCodePoint(0)===cA||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:c.apply(void 0,A)}):(this.consumeBadUrlRemnants(),kA);if(34===n||39===n||40===n||hA(n))return this.consumeBadUrlRemnants(),kA;if(92===n){if(!BA(n,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),kA;A.push(this.consumeEscapedCodePoint())}else A.push(n)}},A.prototype.consumeWhiteSpace=function(){for(;uA(this.peekCodePoint(0));)this.consumeCodePoint()},A.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(41===A||A===cA)return;BA(A,this.peekCodePoint(0))&&this.consumeEscapedCodePoint()}},A.prototype.consumeStringSlice=function(A){for(var e="";A>0;){var t=Math.min(5e4,A);e+=c.apply(void 0,this._value.splice(0,t)),A-=t}return this._value.shift(),e},A.prototype.consumeStringToken=function(A){for(var e="",t=0;;){var n=this._value[t];if(n===cA||void 0===n||n===A)return{type:0,value:e+=this.consumeStringSlice(t)};if(10===n)return this._value.splice(0,t),HA;if(92===n){var o=this._value[t+1];o!==cA&&void 0!==o&&(10===o?(e+=this.consumeStringSlice(t),t=-1,this._value.shift()):BA(n,o)&&(e+=this.consumeStringSlice(t),e+=c(this.consumeEscapedCodePoint()),t=-1))}t++}},A.prototype.consumeNumber=function(){var A=[],e=4,t=this.peekCodePoint(0);for(t!==aA&&t!==sA||A.push(this.consumeCodePoint());lA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0);var n=this.peekCodePoint(1);if(46===t&&lA(n))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;lA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());t=this.peekCodePoint(0),n=this.peekCodePoint(1);var o=this.peekCodePoint(2);if((69===t||101===t)&&((n===aA||n===sA)&&lA(o)||lA(n)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;lA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[vA(A),e]},A.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),e=A[0],t=A[1],n=this.peekCodePoint(0),o=this.peekCodePoint(1),i=this.peekCodePoint(2);return mA(n,o,i)?{type:15,number:e,flags:t,unit:this.consumeName()}:37===n?(this.consumeCodePoint(),{type:16,number:e,flags:t}):{type:17,number:e,flags:t}},A.prototype.consumeEscapedCodePoint=function(){var A=this.consumeCodePoint();if(dA(A)){for(var e=c(A);dA(this.peekCodePoint(0))&&e.length<6;)e+=c(this.consumeCodePoint());uA(this.peekCodePoint(0))&&this.consumeCodePoint();var t=parseInt(e,16);return 0===t||function(A){return A>=55296&&A<=57343}(t)||t>1114111?65533:t}return A===cA?65533:A},A.prototype.consumeName=function(){for(var A="";;){var e=this.consumeCodePoint();if(pA(e))A+=c(e);else{if(!BA(e,this.peekCodePoint(0)))return this.reconsumeCodePoint(e),A;A+=c(this.consumeEscapedCodePoint())}}},A}(),_A=function(){function A(A){this._tokens=A}return A.create=function(e){var t=new VA;return t.write(e),new A(t.read())},A.parseValue=function(e){return A.create(e).parseComponentValue()},A.parseValues=function(e){return A.create(e).parseComponentValues()},A.prototype.parseComponentValue=function(){for(var A=this.consumeToken();31===A.type;)A=this.consumeToken();if(32===A.type)throw new SyntaxError("Error parsing CSS component value, unexpected EOF");this.reconsumeToken(A);var e=this.consumeComponentValue();do{A=this.consumeToken()}while(31===A.type);if(32===A.type)return e;throw new SyntaxError("Error parsing CSS component value, multiple values found when expecting only one")},A.prototype.parseComponentValues=function(){for(var A=[];;){var e=this.consumeComponentValue();if(32===e.type)return A;A.push(e),A.push()}},A.prototype.consumeComponentValue=function(){var A=this.consumeToken();switch(A.type){case 11:case 28:case 2:return this.consumeSimpleBlock(A.type);case 19:return this.consumeFunction(A)}return A},A.prototype.consumeSimpleBlock=function(A){for(var e={type:A,values:[]},t=this.consumeToken();;){if(32===t.type||qA(t,A))return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue()),t=this.consumeToken()}},A.prototype.consumeFunction=function(A){for(var e={name:A.value,values:[],type:18};;){var t=this.consumeToken();if(32===t.type||3===t.type)return e;this.reconsumeToken(t),e.values.push(this.consumeComponentValue())}},A.prototype.consumeToken=function(){var A=this._tokens.shift();return void 0===A?OA:A},A.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},A}(),NA=function(A){return 15===A.type},GA=function(A){return 17===A.type},WA=function(A){return 20===A.type},jA=function(A){return 0===A.type},zA=function(A,e){return WA(A)&&A.value===e},XA=function(A){return 31!==A.type},JA=function(A){return 31!==A.type&&4!==A.type},YA=function(A){var e=[],t=[];return A.forEach(function(A){if(4===A.type){if(0===t.length)throw new Error("Error parsing function args, zero tokens for arg");return e.push(t),void(t=[])}31!==A.type&&t.push(A)}),t.length&&e.push(t),e},qA=function(A,e){return 11===e&&12===A.type||28===e&&29===A.type||2===e&&3===A.type},ZA=function(A){return 17===A.type||15===A.type},$A=function(A){return 16===A.type||ZA(A)},Ae=function(A){return A.length>1?[A[0],A[1]]:[A[0]]},ee={type:17,number:0,flags:4},te={type:16,number:50,flags:4},ne={type:16,number:100,flags:4},oe=function(A,e,t){var n=A[0],o=A[1];return[ie(n,e),ie(void 0!==o?o:n,t)]},ie=function(A,e){if(16===A.type)return A.number/100*e;if(NA(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},re="grad",se="turn",ae=function(A,e){if(15===e.type)switch(e.unit){case"deg":return Math.PI*e.number/180;case re:return Math.PI/200*e.number;case"rad":return e.number;case se:return 2*Math.PI*e.number}throw new Error("Unsupported angle type")},ce=function(A){return 15===A.type&&("deg"===A.unit||A.unit===re||"rad"===A.unit||A.unit===se)},le=function(A){switch(A.filter(WA).map(function(A){return A.value}).join(" ")){case"to bottom right":case"to right bottom":case"left top":case"top left":return[ee,ee];case"to top":case"bottom":return de(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[ee,ne];case"to right":case"left":return de(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[ne,ne];case"to bottom":case"top":return de(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[ne,ee];case"to left":case"right":return de(270)}return 0},de=function(A){return Math.PI*A/180},ue=function(A,e){if(18===e.type){var t=we[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported color function "'+e.name+'"');return t(A,e.values)}if(5===e.type){if(3===e.value.length){var n=e.value.substring(0,1),o=e.value.substring(1,2),i=e.value.substring(2,3);return he(parseInt(n+n,16),parseInt(o+o,16),parseInt(i+i,16),1)}if(4===e.value.length){n=e.value.substring(0,1),o=e.value.substring(1,2),i=e.value.substring(2,3);var r=e.value.substring(3,4);return he(parseInt(n+n,16),parseInt(o+o,16),parseInt(i+i,16),parseInt(r+r,16)/255)}if(6===e.value.length)return n=e.value.substring(0,2),o=e.value.substring(2,4),i=e.value.substring(4,6),he(parseInt(n,16),parseInt(o,16),parseInt(i,16),1);if(8===e.value.length)return n=e.value.substring(0,2),o=e.value.substring(2,4),i=e.value.substring(4,6),r=e.value.substring(6,8),he(parseInt(n,16),parseInt(o,16),parseInt(i,16),parseInt(r,16)/255)}if(20===e.type){var s=ye[e.value.toUpperCase()];if(void 0!==s)return s}return ye.TRANSPARENT},ge=function(A){return!(255&A)},pe=function(A){var e=255&A,t=255&A>>8,n=255&A>>16,o=255&A>>24;return e<255?"rgba("+o+","+n+","+t+","+e/255+")":"rgb("+o+","+n+","+t+")"},he=function(A,e,t,n){return(A<<24|e<<16|t<<8|Math.round(255*n))>>>0},Be=function(A,e){if(17===A.type)return A.number;if(16===A.type){var t=3===e?1:255;return 3===e?A.number/100*t:Math.round(A.number/100*t)}return 0},me=function(A,e){var t=e.filter(JA);if(3===t.length){var n=t.map(Be),o=n[0],i=n[1],r=n[2];return he(o,i,r,1)}if(4===t.length){var s=t.map(Be),a=(o=s[0],i=s[1],r=s[2],s[3]);return he(o,i,r,a)}return 0};function fe(A,e,t){return t<0&&(t+=1),t>=1&&(t-=1),t<1/6?(e-A)*t*6+A:t<.5?e:t<2/3?6*(e-A)*(2/3-t)+A:A}var ve=function(A,e){var t=e.filter(JA),n=t[0],o=t[1],i=t[2],r=t[3],s=(17===n.type?de(n.number):ae(A,n))/(2*Math.PI),a=$A(o)?o.number/100:0,c=$A(i)?i.number/100:0,l=void 0!==r&&$A(r)?ie(r,1):1;if(0===a)return he(255*c,255*c,255*c,1);var d=c<=.5?c*(a+1):c+a-c*a,u=2*c-d,g=fe(u,d,s+1/3),p=fe(u,d,s),h=fe(u,d,s-1/3);return he(255*g,255*p,255*h,l)},we={hsl:ve,hsla:ve,rgb:me,rgba:me},Ce=function(A,e){return ue(A,_A.create(e).parseComponentValue())},ye={ALICEBLUE:4042850303,ANTIQUEWHITE:4209760255,AQUA:16777215,AQUAMARINE:2147472639,AZURE:4043309055,BEIGE:4126530815,BISQUE:4293182719,BLACK:255,BLANCHEDALMOND:4293643775,BLUE:65535,BLUEVIOLET:2318131967,BROWN:2771004159,BURLYWOOD:3736635391,CADETBLUE:1604231423,CHARTREUSE:2147418367,CHOCOLATE:3530104575,CORAL:4286533887,CORNFLOWERBLUE:1687547391,CORNSILK:4294499583,CRIMSON:3692313855,CYAN:16777215,DARKBLUE:35839,DARKCYAN:9145343,DARKGOLDENROD:3095837695,DARKGRAY:2846468607,DARKGREEN:6553855,DARKGREY:2846468607,DARKKHAKI:3182914559,DARKMAGENTA:2332068863,DARKOLIVEGREEN:1433087999,DARKORANGE:4287365375,DARKORCHID:2570243327,DARKRED:2332033279,DARKSALMON:3918953215,DARKSEAGREEN:2411499519,DARKSLATEBLUE:1211993087,DARKSLATEGRAY:793726975,DARKSLATEGREY:793726975,DARKTURQUOISE:13554175,DARKVIOLET:2483082239,DEEPPINK:4279538687,DEEPSKYBLUE:12582911,DIMGRAY:1768516095,DIMGREY:1768516095,DODGERBLUE:512819199,FIREBRICK:2988581631,FLORALWHITE:4294635775,FORESTGREEN:579543807,FUCHSIA:4278255615,GAINSBORO:3705462015,GHOSTWHITE:4177068031,GOLD:4292280575,GOLDENROD:3668254975,GRAY:2155905279,GREEN:8388863,GREENYELLOW:2919182335,GREY:2155905279,HONEYDEW:4043305215,HOTPINK:4285117695,INDIANRED:3445382399,INDIGO:1258324735,IVORY:4294963455,KHAKI:4041641215,LAVENDER:3873897215,LAVENDERBLUSH:4293981695,LAWNGREEN:2096890111,LEMONCHIFFON:4294626815,LIGHTBLUE:2916673279,LIGHTCORAL:4034953471,LIGHTCYAN:3774873599,LIGHTGOLDENRODYELLOW:4210742015,LIGHTGRAY:3553874943,LIGHTGREEN:2431553791,LIGHTGREY:3553874943,LIGHTPINK:4290167295,LIGHTSALMON:4288707327,LIGHTSEAGREEN:548580095,LIGHTSKYBLUE:2278488831,LIGHTSLATEGRAY:2005441023,LIGHTSLATEGREY:2005441023,LIGHTSTEELBLUE:2965692159,LIGHTYELLOW:4294959359,LIME:16711935,LIMEGREEN:852308735,LINEN:4210091775,MAGENTA:4278255615,MAROON:2147483903,MEDIUMAQUAMARINE:1724754687,MEDIUMBLUE:52735,MEDIUMORCHID:3126187007,MEDIUMPURPLE:2473647103,MEDIUMSEAGREEN:1018393087,MEDIUMSLATEBLUE:2070474495,MEDIUMSPRINGGREEN:16423679,MEDIUMTURQUOISE:1221709055,MEDIUMVIOLETRED:3340076543,MIDNIGHTBLUE:421097727,MINTCREAM:4127193855,MISTYROSE:4293190143,MOCCASIN:4293178879,NAVAJOWHITE:4292783615,NAVY:33023,OLDLACE:4260751103,OLIVE:2155872511,OLIVEDRAB:1804477439,ORANGE:4289003775,ORANGERED:4282712319,ORCHID:3664828159,PALEGOLDENROD:4008225535,PALEGREEN:2566625535,PALETURQUOISE:2951671551,PALEVIOLETRED:3681588223,PAPAYAWHIP:4293907967,PEACHPUFF:4292524543,PERU:3448061951,PINK:4290825215,PLUM:3718307327,POWDERBLUE:2967529215,PURPLE:2147516671,REBECCAPURPLE:1714657791,RED:4278190335,ROSYBROWN:3163525119,ROYALBLUE:1097458175,SADDLEBROWN:2336560127,SALMON:4202722047,SANDYBROWN:4104413439,SEAGREEN:780883967,SEASHELL:4294307583,SIENNA:2689740287,SILVER:3233857791,SKYBLUE:2278484991,SLATEBLUE:1784335871,SLATEGRAY:1887473919,SLATEGREY:1887473919,SNOW:4294638335,SPRINGGREEN:16744447,STEELBLUE:1182971135,TAN:3535047935,TEAL:8421631,THISTLE:3636451583,TOMATO:4284696575,TRANSPARENT:0,TURQUOISE:1088475391,VIOLET:4001558271,WHEAT:4125012991,WHITE:4294967295,WHITESMOKE:4126537215,YELLOW:4294902015,YELLOWGREEN:2597139199},be={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map(function(A){if(WA(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},xe={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Qe=function(A,e){var t=ue(A,e[0]),n=e[1];return n&&$A(n)?{color:t,stop:n}:{color:t,stop:null}},Fe=function(A,e){var t=A[0],n=A[A.length-1];null===t.stop&&(t.stop=ee),null===n.stop&&(n.stop=ne);for(var o=[],i=0,r=0;r<A.length;r++){var s=A[r].stop;if(null!==s){var a=ie(s,e);a>i?o.push(a):o.push(i),i=a}else o.push(null)}var c=null;for(r=0;r<o.length;r++){var l=o[r];if(null===l)null===c&&(c=r);else if(null!==c){for(var d=r-c,u=(l-o[c-1])/(d+1),g=1;g<=d;g++)o[c+g-1]=u*g;c=null}}return A.map(function(A,t){return{color:A.color,stop:Math.max(Math.min(1,o[t]/e),0)}})},Ue=function(A,e,t){var n="number"==typeof A?A:function(A,e,t){var n=e/2,o=t/2,i=ie(A[0],e)-n,r=o-ie(A[1],t);return(Math.atan2(r,i)+2*Math.PI)%(2*Math.PI)}(A,e,t),o=Math.abs(e*Math.sin(n))+Math.abs(t*Math.cos(n)),i=e/2,r=t/2,s=o/2,a=Math.sin(n-Math.PI/2)*s,c=Math.cos(n-Math.PI/2)*s;return[o,i-c,i+c,r-a,r+a]},Se=function(A,e){return Math.sqrt(A*A+e*e)},Ie=function(A,e,t,n,o){return[[0,0],[0,e],[A,0],[A,e]].reduce(function(A,e){var i=e[0],r=e[1],s=Se(t-i,n-r);return(o?s<A.optimumDistance:s>A.optimumDistance)?{optimumCorner:e,optimumDistance:s}:A},{optimumDistance:o?1/0:-1/0,optimumCorner:null}).optimumCorner},Ee=function(A,e){var t=de(180),n=[];return YA(e).forEach(function(e,o){if(0===o){var i=e[0];if(20===i.type&&-1!==["top","left","right","bottom"].indexOf(i.value))return void(t=le(e));if(ce(i))return void(t=(ae(A,i)+de(270))%de(360))}var r=Qe(A,e);n.push(r)}),{angle:t,stops:n,type:1}},ke="closest-side",He="farthest-side",Te="closest-corner",De="farthest-corner",Ke="circle",Le="ellipse",Me="cover",Re="contain",Pe=function(A,e){var t=0,n=3,o=[],i=[];return YA(e).forEach(function(e,r){var s=!0;if(0===r?s=e.reduce(function(A,e){if(WA(e))switch(e.value){case"center":return i.push(te),!1;case"top":case"left":return i.push(ee),!1;case"right":case"bottom":return i.push(ne),!1}else if($A(e)||ZA(e))return i.push(e),!1;return A},s):1===r&&(s=e.reduce(function(A,e){if(WA(e))switch(e.value){case Ke:return t=0,!1;case Le:return t=1,!1;case Re:case ke:return n=0,!1;case He:return n=1,!1;case Te:return n=2,!1;case Me:case De:return n=3,!1}else if(ZA(e)||$A(e))return Array.isArray(n)||(n=[]),n.push(e),!1;return A},s)),s){var a=Qe(A,e);o.push(a)}}),{size:n,shape:t,stops:o,position:i,type:2}},Oe=function(A,e){if(22===e.type){var t={url:e.value,type:0};return A.cache.addImage(e.value),t}if(18===e.type){var n=_e[e.name];if(void 0===n)throw new Error('Attempting to parse an unsupported image function "'+e.name+'"');return n(A,e.values)}throw new Error("Unsupported image type "+e.type)};var Ve,_e={"linear-gradient":function(A,e){var t=de(180),n=[];return YA(e).forEach(function(e,o){if(0===o){var i=e[0];if(20===i.type&&"to"===i.value)return void(t=le(e));if(ce(i))return void(t=ae(A,i))}var r=Qe(A,e);n.push(r)}),{angle:t,stops:n,type:1}},"-moz-linear-gradient":Ee,"-ms-linear-gradient":Ee,"-o-linear-gradient":Ee,"-webkit-linear-gradient":Ee,"radial-gradient":function(A,e){var t=0,n=3,o=[],i=[];return YA(e).forEach(function(e,r){var s=!0;if(0===r){var a=!1;s=e.reduce(function(A,e){if(a)if(WA(e))switch(e.value){case"center":return i.push(te),A;case"top":case"left":return i.push(ee),A;case"right":case"bottom":return i.push(ne),A}else($A(e)||ZA(e))&&i.push(e);else if(WA(e))switch(e.value){case Ke:return t=0,!1;case Le:return t=1,!1;case"at":return a=!0,!1;case ke:return n=0,!1;case Me:case He:return n=1,!1;case Re:case Te:return n=2,!1;case De:return n=3,!1}else if(ZA(e)||$A(e))return Array.isArray(n)||(n=[]),n.push(e),!1;return A},s)}if(s){var c=Qe(A,e);o.push(c)}}),{size:n,shape:t,stops:o,position:i,type:2}},"-moz-radial-gradient":Pe,"-ms-radial-gradient":Pe,"-o-radial-gradient":Pe,"-webkit-radial-gradient":Pe,"-webkit-gradient":function(A,e){var t=de(180),n=[],o=1;return YA(e).forEach(function(e,t){var i=e[0];if(0===t){if(WA(i)&&"linear"===i.value)return void(o=1);if(WA(i)&&"radial"===i.value)return void(o=2)}if(18===i.type)if("from"===i.name){var r=ue(A,i.values[0]);n.push({stop:ee,color:r})}else if("to"===i.name)r=ue(A,i.values[0]),n.push({stop:ne,color:r});else if("color-stop"===i.name){var s=i.values.filter(JA);if(2===s.length){r=ue(A,s[1]);var a=s[0];GA(a)&&n.push({stop:{type:16,number:100*a.number,flags:a.flags},color:r})}}}),1===o?{angle:(t+de(180))%de(360),stops:n,type:o}:{size:3,shape:0,stops:n,position:[],type:o}}},Ne={name:"background-image",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(0===e.length)return[];var t=e[0];return 20===t.type&&"none"===t.value?[]:e.filter(function(A){return JA(A)&&function(A){return!(20===A.type&&"none"===A.value||18===A.type&&!_e[A.name])}(A)}).map(function(e){return Oe(A,e)})}},Ge={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map(function(A){if(WA(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},We={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(A,e){return YA(e).map(function(A){return A.filter($A)}).map(Ae)}},je={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(A,e){return YA(e).map(function(A){return A.filter(WA).map(function(A){return A.value}).join(" ")}).map(ze)}},ze=function(A){switch(A){case"no-repeat":return 1;case"repeat-x":case"repeat no-repeat":return 2;case"repeat-y":case"no-repeat repeat":return 3;default:return 0}};!function(A){A.AUTO="auto",A.CONTAIN="contain",A.COVER="cover"}(Ve||(Ve={}));var Xe,Je={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(A,e){return YA(e).map(function(A){return A.filter(Ye)})}},Ye=function(A){return WA(A)||$A(A)},qe=function(A){return{name:"border-"+A+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},Ze=qe("top"),$e=qe("right"),At=qe("bottom"),et=qe("left"),tt=function(A){return{name:"border-radius-"+A,initialValue:"0 0",prefix:!1,type:1,parse:function(A,e){return Ae(e.filter($A))}}},nt=tt("top-left"),ot=tt("top-right"),it=tt("bottom-right"),rt=tt("bottom-left"),st=function(A){return{name:"border-"+A+"-style",initialValue:"solid",prefix:!1,type:2,parse:function(A,e){switch(e){case"none":return 0;case"dashed":return 2;case"dotted":return 3;case"double":return 4}return 1}}},at=st("top"),ct=st("right"),lt=st("bottom"),dt=st("left"),ut=function(A){return{name:"border-"+A+"-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return NA(e)?e.number:0}}},gt=ut("top"),pt=ut("right"),ht=ut("bottom"),Bt=ut("left"),mt={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},ft={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(A,e){return"rtl"===e?1:0}},vt={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(A,e){return e.filter(WA).reduce(function(A,e){return A|wt(e.value)},0)}},wt=function(A){switch(A){case"block":case"-webkit-box":return 2;case"inline":return 4;case"run-in":return 8;case"flow":return 16;case"flow-root":return 32;case"table":return 64;case"flex":case"-webkit-flex":return 128;case"grid":case"-ms-grid":return 256;case"ruby":return 512;case"subgrid":return 1024;case"list-item":return 2048;case"table-row-group":return 4096;case"table-header-group":return 8192;case"table-footer-group":return 16384;case"table-row":return 32768;case"table-cell":return 65536;case"table-column-group":return 131072;case"table-column":return 262144;case"table-caption":return 524288;case"ruby-base":return 1048576;case"ruby-text":return 2097152;case"ruby-base-container":return 4194304;case"ruby-text-container":return 8388608;case"contents":return 16777216;case"inline-block":return 33554432;case"inline-list-item":return 67108864;case"inline-table":return 134217728;case"inline-flex":return 268435456;case"inline-grid":return 536870912}return 0},Ct={name:"float",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"left":return 1;case"right":return 2;case"inline-start":return 3;case"inline-end":return 4}return 0}},yt={name:"letter-spacing",initialValue:"0",prefix:!1,type:0,parse:function(A,e){return 20===e.type&&"normal"===e.value?0:17===e.type||15===e.type?e.number:0}};!function(A){A.NORMAL="normal",A.STRICT="strict"}(Xe||(Xe={}));var bt,xt={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"strict"===e?Xe.STRICT:Xe.NORMAL}},Qt={name:"line-height",initialValue:"normal",prefix:!1,type:4},Ft=function(A,e){return WA(A)&&"normal"===A.value?1.2*e:17===A.type?e*A.number:$A(A)?ie(A,e):e},Ut={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(A,e){return 20===e.type&&"none"===e.value?null:Oe(A,e)}},St={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(A,e){return"inside"===e?0:1}},It={name:"list-style-type",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"disc":return 0;case"circle":return 1;case"square":return 2;case"decimal":return 3;case"cjk-decimal":return 4;case"decimal-leading-zero":return 5;case"lower-roman":return 6;case"upper-roman":return 7;case"lower-greek":return 8;case"lower-alpha":return 9;case"upper-alpha":return 10;case"arabic-indic":return 11;case"armenian":return 12;case"bengali":return 13;case"cambodian":return 14;case"cjk-earthly-branch":return 15;case"cjk-heavenly-stem":return 16;case"cjk-ideographic":return 17;case"devanagari":return 18;case"ethiopic-numeric":return 19;case"georgian":return 20;case"gujarati":return 21;case"gurmukhi":case"hebrew":return 22;case"hiragana":return 23;case"hiragana-iroha":return 24;case"japanese-formal":return 25;case"japanese-informal":return 26;case"kannada":return 27;case"katakana":return 28;case"katakana-iroha":return 29;case"khmer":return 30;case"korean-hangul-formal":return 31;case"korean-hanja-formal":return 32;case"korean-hanja-informal":return 33;case"lao":return 34;case"lower-armenian":return 35;case"malayalam":return 36;case"mongolian":return 37;case"myanmar":return 38;case"oriya":return 39;case"persian":return 40;case"simp-chinese-formal":return 41;case"simp-chinese-informal":return 42;case"tamil":return 43;case"telugu":return 44;case"thai":return 45;case"tibetan":return 46;case"trad-chinese-formal":return 47;case"trad-chinese-informal":return 48;case"upper-armenian":return 49;case"disclosure-open":return 50;case"disclosure-closed":return 51;default:return-1}}},Et=function(A){return{name:"margin-"+A,initialValue:"0",prefix:!1,type:4}},kt=Et("top"),Ht=Et("right"),Tt=Et("bottom"),Dt=Et("left"),Kt={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(A,e){return e.filter(WA).map(function(A){switch(A.value){case"hidden":return 1;case"scroll":return 2;case"clip":return 3;case"auto":return 4;default:return 0}})}},Lt={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"break-word"===e?"break-word":"normal"}},Mt=function(A){return{name:"padding-"+A,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Rt=Mt("top"),Pt=Mt("right"),Ot=Mt("bottom"),Vt=Mt("left"),_t={name:"text-align",initialValue:"left",prefix:!1,type:2,parse:function(A,e){switch(e){case"right":return 2;case"center":case"justify":return 1;default:return 0}}},Nt={name:"position",initialValue:"static",prefix:!1,type:2,parse:function(A,e){switch(e){case"relative":return 1;case"absolute":return 2;case"fixed":return 3;case"sticky":return 4}return 0}},Gt={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&zA(e[0],"none")?[]:YA(e).map(function(e){for(var t={color:ye.TRANSPARENT,offsetX:ee,offsetY:ee,blur:ee},n=0,o=0;o<e.length;o++){var i=e[o];ZA(i)?(0===n?t.offsetX=i:1===n?t.offsetY=i:t.blur=i,n++):t.color=ue(A,i)}return t})}},Wt={name:"text-transform",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"uppercase":return 2;case"lowercase":return 1;case"capitalize":return 3}return 0}},jt={name:"transform",initialValue:"none",prefix:!0,type:0,parse:function(A,e){if(20===e.type&&"none"===e.value)return null;if(18===e.type){var t=zt[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported transform function "'+e.name+'"');return t(e.values)}return null}},zt={matrix:function(A){var e=A.filter(function(A){return 17===A.type}).map(function(A){return A.number});return 6===e.length?e:null},matrix3d:function(A){var e=A.filter(function(A){return 17===A.type}).map(function(A){return A.number}),t=e[0],n=e[1];e[2],e[3];var o=e[4],i=e[5];e[6],e[7],e[8],e[9],e[10],e[11];var r=e[12],s=e[13];return e[14],e[15],16===e.length?[t,n,o,i,r,s]:null}},Xt={type:16,number:50,flags:4},Jt=[Xt,Xt],Yt={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(A,e){var t=e.filter($A);return 2!==t.length?Jt:[t[0],t[1]]}},qt={name:"visible",initialValue:"none",prefix:!1,type:2,parse:function(A,e){switch(e){case"hidden":return 1;case"collapse":return 2;default:return 0}}};!function(A){A.NORMAL="normal",A.BREAK_ALL="break-all",A.KEEP_ALL="keep-all"}(bt||(bt={}));for(var Zt={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){switch(e){case"break-all":return bt.BREAK_ALL;case"keep-all":return bt.KEEP_ALL;default:return bt.NORMAL}}},$t={name:"z-index",initialValue:"auto",prefix:!1,type:0,parse:function(A,e){if(20===e.type)return{auto:!0,order:0};if(GA(e))return{auto:!1,order:e.number};throw new Error("Invalid z-index number parsed")}},An={name:"time",parse:function(A,e){if(15===e.type)switch(e.unit.toLowerCase()){case"s":return 1e3*e.number;case"ms":return e.number}throw new Error("Unsupported time type")}},en={name:"opacity",initialValue:"1",type:0,prefix:!1,parse:function(A,e){return GA(e)?e.number:1}},tn={name:"text-decoration-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},nn={name:"text-decoration-line",initialValue:"none",prefix:!1,type:1,parse:function(A,e){return e.filter(WA).map(function(A){switch(A.value){case"underline":return 1;case"overline":return 2;case"line-through":return 3;case"none":return 4}return 0}).filter(function(A){return 0!==A})}},on={name:"font-family",initialValue:"",prefix:!1,type:1,parse:function(A,e){var t=[],n=[];return e.forEach(function(A){switch(A.type){case 20:case 0:t.push(A.value);break;case 17:t.push(A.number.toString());break;case 4:n.push(t.join(" ")),t.length=0}}),t.length&&n.push(t.join(" ")),n.map(function(A){return-1===A.indexOf(" ")?A:"'"+A+"'"})}},rn={name:"font-size",initialValue:"0",prefix:!1,type:3,format:"length"},sn={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(A,e){return GA(e)?e.number:WA(e)&&"bold"===e.value?700:400}},an={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return e.filter(WA).map(function(A){return A.value})}},cn={name:"font-style",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){switch(e){case"oblique":return"oblique";case"italic":return"italic";default:return"normal"}}},ln=function(A,e){return 0!==(A&e)},dn={name:"content",initialValue:"none",type:1,prefix:!1,parse:function(A,e){if(0===e.length)return[];var t=e[0];return 20===t.type&&"none"===t.value?[]:e}},un={name:"counter-increment",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return null;var t=e[0];if(20===t.type&&"none"===t.value)return null;for(var n=[],o=e.filter(XA),i=0;i<o.length;i++){var r=o[i],s=o[i+1];if(20===r.type){var a=s&&GA(s)?s.number:1;n.push({counter:r.value,increment:a})}}return n}},gn={name:"counter-reset",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return[];for(var t=[],n=e.filter(XA),o=0;o<n.length;o++){var i=n[o],r=n[o+1];if(WA(i)&&"none"!==i.value){var s=r&&GA(r)?r.number:0;t.push({counter:i.value,reset:s})}}return t}},pn={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(A,e){return e.filter(NA).map(function(e){return An.parse(A,e)})}},hn={name:"quotes",initialValue:"none",prefix:!0,type:1,parse:function(A,e){if(0===e.length)return null;var t=e[0];if(20===t.type&&"none"===t.value)return null;var n=[],o=e.filter(jA);if(o.length%2!=0)return null;for(var i=0;i<o.length;i+=2){var r=o[i].value,s=o[i+1].value;n.push({open:r,close:s})}return n}},Bn=function(A,e,t){if(!A)return"";var n=A[Math.min(e,A.length-1)];return n?t?n.open:n.close:""},mn={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&zA(e[0],"none")?[]:YA(e).map(function(e){for(var t={color:255,offsetX:ee,offsetY:ee,blur:ee,spread:ee,inset:!1},n=0,o=0;o<e.length;o++){var i=e[o];zA(i,"inset")?t.inset=!0:ZA(i)?(0===n?t.offsetX=i:1===n?t.offsetY=i:2===n?t.blur=i:t.spread=i,n++):t.color=ue(A,i)}return t})}},fn={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(A,e){var t=[];return e.filter(WA).forEach(function(A){switch(A.value){case"stroke":t.push(1);break;case"fill":t.push(0);break;case"markers":t.push(2)}}),[0,1,2].forEach(function(A){-1===t.indexOf(A)&&t.push(A)}),t}},vn={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},wn={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return NA(e)?e.number:0}},Cn=function(){function A(A,e){var t,n;this.animationDuration=xn(A,pn,e.animationDuration),this.backgroundClip=xn(A,be,e.backgroundClip),this.backgroundColor=xn(A,xe,e.backgroundColor),this.backgroundImage=xn(A,Ne,e.backgroundImage),this.backgroundOrigin=xn(A,Ge,e.backgroundOrigin),this.backgroundPosition=xn(A,We,e.backgroundPosition),this.backgroundRepeat=xn(A,je,e.backgroundRepeat),this.backgroundSize=xn(A,Je,e.backgroundSize),this.borderTopColor=xn(A,Ze,e.borderTopColor),this.borderRightColor=xn(A,$e,e.borderRightColor),this.borderBottomColor=xn(A,At,e.borderBottomColor),this.borderLeftColor=xn(A,et,e.borderLeftColor),this.borderTopLeftRadius=xn(A,nt,e.borderTopLeftRadius),this.borderTopRightRadius=xn(A,ot,e.borderTopRightRadius),this.borderBottomRightRadius=xn(A,it,e.borderBottomRightRadius),this.borderBottomLeftRadius=xn(A,rt,e.borderBottomLeftRadius),this.borderTopStyle=xn(A,at,e.borderTopStyle),this.borderRightStyle=xn(A,ct,e.borderRightStyle),this.borderBottomStyle=xn(A,lt,e.borderBottomStyle),this.borderLeftStyle=xn(A,dt,e.borderLeftStyle),this.borderTopWidth=xn(A,gt,e.borderTopWidth),this.borderRightWidth=xn(A,pt,e.borderRightWidth),this.borderBottomWidth=xn(A,ht,e.borderBottomWidth),this.borderLeftWidth=xn(A,Bt,e.borderLeftWidth),this.boxShadow=xn(A,mn,e.boxShadow),this.color=xn(A,mt,e.color),this.direction=xn(A,ft,e.direction),this.display=xn(A,vt,e.display),this.float=xn(A,Ct,e.cssFloat),this.fontFamily=xn(A,on,e.fontFamily),this.fontSize=xn(A,rn,e.fontSize),this.fontStyle=xn(A,cn,e.fontStyle),this.fontVariant=xn(A,an,e.fontVariant),this.fontWeight=xn(A,sn,e.fontWeight),this.letterSpacing=xn(A,yt,e.letterSpacing),this.lineBreak=xn(A,xt,e.lineBreak),this.lineHeight=xn(A,Qt,e.lineHeight),this.listStyleImage=xn(A,Ut,e.listStyleImage),this.listStylePosition=xn(A,St,e.listStylePosition),this.listStyleType=xn(A,It,e.listStyleType),this.marginTop=xn(A,kt,e.marginTop),this.marginRight=xn(A,Ht,e.marginRight),this.marginBottom=xn(A,Tt,e.marginBottom),this.marginLeft=xn(A,Dt,e.marginLeft),this.opacity=xn(A,en,e.opacity);var o=xn(A,Kt,e.overflow);this.overflowX=o[0],this.overflowY=o[o.length>1?1:0],this.overflowWrap=xn(A,Lt,e.overflowWrap),this.paddingTop=xn(A,Rt,e.paddingTop),this.paddingRight=xn(A,Pt,e.paddingRight),this.paddingBottom=xn(A,Ot,e.paddingBottom),this.paddingLeft=xn(A,Vt,e.paddingLeft),this.paintOrder=xn(A,fn,e.paintOrder),this.position=xn(A,Nt,e.position),this.textAlign=xn(A,_t,e.textAlign),this.textDecorationColor=xn(A,tn,null!==(t=e.textDecorationColor)&&void 0!==t?t:e.color),this.textDecorationLine=xn(A,nn,null!==(n=e.textDecorationLine)&&void 0!==n?n:e.textDecoration),this.textShadow=xn(A,Gt,e.textShadow),this.textTransform=xn(A,Wt,e.textTransform),this.transform=xn(A,jt,e.transform),this.transformOrigin=xn(A,Yt,e.transformOrigin),this.visibility=xn(A,qt,e.visibility),this.webkitTextStrokeColor=xn(A,vn,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=xn(A,wn,e.webkitTextStrokeWidth),this.wordBreak=xn(A,Zt,e.wordBreak),this.zIndex=xn(A,$t,e.zIndex)}return A.prototype.isVisible=function(){return this.display>0&&this.opacity>0&&0===this.visibility},A.prototype.isTransparent=function(){return ge(this.backgroundColor)},A.prototype.isTransformed=function(){return null!==this.transform},A.prototype.isPositioned=function(){return 0!==this.position},A.prototype.isPositionedWithZIndex=function(){return this.isPositioned()&&!this.zIndex.auto},A.prototype.isFloating=function(){return 0!==this.float},A.prototype.isInlineLevel=function(){return ln(this.display,4)||ln(this.display,33554432)||ln(this.display,268435456)||ln(this.display,536870912)||ln(this.display,67108864)||ln(this.display,134217728)},A}(),yn=function(A,e){this.content=xn(A,dn,e.content),this.quotes=xn(A,hn,e.quotes)},bn=function(A,e){this.counterIncrement=xn(A,un,e.counterIncrement),this.counterReset=xn(A,gn,e.counterReset)},xn=function(A,e,t){var n=new VA,o=null!=t?t.toString():e.initialValue;n.write(o);var i=new _A(n.read());switch(e.type){case 2:var r=i.parseComponentValue();return e.parse(A,WA(r)?r.value:e.initialValue);case 0:return e.parse(A,i.parseComponentValue());case 1:return e.parse(A,i.parseComponentValues());case 4:return i.parseComponentValue();case 3:switch(e.format){case"angle":return ae(A,i.parseComponentValue());case"color":return ue(A,i.parseComponentValue());case"image":return Oe(A,i.parseComponentValue());case"length":var s=i.parseComponentValue();return ZA(s)?s:ee;case"length-percentage":var a=i.parseComponentValue();return $A(a)?a:ee;case"time":return An.parse(A,i.parseComponentValue())}}},Qn=function(A,e){var t=function(A){switch(A.getAttribute("data-html2canvas-debug")){case"all":return 1;case"clone":return 2;case"parse":return 3;case"render":return 4;default:return 0}}(A);return 1===t||e===t},Fn=function(A,e){this.context=A,this.textNodes=[],this.elements=[],this.flags=0,Qn(e,3),this.styles=new Cn(A,window.getComputedStyle(e,null)),ko(e)&&(this.styles.animationDuration.some(function(A){return A>0})&&(e.style.animationDuration="0s"),null!==this.styles.transform&&(e.style.transform="none")),this.bounds=s(this.context,e),Qn(e,4)&&(this.flags|=16)},Un="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),In=0;In<64;In++)Sn[Un.charCodeAt(In)]=In;for(var En=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},kn=function(){function A(A,e,t,n,o,i){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=n,this.index=o,this.data=i}return A.prototype.get=function(A){var e;if(A>=0){if(A<55296||A>56319&&A<=65535)return e=((e=this.index[A>>5])<<2)+(31&A),this.data[e];if(A<=65535)return e=((e=this.index[2048+(A-55296>>5)])<<2)+(31&A),this.data[e];if(A<this.highStart)return e=2080+(A>>11),e=this.index[e],e+=A>>5&63,e=((e=this.index[e])<<2)+(31&A),this.data[e];if(A<=1114111)return this.data[this.highValueIndex]}return this.errorValue},A}(),Hn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Tn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Dn=0;Dn<64;Dn++)Tn[Hn.charCodeAt(Dn)]=Dn;var Kn,Ln=8,Mn=9,Rn=11,Pn=12,On=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];if(String.fromCodePoint)return String.fromCodePoint.apply(String,A);var t=A.length;if(!t)return"";for(var n=[],o=-1,i="";++o<t;){var r=A[o];r<=65535?n.push(r):(r-=65536,n.push(55296+(r>>10),r%1024+56320)),(o+1===t||n.length>16384)&&(i+=String.fromCharCode.apply(String,n),n.length=0)}return i},Vn=function(A){var e,t,n,o=function(A){var e,t,n,o,i,r=.75*A.length,s=A.length,a=0;"="===A[A.length-1]&&(r--,"="===A[A.length-2]&&r--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(r):new Array(r),l=Array.isArray(c)?c:new Uint8Array(c);for(e=0;e<s;e+=4)t=Sn[A.charCodeAt(e)],n=Sn[A.charCodeAt(e+1)],o=Sn[A.charCodeAt(e+2)],i=Sn[A.charCodeAt(e+3)],l[a++]=t<<2|n>>4,l[a++]=(15&n)<<4|o>>2,l[a++]=(3&o)<<6|63&i;return c}(A),i=Array.isArray(o)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=4)t.push(A[n+3]<<24|A[n+2]<<16|A[n+1]<<8|A[n]);return t}(o):new Uint32Array(o),r=Array.isArray(o)?function(A){for(var e=A.length,t=[],n=0;n<e;n+=2)t.push(A[n+1]<<8|A[n]);return t}(o):new Uint16Array(o),s=En(r,12,i[4]/2),a=2===i[5]?En(r,(24+i[4])/2):(e=i,t=Math.ceil((24+i[4])/4),e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,t,n)));return new kn(i[0],i[1],i[2],i[3],s,a)}("AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFIQUoBSwFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAfAKAAuZA64AtwCJALoC6ADwAAgAuACgA/oEpgO6AqsD+AAIAAgAswMIAAgACAAIAIkAuwP5AfsBwwPLAwgACAAIAAgACADRA9kDCAAIAOED6QMIAAgACAAIAAgACADuA/YDCAAIAP4DyQAIAAgABgQIAAgAXQAOBAgACAAIAAgACAAIABMECAAIAAgACAAIAAgACAD8AAQBCAAIAAgAGgQiBCoECAExBAgAEAEIAAgACAAIAAgACAAIAAgACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAQADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUAAAAFAAUAAAAFAAUAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUAAQAAAAUABQAFAAUABQAFAAAAAAAFAAUAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAFAAUAAQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAAABwAHAAcAAAAHAAcABwAFAAEAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAcABwAFAAUAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAAAAQABAAAAAAAAAAAAAAAFAAUABQAFAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAHAAcAAAAHAAcAAAAAAAUABQAHAAUAAQAHAAEABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwABAAUABQAFAAUAAAAAAAAAAAAAAAEAAQABAAEAAQABAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABQANAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAEAAQABAAEAAQABAAEAAQABAAEAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAABQAHAAUABQAFAAAAAAAAAAcABQAFAAUABQAFAAQABAAEAAQABAAEAAQABAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUAAAAFAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAUAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAcABwAFAAcABwAAAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUABwAHAAUABQAFAAUAAAAAAAcABwAAAAAABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAABQAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAAAAAAAAAAABQAFAAAAAAAFAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAFAAUABQAFAAUAAAAFAAUABwAAAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABwAFAAUABQAFAAAAAAAHAAcAAAAAAAcABwAFAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAAAAAAAAAHAAcABwAAAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAABQAHAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAUABQAFAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAHAAcABQAHAAcAAAAFAAcABwAAAAcABwAFAAUAAAAAAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAFAAcABwAFAAUABQAAAAUAAAAHAAcABwAHAAcABwAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAHAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAABwAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAUAAAAFAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABwAFAAUABQAFAAUAAAAFAAUAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABwAFAAUABQAFAAUABQAAAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABQAFAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABQAFAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAHAAUABQAFAAUABQAFAAUABwAHAAcABwAHAAcABwAHAAUABwAHAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABwAHAAcABwAFAAUABwAHAAcAAAAAAAAAAAAHAAcABQAHAAcABwAHAAcABwAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAcABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAUABQAFAAUABQAFAAUAAAAFAAAABQAAAAAABQAFAAUABQAFAAUABQAFAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAFAAUAAAAAAAUABQAFAAUABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABwAFAAcABwAHAAcABwAFAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAUABQAFAAUABwAHAAUABQAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABQAFAAcABwAHAAUABwAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAcABQAFAAUABQAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAAAAAABwAFAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAAAAAAAAAFAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAUABQAHAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAUABQAFAAUABQAHAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAcABwAFAAUABQAFAAcABwAFAAUABwAHAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAFAAcABwAFAAUABwAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAFAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAFAAUABQAAAAAABQAFAAAAAAAAAAAAAAAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAcABwAAAAAAAAAAAAAABwAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAcABwAFAAcABwAAAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAFAAUABQAAAAUABQAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABwAFAAUABQAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAUABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAHAAcABQAHAAUABQAAAAAAAAAAAAAAAAAFAAAABwAHAAcABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAHAAcABwAAAAAABwAHAAAAAAAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABwAHAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAFAAUABwAFAAcABwAFAAcABQAFAAcABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAHAAcABQAFAAUABQAAAAAABwAHAAcABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAHAAUABQAFAAUABQAFAAUABQAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABwAFAAcABwAFAAUABQAFAAUABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAcABwAFAAUABQAFAAcABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAUABQAFAAUABQAHAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAFAAUABQAFAAAAAAAFAAUABwAHAAcABwAFAAAAAAAAAAcAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABwAHAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAcABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAAAHAAUABQAFAAUABQAFAAUABwAFAAUABwAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUAAAAAAAAABQAAAAUABQAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAHAAcABwAHAAcAAAAFAAUAAAAHAAcABQAHAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAAAAUABQAFAAAAAAAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAFAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAAAAABQAFAAUABQAFAAUABQAAAAUABQAAAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFAAUABQAFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABQAFAAUABQAFAAUABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAFAAUABQAFAAUADgAOAA4ADgAOAA4ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAA8ADwAPAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAMAAwADAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkACQAJAAkAAAAAAAAAAAAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAKAAoACgAAAAAAAAAAAAsADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwACwAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAADgAOAA4AAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAAAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4AAAAOAAAAAAAAAAAAAAAAAA4AAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAAAAAAAAAAAA4AAAAOAAAAAAAAAAAADgAOAA4AAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA="),_n="×",Nn=function(A){return Vn.get(A)},Gn=function(A,e,t){var n=t-2,o=e[n],i=e[t-1],r=e[t];if(2===i&&3===r)return _n;if(2===i||3===i||4===i)return"÷";if(2===r||3===r||4===r)return"÷";if(i===Ln&&-1!==[Ln,Mn,Rn,Pn].indexOf(r))return _n;if(!(i!==Rn&&i!==Mn||r!==Mn&&10!==r))return _n;if((i===Pn||10===i)&&10===r)return _n;if(13===r||5===r)return _n;if(7===r)return _n;if(1===i)return _n;if(13===i&&14===r){for(;5===o;)o=e[--n];if(14===o)return _n}if(15===i&&15===r){for(var s=0;15===o;)s++,o=e[--n];if(s%2==0)return _n}return"÷"},Wn=function(A){var e=function(A){for(var e=[],t=0,n=A.length;t<n;){var o=A.charCodeAt(t++);if(o>=55296&&o<=56319&&t<n){var i=A.charCodeAt(t++);56320==(64512&i)?e.push(((1023&o)<<10)+(1023&i)+65536):(e.push(o),t--)}else e.push(o)}return e}(A),t=e.length,n=0,o=0,i=e.map(Nn);return{next:function(){if(n>=t)return{done:!0,value:null};for(var A=_n;n<t&&(A=Gn(0,i,++n))===_n;);if(A!==_n||n===t){var r=On.apply(null,e.slice(o,n));return o=n,{value:r,done:!1}}return{done:!0,value:null}}}},jn=function(A){return 0===A[0]&&255===A[1]&&0===A[2]&&255===A[3]},zn=function(A,e,t,n,o){var i="http://www.w3.org/2000/svg",r=document.createElementNS(i,"svg"),s=document.createElementNS(i,"foreignObject");return r.setAttributeNS(null,"width",A.toString()),r.setAttributeNS(null,"height",e.toString()),s.setAttributeNS(null,"width","100%"),s.setAttributeNS(null,"height","100%"),s.setAttributeNS(null,"x",t.toString()),s.setAttributeNS(null,"y",n.toString()),s.setAttributeNS(null,"externalResourcesRequired","true"),r.appendChild(s),s.appendChild(o),r},Xn=function(A){return new Promise(function(e,t){var n=new Image;n.onload=function(){return e(n)},n.onerror=t,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(A))})},Jn={get SUPPORT_RANGE_BOUNDS(){var A=function(A){if(A.createRange){var e=A.createRange();if(e.getBoundingClientRect){var t=A.createElement("boundtest");t.style.height="123px",t.style.display="block",A.body.appendChild(t),e.selectNode(t);var n=e.getBoundingClientRect(),o=Math.round(n.height);if(A.body.removeChild(t),123===o)return!0}}return!1}(document);return Object.defineProperty(Jn,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_WORD_BREAKING(){var A=Jn.SUPPORT_RANGE_BOUNDS&&function(A){var e=A.createElement("boundtest");e.style.width="50px",e.style.display="block",e.style.fontSize="12px",e.style.letterSpacing="0px",e.style.wordSpacing="0px",A.body.appendChild(e);var t=A.createRange();e.innerHTML="function"==typeof"".repeat?"&#128104;".repeat(10):"";var n=e.firstChild,o=a(n.data).map(function(A){return c(A)}),i=0,r={},s=o.every(function(A,e){t.setStart(n,i),t.setEnd(n,i+A.length);var o=t.getBoundingClientRect();i+=A.length;var s=o.x>r.x||o.y>r.y;return r=o,0===e||s});return A.body.removeChild(e),s}(document);return Object.defineProperty(Jn,"SUPPORT_WORD_BREAKING",{value:A}),A},get SUPPORT_SVG_DRAWING(){var A=function(A){var e=new Image,t=A.createElement("canvas"),n=t.getContext("2d");if(!n)return!1;e.src="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'></svg>";try{n.drawImage(e,0,0),t.toDataURL()}catch(A){return!1}return!0}(document);return Object.defineProperty(Jn,"SUPPORT_SVG_DRAWING",{value:A}),A},get SUPPORT_FOREIGNOBJECT_DRAWING(){var A="function"==typeof Array.from&&"function"==typeof window.fetch?function(A){var e=A.createElement("canvas"),t=100;e.width=t,e.height=t;var n=e.getContext("2d");if(!n)return Promise.reject(!1);n.fillStyle="rgb(0, 255, 0)",n.fillRect(0,0,t,t);var o=new Image,i=e.toDataURL();o.src=i;var r=zn(t,t,0,0,o);return n.fillStyle="red",n.fillRect(0,0,t,t),Xn(r).then(function(e){n.drawImage(e,0,0);var o=n.getImageData(0,0,t,t).data;n.fillStyle="red",n.fillRect(0,0,t,t);var r=A.createElement("div");return r.style.backgroundImage="url("+i+")",r.style.height=t+"px",jn(o)?Xn(zn(t,t,0,0,r)):Promise.reject(!1)}).then(function(A){return n.drawImage(A,0,0),jn(n.getImageData(0,0,t,t).data)}).catch(function(){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(Jn,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(Jn,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(Jn,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Jn,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var A=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(Jn,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:A}),A}},Yn=function(A,e){this.text=A,this.bounds=e},qn=function(A,e){var t=e.ownerDocument;if(t){var n=t.createElement("html2canvaswrapper");n.appendChild(e.cloneNode(!0));var o=e.parentNode;if(o){o.replaceChild(n,e);var i=s(A,n);return n.firstChild&&o.replaceChild(n.firstChild,n),i}}return r.EMPTY},Zn=function(A,e,t){var n=A.ownerDocument;if(!n)throw new Error("Node has no owner document");var o=n.createRange();return o.setStart(A,e),o.setEnd(A,e+t),o},$n=function(A){if(Jn.SUPPORT_NATIVE_TEXT_SEGMENTATION){var e=new Intl.Segmenter(void 0,{granularity:"grapheme"});return Array.from(e.segment(A)).map(function(A){return A.segment})}return function(A){for(var e,t=Wn(A),n=[];!(e=t.next()).done;)e.value&&n.push(e.value.slice());return n}(A)},Ao=function(A,e){return 0!==e.letterSpacing?$n(A):function(A,e){if(Jn.SUPPORT_NATIVE_TEXT_SEGMENTATION){var t=new Intl.Segmenter(void 0,{granularity:"word"});return Array.from(t.segment(A)).map(function(A){return A.segment})}return to(A,e)}(A,e)},eo=[32,160,4961,65792,65793,4153,4241],to=function(A,e){for(var t,n=function(A,e){var t=a(A),n=iA(t,e),o=n[0],i=n[1],r=n[2],s=t.length,c=0,l=0;return{next:function(){if(l>=s)return{done:!0,value:null};for(var A=j;l<s&&(A=oA(t,i,o,++l,r))===j;);if(A!==j||l===s){var e=new rA(t,A,c,l);return c=l,{value:e,done:!1}}return{done:!0,value:null}}}}(A,{lineBreak:e.lineBreak,wordBreak:"break-word"===e.overflowWrap?"break-word":e.wordBreak}),o=[],i=function(){if(t.value){var A=t.value.slice(),e=a(A),n="";e.forEach(function(A){-1===eo.indexOf(A)?n+=c(A):(n.length&&o.push(n),o.push(c(A)),n="")}),n.length&&o.push(n)}};!(t=n.next()).done;)i();return o},no=function(A,e,t){this.text=oo(e.data,t.textTransform),this.textBounds=function(A,e,t,n){var o=Ao(e,t),i=[],s=0;return o.forEach(function(e){if(t.textDecorationLine.length||e.trim().length>0)if(Jn.SUPPORT_RANGE_BOUNDS){var o=Zn(n,s,e.length).getClientRects();if(o.length>1){var a=$n(e),c=0;a.forEach(function(e){i.push(new Yn(e,r.fromDOMRectList(A,Zn(n,c+s,e.length).getClientRects()))),c+=e.length})}else i.push(new Yn(e,r.fromDOMRectList(A,o)))}else{var l=n.splitText(e.length);i.push(new Yn(e,qn(A,n))),n=l}else Jn.SUPPORT_RANGE_BOUNDS||(n=n.splitText(e.length));s+=e.length}),i}(A,this.text,t,e)},oo=function(A,e){switch(e){case 1:return A.toLowerCase();case 3:return A.replace(io,ro);case 2:return A.toUpperCase();default:return A}},io=/(^|\s|:|-|\(|\))([a-z])/g,ro=function(A,e,t){return A.length>0?e+t.toUpperCase():A},so=function(A){function t(e,t){var n=A.call(this,e,t)||this;return n.src=t.currentSrc||t.src,n.intrinsicWidth=t.naturalWidth,n.intrinsicHeight=t.naturalHeight,n.context.cache.addImage(n.src),n}return e(t,A),t}(Fn),ao=function(A){function t(e,t){var n=A.call(this,e,t)||this;return n.canvas=t,n.intrinsicWidth=t.width,n.intrinsicHeight=t.height,n}return e(t,A),t}(Fn),co=function(A){function t(e,t){var n=A.call(this,e,t)||this,o=new XMLSerializer,i=s(e,t);return t.setAttribute("width",i.width+"px"),t.setAttribute("height",i.height+"px"),n.svg="data:image/svg+xml,"+encodeURIComponent(o.serializeToString(t)),n.intrinsicWidth=t.width.baseVal.value,n.intrinsicHeight=t.height.baseVal.value,n.context.cache.addImage(n.svg),n}return e(t,A),t}(Fn),lo=function(A){function t(e,t){var n=A.call(this,e,t)||this;return n.value=t.value,n}return e(t,A),t}(Fn),uo=function(A){function t(e,t){var n=A.call(this,e,t)||this;return n.start=t.start,n.reversed="boolean"==typeof t.reversed&&!0===t.reversed,n}return e(t,A),t}(Fn),go=[{type:15,flags:0,unit:"px",number:3}],po=[{type:16,flags:0,number:50}],ho="checkbox",Bo="radio",mo="password",fo=707406591,vo=function(A){function t(e,t){var n,o,i,s=A.call(this,e,t)||this;switch(s.type=t.type.toLowerCase(),s.checked=t.checked,s.value=0===(i=(o=t).type===mo?new Array(o.value.length+1).join("•"):o.value).length?o.placeholder||"":i,s.type!==ho&&s.type!==Bo||(s.styles.backgroundColor=3739148031,s.styles.borderTopColor=s.styles.borderRightColor=s.styles.borderBottomColor=s.styles.borderLeftColor=2779096575,s.styles.borderTopWidth=s.styles.borderRightWidth=s.styles.borderBottomWidth=s.styles.borderLeftWidth=1,s.styles.borderTopStyle=s.styles.borderRightStyle=s.styles.borderBottomStyle=s.styles.borderLeftStyle=1,s.styles.backgroundClip=[0],s.styles.backgroundOrigin=[0],s.bounds=(n=s.bounds).width>n.height?new r(n.left+(n.width-n.height)/2,n.top,n.height,n.height):n.width<n.height?new r(n.left,n.top+(n.height-n.width)/2,n.width,n.width):n),s.type){case ho:s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=go;break;case Bo:s.styles.borderTopRightRadius=s.styles.borderTopLeftRadius=s.styles.borderBottomRightRadius=s.styles.borderBottomLeftRadius=po}return s}return e(t,A),t}(Fn),wo=function(A){function t(e,t){var n=A.call(this,e,t)||this,o=t.options[t.selectedIndex||0];return n.value=o&&o.text||"",n}return e(t,A),t}(Fn),Co=function(A){function t(e,t){var n=A.call(this,e,t)||this;return n.value=t.value,n}return e(t,A),t}(Fn),yo=function(A){function t(e,t){var n=A.call(this,e,t)||this;n.src=t.src,n.width=parseInt(t.width,10)||0,n.height=parseInt(t.height,10)||0,n.backgroundColor=n.styles.backgroundColor;try{if(t.contentWindow&&t.contentWindow.document&&t.contentWindow.document.documentElement){n.tree=Fo(e,t.contentWindow.document.documentElement);var o=t.contentWindow.document.documentElement?Ce(e,getComputedStyle(t.contentWindow.document.documentElement).backgroundColor):ye.TRANSPARENT,i=t.contentWindow.document.body?Ce(e,getComputedStyle(t.contentWindow.document.body).backgroundColor):ye.TRANSPARENT;n.backgroundColor=ge(o)?ge(i)?n.styles.backgroundColor:i:o}}catch(A){}return n}return e(t,A),t}(Fn),bo=["OL","UL","MENU"],xo=function(A,e,t,n){for(var o=e.firstChild,i=void 0;o;o=i)if(i=o.nextSibling,Io(o)&&o.data.trim().length>0)t.textNodes.push(new no(A,o,t.styles));else if(Eo(o))if(Wo(o)&&o.assignedNodes)o.assignedNodes().forEach(function(e){return xo(A,e,t,n)});else{var r=Qo(A,o);r.styles.isVisible()&&(Uo(o,r,n)?r.flags|=4:So(r.styles)&&(r.flags|=2),-1!==bo.indexOf(o.tagName)&&(r.flags|=8),t.elements.push(r),o.slot,o.shadowRoot?xo(A,o.shadowRoot,r,n):No(o)||Lo(o)||Go(o)||xo(A,o,r,n))}},Qo=function(A,e){return Oo(e)?new so(A,e):Ro(e)?new ao(A,e):Lo(e)?new co(A,e):To(e)?new lo(A,e):Do(e)?new uo(A,e):Ko(e)?new vo(A,e):Go(e)?new wo(A,e):No(e)?new Co(A,e):Vo(e)?new yo(A,e):new Fn(A,e)},Fo=function(A,e){var t=Qo(A,e);return t.flags|=4,xo(A,e,t,t),t},Uo=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||Mo(A)&&t.styles.isTransparent()},So=function(A){return A.isPositioned()||A.isFloating()},Io=function(A){return A.nodeType===Node.TEXT_NODE},Eo=function(A){return A.nodeType===Node.ELEMENT_NODE},ko=function(A){return Eo(A)&&void 0!==A.style&&!Ho(A)},Ho=function(A){return"object"==typeof A.className},To=function(A){return"LI"===A.tagName},Do=function(A){return"OL"===A.tagName},Ko=function(A){return"INPUT"===A.tagName},Lo=function(A){return"svg"===A.tagName},Mo=function(A){return"BODY"===A.tagName},Ro=function(A){return"CANVAS"===A.tagName},Po=function(A){return"VIDEO"===A.tagName},Oo=function(A){return"IMG"===A.tagName},Vo=function(A){return"IFRAME"===A.tagName},_o=function(A){return"STYLE"===A.tagName},No=function(A){return"TEXTAREA"===A.tagName},Go=function(A){return"SELECT"===A.tagName},Wo=function(A){return"SLOT"===A.tagName},jo=function(A){return A.tagName.indexOf("-")>0},zo=function(){function A(){this.counters={}}return A.prototype.getCounterValue=function(A){var e=this.counters[A];return e&&e.length?e[e.length-1]:1},A.prototype.getCounterValues=function(A){return this.counters[A]||[]},A.prototype.pop=function(A){var e=this;A.forEach(function(A){return e.counters[A].pop()})},A.prototype.parse=function(A){var e=this,t=A.counterIncrement,n=A.counterReset,o=!0;null!==t&&t.forEach(function(A){var t=e.counters[A.counter];t&&0!==A.increment&&(o=!1,t.length||t.push(1),t[Math.max(0,t.length-1)]+=A.increment)});var i=[];return o&&n.forEach(function(A){var t=e.counters[A.counter];i.push(A.counter),t||(t=e.counters[A.counter]=[]),t.push(A.reset)}),i},A}(),Xo={integers:[1e3,900,500,400,100,90,50,40,10,9,5,4,1],values:["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]},Jo={integers:[9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},Yo={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,400,300,200,100,90,80,70,60,50,40,30,20,19,18,17,16,15,10,9,8,7,6,5,4,3,2,1],values:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},qo={integers:[1e4,9e3,8e3,7e3,6e3,5e3,4e3,3e3,2e3,1e3,900,800,700,600,500,400,300,200,100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1],values:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},Zo=function(A,e,t,n,o,i){return A<e||A>t?si(A,o,i.length>0):n.integers.reduce(function(e,t,o){for(;A>=t;)A-=t,e+=n.values[o];return e},"")+i},$o=function(A,e,t,n){var o="";do{t||A--,o=n(A)+o,A/=e}while(A*e>=e);return o},Ai=function(A,e,t,n,o){var i=t-e+1;return(A<0?"-":"")+($o(Math.abs(A),i,n,function(A){return c(Math.floor(A%i)+e)})+o)},ei=function(A,e,t){void 0===t&&(t=". ");var n=e.length;return $o(Math.abs(A),n,!1,function(A){return e[Math.floor(A%n)]})+t},ti=function(A,e,t,n,o,i){if(A<-9999||A>9999)return si(A,4,o.length>0);var r=Math.abs(A),s=o;if(0===r)return e[0]+s;for(var a=0;r>0&&a<=4;a++){var c=r%10;0===c&&ln(i,1)&&""!==s?s=e[c]+s:c>1||1===c&&0===a||1===c&&1===a&&ln(i,2)||1===c&&1===a&&ln(i,4)&&A>100||1===c&&a>1&&ln(i,8)?s=e[c]+(a>0?t[a-1]:"")+s:1===c&&a>0&&(s=t[a-1]+s),r=Math.floor(r/10)}return(A<0?n:"")+s},ni="十百千萬",oi="拾佰仟萬",ii="マイナス",ri="마이너스",si=function(A,e,t){var n=t?". ":"",o=t?"、":"",i=t?", ":"",r=t?" ":"";switch(e){case 0:return"•"+r;case 1:return"◦"+r;case 2:return"◾"+r;case 5:var s=Ai(A,48,57,!0,n);return s.length<4?"0"+s:s;case 4:return ei(A,"〇一二三四五六七八九",o);case 6:return Zo(A,1,3999,Xo,3,n).toLowerCase();case 7:return Zo(A,1,3999,Xo,3,n);case 8:return Ai(A,945,969,!1,n);case 9:return Ai(A,97,122,!1,n);case 10:return Ai(A,65,90,!1,n);case 11:return Ai(A,1632,1641,!0,n);case 12:case 49:return Zo(A,1,9999,Jo,3,n);case 35:return Zo(A,1,9999,Jo,3,n).toLowerCase();case 13:return Ai(A,2534,2543,!0,n);case 14:case 30:return Ai(A,6112,6121,!0,n);case 15:return ei(A,"子丑寅卯辰巳午未申酉戌亥",o);case 16:return ei(A,"甲乙丙丁戊己庚辛壬癸",o);case 17:case 48:return ti(A,"零一二三四五六七八九",ni,"負",o,14);case 47:return ti(A,"零壹貳參肆伍陸柒捌玖",oi,"負",o,15);case 42:return ti(A,"零一二三四五六七八九",ni,"负",o,14);case 41:return ti(A,"零壹贰叁肆伍陆柒捌玖",oi,"负",o,15);case 26:return ti(A,"〇一二三四五六七八九","十百千万",ii,o,0);case 25:return ti(A,"零壱弐参四伍六七八九","拾百千万",ii,o,7);case 31:return ti(A,"영일이삼사오육칠팔구","십백천만",ri,i,7);case 33:return ti(A,"零一二三四五六七八九","十百千萬",ri,i,0);case 32:return ti(A,"零壹貳參四五六七八九","拾百千",ri,i,7);case 18:return Ai(A,2406,2415,!0,n);case 20:return Zo(A,1,19999,qo,3,n);case 21:return Ai(A,2790,2799,!0,n);case 22:return Ai(A,2662,2671,!0,n);case 22:return Zo(A,1,10999,Yo,3,n);case 23:return ei(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return ei(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return Ai(A,3302,3311,!0,n);case 28:return ei(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",o);case 29:return ei(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",o);case 34:return Ai(A,3792,3801,!0,n);case 37:return Ai(A,6160,6169,!0,n);case 38:return Ai(A,4160,4169,!0,n);case 39:return Ai(A,2918,2927,!0,n);case 40:return Ai(A,1776,1785,!0,n);case 43:return Ai(A,3046,3055,!0,n);case 44:return Ai(A,3174,3183,!0,n);case 45:return Ai(A,3664,3673,!0,n);case 46:return Ai(A,3872,3881,!0,n);default:return Ai(A,48,57,!0,n)}},ai="data-html2canvas-ignore",ci=function(){function A(A,e,t){if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new zo,this.quoteDepth=0,!e.ownerDocument)throw new Error("Cloned element does not have an owner document");this.documentElement=this.cloneNode(e.ownerDocument.documentElement,!1)}return A.prototype.toIFrame=function(A,e){var t=this,i=di(A,e);if(!i.contentWindow)return Promise.reject("Unable to find iframe window");var r=A.defaultView.pageXOffset,s=A.defaultView.pageYOffset,a=i.contentWindow,c=a.document,l=pi(i).then(function(){return n(t,void 0,void 0,function(){var A,t;return o(this,function(n){switch(n.label){case 0:return this.scrolledElements.forEach(vi),a&&(a.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||a.scrollY===e.top&&a.scrollX===e.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(a.scrollX-e.left,a.scrollY-e.top,0,0))),A=this.options.onclone,void 0===(t=this.clonedReferenceElement)?[2,Promise.reject("Error finding the "+this.referenceElement.nodeName+" in the cloned document")]:c.fonts&&c.fonts.ready?[4,c.fonts.ready]:[3,2];case 1:n.sent(),n.label=2;case 2:return/(AppleWebKit)/g.test(navigator.userAgent)?[4,gi(c)]:[3,4];case 3:n.sent(),n.label=4;case 4:return"function"==typeof A?[2,Promise.resolve().then(function(){return A(c,t)}).then(function(){return i})]:[2,i]}})})});return c.open(),c.write(mi(document.doctype)+"<html></html>"),fi(this.referenceElement.ownerDocument,r,s),c.replaceChild(c.adoptNode(this.documentElement),c.documentElement),c.close(),l},A.prototype.createElementClone=function(A){if(Qn(A,2),Ro(A))return this.createCanvasClone(A);if(Po(A))return this.createVideoClone(A);if(_o(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return Oo(e)&&(Oo(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),"lazy"===e.loading&&(e.loading="eager")),jo(e)?this.createCustomElementClone(e):e},A.prototype.createCustomElementClone=function(A){var e=document.createElement("html2canvascustomelement");return Bi(A.style,e),e},A.prototype.createStyleClone=function(A){try{var e=A.sheet;if(e&&e.cssRules){var t=[].slice.call(e.cssRules,0).reduce(function(A,e){return e&&"string"==typeof e.cssText?A+e.cssText:A},""),n=A.cloneNode(!1);return n.textContent=t,n}}catch(A){if(this.context.logger.error("Unable to access cssRules property",A),"SecurityError"!==A.name)throw A}return A.cloneNode(!1)},A.prototype.createCanvasClone=function(A){var e;if(this.options.inlineImages&&A.ownerDocument){var t=A.ownerDocument.createElement("img");try{return t.src=A.toDataURL(),t}catch(e){this.context.logger.info("Unable to inline canvas contents, canvas is tainted",A)}}var n=A.cloneNode(!1);try{n.width=A.width,n.height=A.height;var o=A.getContext("2d"),i=n.getContext("2d");if(i)if(!this.options.allowTaint&&o)i.putImageData(o.getImageData(0,0,A.width,A.height),0,0);else{var r=null!==(e=A.getContext("webgl2"))&&void 0!==e?e:A.getContext("webgl");if(r){var s=r.getContextAttributes();!1===(null==s?void 0:s.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",A)}i.drawImage(A,0,0)}return n}catch(e){this.context.logger.info("Unable to clone canvas as it is tainted",A)}return n},A.prototype.createVideoClone=function(A){var e=A.ownerDocument.createElement("canvas");e.width=A.offsetWidth,e.height=A.offsetHeight;var t=e.getContext("2d");try{return t&&(t.drawImage(A,0,0,e.width,e.height),this.options.allowTaint||t.getImageData(0,0,e.width,e.height)),e}catch(e){this.context.logger.info("Unable to clone video as it is tainted",A)}var n=A.ownerDocument.createElement("canvas");return n.width=A.offsetWidth,n.height=A.offsetHeight,n},A.prototype.appendChildNode=function(A,e,t){Eo(e)&&("SCRIPT"===e.tagName||e.hasAttribute(ai)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(e))||this.options.copyStyles&&Eo(e)&&_o(e)||A.appendChild(this.cloneNode(e,t))},A.prototype.cloneChildNodes=function(A,e,t){for(var n=this,o=A.shadowRoot?A.shadowRoot.firstChild:A.firstChild;o;o=o.nextSibling)if(Eo(o)&&Wo(o)&&"function"==typeof o.assignedNodes){var i=o.assignedNodes();i.length&&i.forEach(function(A){return n.appendChildNode(e,A,t)})}else this.appendChildNode(e,o,t)},A.prototype.cloneNode=function(A,e){if(Io(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var t=A.ownerDocument.defaultView;if(t&&Eo(A)&&(ko(A)||Ho(A))){var n=this.createElementClone(A);n.style.transitionProperty="none";var o=t.getComputedStyle(A),i=t.getComputedStyle(A,":before"),r=t.getComputedStyle(A,":after");this.referenceElement===A&&ko(n)&&(this.clonedReferenceElement=n),Mo(n)&&bi(n);var s=this.counters.parse(new bn(this.context,o)),a=this.resolvePseudoContent(A,n,i,Kn.BEFORE);jo(A)&&(e=!0),Po(A)||this.cloneChildNodes(A,n,e),a&&n.insertBefore(a,n.firstChild);var c=this.resolvePseudoContent(A,n,r,Kn.AFTER);return c&&n.appendChild(c),this.counters.pop(s),(o&&(this.options.copyStyles||Ho(A))&&!Vo(A)||e)&&Bi(o,n),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([n,A.scrollLeft,A.scrollTop]),(No(A)||Go(A))&&(No(n)||Go(n))&&(n.value=A.value),n}return A.cloneNode(!1)},A.prototype.resolvePseudoContent=function(A,e,t,n){var o=this;if(t){var i=t.content,r=e.ownerDocument;if(r&&i&&"none"!==i&&"-moz-alt-content"!==i&&"none"!==t.display){this.counters.parse(new bn(this.context,t));var s=new yn(this.context,t),a=r.createElement("html2canvaspseudoelement");Bi(t,a),s.content.forEach(function(e){if(0===e.type)a.appendChild(r.createTextNode(e.value));else if(22===e.type){var t=r.createElement("img");t.src=e.value,t.style.opacity="1",a.appendChild(t)}else if(18===e.type){if("attr"===e.name){var n=e.values.filter(WA);n.length&&a.appendChild(r.createTextNode(A.getAttribute(n[0].value)||""))}else if("counter"===e.name){var i=e.values.filter(JA),c=i[0],l=i[1];if(c&&WA(c)){var d=o.counters.getCounterValue(c.value),u=l&&WA(l)?It.parse(o.context,l.value):3;a.appendChild(r.createTextNode(si(d,u,!1)))}}else if("counters"===e.name){var g=e.values.filter(JA),p=(c=g[0],g[1]);if(l=g[2],c&&WA(c)){var h=o.counters.getCounterValues(c.value),B=l&&WA(l)?It.parse(o.context,l.value):3,m=p&&0===p.type?p.value:"",f=h.map(function(A){return si(A,B,!1)}).join(m);a.appendChild(r.createTextNode(f))}}}else if(20===e.type)switch(e.value){case"open-quote":a.appendChild(r.createTextNode(Bn(s.quotes,o.quoteDepth++,!0)));break;case"close-quote":a.appendChild(r.createTextNode(Bn(s.quotes,--o.quoteDepth,!1)));break;default:a.appendChild(r.createTextNode(e.value))}}),a.className=wi+" "+Ci;var c=n===Kn.BEFORE?" "+wi:" "+Ci;return Ho(e)?e.className.baseValue+=c:e.className+=c,a}}},A.destroy=function(A){return!!A.parentNode&&(A.parentNode.removeChild(A),!0)},A}();!function(A){A[A.BEFORE=0]="BEFORE",A[A.AFTER=1]="AFTER"}(Kn||(Kn={}));var li,di=function(A,e){var t=A.createElement("iframe");return t.className="html2canvas-container",t.style.visibility="hidden",t.style.position="fixed",t.style.left="-10000px",t.style.top="0px",t.style.border="0",t.width=e.width.toString(),t.height=e.height.toString(),t.scrolling="no",t.setAttribute(ai,"true"),A.body.appendChild(t),t},ui=function(A){return new Promise(function(e){A.complete?e():A.src?(A.onload=e,A.onerror=e):e()})},gi=function(A){return Promise.all([].slice.call(A.images,0).map(ui))},pi=function(A){return new Promise(function(e,t){var n=A.contentWindow;if(!n)return t("No window assigned for iframe");var o=n.document;n.onload=A.onload=function(){n.onload=A.onload=null;var t=setInterval(function(){o.body.childNodes.length>0&&"complete"===o.readyState&&(clearInterval(t),e(A))},50)}})},hi=["all","d","content"],Bi=function(A,e){for(var t=A.length-1;t>=0;t--){var n=A.item(t);-1===hi.indexOf(n)&&e.style.setProperty(n,A.getPropertyValue(n))}return e},mi=function(A){var e="";return A&&(e+="<!DOCTYPE ",A.name&&(e+=A.name),A.internalSubset&&(e+=A.internalSubset),A.publicId&&(e+='"'+A.publicId+'"'),A.systemId&&(e+='"'+A.systemId+'"'),e+=">"),e},fi=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},vi=function(A){var e=A[0],t=A[1],n=A[2];e.scrollLeft=t,e.scrollTop=n},wi="___html2canvas___pseudoelement_before",Ci="___html2canvas___pseudoelement_after",yi='{\n content: "" !important;\n display: none !important;\n}',bi=function(A){xi(A,"."+wi+":before"+yi+"\n ."+Ci+":after"+yi)},xi=function(A,e){var t=A.ownerDocument;if(t){var n=t.createElement("style");n.textContent=e,A.appendChild(n)}},Qi=function(){function A(){}return A.getOrigin=function(e){var t=A._link;return t?(t.href=e,t.href=t.href,t.protocol+t.hostname+t.port):"about:blank"},A.isSameOrigin=function(e){return A.getOrigin(e)===A._origin},A.setContext=function(e){A._link=e.document.createElement("a"),A._origin=A.getOrigin(e.location.href)},A._origin="about:blank",A}(),Fi=function(){function A(A,e){this.context=A,this._options=e,this._cache={}}return A.prototype.addImage=function(A){var e=Promise.resolve();return this.has(A)?e:Ti(A)||Ei(A)?((this._cache[A]=this.loadImage(A)).catch(function(){}),e):e},A.prototype.match=function(A){return this._cache[A]},A.prototype.loadImage=function(A){return n(this,void 0,void 0,function(){var e,t,n,i,r=this;return o(this,function(o){switch(o.label){case 0:return e=Qi.isSameOrigin(A),t=!ki(A)&&!0===this._options.useCORS&&Jn.SUPPORT_CORS_IMAGES&&!e,n=!ki(A)&&!e&&!Ti(A)&&"string"==typeof this._options.proxy&&Jn.SUPPORT_CORS_XHR&&!t,e||!1!==this._options.allowTaint||ki(A)||Ti(A)||n||t?(i=A,n?[4,this.proxy(i)]:[3,2]):[2];case 1:i=o.sent(),o.label=2;case 2:return this.context.logger.debug("Added image "+A.substring(0,256)),[4,new Promise(function(A,e){var n=new Image;n.onload=function(){return A(n)},n.onerror=e,(Hi(i)||t)&&(n.crossOrigin="anonymous"),n.src=i,!0===n.complete&&setTimeout(function(){return A(n)},500),r._options.imageTimeout>0&&setTimeout(function(){return e("Timed out ("+r._options.imageTimeout+"ms) loading image")},r._options.imageTimeout)})];case 3:return[2,o.sent()]}})})},A.prototype.has=function(A){return void 0!==this._cache[A]},A.prototype.keys=function(){return Promise.resolve(Object.keys(this._cache))},A.prototype.proxy=function(A){var e=this,t=this._options.proxy;if(!t)throw new Error("No proxy defined");var n=A.substring(0,256);return new Promise(function(o,i){var r=Jn.SUPPORT_RESPONSE_TYPE?"blob":"text",s=new XMLHttpRequest;s.onload=function(){if(200===s.status)if("text"===r)o(s.response);else{var A=new FileReader;A.addEventListener("load",function(){return o(A.result)},!1),A.addEventListener("error",function(A){return i(A)},!1),A.readAsDataURL(s.response)}else i("Failed to proxy resource "+n+" with status code "+s.status)},s.onerror=i;var a=t.indexOf("?")>-1?"&":"?";if(s.open("GET",""+t+a+"url="+encodeURIComponent(A)+"&responseType="+r),"text"!==r&&s instanceof XMLHttpRequest&&(s.responseType=r),e._options.imageTimeout){var c=e._options.imageTimeout;s.timeout=c,s.ontimeout=function(){return i("Timed out ("+c+"ms) proxying "+n)}}s.send()})},A}(),Ui=/^data:image\/svg\+xml/i,Si=/^data:image\/.*;base64,/i,Ii=/^data:image\/.*/i,Ei=function(A){return Jn.SUPPORT_SVG_DRAWING||!Di(A)},ki=function(A){return Ii.test(A)},Hi=function(A){return Si.test(A)},Ti=function(A){return"blob"===A.substr(0,4)},Di=function(A){return"svg"===A.substr(-3).toLowerCase()||Ui.test(A)},Ki=function(){function A(A,e){this.type=0,this.x=A,this.y=e}return A.prototype.add=function(e,t){return new A(this.x+e,this.y+t)},A}(),Li=function(A,e,t){return new Ki(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)},Mi=function(){function A(A,e,t,n){this.type=1,this.start=A,this.startControl=e,this.endControl=t,this.end=n}return A.prototype.subdivide=function(e,t){var n=Li(this.start,this.startControl,e),o=Li(this.startControl,this.endControl,e),i=Li(this.endControl,this.end,e),r=Li(n,o,e),s=Li(o,i,e),a=Li(r,s,e);return t?new A(this.start,n,r,a):new A(a,s,i,this.end)},A.prototype.add=function(e,t){return new A(this.start.add(e,t),this.startControl.add(e,t),this.endControl.add(e,t),this.end.add(e,t))},A.prototype.reverse=function(){return new A(this.end,this.endControl,this.startControl,this.start)},A}(),Ri=function(A){return 1===A.type},Pi=function(A){var e=A.styles,t=A.bounds,n=oe(e.borderTopLeftRadius,t.width,t.height),o=n[0],i=n[1],r=oe(e.borderTopRightRadius,t.width,t.height),s=r[0],a=r[1],c=oe(e.borderBottomRightRadius,t.width,t.height),l=c[0],d=c[1],u=oe(e.borderBottomLeftRadius,t.width,t.height),g=u[0],p=u[1],h=[];h.push((o+s)/t.width),h.push((g+l)/t.width),h.push((i+p)/t.height),h.push((a+d)/t.height);var B=Math.max.apply(Math,h);B>1&&(o/=B,i/=B,s/=B,a/=B,l/=B,d/=B,g/=B,p/=B);var m=t.width-s,f=t.height-d,v=t.width-l,w=t.height-p,C=e.borderTopWidth,y=e.borderRightWidth,b=e.borderBottomWidth,x=e.borderLeftWidth,Q=ie(e.paddingTop,A.bounds.width),F=ie(e.paddingRight,A.bounds.width),U=ie(e.paddingBottom,A.bounds.width),S=ie(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=o>0||i>0?Oi(t.left+x/3,t.top+C/3,o-x/3,i-C/3,li.TOP_LEFT):new Ki(t.left+x/3,t.top+C/3),this.topRightBorderDoubleOuterBox=o>0||i>0?Oi(t.left+m,t.top+C/3,s-y/3,a-C/3,li.TOP_RIGHT):new Ki(t.left+t.width-y/3,t.top+C/3),this.bottomRightBorderDoubleOuterBox=l>0||d>0?Oi(t.left+v,t.top+f,l-y/3,d-b/3,li.BOTTOM_RIGHT):new Ki(t.left+t.width-y/3,t.top+t.height-b/3),this.bottomLeftBorderDoubleOuterBox=g>0||p>0?Oi(t.left+x/3,t.top+w,g-x/3,p-b/3,li.BOTTOM_LEFT):new Ki(t.left+x/3,t.top+t.height-b/3),this.topLeftBorderDoubleInnerBox=o>0||i>0?Oi(t.left+2*x/3,t.top+2*C/3,o-2*x/3,i-2*C/3,li.TOP_LEFT):new Ki(t.left+2*x/3,t.top+2*C/3),this.topRightBorderDoubleInnerBox=o>0||i>0?Oi(t.left+m,t.top+2*C/3,s-2*y/3,a-2*C/3,li.TOP_RIGHT):new Ki(t.left+t.width-2*y/3,t.top+2*C/3),this.bottomRightBorderDoubleInnerBox=l>0||d>0?Oi(t.left+v,t.top+f,l-2*y/3,d-2*b/3,li.BOTTOM_RIGHT):new Ki(t.left+t.width-2*y/3,t.top+t.height-2*b/3),this.bottomLeftBorderDoubleInnerBox=g>0||p>0?Oi(t.left+2*x/3,t.top+w,g-2*x/3,p-2*b/3,li.BOTTOM_LEFT):new Ki(t.left+2*x/3,t.top+t.height-2*b/3),this.topLeftBorderStroke=o>0||i>0?Oi(t.left+x/2,t.top+C/2,o-x/2,i-C/2,li.TOP_LEFT):new Ki(t.left+x/2,t.top+C/2),this.topRightBorderStroke=o>0||i>0?Oi(t.left+m,t.top+C/2,s-y/2,a-C/2,li.TOP_RIGHT):new Ki(t.left+t.width-y/2,t.top+C/2),this.bottomRightBorderStroke=l>0||d>0?Oi(t.left+v,t.top+f,l-y/2,d-b/2,li.BOTTOM_RIGHT):new Ki(t.left+t.width-y/2,t.top+t.height-b/2),this.bottomLeftBorderStroke=g>0||p>0?Oi(t.left+x/2,t.top+w,g-x/2,p-b/2,li.BOTTOM_LEFT):new Ki(t.left+x/2,t.top+t.height-b/2),this.topLeftBorderBox=o>0||i>0?Oi(t.left,t.top,o,i,li.TOP_LEFT):new Ki(t.left,t.top),this.topRightBorderBox=s>0||a>0?Oi(t.left+m,t.top,s,a,li.TOP_RIGHT):new Ki(t.left+t.width,t.top),this.bottomRightBorderBox=l>0||d>0?Oi(t.left+v,t.top+f,l,d,li.BOTTOM_RIGHT):new Ki(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=g>0||p>0?Oi(t.left,t.top+w,g,p,li.BOTTOM_LEFT):new Ki(t.left,t.top+t.height),this.topLeftPaddingBox=o>0||i>0?Oi(t.left+x,t.top+C,Math.max(0,o-x),Math.max(0,i-C),li.TOP_LEFT):new Ki(t.left+x,t.top+C),this.topRightPaddingBox=s>0||a>0?Oi(t.left+Math.min(m,t.width-y),t.top+C,m>t.width+y?0:Math.max(0,s-y),Math.max(0,a-C),li.TOP_RIGHT):new Ki(t.left+t.width-y,t.top+C),this.bottomRightPaddingBox=l>0||d>0?Oi(t.left+Math.min(v,t.width-x),t.top+Math.min(f,t.height-b),Math.max(0,l-y),Math.max(0,d-b),li.BOTTOM_RIGHT):new Ki(t.left+t.width-y,t.top+t.height-b),this.bottomLeftPaddingBox=g>0||p>0?Oi(t.left+x,t.top+Math.min(w,t.height-b),Math.max(0,g-x),Math.max(0,p-b),li.BOTTOM_LEFT):new Ki(t.left+x,t.top+t.height-b),this.topLeftContentBox=o>0||i>0?Oi(t.left+x+S,t.top+C+Q,Math.max(0,o-(x+S)),Math.max(0,i-(C+Q)),li.TOP_LEFT):new Ki(t.left+x+S,t.top+C+Q),this.topRightContentBox=s>0||a>0?Oi(t.left+Math.min(m,t.width+x+S),t.top+C+Q,m>t.width+x+S?0:s-x+S,a-(C+Q),li.TOP_RIGHT):new Ki(t.left+t.width-(y+F),t.top+C+Q),this.bottomRightContentBox=l>0||d>0?Oi(t.left+Math.min(v,t.width-(x+S)),t.top+Math.min(f,t.height+C+Q),Math.max(0,l-(y+F)),d-(b+U),li.BOTTOM_RIGHT):new Ki(t.left+t.width-(y+F),t.top+t.height-(b+U)),this.bottomLeftContentBox=g>0||p>0?Oi(t.left+x+S,t.top+w,Math.max(0,g-(x+S)),p-(b+U),li.BOTTOM_LEFT):new Ki(t.left+x+S,t.top+t.height-(b+U))};!function(A){A[A.TOP_LEFT=0]="TOP_LEFT",A[A.TOP_RIGHT=1]="TOP_RIGHT",A[A.BOTTOM_RIGHT=2]="BOTTOM_RIGHT",A[A.BOTTOM_LEFT=3]="BOTTOM_LEFT"}(li||(li={}));var Oi=function(A,e,t,n,o){var i=(Math.sqrt(2)-1)/3*4,r=t*i,s=n*i,a=A+t,c=e+n;switch(o){case li.TOP_LEFT:return new Mi(new Ki(A,c),new Ki(A,c-s),new Ki(a-r,e),new Ki(a,e));case li.TOP_RIGHT:return new Mi(new Ki(A,e),new Ki(A+r,e),new Ki(a,c-s),new Ki(a,c));case li.BOTTOM_RIGHT:return new Mi(new Ki(a,e),new Ki(a,e+s),new Ki(A+r,c),new Ki(A,c));case li.BOTTOM_LEFT:default:return new Mi(new Ki(a,c),new Ki(a-r,c),new Ki(A,e+s),new Ki(A,e))}},Vi=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},_i=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},Ni=function(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6},Gi=function(A,e){this.path=A,this.target=e,this.type=1},Wi=function(A){this.opacity=A,this.type=2,this.target=6},ji=function(A){return 1===A.type},zi=function(A,e){return A.length===e.length&&A.some(function(A,t){return A===e[t]})},Xi=function(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},Ji=function(){function A(A,e){if(this.container=A,this.parent=e,this.effects=[],this.curves=new Pi(this.container),this.container.styles.opacity<1&&this.effects.push(new Wi(this.container.styles.opacity)),null!==this.container.styles.transform){var t=this.container.bounds.left+this.container.styles.transformOrigin[0].number,n=this.container.bounds.top+this.container.styles.transformOrigin[1].number,o=this.container.styles.transform;this.effects.push(new Ni(t,n,o))}if(0!==this.container.styles.overflowX){var i=Vi(this.curves),r=_i(this.curves);zi(i,r)?this.effects.push(new Gi(i,6)):(this.effects.push(new Gi(i,2)),this.effects.push(new Gi(r,4)))}}return A.prototype.getEffects=function(A){for(var e=-1===[2,3].indexOf(this.container.styles.position),t=this.parent,n=this.effects.slice(0);t;){var o=t.effects.filter(function(A){return!ji(A)});if(e||0!==t.container.styles.position||!t.parent){if(n.unshift.apply(n,o),e=-1===[2,3].indexOf(t.container.styles.position),0!==t.container.styles.overflowX){var i=Vi(t.curves),r=_i(t.curves);zi(i,r)||n.unshift(new Gi(r,6))}}else n.unshift.apply(n,o);t=t.parent}return n.filter(function(e){return ln(e.target,A)})},A}(),Yi=function(A,e,t,n){A.container.elements.forEach(function(o){var i=ln(o.flags,4),r=ln(o.flags,2),s=new Ji(o,A);ln(o.styles.display,2048)&&n.push(s);var a=ln(o.flags,8)?[]:n;if(i||r){var c=i||o.styles.isPositioned()?t:e,l=new Xi(s);if(o.styles.isPositioned()||o.styles.opacity<1||o.styles.isTransformed()){var d=o.styles.zIndex.order;if(d<0){var u=0;c.negativeZIndex.some(function(A,e){return d>A.element.container.styles.zIndex.order?(u=e,!1):u>0}),c.negativeZIndex.splice(u,0,l)}else if(d>0){var g=0;c.positiveZIndex.some(function(A,e){return d>=A.element.container.styles.zIndex.order?(g=e+1,!1):g>0}),c.positiveZIndex.splice(g,0,l)}else c.zeroOrAutoZIndexOrTransformedOrOpacity.push(l)}else o.styles.isFloating()?c.nonPositionedFloats.push(l):c.nonPositionedInlineLevel.push(l);Yi(s,l,i?l:t,a)}else o.styles.isInlineLevel()?e.inlineLevel.push(s):e.nonInlineLevel.push(s),Yi(s,e,t,a);ln(o.flags,8)&&qi(o,a)})},qi=function(A,e){for(var t=A instanceof uo?A.start:1,n=A instanceof uo&&A.reversed,o=0;o<e.length;o++){var i=e[o];i.container instanceof lo&&"number"==typeof i.container.value&&0!==i.container.value&&(t=i.container.value),i.listValue=si(t,i.container.styles.listStyleType,!0),t+=n?-1:1}},Zi=function(A,e){switch(e){case 0:return Ar(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return Ar(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return Ar(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return Ar(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},$i=function(A,e){var t=[];return Ri(A)?t.push(A.subdivide(.5,!1)):t.push(A),Ri(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},Ar=function(A,e,t,n){var o=[];return Ri(A)?o.push(A.subdivide(.5,!1)):o.push(A),Ri(t)?o.push(t.subdivide(.5,!0)):o.push(t),Ri(n)?o.push(n.subdivide(.5,!0).reverse()):o.push(n),Ri(e)?o.push(e.subdivide(.5,!1).reverse()):o.push(e),o},er=function(A){var e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},tr=function(A){var e=A.styles,t=A.bounds,n=ie(e.paddingLeft,t.width),o=ie(e.paddingRight,t.width),i=ie(e.paddingTop,t.width),r=ie(e.paddingBottom,t.width);return t.add(n+e.borderLeftWidth,i+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+n+o),-(e.borderTopWidth+e.borderBottomWidth+i+r))},nr=function(A,e,t){var n=function(A,e){return 0===A?e.bounds:2===A?tr(e):er(e)}(sr(A.styles.backgroundOrigin,e),A),o=function(A,e){return 0===A?e.bounds:2===A?tr(e):er(e)}(sr(A.styles.backgroundClip,e),A),i=rr(sr(A.styles.backgroundSize,e),t,n),r=i[0],s=i[1],a=oe(sr(A.styles.backgroundPosition,e),n.width-r,n.height-s);return[ar(sr(A.styles.backgroundRepeat,e),a,i,n,o),Math.round(n.left+a[0]),Math.round(n.top+a[1]),r,s]},or=function(A){return WA(A)&&A.value===Ve.AUTO},ir=function(A){return"number"==typeof A},rr=function(A,e,t){var n=e[0],o=e[1],i=e[2],r=A[0],s=A[1];if(!r)return[0,0];if($A(r)&&s&&$A(s))return[ie(r,t.width),ie(s,t.height)];var a=ir(i);if(WA(r)&&(r.value===Ve.CONTAIN||r.value===Ve.COVER))return ir(i)?t.width/t.height<i!=(r.value===Ve.COVER)?[t.width,t.width/i]:[t.height*i,t.height]:[t.width,t.height];var c=ir(n),l=ir(o),d=c||l;if(or(r)&&(!s||or(s)))return c&&l?[n,o]:a||d?d&&a?[c?n:o*i,l?o:n/i]:[c?n:t.width,l?o:t.height]:[t.width,t.height];if(a){var u=0,g=0;return $A(r)?u=ie(r,t.width):$A(s)&&(g=ie(s,t.height)),or(r)?u=g*i:s&&!or(s)||(g=u/i),[u,g]}var p=null,h=null;if($A(r)?p=ie(r,t.width):s&&$A(s)&&(h=ie(s,t.height)),null===p||s&&!or(s)||(h=c&&l?p/n*o:t.height),null!==h&&or(r)&&(p=c&&l?h/o*n:t.width),null!==p&&null!==h)return[p,h];throw new Error("Unable to calculate background-size for element")},sr=function(A,e){var t=A[e];return void 0===t?A[0]:t},ar=function(A,e,t,n,o){var i=e[0],r=e[1],s=t[0],a=t[1];switch(A){case 2:return[new Ki(Math.round(n.left),Math.round(n.top+r)),new Ki(Math.round(n.left+n.width),Math.round(n.top+r)),new Ki(Math.round(n.left+n.width),Math.round(a+n.top+r)),new Ki(Math.round(n.left),Math.round(a+n.top+r))];case 3:return[new Ki(Math.round(n.left+i),Math.round(n.top)),new Ki(Math.round(n.left+i+s),Math.round(n.top)),new Ki(Math.round(n.left+i+s),Math.round(n.height+n.top)),new Ki(Math.round(n.left+i),Math.round(n.height+n.top))];case 1:return[new Ki(Math.round(n.left+i),Math.round(n.top+r)),new Ki(Math.round(n.left+i+s),Math.round(n.top+r)),new Ki(Math.round(n.left+i+s),Math.round(n.top+r+a)),new Ki(Math.round(n.left+i),Math.round(n.top+r+a))];default:return[new Ki(Math.round(o.left),Math.round(o.top)),new Ki(Math.round(o.left+o.width),Math.round(o.top)),new Ki(Math.round(o.left+o.width),Math.round(o.height+o.top)),new Ki(Math.round(o.left),Math.round(o.height+o.top))]}},cr="Hidden Text",lr=function(){function A(A){this._data={},this._document=A}return A.prototype.parseMetrics=function(A,e){var t=this._document.createElement("div"),n=this._document.createElement("img"),o=this._document.createElement("span"),i=this._document.body;t.style.visibility="hidden",t.style.fontFamily=A,t.style.fontSize=e,t.style.margin="0",t.style.padding="0",t.style.whiteSpace="nowrap",i.appendChild(t),n.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",n.width=1,n.height=1,n.style.margin="0",n.style.padding="0",n.style.verticalAlign="baseline",o.style.fontFamily=A,o.style.fontSize=e,o.style.margin="0",o.style.padding="0",o.appendChild(this._document.createTextNode(cr)),t.appendChild(o),t.appendChild(n);var r=n.offsetTop-o.offsetTop+2;t.removeChild(o),t.appendChild(this._document.createTextNode(cr)),t.style.lineHeight="normal",n.style.verticalAlign="super";var s=n.offsetTop-t.offsetTop+2;return i.removeChild(t),{baseline:r,middle:s}},A.prototype.getMetrics=function(A,e){var t=A+" "+e;return void 0===this._data[t]&&(this._data[t]=this.parseMetrics(A,e)),this._data[t]},A}(),dr=function(A,e){this.context=A,this.options=e},ur=function(A){function t(e,t){var n=A.call(this,e,t)||this;return n._activeEffects=[],n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),t.canvas||(n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width=t.width+"px",n.canvas.style.height=t.height+"px"),n.fontMetrics=new lr(document),n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.ctx.textBaseline="bottom",n._activeEffects=[],n.context.logger.debug("Canvas renderer initialized ("+t.width+"x"+t.height+") with scale "+t.scale),n}return e(t,A),t.prototype.applyEffects=function(A){for(var e=this;this._activeEffects.length;)this.popEffect();A.forEach(function(A){return e.applyEffect(A)})},t.prototype.applyEffect=function(A){this.ctx.save(),function(A){return 2===A.type}(A)&&(this.ctx.globalAlpha=A.opacity),function(A){return 0===A.type}(A)&&(this.ctx.translate(A.offsetX,A.offsetY),this.ctx.transform(A.matrix[0],A.matrix[1],A.matrix[2],A.matrix[3],A.matrix[4],A.matrix[5]),this.ctx.translate(-A.offsetX,-A.offsetY)),ji(A)&&(this.path(A.path),this.ctx.clip()),this._activeEffects.push(A)},t.prototype.popEffect=function(){this._activeEffects.pop(),this.ctx.restore()},t.prototype.renderStack=function(A){return n(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return A.element.container.styles.isVisible()?[4,this.renderStackContent(A)]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}})})},t.prototype.renderNode=function(A){return n(this,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return ln(A.container.flags,16),A.container.styles.isVisible()?[4,this.renderNodeBackgroundAndBorders(A)]:[3,3];case 1:return e.sent(),[4,this.renderNodeContent(A)];case 2:e.sent(),e.label=3;case 3:return[2]}})})},t.prototype.renderTextWithLetterSpacing=function(A,e,t){var n=this;0===e?this.ctx.fillText(A.text,A.bounds.left,A.bounds.top+t):$n(A.text).reduce(function(e,o){return n.ctx.fillText(o,e,A.bounds.top+t),e+n.ctx.measureText(o).width},A.bounds.left)},t.prototype.createFontStyle=function(A){var e=A.fontVariant.filter(function(A){return"normal"===A||"small-caps"===A}).join(""),t=mr(A.fontFamily).join(", "),n=NA(A.fontSize)?""+A.fontSize.number+A.fontSize.unit:A.fontSize.number+"px";return[[A.fontStyle,e,A.fontWeight,n,t].join(" "),t,n]},t.prototype.renderTextNode=function(A,e){return n(this,void 0,void 0,function(){var t,n,i,r,s,a,c,l,d=this;return o(this,function(o){return t=this.createFontStyle(e),n=t[0],i=t[1],r=t[2],this.ctx.font=n,this.ctx.direction=1===e.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",s=this.fontMetrics.getMetrics(i,r),a=s.baseline,c=s.middle,l=e.paintOrder,A.textBounds.forEach(function(A){l.forEach(function(t){switch(t){case 0:d.ctx.fillStyle=pe(e.color),d.renderTextWithLetterSpacing(A,e.letterSpacing,a);var n=e.textShadow;n.length&&A.text.trim().length&&(n.slice(0).reverse().forEach(function(t){d.ctx.shadowColor=pe(t.color),d.ctx.shadowOffsetX=t.offsetX.number*d.options.scale,d.ctx.shadowOffsetY=t.offsetY.number*d.options.scale,d.ctx.shadowBlur=t.blur.number,d.renderTextWithLetterSpacing(A,e.letterSpacing,a)}),d.ctx.shadowColor="",d.ctx.shadowOffsetX=0,d.ctx.shadowOffsetY=0,d.ctx.shadowBlur=0),e.textDecorationLine.length&&(d.ctx.fillStyle=pe(e.textDecorationColor||e.color),e.textDecorationLine.forEach(function(e){switch(e){case 1:d.ctx.fillRect(A.bounds.left,Math.round(A.bounds.top+a),A.bounds.width,1);break;case 2:d.ctx.fillRect(A.bounds.left,Math.round(A.bounds.top),A.bounds.width,1);break;case 3:d.ctx.fillRect(A.bounds.left,Math.ceil(A.bounds.top+c),A.bounds.width,1)}}));break;case 1:e.webkitTextStrokeWidth&&A.text.trim().length&&(d.ctx.strokeStyle=pe(e.webkitTextStrokeColor),d.ctx.lineWidth=e.webkitTextStrokeWidth,d.ctx.lineJoin=window.chrome?"miter":"round",d.ctx.strokeText(A.text,A.bounds.left,A.bounds.top+a)),d.ctx.strokeStyle="",d.ctx.lineWidth=0,d.ctx.lineJoin="miter"}})}),[2]})})},t.prototype.renderReplacedElement=function(A,e,t){if(t&&A.intrinsicWidth>0&&A.intrinsicHeight>0){var n=tr(A),o=_i(e);this.path(o),this.ctx.save(),this.ctx.clip(),this.ctx.drawImage(t,0,0,A.intrinsicWidth,A.intrinsicHeight,n.left,n.top,n.width,n.height),this.ctx.restore()}},t.prototype.renderNodeContent=function(A){return n(this,void 0,void 0,function(){var e,n,i,s,a,c,l,d,u,g,p,h,B,m,f,v,w,C;return o(this,function(o){switch(o.label){case 0:this.applyEffects(A.getEffects(4)),e=A.container,n=A.curves,i=e.styles,s=0,a=e.textNodes,o.label=1;case 1:return s<a.length?(c=a[s],[4,this.renderTextNode(c,i)]):[3,4];case 2:o.sent(),o.label=3;case 3:return s++,[3,1];case 4:if(!(e instanceof so))return[3,8];o.label=5;case 5:return o.trys.push([5,7,,8]),[4,this.context.cache.match(e.src)];case 6:return f=o.sent(),this.renderReplacedElement(e,n,f),[3,8];case 7:return o.sent(),this.context.logger.error("Error loading image "+e.src),[3,8];case 8:if(e instanceof ao&&this.renderReplacedElement(e,n,e.canvas),!(e instanceof co))return[3,12];o.label=9;case 9:return o.trys.push([9,11,,12]),[4,this.context.cache.match(e.svg)];case 10:return f=o.sent(),this.renderReplacedElement(e,n,f),[3,12];case 11:return o.sent(),this.context.logger.error("Error loading svg "+e.svg.substring(0,255)),[3,12];case 12:return e instanceof yo&&e.tree?[4,new t(this.context,{scale:this.options.scale,backgroundColor:e.backgroundColor,x:0,y:0,width:e.width,height:e.height}).render(e.tree)]:[3,14];case 13:l=o.sent(),e.width&&e.height&&this.ctx.drawImage(l,0,0,e.width,e.height,e.bounds.left,e.bounds.top,e.bounds.width,e.bounds.height),o.label=14;case 14:if(e instanceof vo&&(d=Math.min(e.bounds.width,e.bounds.height),e.type===ho?e.checked&&(this.ctx.save(),this.path([new Ki(e.bounds.left+.39363*d,e.bounds.top+.79*d),new Ki(e.bounds.left+.16*d,e.bounds.top+.5549*d),new Ki(e.bounds.left+.27347*d,e.bounds.top+.44071*d),new Ki(e.bounds.left+.39694*d,e.bounds.top+.5649*d),new Ki(e.bounds.left+.72983*d,e.bounds.top+.23*d),new Ki(e.bounds.left+.84*d,e.bounds.top+.34085*d),new Ki(e.bounds.left+.39363*d,e.bounds.top+.79*d)]),this.ctx.fillStyle=pe(fo),this.ctx.fill(),this.ctx.restore()):e.type===Bo&&e.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(e.bounds.left+d/2,e.bounds.top+d/2,d/4,0,2*Math.PI,!0),this.ctx.fillStyle=pe(fo),this.ctx.fill(),this.ctx.restore())),gr(e)&&e.value.length){switch(u=this.createFontStyle(i),w=u[0],g=u[1],p=this.fontMetrics.getMetrics(w,g).baseline,this.ctx.font=w,this.ctx.fillStyle=pe(i.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=hr(e.styles.textAlign),C=tr(e),h=0,e.styles.textAlign){case 1:h+=C.width/2;break;case 2:h+=C.width}B=C.add(h,0,0,-C.height/2+1),this.ctx.save(),this.path([new Ki(C.left,C.top),new Ki(C.left+C.width,C.top),new Ki(C.left+C.width,C.top+C.height),new Ki(C.left,C.top+C.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Yn(e.value,B),i.letterSpacing,p),this.ctx.restore(),this.ctx.textBaseline="alphabetic",this.ctx.textAlign="left"}if(!ln(e.styles.display,2048))return[3,20];if(null===e.styles.listStyleImage)return[3,19];if(0!==(m=e.styles.listStyleImage).type)return[3,18];f=void 0,v=m.url,o.label=15;case 15:return o.trys.push([15,17,,18]),[4,this.context.cache.match(v)];case 16:return f=o.sent(),this.ctx.drawImage(f,e.bounds.left-(f.width+10),e.bounds.top),[3,18];case 17:return o.sent(),this.context.logger.error("Error loading list-style-image "+v),[3,18];case 18:return[3,20];case 19:A.listValue&&-1!==e.styles.listStyleType&&(w=this.createFontStyle(i)[0],this.ctx.font=w,this.ctx.fillStyle=pe(i.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",C=new r(e.bounds.left,e.bounds.top+ie(e.styles.paddingTop,e.bounds.width),e.bounds.width,Ft(i.lineHeight,i.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Yn(A.listValue,C),i.letterSpacing,Ft(i.lineHeight,i.fontSize.number)/2+2),this.ctx.textBaseline="bottom",this.ctx.textAlign="left"),o.label=20;case 20:return[2]}})})},t.prototype.renderStackContent=function(A){return n(this,void 0,void 0,function(){var e,t,n,i,r,s,a,c,l,d,u,g,p,h,B;return o(this,function(o){switch(o.label){case 0:return ln(A.element.container.flags,16),[4,this.renderNodeBackgroundAndBorders(A.element)];case 1:o.sent(),e=0,t=A.negativeZIndex,o.label=2;case 2:return e<t.length?(B=t[e],[4,this.renderStack(B)]):[3,5];case 3:o.sent(),o.label=4;case 4:return e++,[3,2];case 5:return[4,this.renderNodeContent(A.element)];case 6:o.sent(),n=0,i=A.nonInlineLevel,o.label=7;case 7:return n<i.length?(B=i[n],[4,this.renderNode(B)]):[3,10];case 8:o.sent(),o.label=9;case 9:return n++,[3,7];case 10:r=0,s=A.nonPositionedFloats,o.label=11;case 11:return r<s.length?(B=s[r],[4,this.renderStack(B)]):[3,14];case 12:o.sent(),o.label=13;case 13:return r++,[3,11];case 14:a=0,c=A.nonPositionedInlineLevel,o.label=15;case 15:return a<c.length?(B=c[a],[4,this.renderStack(B)]):[3,18];case 16:o.sent(),o.label=17;case 17:return a++,[3,15];case 18:l=0,d=A.inlineLevel,o.label=19;case 19:return l<d.length?(B=d[l],[4,this.renderNode(B)]):[3,22];case 20:o.sent(),o.label=21;case 21:return l++,[3,19];case 22:u=0,g=A.zeroOrAutoZIndexOrTransformedOrOpacity,o.label=23;case 23:return u<g.length?(B=g[u],[4,this.renderStack(B)]):[3,26];case 24:o.sent(),o.label=25;case 25:return u++,[3,23];case 26:p=0,h=A.positiveZIndex,o.label=27;case 27:return p<h.length?(B=h[p],[4,this.renderStack(B)]):[3,30];case 28:o.sent(),o.label=29;case 29:return p++,[3,27];case 30:return[2]}})})},t.prototype.mask=function(A){this.ctx.beginPath(),this.ctx.moveTo(0,0),this.ctx.lineTo(this.canvas.width,0),this.ctx.lineTo(this.canvas.width,this.canvas.height),this.ctx.lineTo(0,this.canvas.height),this.ctx.lineTo(0,0),this.formatPath(A.slice(0).reverse()),this.ctx.closePath()},t.prototype.path=function(A){this.ctx.beginPath(),this.formatPath(A),this.ctx.closePath()},t.prototype.formatPath=function(A){var e=this;A.forEach(function(A,t){var n=Ri(A)?A.start:A;0===t?e.ctx.moveTo(n.x,n.y):e.ctx.lineTo(n.x,n.y),Ri(A)&&e.ctx.bezierCurveTo(A.startControl.x,A.startControl.y,A.endControl.x,A.endControl.y,A.end.x,A.end.y)})},t.prototype.renderRepeat=function(A,e,t,n){this.path(A),this.ctx.fillStyle=e,this.ctx.translate(t,n),this.ctx.fill(),this.ctx.translate(-t,-n)},t.prototype.resizeImage=function(A,e,t){var n;if(A.width===e&&A.height===t)return A;var o=(null!==(n=this.canvas.ownerDocument)&&void 0!==n?n:document).createElement("canvas");return o.width=Math.max(1,e),o.height=Math.max(1,t),o.getContext("2d").drawImage(A,0,0,A.width,A.height,0,0,e,t),o},t.prototype.renderBackgroundImage=function(A){return n(this,void 0,void 0,function(){var e,t,n,i,r,s;return o(this,function(a){switch(a.label){case 0:e=A.styles.backgroundImage.length-1,t=function(t){var i,r,s,a,c,l,d,u,g,p,h,B,m,f,v,w,C,y,b,x,Q,F,U,S,I,E,k,H,T,D,K;return o(this,function(o){switch(o.label){case 0:if(0!==t.type)return[3,5];i=void 0,r=t.url,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n.context.cache.match(r)];case 2:return i=o.sent(),[3,4];case 3:return o.sent(),n.context.logger.error("Error loading background-image "+r),[3,4];case 4:return i&&(s=nr(A,e,[i.width,i.height,i.width/i.height]),w=s[0],F=s[1],U=s[2],b=s[3],x=s[4],f=n.ctx.createPattern(n.resizeImage(i,b,x),"repeat"),n.renderRepeat(w,f,F,U)),[3,6];case 5:1===t.type?(a=nr(A,e,[null,null,null]),w=a[0],F=a[1],U=a[2],b=a[3],x=a[4],c=Ue(t.angle,b,x),l=c[0],d=c[1],u=c[2],g=c[3],p=c[4],(h=document.createElement("canvas")).width=b,h.height=x,B=h.getContext("2d"),m=B.createLinearGradient(d,g,u,p),Fe(t.stops,l).forEach(function(A){return m.addColorStop(A.stop,pe(A.color))}),B.fillStyle=m,B.fillRect(0,0,b,x),b>0&&x>0&&(f=n.ctx.createPattern(h,"repeat"),n.renderRepeat(w,f,F,U))):function(A){return 2===A.type}(t)&&(v=nr(A,e,[null,null,null]),w=v[0],C=v[1],y=v[2],b=v[3],x=v[4],Q=0===t.position.length?[te]:t.position,F=ie(Q[0],b),U=ie(Q[Q.length-1],x),S=function(A,e,t,n,o){var i=0,r=0;switch(A.size){case 0:0===A.shape?i=r=Math.min(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-o)):1===A.shape&&(i=Math.min(Math.abs(e),Math.abs(e-n)),r=Math.min(Math.abs(t),Math.abs(t-o)));break;case 2:if(0===A.shape)i=r=Math.min(Se(e,t),Se(e,t-o),Se(e-n,t),Se(e-n,t-o));else if(1===A.shape){var s=Math.min(Math.abs(t),Math.abs(t-o))/Math.min(Math.abs(e),Math.abs(e-n)),a=Ie(n,o,e,t,!0),c=a[0],l=a[1];r=s*(i=Se(c-e,(l-t)/s))}break;case 1:0===A.shape?i=r=Math.max(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-o)):1===A.shape&&(i=Math.max(Math.abs(e),Math.abs(e-n)),r=Math.max(Math.abs(t),Math.abs(t-o)));break;case 3:if(0===A.shape)i=r=Math.max(Se(e,t),Se(e,t-o),Se(e-n,t),Se(e-n,t-o));else if(1===A.shape){s=Math.max(Math.abs(t),Math.abs(t-o))/Math.max(Math.abs(e),Math.abs(e-n));var d=Ie(n,o,e,t,!1);c=d[0],l=d[1],r=s*(i=Se(c-e,(l-t)/s))}}return Array.isArray(A.size)&&(i=ie(A.size[0],n),r=2===A.size.length?ie(A.size[1],o):i),[i,r]}(t,F,U,b,x),I=S[0],E=S[1],I>0&&E>0&&(k=n.ctx.createRadialGradient(C+F,y+U,0,C+F,y+U,I),Fe(t.stops,2*I).forEach(function(A){return k.addColorStop(A.stop,pe(A.color))}),n.path(w),n.ctx.fillStyle=k,I!==E?(H=A.bounds.left+.5*A.bounds.width,T=A.bounds.top+.5*A.bounds.height,K=1/(D=E/I),n.ctx.save(),n.ctx.translate(H,T),n.ctx.transform(1,0,0,D,0,0),n.ctx.translate(-H,-T),n.ctx.fillRect(C,K*(y-T)+T,b,x*K),n.ctx.restore()):n.ctx.fill())),o.label=6;case 6:return e--,[2]}})},n=this,i=0,r=A.styles.backgroundImage.slice(0).reverse(),a.label=1;case 1:return i<r.length?(s=r[i],[5,t(s)]):[3,4];case 2:a.sent(),a.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},t.prototype.renderSolidBorder=function(A,e,t){return n(this,void 0,void 0,function(){return o(this,function(n){return this.path(Zi(t,e)),this.ctx.fillStyle=pe(A),this.ctx.fill(),[2]})})},t.prototype.renderDoubleBorder=function(A,e,t,i){return n(this,void 0,void 0,function(){var n,r;return o(this,function(o){switch(o.label){case 0:return e<3?[4,this.renderSolidBorder(A,t,i)]:[3,2];case 1:return o.sent(),[2];case 2:return n=function(A,e){switch(e){case 0:return Ar(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return Ar(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return Ar(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return Ar(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}}(i,t),this.path(n),this.ctx.fillStyle=pe(A),this.ctx.fill(),r=function(A,e){switch(e){case 0:return Ar(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return Ar(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return Ar(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return Ar(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}}(i,t),this.path(r),this.ctx.fill(),[2]}})})},t.prototype.renderNodeBackgroundAndBorders=function(A){return n(this,void 0,void 0,function(){var e,t,n,i,r,s,a,c,l=this;return o(this,function(o){switch(o.label){case 0:return this.applyEffects(A.getEffects(2)),e=A.container.styles,t=!ge(e.backgroundColor)||e.backgroundImage.length,n=[{style:e.borderTopStyle,color:e.borderTopColor,width:e.borderTopWidth},{style:e.borderRightStyle,color:e.borderRightColor,width:e.borderRightWidth},{style:e.borderBottomStyle,color:e.borderBottomColor,width:e.borderBottomWidth},{style:e.borderLeftStyle,color:e.borderLeftColor,width:e.borderLeftWidth}],i=pr(sr(e.backgroundClip,0),A.curves),t||e.boxShadow.length?(this.ctx.save(),this.path(i),this.ctx.clip(),ge(e.backgroundColor)||(this.ctx.fillStyle=pe(e.backgroundColor),this.ctx.fill()),[4,this.renderBackgroundImage(A.container)]):[3,2];case 1:o.sent(),this.ctx.restore(),e.boxShadow.slice(0).reverse().forEach(function(e){l.ctx.save();var t,n,o,i,r,s=Vi(A.curves),a=e.inset?0:1e4,c=(t=s,n=-a+(e.inset?1:-1)*e.spread.number,o=(e.inset?1:-1)*e.spread.number,i=e.spread.number*(e.inset?-2:2),r=e.spread.number*(e.inset?-2:2),t.map(function(A,e){switch(e){case 0:return A.add(n,o);case 1:return A.add(n+i,o);case 2:return A.add(n+i,o+r);case 3:return A.add(n,o+r)}return A}));e.inset?(l.path(s),l.ctx.clip(),l.mask(c)):(l.mask(s),l.ctx.clip(),l.path(c)),l.ctx.shadowOffsetX=e.offsetX.number+a,l.ctx.shadowOffsetY=e.offsetY.number,l.ctx.shadowColor=pe(e.color),l.ctx.shadowBlur=e.blur.number,l.ctx.fillStyle=e.inset?pe(e.color):"rgba(0,0,0,1)",l.ctx.fill(),l.ctx.restore()}),o.label=2;case 2:r=0,s=0,a=n,o.label=3;case 3:return s<a.length?0!==(c=a[s]).style&&!ge(c.color)&&c.width>0?2!==c.style?[3,5]:[4,this.renderDashedDottedBorder(c.color,c.width,r,A.curves,2)]:[3,11]:[3,13];case 4:return o.sent(),[3,11];case 5:return 3!==c.style?[3,7]:[4,this.renderDashedDottedBorder(c.color,c.width,r,A.curves,3)];case 6:return o.sent(),[3,11];case 7:return 4!==c.style?[3,9]:[4,this.renderDoubleBorder(c.color,c.width,r,A.curves)];case 8:return o.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,r,A.curves)];case 10:o.sent(),o.label=11;case 11:r++,o.label=12;case 12:return s++,[3,3];case 13:return[2]}})})},t.prototype.renderDashedDottedBorder=function(A,e,t,i,r){return n(this,void 0,void 0,function(){var n,s,a,c,l,d,u,g,p,h,B,m,f,v,w,C;return o(this,function(o){return this.ctx.save(),n=function(A,e){switch(e){case 0:return $i(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return $i(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return $i(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return $i(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}}(i,t),s=Zi(i,t),2===r&&(this.path(s),this.ctx.clip()),Ri(s[0])?(a=s[0].start.x,c=s[0].start.y):(a=s[0].x,c=s[0].y),Ri(s[1])?(l=s[1].end.x,d=s[1].end.y):(l=s[1].x,d=s[1].y),u=0===t||2===t?Math.abs(a-l):Math.abs(c-d),this.ctx.beginPath(),3===r?this.formatPath(n):this.formatPath(s.slice(0,2)),g=e<3?3*e:2*e,p=e<3?2*e:e,3===r&&(g=e,p=e),h=!0,u<=2*g?h=!1:u<=2*g+p?(g*=B=u/(2*g+p),p*=B):(m=Math.floor((u+p)/(g+p)),f=(u-m*g)/(m-1),p=(v=(u-(m+1)*g)/m)<=0||Math.abs(p-f)<Math.abs(p-v)?f:v),h&&(3===r?this.ctx.setLineDash([0,g+p]):this.ctx.setLineDash([g,p])),3===r?(this.ctx.lineCap="round",this.ctx.lineWidth=e):this.ctx.lineWidth=2*e+1.1,this.ctx.strokeStyle=pe(A),this.ctx.stroke(),this.ctx.setLineDash([]),2===r&&(Ri(s[0])&&(w=s[3],C=s[0],this.ctx.beginPath(),this.formatPath([new Ki(w.end.x,w.end.y),new Ki(C.start.x,C.start.y)]),this.ctx.stroke()),Ri(s[1])&&(w=s[1],C=s[2],this.ctx.beginPath(),this.formatPath([new Ki(w.end.x,w.end.y),new Ki(C.start.x,C.start.y)]),this.ctx.stroke())),this.ctx.restore(),[2]})})},t.prototype.render=function(A){return n(this,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:return this.options.backgroundColor&&(this.ctx.fillStyle=pe(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),n=new Ji(A,null),o=new Xi(n),Yi(n,o,o,i=[]),qi(n.container,i),e=o,[4,this.renderStack(e)];case 1:return t.sent(),this.applyEffects([]),[2,this.canvas]}var n,o,i})})},t}(dr),gr=function(A){return A instanceof Co||A instanceof wo||A instanceof vo&&A.type!==Bo&&A.type!==ho},pr=function(A,e){switch(A){case 0:return Vi(e);case 2:return function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]}(e);default:return _i(e)}},hr=function(A){switch(A){case 1:return"center";case 2:return"right";default:return"left"}},Br=["-apple-system","system-ui"],mr=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter(function(A){return-1===Br.indexOf(A)}):A},fr=function(A){function t(e,t){var n=A.call(this,e,t)||this;return n.canvas=t.canvas?t.canvas:document.createElement("canvas"),n.ctx=n.canvas.getContext("2d"),n.options=t,n.canvas.width=Math.floor(t.width*t.scale),n.canvas.height=Math.floor(t.height*t.scale),n.canvas.style.width=t.width+"px",n.canvas.style.height=t.height+"px",n.ctx.scale(n.options.scale,n.options.scale),n.ctx.translate(-t.x,-t.y),n.context.logger.debug("EXPERIMENTAL ForeignObject renderer initialized ("+t.width+"x"+t.height+" at "+t.x+","+t.y+") with scale "+t.scale),n}return e(t,A),t.prototype.render=function(A){return n(this,void 0,void 0,function(){var e,t;return o(this,function(n){switch(n.label){case 0:return e=zn(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,A),[4,vr(e)];case 1:return t=n.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=pe(this.options.backgroundColor),this.ctx.fillRect(0,0,this.options.width*this.options.scale,this.options.height*this.options.scale)),this.ctx.drawImage(t,-this.options.x*this.options.scale,-this.options.y*this.options.scale),[2,this.canvas]}})})},t}(dr),vr=function(A){return new Promise(function(e,t){var n=new Image;n.onload=function(){e(n)},n.onerror=t,n.src="data:image/svg+xml;charset=utf-8,"+encodeURIComponent((new XMLSerializer).serializeToString(A))})},wr=function(){function A(A){var e=A.id,t=A.enabled;this.id=e,this.enabled=t,this.start=Date.now()}return A.prototype.debug=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.debug?console.debug.apply(console,i([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},A.prototype.getTime=function(){return Date.now()-this.start},A.prototype.info=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&"undefined"!=typeof window&&window.console&&"function"==typeof console.info&&console.info.apply(console,i([this.id,this.getTime()+"ms"],A))},A.prototype.warn=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.warn?console.warn.apply(console,i([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},A.prototype.error=function(){for(var A=[],e=0;e<arguments.length;e++)A[e]=arguments[e];this.enabled&&("undefined"!=typeof window&&window.console&&"function"==typeof console.error?console.error.apply(console,i([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},A.instances={},A}(),Cr=function(){function A(e,t){var n;this.windowBounds=t,this.instanceName="#"+A.instanceCount++,this.logger=new wr({id:this.instanceName,enabled:e.logging}),this.cache=null!==(n=e.cache)&&void 0!==n?n:new Fi(this,e)}return A.instanceCount=1,A}();"undefined"!=typeof window&&Qi.setContext(window);var yr=function(A,e){return n(void 0,void 0,void 0,function(){var n,i,a,c,l,d,u,g,p,h,B,m,f,v,w,C,y,b,x,Q,F,U,S,I,E,k,H,T,D,K,L,M,R,P,O,V,_,N;return o(this,function(o){switch(o.label){case 0:if(!A||"object"!=typeof A)return[2,Promise.reject("Invalid element provided as first argument")];if(!(n=A.ownerDocument))throw new Error("Element is not attached to a Document");if(!(i=n.defaultView))throw new Error("Document is not attached to a Window");return a={allowTaint:null!==(U=e.allowTaint)&&void 0!==U&&U,imageTimeout:null!==(S=e.imageTimeout)&&void 0!==S?S:15e3,proxy:e.proxy,useCORS:null!==(I=e.useCORS)&&void 0!==I&&I},c=t({logging:null===(E=e.logging)||void 0===E||E,cache:e.cache},a),l={windowWidth:null!==(k=e.windowWidth)&&void 0!==k?k:i.innerWidth,windowHeight:null!==(H=e.windowHeight)&&void 0!==H?H:i.innerHeight,scrollX:null!==(T=e.scrollX)&&void 0!==T?T:i.pageXOffset,scrollY:null!==(D=e.scrollY)&&void 0!==D?D:i.pageYOffset},d=new r(l.scrollX,l.scrollY,l.windowWidth,l.windowHeight),u=new Cr(c,d),g=null!==(K=e.foreignObjectRendering)&&void 0!==K&&K,p={allowTaint:null!==(L=e.allowTaint)&&void 0!==L&&L,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:g,copyStyles:g},u.logger.debug("Starting document clone with size "+d.width+"x"+d.height+" scrolled to "+-d.left+","+-d.top),h=new ci(u,A,p),(B=h.clonedReferenceElement)?[4,h.toIFrame(n,d)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return m=o.sent(),f=Mo(B)||"HTML"===B.tagName?function(A){var e=A.body,t=A.documentElement;if(!e||!t)throw new Error("Unable to get document size");var n=Math.max(Math.max(e.scrollWidth,t.scrollWidth),Math.max(e.offsetWidth,t.offsetWidth),Math.max(e.clientWidth,t.clientWidth)),o=Math.max(Math.max(e.scrollHeight,t.scrollHeight),Math.max(e.offsetHeight,t.offsetHeight),Math.max(e.clientHeight,t.clientHeight));return new r(0,0,n,o)}(B.ownerDocument):s(u,B),v=f.width,w=f.height,C=f.left,y=f.top,b=br(u,B,e.backgroundColor),x={canvas:e.canvas,backgroundColor:b,scale:null!==(R=null!==(M=e.scale)&&void 0!==M?M:i.devicePixelRatio)&&void 0!==R?R:1,x:(null!==(P=e.x)&&void 0!==P?P:0)+C,y:(null!==(O=e.y)&&void 0!==O?O:0)+y,width:null!==(V=e.width)&&void 0!==V?V:Math.ceil(v),height:null!==(_=e.height)&&void 0!==_?_:Math.ceil(w)},g?(u.logger.debug("Document cloned, using foreign object rendering"),[4,new fr(u,x).render(B)]):[3,3];case 2:return Q=o.sent(),[3,5];case 3:return u.logger.debug("Document cloned, element located at "+C+","+y+" with size "+v+"x"+w+" using computed rendering"),u.logger.debug("Starting DOM parsing"),F=Fo(u,B),b===F.styles.backgroundColor&&(F.styles.backgroundColor=ye.TRANSPARENT),u.logger.debug("Starting renderer for element at "+x.x+","+x.y+" with size "+x.width+"x"+x.height),[4,new ur(u,x).render(F)];case 4:Q=o.sent(),o.label=5;case 5:return(null===(N=e.removeContainer)||void 0===N||N)&&(ci.destroy(m)||u.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),u.logger.debug("Finished rendering"),[2,Q]}})})},br=function(A,e,t){var n=e.ownerDocument,o=n.documentElement?Ce(A,getComputedStyle(n.documentElement).backgroundColor):ye.TRANSPARENT,i=n.body?Ce(A,getComputedStyle(n.body).backgroundColor):ye.TRANSPARENT,r="string"==typeof t?Ce(A,t):null===t?ye.TRANSPARENT:4294967295;return e===n.documentElement?ge(o)?ge(i)?r:i:o:r};return function(A,e){return void 0===e&&(e={}),yr(A,e)}}()},698:(A,e)=>{var t=Symbol.for("react.transitional.element");function n(A,e,n){var o=null;if(void 0!==n&&(o=""+n),void 0!==e.key&&(o=""+e.key),"key"in e)for(var i in n={},e)"key"!==i&&(n[i]=e[i]);else n=e;return e=n.ref,{$$typeof:t,type:A,key:o,ref:void 0!==e?e:null,props:n}}Symbol.for("react.fragment"),e.jsx=n,e.jsxs=n},848:(A,e,t)=>{A.exports=t(698)}},o={};function i(A){var e=o[A];if(void 0!==e)return e.exports;var t=o[A]={exports:{}};return n[A].call(t.exports,t,t.exports,i),t.exports}i.n=A=>{var e=A&&A.__esModule?()=>A.default:()=>A;return i.d(e,{a:e}),e},i.d=(A,e)=>{for(var t in e)i.o(e,t)&&!i.o(A,t)&&Object.defineProperty(A,t,{enumerable:!0,get:e[t]})},i.o=(A,e)=>Object.prototype.hasOwnProperty.call(A,e),i.r=A=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})};var r={};i.r(r),i.d(r,{checkPermissionState:()=>ee,getDeviceInfo:()=>Ae,getPermissionInstructions:()=>ne,openSettings:()=>oe});var s={};i.r(s),i.d(s,{showBlockedModal:()=>se,showNoMicrophoneModal:()=>ae,showPrePromptModal:()=>re});const a=class{constructor(){this.events={}}on(A,e){return this.events[A]||(this.events[A]=[]),this.events[A].push(e),this}off(A,e){return this.events[A]?(this.events[A]=this.events[A].filter(A=>A!==e),this):this}emit(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];return!!this.events[A]&&(this.events[A].forEach(A=>{A(...t)}),!0)}once(A,e){var t=this,n=function(){e(...arguments),t.off(A,n)};return this.on(A,n)}removeAllListeners(A){return A?delete this.events[A]:this.events={},this}},c=class{constructor(){this.name="PCM"}decode(A){if(A instanceof ArrayBuffer)return A;if(A instanceof Uint8Array)return A.buffer;throw new Error("Invalid PCM data type")}encode(A){return A}},l=class{constructor(){this.name="PCMU"}decode(A){for(var e=A instanceof Uint8Array?A:new Uint8Array(A),t=new Int16Array(e.length),n=0;n<e.length;n++)t[n]=this.mulawToLinear(e[n]);return t.buffer}encode(A){for(var e=A instanceof Int16Array?A:new Int16Array(A),t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=this.linearToMulaw(e[n]);return t}mulawToLinear(A){var e=1<<3+(A>>4&7);return(128&A?-1:1)*(132+(15&A)*e+(e>>1)-4)}linearToMulaw(A){var e=A>>8&128;e&&(A=-A),A>32635&&(A=32635),A+=132;for(var t=7,n=16384;0===(A&n)&&t>0;t--,n>>=1);return 255&~(e|t<<4|A>>t+3&15)}},d=class{constructor(){this.name="PCMA"}decode(A){for(var e=A instanceof Uint8Array?A:new Uint8Array(A),t=new Int16Array(e.length),n=0;n<e.length;n++)t[n]=this.alawToLinear(e[n]);return t.buffer}encode(A){for(var e=A instanceof Int16Array?A:new Int16Array(A),t=new Uint8Array(e.length),n=0;n<e.length;n++)t[n]=this.linearToAlaw(e[n]);return t}alawToLinear(A){var e=(A^=85)>>4&7,t=15&A;return(128&A?-1:1)*(0===e?8+(t<<4):264+(t<<4)<<e-1)}linearToAlaw(A){var e,t,n=A>>8&128;if(n&&(A=-A),A>32635&&(A=32635),A<256)e=0,t=A>>4;else{e=7;for(var o=16384;0===(A&o)&&e>0;e--,o>>=1);t=A>>e+3&15}return 85^(n|e<<4|t)}};function u(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function g(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){u(i,n,o,r,s,"next",A)}function s(A){u(i,n,o,r,s,"throw",A)}r(void 0)})}}const p=class extends a{constructor(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),console.log("%c🔊 AUDIO PLAYER - SILENT BUFFER PRIMING FIX ENABLED","background: #10b981; color: white; font-size: 14px; font-weight: bold; padding: 4px 8px; border-radius: 4px;"),console.log("%cAndroid Greeting Cut-Off Fix: Silent buffer priming (100ms) + dynamic startup buffer","background: #d1fae5; color: #065f46; font-size: 12px; padding: 2px 6px; border-radius: 3px;"),console.log("%cBuild: 2026-01-30-SILENT-BUFFER-PRIMING | Look for [scheduleWAV] and priming logs","background: #e0e7ff; color: #1e40af; font-size: 11px; padding: 2px 6px; border-radius: 3px;"),console.log(""),this.config=A,this.audioContext=null,this.gainNode=null,this._audioContextPrimed=!1,this._waitForReadyStateHandler=null,this.audioQueue=[],this.isPlaying=!1,this.isProcessingQueue=!1,this.currentSource=null,this.outputFormat=null,this.nextStartTime=0,this.scheduledBuffers=0,this.scheduledSources=new Set,this.pcmChunkQueue=[],this.preparedBuffer=[],this.MAX_PREPARED_BUFFER_SIZE=200,this.MAX_PCM_CHUNK_QUEUE_SIZE=50,this.isProcessingPcmQueue=!1,this.isSchedulingFrames=!1,this._emptySentenceTimeout=null,this.MAX_LOOKAHEAD_SECONDS=.02,this.pendingSentenceText=null,this.sentenceTimings=[],this.isCheckingTranscripts=!1,this._isStopped=!1,this._currentSentenceId=0,this.codecs={pcm:new c,pcmu:new l,pcma:new d},this.SUPPORTED_CONTAINERS=["wav","raw"],this.SUPPORTED_ENCODINGS=["pcm","pcmu","pcma"],this.SUPPORTED_SAMPLE_RATES=[8e3,16e3,22050,24e3,44100,48e3],this.SUPPORTED_BIT_DEPTHS=[8,16,24],this.SUPPORTED_CHANNELS=[1],console.log("🎵 AudioPlayer v2 initialized")}setOutputFormat(A){var e;this.validateFormat(A)||(console.warn("⚠️ AudioPlayer: Invalid format, using defaults:",A),A=this.getDefaultFormat());var t=null===(e=this.outputFormat)||void 0===e?void 0:e.sampleRate,n=A.sampleRate;this.outputFormat=A,console.log("✅ AudioPlayer v2: Format set:",A),this.audioContext&&t&&t!==n&&(console.warn("⚠️ AudioPlayer: Sample rate changed, recreating AudioContext"),console.warn(" Old: ".concat(t,"Hz → New: ").concat(n,"Hz")),this.stopImmediate(),this._cleanupAudioContext(),console.log("ℹ️ AudioContext will be recreated on next audio chunk with correct sample rate"))}validateFormat(A){var e,t;if(!A)return!1;var n=null===(e=A.container)||void 0===e?void 0:e.toLowerCase(),o=null===(t=A.encoding)||void 0===t?void 0:t.toLowerCase();return n&&o&&this.SUPPORTED_CONTAINERS.includes(n)&&this.SUPPORTED_ENCODINGS.includes(o)&&this.SUPPORTED_SAMPLE_RATES.includes(A.sampleRate)&&this.SUPPORTED_BIT_DEPTHS.includes(A.bitDepth)&&(!A.channels||this.SUPPORTED_CHANNELS.includes(A.channels))}getDefaultFormat(){return{container:"raw",encoding:"pcm",sampleRate:16e3,channels:1,bitDepth:16}}playAudio(A){if(this._isStopped)console.log("🛑 AudioPlayer: Ignoring audio chunk - playback was stopped (barge-in)");else try{var e=this.createAudioBlob(A);this.audioQueue.push(e),this.isPlaying||this.isProcessingQueue||this.currentSource||setTimeout(()=>this.processQueue(),50)}catch(A){console.error("❌ AudioPlayer v2: Playback error:",A),this.emit("playbackError",A)}}playChunk(A){var e=this;return g(function*(){if(e._isStopped)console.log("🛑 AudioPlayer: Ignoring PCM chunk - playback was stopped (barge-in)");else{var t,n=e.prepareChunk(A);if(n)e._emptySentenceTimeout&&(clearTimeout(e._emptySentenceTimeout),e._emptySentenceTimeout=null),e.preparedBuffer.length>=e.MAX_PREPARED_BUFFER_SIZE&&(e.preparedBuffer.shift(),console.warn("⚠️ AudioPlayer: preparedBuffer at max size (".concat(e.MAX_PREPARED_BUFFER_SIZE,"), dropped oldest frame"))),e.preparedBuffer.push(n),e.isSchedulingFrames||e._isStopped?setTimeout(()=>{e.preparedBuffer.length>0&&!e.isSchedulingFrames&&!e._isStopped&&e.schedulePreparedFrames()},5):e.schedulePreparedFrames(),e.pcmChunkQueue.length>0&&!e.isProcessingPcmQueue&&e.processPcmQueue();else console.error("❌ AudioPlayer: playChunk failed - prepareChunk returned null"),console.error(" pcmData length:",(null==A?void 0:A.byteLength)||"undefined"),console.error(" outputFormat:",e.outputFormat),console.error(" audioContext:",e.audioContext?"initialized":"not initialized"),console.error(" audioContext state:",(null===(t=e.audioContext)||void 0===t?void 0:t.state)||"N/A"),e.emit("playbackError",new Error("Failed to prepare PCM chunk for playback"))}})()}prepareChunk(A){try{var e;if(!this.outputFormat)return console.error("❌ AudioPlayer: Cannot prepare chunk - outputFormat not set"),console.error(" Call setOutputFormat() before playing audio chunks"),null;if(this.audioContext||this.initializeAudioContext(),!this.audioContext)return console.error("❌ AudioPlayer: Cannot prepare chunk - AudioContext not available"),null;var t=A;if(A.byteLength%2!=0){console.warn("⚠️ Odd PCM chunk size, padding:",A.byteLength);var n=new Uint8Array(A.byteLength+1);n.set(new Uint8Array(A),0),n[A.byteLength]=0,t=n.buffer}for(var o=new Int16Array(t),i=new Float32Array(o.length),r=1/32768,s=o.length,a=0;a<s;a++)i[a]=o[a]*r;var c=(null===(e=this.outputFormat)||void 0===e?void 0:e.sampleRate)||this.audioContext.sampleRate,l=this.audioContext.sampleRate,d=this.audioContext.createBuffer(1,i.length,c);d.getChannelData(0).set(i);var u=d.duration,g=i.length,p=u;return l!==c&&(p=g/l),{buffer:d,duration:p,sampleRate:c,contextSampleRate:l}}catch(A){return console.error("❌ AudioPlayer: Error preparing chunk:",A),null}}applyFadeOut(A){return A}schedulePreparedFrames(){var A=this;return g(function*(){if(A._isStopped)console.log("🛑 AudioPlayer: Not scheduling frames - playback was stopped (barge-in)");else if(!A.isSchedulingFrames){A.isSchedulingFrames=!0;var e=A.preparedBuffer.length,t=Math.min(e,5);0===t&&e>0&&(t=1);try{var n,o,i,r;A.audioContext||A.initializeAudioContext(),console.log("🔍 [scheduleWAV] BEFORE waitForAudioContextReady - state:",null===(n=A.audioContext)||void 0===n?void 0:n.state,"currentTime:",null===(o=A.audioContext)||void 0===o?void 0:o.currentTime),yield A.waitForAudioContextReady(),console.log("🔍 [scheduleWAV] AFTER waitForAudioContextReady - state:",null===(i=A.audioContext)||void 0===i?void 0:i.state,"currentTime:",null===(r=A.audioContext)||void 0===r?void 0:r.currentTime);for(var s=0,a=function*(){if(A._isStopped)return console.log("🛑 AudioPlayer: Stopping frame scheduling - playback was stopped"),0;var e=A.preparedBuffer.shift();if(!e)return 0;var t=A.audioContext.createBufferSource();t.buffer=e.buffer,t.connect(A.gainNode||A.audioContext.destination),A.scheduledSources.add(t);var n=A.audioContext.currentTime;if(0===A.scheduledBuffers){var o=.03;/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&(A._audioContextPrimed?o=0:(o=2,console.warn("⚠️ AudioPlayer: Audio not primed yet, using 2000ms fallback buffer"))),A.nextStartTime=n+o,console.log("🎵 [scheduleWAV] FIRST FRAME - primed: ".concat(A._audioContextPrimed,", buffer: ").concat(1e3*o,"ms"))}else{var i=n+A.MAX_LOOKAHEAD_SECONDS;A.nextStartTime<i&&(A.nextStartTime=i,console.warn("⚠️ AudioPlayer: Fell behind schedule, adjusting nextStartTime to ".concat(A.nextStartTime.toFixed(4),"s")))}A.pendingSentenceText&&(A.sentenceTimings.push({startTime:A.nextStartTime,text:A.pendingSentenceText,displayed:!1}),console.log("📝 AudioPlayer: Sentence scheduled at ".concat(A.nextStartTime.toFixed(3),'s: "').concat(A.pendingSentenceText.substring(0,40),'..."')),A.pendingSentenceText=null,A.isCheckingTranscripts||A.startTranscriptChecker()),t.start(A.nextStartTime),A.nextStartTime+=e.duration,A.nextStartTime=Math.round(1e6*A.nextStartTime)/1e6;var r=A.nextStartTime-e.duration;A.scheduledBuffers<5&&(console.log("🎵 AudioPlayer: Scheduled frame ".concat(A.scheduledBuffers+1," at ").concat(r.toFixed(4),"s, next at ").concat(A.nextStartTime.toFixed(4),"s")),console.log(" Duration: ".concat(e.duration.toFixed(4),"s (").concat((1e3*e.duration).toFixed(2),"ms), Queued: ").concat(A.preparedBuffer.length,", Scheduled: ").concat(A.scheduledBuffers))),A.scheduledBuffers++,s++,t.onended=()=>{if(!A._isStopped&&A.scheduledSources.has(t))if(A.scheduledSources.delete(t),!A._isStopped&&A.scheduledBuffers>0&&A.scheduledBuffers--,0!==A.scheduledBuffers||0!==A.preparedBuffer.length||0!==A.pcmChunkQueue.length||A._isStopped){if(A.preparedBuffer.length>0&&!A._isStopped)setTimeout(()=>{A.preparedBuffer.length>0&&!A.isSchedulingFrames&&!A._isStopped&&A.schedulePreparedFrames()},0);else if(A.scheduledBuffers>0&&!A._isStopped){var e=()=>{A._isStopped||(A.preparedBuffer.length>0&&!A.isSchedulingFrames&&A.scheduledBuffers>0?A.schedulePreparedFrames():A.scheduledBuffers>0&&!A._isStopped&&setTimeout(e,10))};setTimeout(e,10)}}else A.isPlaying=!1,A.isSchedulingFrames=!1,console.log("🛑 AudioPlayer: Emitting playbackStopped event (all buffers finished)"),A.emit("playbackStopped")},A.isPlaying||(A.isPlaying=!0,console.log("🎵 AudioPlayer: Emitting playbackStarted event"),A.emit("playbackStarted"))};A.preparedBuffer.length>0&&s<t&&0!==(yield*a()););A.isSchedulingFrames=!1,A.preparedBuffer.length>0&&!A._isStopped&&requestAnimationFrame(()=>{A.preparedBuffer.length>0&&!A.isSchedulingFrames&&!A._isStopped&&A.schedulePreparedFrames()}),A.scheduledBuffers>0&&!A._isStopped&&setTimeout(()=>{A.preparedBuffer.length>0&&!A.isSchedulingFrames&&A.scheduledBuffers>0&&!A._isStopped?A.schedulePreparedFrames():A.scheduledBuffers>0&&!A._isStopped&&setTimeout(()=>{A.preparedBuffer.length>0&&!A.isSchedulingFrames&&A.scheduledBuffers>0&&!A._isStopped&&A.schedulePreparedFrames()},10)},10)}catch(e){console.error("❌ AudioPlayer v2: Error scheduling frames:",e),A.emit("playbackError",e),A.isSchedulingFrames=!1}}})()}processPcmQueue(){var A=this;return g(function*(){if(A._isStopped)console.log("🛑 AudioPlayer: Not processing PCM queue - playback was stopped (barge-in)");else if(!A.isProcessingPcmQueue){A.isProcessingPcmQueue=!0;try{for(A.audioContext||A.initializeAudioContext(),yield A.waitForAudioContextReady();A.pcmChunkQueue.length>0;){var e,t;if(A._isStopped){console.log("🛑 AudioPlayer: Stopping PCM queue processing - playback was stopped");break}var n=A.pcmChunkQueue.shift();if(n){var o=n;if(n.byteLength%2!=0){console.warn("⚠️ Odd PCM chunk size, padding:",n.byteLength);var i=new Uint8Array(n.byteLength+1);i.set(new Uint8Array(n),0),i[n.byteLength]=0,o=i.buffer}for(var r=new Int16Array(o),s=new Float32Array(r.length),a=1/32768,c=r.length,l=0;l<c;l++)s[l]=r[l]*a;var d=(null===(e=A.outputFormat)||void 0===e?void 0:e.sampleRate)||A.audioContext.sampleRate,u=A.audioContext.sampleRate;null!==(t=A.outputFormat)&&void 0!==t&&t.sampleRate?A.scheduledBuffers<3&&console.log("🎵 AudioPlayer: Creating buffer at ".concat(d,"Hz (AudioContext: ").concat(u,"Hz)")):console.warn("⚠️ AudioPlayer: outputFormat.sampleRate not set! Using AudioContext sample rate:",u);var g=A.audioContext.createBuffer(1,s.length,d);g.getChannelData(0).set(s);var p=A.audioContext.createBufferSource();p.buffer=g,p.connect(A.gainNode||A.audioContext.destination);var h=A.audioContext.currentTime;A.nextStartTime<h&&(A.nextStartTime=h,0===A.scheduledBuffers&&console.log("🎵 Starting playback at current time:",h));var B=g.duration,m=s.length,f=B;if(u!==d&&(f=m/u,A.scheduledBuffers<3&&(console.log("🔄 Resampling detected: ".concat(d,"Hz → ").concat(u,"Hz")),console.log(" Buffer duration: ".concat(B.toFixed(4),"s, Calculated: ").concat(f.toFixed(4),"s")))),p.start(A.nextStartTime),A.nextStartTime+=f,A.nextStartTime=Math.round(1e6*A.nextStartTime)/1e6,A.scheduledBuffers<3){var v=A.nextStartTime-f;console.log("🎵 AudioPlayer: Scheduled chunk ".concat(A.scheduledBuffers+1," at ").concat(v.toFixed(4),"s, next at ").concat(A.nextStartTime.toFixed(4),"s")),console.log(" Duration: ".concat(f.toFixed(4),"s (").concat((1e3*f).toFixed(2),"ms)"))}A.scheduledBuffers++,p.onended=()=>{A.scheduledBuffers--,0===A.scheduledBuffers&&0===A.pcmChunkQueue.length&&(A.isPlaying=!1,A.isProcessingPcmQueue=!1,A.emit("playbackStopped"))},A.isPlaying||(A.isPlaying=!0,A.emit("playbackStarted"))}}A.isProcessingPcmQueue=!1}catch(e){console.error("❌ AudioPlayer v2: Error playing chunk:",e),A.emit("playbackError",e),A.isProcessingPcmQueue=!1}}})()}createAudioBlob(A){var e=new Uint8Array(A);console.log("🎵 AudioPlayer: Processing ".concat(e.length," bytes")),console.log("🎵 AudioPlayer: Negotiated format:",this.outputFormat);var t=this.outputFormat&&this.outputFormat.container&&"wav"===this.outputFormat.container.toLowerCase(),n=this.outputFormat&&this.outputFormat.container&&"raw"===this.outputFormat.container.toLowerCase(),o=this.isWavFile(e);if(o&&console.log("🎵 AudioPlayer: Data has WAV header (RIFF)"),n&&o)return console.error("❌ AudioPlayer: CRITICAL MISMATCH!"),console.error(" Negotiated format: RAW"),console.error(" Actual data: WAV (RIFF header detected)"),console.error(" Backend is ignoring format request and sending WAV anyway."),console.warn("⚠️ AudioPlayer: Processing as WAV to avoid playback failure, but UI configuration was bypassed."),this.handleWavFile(e);if(n&&!o)console.log("🎵 AudioPlayer: Processing as RAW data (as negotiated)");else{if(t&&o)return console.log("✅ AudioPlayer: Processing as WAV file (matches negotiation)"),this.handleWavFile(e);if(t&&!o)return console.warn("⚠️ AudioPlayer: Negotiated WAV but data lacks WAV header. Attempting WAV processing anyway."),this.handleWavFile(e);if(!this.outputFormat&&o)return console.log("🎵 AudioPlayer: No format negotiated, auto-detecting WAV"),this.handleWavFile(e);this.outputFormat||o||(console.warn("⚠️ AudioPlayer: No format negotiated and data not WAV, using defaults"),this.outputFormat=this.getDefaultFormat())}return this.outputFormat||(console.warn("⚠️ AudioPlayer: No format set, using defaults"),this.outputFormat=this.getDefaultFormat()),console.log("🎵 AudioPlayer: Processing as RAW data with encoding:",this.outputFormat.encoding),this.handleRawData(e)}isWavFile(A){return A.length>=44&&82===A[0]&&73===A[1]&&70===A[2]&&70===A[3]}handleWavFile(A){var e=this.parseWavHeader(A);if(console.log("🎵 WAV file detected:",{format:e.audioFormat,encoding:this.getEncodingName(e.audioFormat),sampleRate:e.sampleRate,channels:e.channels,bitDepth:e.bitsPerSample}),1===e.audioFormat)return console.log("✅ PCM WAV - using directly"),new Blob([A],{type:"audio/wav"});var t=this.getCodecForWavFormat(e.audioFormat);if(!t)throw new Error("Unsupported WAV format code: ".concat(e.audioFormat));console.log("🔄 Non-PCM WAV - converting to PCM WAV");var n=A.slice(44),o=t.decode(n),i=this.createWavHeader(o.byteLength,e.sampleRate,e.channels,16);return new Blob([i,o],{type:"audio/wav"})}handleRawData(A){var e,t,n=this.outputFormat.encoding.toLowerCase(),o=this.getCodec(n);if(!o)throw new Error("No codec found for encoding: ".concat(n));if(console.log("🎵 AudioPlayer: Decoding ".concat(n.toUpperCase()," to PCM")),console.log("🎵 AudioPlayer: Input format - bitDepth: ".concat(this.outputFormat.bitDepth,", sampleRate: ").concat(this.outputFormat.sampleRate)),"pcm"===n){var i=this.outputFormat.bitDepth||16;A.length,24===i?(console.warn("⚠️ AudioPlayer: Format says 24-bit PCM, but browser support is limited."),console.warn(" Treating as 16-bit PCM. If audio sounds wrong, backend should send 16-bit instead."),e=this.convert24BitTo16Bit(A),t=16):8===i?(console.log("🔄 AudioPlayer: Converting 8-bit PCM to 16-bit PCM"),e=this.convert8BitTo16Bit(A),t=16):(e=A.buffer,t=i,console.log("✅ AudioPlayer: Using native ".concat(i,"-bit PCM (no conversion needed)")))}else e=o.decode(A),t=16,console.log("🔄 AudioPlayer: Decoded ".concat(n.toUpperCase()," to 16-bit PCM"));var r=this.createWavHeader(e.byteLength,this.outputFormat.sampleRate,this.outputFormat.channels,t);return new Blob([r,e],{type:"audio/wav"})}convert24BitTo16Bit(A){for(var e=Math.floor(A.length/3),t=new Int16Array(e),n=0;n<e;n++){var o=A[3*n],i=A[3*n+1],r=A[3*n+2],s=o|i<<8|(255&r)<<16;128&r&&(s|=4278190080),t[n]=Math.max(-32768,Math.min(32767,Math.round(s/256)))}return t.buffer}convert8BitTo16Bit(A){for(var e=A.length,t=new Int16Array(e),n=0;n<e;n++){var o=A[n];t[n]=256*(o-128)}return t.buffer}getCodec(A){var e={pcm:"pcm",linear:"pcm",l16:"pcm",pcmu:"pcmu",ulaw:"pcmu",mulaw:"pcmu",g711u:"pcmu",pcma:"pcma",alaw:"pcma",g711a:"pcma"}[A.toLowerCase()];return this.codecs[e]}getCodecForWavFormat(A){switch(A){case 1:return this.codecs.pcm;case 6:return this.codecs.pcma;case 7:return this.codecs.pcmu;default:return null}}getEncodingName(A){switch(A){case 1:return"PCM";case 6:return"A-law";case 7:return"μ-law";default:return"Unknown (".concat(A,")")}}parseWavHeader(A){var e=new DataView(A.buffer,A.byteOffset,A.byteLength);return{audioFormat:e.getUint16(20,!0),channels:e.getUint16(22,!0),sampleRate:e.getUint32(24,!0),byteRate:e.getUint32(28,!0),blockAlign:e.getUint16(32,!0),bitsPerSample:e.getUint16(34,!0)}}createWavHeader(A,e,t,n){var o=new ArrayBuffer(44),i=new DataView(o);return i.setUint32(0,1380533830,!1),i.setUint32(4,36+A,!0),i.setUint32(8,1463899717,!1),i.setUint32(12,1718449184,!1),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,t,!0),i.setUint32(24,e,!0),i.setUint32(28,e*t*n/8,!0),i.setUint16(32,t*n/8,!0),i.setUint16(34,n,!0),i.setUint32(36,1684108385,!1),i.setUint32(40,A,!0),o}waitForAudioContextReady(){var A=this;return g(function*(){var e,t;if(console.log("🔍 [waitForAudioContextReady] ENTRY - audioContext exists:",!!A.audioContext),A.audioContext||(console.log("🔍 [waitForAudioContextReady] Creating AudioContext..."),A.initializeAudioContext(),console.log("🔍 [waitForAudioContextReady] After initializeAudioContext - state:",null===(e=A.audioContext)||void 0===e?void 0:e.state,"currentTime:",null===(t=A.audioContext)||void 0===t?void 0:t.currentTime)),!A.audioContext)return console.error("❌ AudioPlayer: Failed to create AudioContext"),Promise.resolve();var n=A.audioContext;if(console.log("🔍 [waitForAudioContextReady] Initial state:",n.state,"currentTime:",n.currentTime),"running"===n.state)return console.log("🔍 [waitForAudioContextReady] Already running - returning immediately, currentTime:",n.currentTime),Promise.resolve();if("suspended"===n.state){if(console.log("🔍 [waitForAudioContextReady] State is suspended - calling resume()..."),yield n.resume(),console.log("🔍 [waitForAudioContextReady] After resume() - state:",n.state,"currentTime:",n.currentTime),"running"!==n.state)return console.log("🔍 [waitForAudioContextReady] Still not running after resume() - waiting for statechange event..."),new Promise(e=>{var t=setTimeout(()=>{n&&A._waitForReadyStateHandler&&(n.removeEventListener("statechange",A._waitForReadyStateHandler),A._waitForReadyStateHandler=null),console.warn("⚠️ AudioPlayer: AudioContext did not become running within timeout - proceeding anyway, state:",null==n?void 0:n.state,"currentTime:",null==n?void 0:n.currentTime),e()},2e3),o=()=>{if(console.log("🔍 [waitForAudioContextReady] statechange event fired - state:",null==n?void 0:n.state,"currentTime:",null==n?void 0:n.currentTime),!n)return clearTimeout(t),A._waitForReadyStateHandler=null,console.warn("⚠️ AudioPlayer: AudioContext became null during state change"),void e();"running"===n.state&&(clearTimeout(t),A._waitForReadyStateHandler&&(n.removeEventListener("statechange",A._waitForReadyStateHandler),A._waitForReadyStateHandler=null),console.log("✅ [waitForAudioContextReady] AudioContext became running via statechange, currentTime:",n.currentTime),e())};A._waitForReadyStateHandler=o,n.addEventListener("statechange",o),console.log("🔍 [waitForAudioContextReady] Synchronous check - state:",null==n?void 0:n.state),n&&"running"===n.state&&(clearTimeout(t),A._waitForReadyStateHandler&&(n.removeEventListener("statechange",A._waitForReadyStateHandler),A._waitForReadyStateHandler=null),console.log("✅ [waitForAudioContextReady] State became running synchronously, currentTime:",n.currentTime),e())});console.log("🔍 [waitForAudioContextReady] State is running after resume() - returning, currentTime:",n.currentTime)}return"closed"===n.state?(console.warn("⚠️ AudioPlayer: AudioContext was closed, recreating..."),A.initializeAudioContext(),A.waitForAudioContextReady()):(console.log("🔍 [waitForAudioContextReady] EXIT - state:",n.state,"currentTime:",n.currentTime),Promise.resolve())})()}initializeAudioContext(){var A,e,t=(null===(A=this.outputFormat)||void 0===A?void 0:A.sampleRate)||44100;if(48e3!==t&&44100!==t&&(console.log("ℹ️ AudioPlayer: Backend requested ".concat(t,"Hz, but browser may resample")),console.log(" Consider requesting 44100Hz or 48000Hz from backend to avoid resampling and improve quality")),this.audioContext){var n=this.audioContext.sampleRate;if(!(Math.abs(n-t)>100))return;console.warn("⚠️ AudioPlayer: AudioContext sample rate (".concat(n,"Hz) doesn't match format (").concat(t,"Hz), recreating...")),this.stopImmediate(),this._cleanupAudioContext()}console.log("🎵 AudioPlayer: Creating AudioContext at ".concat(t,"Hz (from outputFormat: ").concat((null===(e=this.outputFormat)||void 0===e?void 0:e.sampleRate)||"not set",")"));try{this.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:t,latencyHint:"playback"}),console.log("✅ AudioContext created at ".concat(this.audioContext.sampleRate,"Hz (requested: ").concat(t,"Hz)")),Math.abs(this.audioContext.sampleRate-t)>100?(console.error("❌ CRITICAL: Browser sample rate mismatch!"),console.error(" Requested: ".concat(t,"Hz")),console.error(" Got: ".concat(this.audioContext.sampleRate,"Hz")),console.error(" This WILL cause audio distortion/noise!"),console.error(" Solution: Backend should send ".concat(this.audioContext.sampleRate,"Hz audio instead"))):this.audioContext.sampleRate!==t&&(console.warn("⚠️ Browser adjusted sample rate: ".concat(t,"Hz → ").concat(this.audioContext.sampleRate,"Hz")),console.warn(" Browser will automatically resample audio.")),this.setupAudioContextStateMonitoring(),this.gainNode=this.audioContext.createGain(),this.gainNode.gain.value=1,this.gainNode.connect(this.audioContext.destination),console.log("✅ AudioPlayer: GainNode created for volume control"),this._primeAudioContext()}catch(A){console.error("❌ Failed to create AudioContext:",A),this.audioContext=new(window.AudioContext||window.webkitAudioContext),console.log("ℹ️ Using browser default: ".concat(this.audioContext.sampleRate,"Hz")),this.setupAudioContextStateMonitoring(),this.gainNode=this.audioContext.createGain(),this.gainNode.gain.value=1,this.gainNode.connect(this.audioContext.destination),console.log("✅ AudioPlayer: GainNode created for volume control (fallback)"),this._primeAudioContext()}}_primeAudioContext(){var A=this;return g(function*(){try{if(!A.audioContext||A._audioContextPrimed)return;var e=A.audioContext.sampleRate,t=A.audioContext.createBuffer(1,.1*e,e),n=A.audioContext.createBufferSource();n.buffer=t,n.connect(A.audioContext.destination),n.start(),yield new Promise(A=>setTimeout(A,100)),A._audioContextPrimed=!0,console.log("✅ AudioPlayer: Audio hardware primed with silent buffer")}catch(A){console.error("❌ AudioPlayer: Audio priming failed:",A)}})()}_cleanupAudioContext(){if(console.log("[TTP AudioPlayer] 🧹 Cleaning up AudioContext (refactored method)"),this.gainNode){try{this.gainNode.disconnect()}catch(A){}this.gainNode=null}this._audioContextStateChangeHandler&&this.audioContext&&(this.audioContext.removeEventListener("statechange",this._audioContextStateChangeHandler),this._audioContextStateChangeHandler=null),this._waitForReadyStateHandler&&this.audioContext&&(this.audioContext.removeEventListener("statechange",this._waitForReadyStateHandler),this._waitForReadyStateHandler=null),this.audioContext&&"closed"!==this.audioContext.state&&this.audioContext.close(),this.audioContext=null,this._audioContextPrimed=!1}setupAudioContextStateMonitoring(){this.audioContext&&(this._audioContextStateChangeHandler&&this.audioContext.removeEventListener("statechange",this._audioContextStateChangeHandler),this._audioContextStateChangeHandler=()=>{this.audioContext?(console.log("🎵 AudioPlayer: AudioContext state changed to: ".concat(this.audioContext.state)),"suspended"===this.audioContext.state&&this.isPlaying?console.warn("⚠️ AudioPlayer: AudioContext suspended during playback"):"running"===this.audioContext.state&&!this.isPlaying&&(this.audioQueue.length>0||this.pcmChunkQueue.length>0||this.preparedBuffer.length>0)&&(console.log("✅ AudioPlayer: AudioContext resumed - resuming queue processing"),this.audioQueue.length>0&&!this.isProcessingQueue&&setTimeout(()=>this.processQueue(),50),this.pcmChunkQueue.length>0&&!this.isProcessingPcmQueue&&setTimeout(()=>this.processPcmQueue(),50),this.preparedBuffer.length>0&&!this.isSchedulingFrames&&setTimeout(()=>this.scheduleFrames(),50))):console.warn("⚠️ AudioPlayer: State change handler fired but AudioContext is null")},this.audioContext.addEventListener("statechange",this._audioContextStateChangeHandler))}processQueue(){var A=this;return g(function*(){if(A._isStopped)console.log("🛑 AudioPlayer: Not processing queue - playback was stopped (barge-in)");else if(!A.isProcessingQueue&&0!==A.audioQueue.length){A.isProcessingQueue=!0;var e=A.audioQueue.shift();if(e)try{var t=!A.isPlaying&&null===A.currentSource;A.audioContext||A.initializeAudioContext(),yield A.waitForAudioContextReady();var n=A.audioContext,o=yield e.arrayBuffer(),i=yield n.decodeAudioData(o),r=t&&!A.isPlaying&&null===A.currentSource,s=n.createBufferSource();s.buffer=i,s.connect(A.gainNode||n.destination),A.currentSource=s,A.isPlaying=!0,r&&A.emit("playbackStarted"),s.onended=()=>{A.currentSource=null,A.isProcessingQueue=!1,A.audioQueue.length>0?setTimeout(()=>A.processQueue(),50):setTimeout(()=>{0!==A.audioQueue.length||A.currentSource||(A.isPlaying=!1,A.emit("playbackStopped"))},100)},s.start()}catch(e){console.error("❌ AudioPlayer v2: Error processing queue:",e),A.currentSource=null,A.emit("playbackError",e),A.audioQueue.length>0?(A.isProcessingQueue=!1,setTimeout(()=>A.processQueue(),100)):(A.isPlaying=!1,A.isProcessingQueue=!1,A.emit("playbackStopped"))}else A.isProcessingQueue=!1}})()}stop(){this.stopImmediate()}reset(){this.stop(),this.audioQueue=[],this.pcmChunkQueue=[]}stopImmediate(){var A=this.isPlaying||null!==this.currentSource||this.scheduledSources.size>0;if(console.log("🛑 AudioPlayer.stopImmediate() called"),console.log(" isPlaying:",this.isPlaying),console.log(" currentSource:",null!==this.currentSource),console.log(" scheduledSources.size:",this.scheduledSources.size),console.log(" scheduledBuffers:",this.scheduledBuffers),this._isStopped=!0,this.isSchedulingFrames=!1,this.currentSource){try{console.log(" Stopping currentSource..."),this.currentSource.stop()}catch(A){console.log(" currentSource already stopped or error:",A.message)}this.currentSource=null}if(this.scheduledSources.size>0){console.log(" Stopping ".concat(this.scheduledSources.size," scheduled sources..."));var e=0,t=Array.from(this.scheduledSources),n=t.length;for(var o of(this.scheduledSources.clear(),this.scheduledBuffers=0,t))try{o.stop(),e++}catch(A){console.log(" Source already stopped or not started:",A.message)}console.log(" Stopped ".concat(e," sources (cleared ").concat(n," from scheduledSources)"))}this.isPlaying=!1,this.isProcessingQueue=!1,this.audioQueue=[],this.pcmChunkQueue=[],this.preparedBuffer=[],this.isProcessingPcmQueue=!1,this.isSchedulingFrames=!1,this._emptySentenceTimeout&&(clearTimeout(this._emptySentenceTimeout),this._emptySentenceTimeout=null),this.nextStartTime=0,this.clearTranscriptState(),A&&(console.log("🛑 AudioPlayer: Emitting playbackStopped event (stopImmediate called)"),this.emit("playbackStopped"))}markNewSentence(A){var e=this._isStopped,t=this.isPlaying||this.scheduledSources.size>0;this._isStopped?(console.log("🛑 AudioPlayer: Clearing stopped flag - new audio starting after barge-in"),this._isStopped=!1,this.nextStartTime=0,this.scheduledBuffers<0&&console.log("🔄 AudioPlayer: scheduledBuffers was negative (".concat(this.scheduledBuffers,"), resetting to 0")),this.scheduledBuffers=0,this.preparedBuffer.length>0&&console.log("🔄 AudioPlayer: Clearing ".concat(this.preparedBuffer.length," prepared frames from previous sentence (after barge-in)")),this.preparedBuffer=[],this.pcmChunkQueue.length>0&&console.log("🔄 AudioPlayer: Clearing ".concat(this.pcmChunkQueue.length," raw PCM chunks from previous sentence (after barge-in)")),this.pcmChunkQueue=[],this.isProcessingPcmQueue=!1,console.log("🔄 AudioPlayer: Reset scheduling state for new sentence (after barge-in)")):t&&console.log("📝 AudioPlayer: New sentence queued while audio playing - will start after current sentence finishes"),this.pendingSentenceText=A,console.log('📝 AudioPlayer: New sentence marked: "'.concat(A.substring(0,40),'..." (wasStopped: ').concat(e,", isPlaying: ").concat(t,")")),this._emptySentenceTimeout&&clearTimeout(this._emptySentenceTimeout);var n=A;this._emptySentenceTimeout=setTimeout(()=>{this.pendingSentenceText!==n||0!==this.scheduledBuffers||0!==this.preparedBuffer.length||0!==this.pcmChunkQueue.length||this._isStopped||(console.warn('⚠️ AudioPlayer: Empty sentence detected after 5s timeout - no chunks received for: "'.concat(n.substring(0,40),'..."')),this.pendingSentenceText===n&&(this.pendingSentenceText=null),this.isPlaying||0!==this.scheduledSources.size||(console.log("🛑 AudioPlayer: Emitting playbackStopped for empty sentence timeout"),this.emit("playbackStopped"))),this._emptySentenceTimeout=null},5e3)}startTranscriptChecker(){if(!this.isCheckingTranscripts){this.isCheckingTranscripts=!0,console.log("📝 AudioPlayer: Transcript checker started");var A=()=>{if(this.isCheckingTranscripts&&this.audioContext){var e=this.audioContext.currentTime;for(var t of this.sentenceTimings)!t.displayed&&e>=t.startTime&&(t.displayed=!0,console.log("📝 AudioPlayer: Display transcript at ".concat(e.toFixed(3),'s: "').concat(t.text.substring(0,40),'..."')),this.emit("transcriptDisplay",{text:t.text}));this.isPlaying||this.scheduledBuffers>0?requestAnimationFrame(A):(this.isCheckingTranscripts=!1,console.log("📝 AudioPlayer: Transcript checker stopped"))}};requestAnimationFrame(A)}}clearTranscriptState(){this.pendingSentenceText=null,this.sentenceTimings=[],this.isCheckingTranscripts=!1,console.log("📝 AudioPlayer: Transcript state cleared")}resumeAudioContext(){var A=this;return g(function*(){if(A.audioContext&&"closed"!==A.audioContext.state){if("suspended"===A.audioContext.state)try{yield A.audioContext.resume(),console.log("✅ AudioPlayer v2: AudioContext resumed after mic permission")}catch(A){console.warn("⚠️ AudioPlayer v2: Failed to resume AudioContext:",A)}}else yield A.initializeAudioContext()})()}setVolume(A){this.gainNode?(this.gainNode.gain.value=Math.max(0,Math.min(1,A)),console.log("🔊 AudioPlayer: Volume set to ".concat(this.gainNode.gain.value))):console.warn("⚠️ AudioPlayer: Cannot set volume - gainNode not initialized")}setMuted(A){this.setVolume(A?0:1)}getStatus(){return{isPlaying:this.isPlaying,isProcessingQueue:this.isProcessingQueue,queueLength:this.audioQueue.length,audioContextState:this.audioContext?this.audioContext.state:"closed",outputFormat:this.outputFormat,scheduledBuffers:this.scheduledBuffers,preparedBufferLength:this.preparedBuffer.length,scheduledSourcesCount:this.scheduledSources.size}}destroy(){this.stop(),this._cleanupAudioContext(),this.removeAllListeners()}};class h{constructor(){this.events={}}on(A,e){this.events[A]||(this.events[A]=[]),this.events[A].push(e)}off(A,e){this.events[A]&&(this.events[A]=this.events[A].filter(A=>A!==e))}emit(A){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];this.events[A]&&this.events[A].forEach(e=>{try{e(...t)}catch(e){console.error("Error in event listener for ".concat(A,":"),e)}})}removeAllListeners(A){A?delete this.events[A]:this.events={}}}function B(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function m(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?B(Object(t),!0).forEach(function(e){f(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):B(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function f(A,e,t){return(e=function(A){var e=function(A){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==typeof e?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function v(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function w(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){v(i,n,o,r,s,"next",A)}function s(A){v(i,n,o,r,s,"throw",A)}r(void 0)})}}class C extends h{constructor(A){super(),this.config=A,this.audioContext=null,this.audioWorkletNode=null,this.mediaStream=null,this.isRecording=!1}getAudioProcessorPath(){if(this.config.audioProcessorPath)return this.config.audioProcessorPath;var A=document.getElementsByTagName("script");for(var e of A){var t=e.src;if(t&&(t.includes("agent-widget.js")||t.includes("ttp-agent-sdk")))try{new URL(t);var n=t.substring(0,t.lastIndexOf("/"));return"".concat(n,"/audio-processor.js")}catch(A){var o=t.substring(0,t.lastIndexOf("/"));return"".concat(o,"/audio-processor.js")}}return"https://cdn.talktopc.com/audio-processor.js"}checkPermissionState(){return w(function*(){try{if(navigator.permissions&&navigator.permissions.query)return(yield navigator.permissions.query({name:"microphone"})).state}catch(A){console.log("⚠️ AudioRecorder: Permissions API not available or not supported for microphone")}return null})()}requestPermission(){var A=this;return w(function*(){try{if("granted"===(yield A.checkPermissionState()))return console.log("✅ AudioRecorder: Microphone permission already granted"),!0;console.log("🎤 AudioRecorder: Requesting microphone permission...");var e=A.config.sampleRate||A.config.outputSampleRate||44100,t={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},n=A.config.audioConstraints?m(m({},t),A.config.audioConstraints):t;return(yield navigator.mediaDevices.getUserMedia({audio:m({sampleRate:e,channelCount:1},n)})).getTracks().forEach(A=>A.stop()),console.log("✅ AudioRecorder: Microphone permission granted"),!0}catch(A){return console.error("❌ AudioRecorder: Failed to get microphone permission:",A),!1}})()}start(){var A=this;return w(function*(){try{console.log("🎤 AudioRecorder: Requesting microphone access...");var e=yield A.checkPermissionState();e&&(console.log("📋 AudioRecorder: Current permission state: ".concat(e)),"denied"===e&&console.warn('⚠️ AudioRecorder: Permission state is "denied" - browser may not show prompt. User may need to change in browser settings.'));var t=A.config.sampleRate||A.config.outputSampleRate||44100,n={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},o=A.config.audioConstraints?m(m({},n),A.config.audioConstraints):n;if(A.mediaStream=yield navigator.mediaDevices.getUserMedia({audio:m({sampleRate:t,channelCount:1},o)}),A.config.checkConnection&&"function"==typeof A.config.checkConnection&&!A.config.checkConnection()){A.mediaStream.getTracks().forEach(A=>A.stop()),A.mediaStream=null;var i=new Error("Connection lost - server may have rejected the call");throw i.name="ServerRejected",i.isServerRejection=!0,i}if(A.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:t}),"suspended"===A.audioContext.state&&(yield A.audioContext.resume()),A.config.checkConnection&&"function"==typeof A.config.checkConnection&&!A.config.checkConnection()){A.mediaStream.getTracks().forEach(A=>A.stop()),A.mediaStream=null,A.audioContext&&"closed"!==A.audioContext.state&&(yield A.audioContext.close()),A.audioContext=null;var r=new Error("Connection lost - server may have rejected the call");throw r.name="ServerRejected",r.isServerRejection=!0,r}var s=A.getAudioProcessorPath();if(yield A.audioContext.audioWorklet.addModule(s),A.config.checkConnection&&"function"==typeof A.config.checkConnection&&!A.config.checkConnection()){A.mediaStream.getTracks().forEach(A=>A.stop()),A.mediaStream=null,A.audioContext&&"closed"!==A.audioContext.state&&(yield A.audioContext.close()),A.audioContext=null;var a=new Error("Connection lost - server may have rejected the call");throw a.name="ServerRejected",a.isServerRejection=!0,a}A.audioWorkletNode=new AudioWorkletNode(A.audioContext,"audio-processor",{processorOptions:{sampleRate:t,outputSampleRate:A.config.outputSampleRate}});var c=A.audioContext.createMediaStreamSource(A.mediaStream);c.connect(A.audioWorkletNode),A.mediaStreamSource=c,A.audioWorkletNode.port.onmessage=e=>{var{type:t,data:n}=e.data;"pcm_audio_data"===t&&A.emit("audioData",n)},A.audioWorkletNode.port.postMessage({type:"setForceContinuous",data:{enabled:!0}}),console.log("✅ AudioRecorder: Microphone access granted"),A.isRecording=!0,A.emit("recordingStarted")}catch(i){if(i.isServerRejection||"ServerRejected"===i.name)throw i;var l=i.message;if("NotAllowedError"===i.name||"PermissionDeniedError"===i.name){var d=yield A.checkPermissionState();"denied"===d?(l='Microphone access was blocked. To enable it: 1) Click the lock icon (🔒) in your browser\'s address bar, 2) Find "Microphone" and change it to "Allow", 3) Refresh this page and try again.',console.error("❌ AudioRecorder: Permission explicitly denied. User must change in browser settings.")):"prompt"===d?(l='Microphone permission was denied. Click the "Voice Call" button again to see the permission prompt.',console.error('❌ AudioRecorder: Permission denied but state is "prompt" - user can try again.')):(l="Microphone permission was denied. Click the button again to retry, or enable microphone access in your browser settings (lock icon 🔒 in address bar).",console.error("❌ AudioRecorder: Permission denied. User can try again or change in browser settings."))}else"NotFoundError"===i.name||"DevicesNotFoundError"===i.name?(l="No microphone found. Please connect a microphone and try again.",console.error("❌ AudioRecorder: No microphone device found.")):"NotReadableError"===i.name||"TrackStartError"===i.name?(l="Microphone is already in use by another application. Please close other apps using the microphone and try again.",console.error("❌ AudioRecorder: Microphone is busy or not readable.")):"SecurityError"!==i.name&&"PermissionDeniedError"!==i.name||(l="Microphone access blocked. On mobile devices, please tap the recording button directly (not from an iframe or popup).",console.error("❌ AudioRecorder: User agent blocked microphone access. This often happens on mobile when not called from direct user interaction."));var u=new Error(l);throw u.name=i.name,u.originalError=i,A.emit("error",u),u}})()}stop(){var A=this;return w(function*(){if(A.isRecording)try{if(A.mediaStreamSource)try{console.log("🛑 AudioRecorder: Disconnecting media stream source to stop audio flow..."),A.mediaStreamSource.disconnect(),A.mediaStreamSource=null,console.log("✅ AudioRecorder: Media stream source disconnected")}catch(A){console.warn("⚠️ AudioRecorder: Error disconnecting source:",A)}if(A.audioWorkletNode){console.log("🛑 AudioRecorder: Sending stop message to AudioWorklet to stop VAD..."),A.audioWorkletNode.port.postMessage({type:"stop"}),yield new Promise(A=>setTimeout(A,150)),A.audioWorkletNode.port.postMessage({type:"flush"}),yield new Promise(A=>setTimeout(A,50));try{A.audioWorkletNode.disconnect(),console.log("✅ AudioRecorder: AudioWorkletNode disconnected")}catch(A){console.log("⚠️ AudioRecorder: AudioWorkletNode already disconnected")}}A.mediaStream&&(console.log("🛑 AudioRecorder: Stopping media stream tracks..."),A.mediaStream.getTracks().forEach(A=>{A.stop(),console.log("✅ AudioRecorder: Stopped track:",A.kind)}),A.mediaStream=null),A.audioContext&&"closed"!==A.audioContext.state&&(console.log("🛑 AudioRecorder: Closing AudioContext..."),yield A.audioContext.close(),A.audioContext=null,console.log("✅ AudioRecorder: AudioContext closed")),A.audioWorkletNode=null,A.isRecording=!1,A.emit("recordingStopped"),console.log("✅ AudioRecorder: Recording stopped, VAD should be stopped")}catch(e){throw A.emit("error",e),e}})()}resumeAudioContext(){var A=this;return w(function*(){if(A.isRecording&&A.audioContext)try{if("suspended"===A.audioContext.state&&(console.log("🔄 AudioRecorder: Resuming suspended AudioContext..."),yield A.audioContext.resume(),console.log("✅ AudioRecorder: AudioContext resumed")),A.mediaStream){var e=A.mediaStream.getAudioTracks();0===e.filter(A=>"live"===A.readyState).length&&e.length>0&&(console.warn("⚠️ AudioRecorder: All audio tracks are inactive. Recording may have stopped."),A.emit("tracksInactive"))}}catch(e){console.error("❌ AudioRecorder: Failed to resume AudioContext:",e),A.emit("error",e)}})()}getStatus(){return{isRecording:this.isRecording,audioContextState:this.audioContext?this.audioContext.state:"closed"}}destroy(){this.stop()}}class y{static extractPcmFromWav(A){var e=A instanceof Uint8Array?A:new Uint8Array(A);if(e.length<44)throw new Error("WAV data too short (< 44 bytes)");if("RIFF"!==String.fromCharCode(e[0],e[1],e[2],e[3]))throw new Error("Not a valid WAV file - missing RIFF header");if("WAVE"!==String.fromCharCode(e[8],e[9],e[10],e[11]))throw new Error("Not a valid WAV file - missing WAVE format");for(var t=e[22]|e[23]<<8,n=e[24]|e[25]<<8|e[26]<<16|e[27]<<24,o=e[34]|e[35]<<8,i=-1,r=12;r<e.length-8;r+=4){if("data"===String.fromCharCode(e[r],e[r+1],e[r+2],e[r+3])){i=r;break}r+=4+(e[r+4]|e[r+5]<<8|e[r+6]<<16|e[r+7]<<24)}if(-1===i)throw new Error("No data chunk found in WAV");var s=e[i+4]|e[i+5]<<8|e[i+6]<<16|e[i+7]<<24,a=i+8,c=Math.min(s,e.length-a);return{pcmData:e.slice(a,a+c).buffer,format:{sampleRate:n,channels:t,bitDepth:o}}}static isWavFile(A){return A.length>=44&&82===A[0]&&73===A[1]&&70===A[2]&&70===A[3]}static createWavHeader(A,e,t,n){var o=new ArrayBuffer(44),i=new DataView(o);return i.setUint32(0,1380533830,!1),i.setUint32(4,36+A,!0),i.setUint32(8,1463899717,!1),i.setUint32(12,1718449184,!1),i.setUint32(16,16,!0),i.setUint16(20,1,!0),i.setUint16(22,t,!0),i.setUint32(24,e,!0),i.setUint32(28,e*t*n/8,!0),i.setUint16(32,t*n/8,!0),i.setUint16(34,n,!0),i.setUint32(36,1684108385,!1),i.setUint32(40,A,!0),o}static wrapPcmInWav(A,e){var t=y.createWavHeader(A.byteLength,e.sampleRate,e.channels||1,e.bitDepth||16),n=new Uint8Array(t.byteLength+A.byteLength);return n.set(new Uint8Array(t),0),n.set(new Uint8Array(A),t.byteLength),n.buffer}}const b=y,x=class{constructor(){this.codecs={pcm:new c,pcmu:new l,pcma:new d}}decodeToPcm(A,e){var t=null==e?void 0:e.toLowerCase();if(!t||"pcm"===t)return A instanceof ArrayBuffer?A:A instanceof Uint8Array?A.buffer:A;var n=this.codecs[t];if(!n)throw new Error("Unsupported encoding: ".concat(e));var o=A instanceof Uint8Array?A:new Uint8Array(A);return n.decode(o)}encodeFromPcm(A,e){var t=null==e?void 0:e.toLowerCase();if(!t||"pcm"===t)return A;var n=this.codecs[t];if(!n)throw new Error("Unsupported target encoding: ".concat(e));var o=n.encode(A);return o instanceof Uint8Array?o.buffer:o}getCodec(A){var e=null==A?void 0:A.toLowerCase();return this.codecs[e]||null}};class Q{static convert(A,e,t){if(e===t)return A;if(8===e)throw new Error("Source bit depth cannot be 8-bit (only 16-bit or 24-bit supported)");var n=e/8,o=t/8,i=A.byteLength/n;if(new ArrayBuffer(i*o),16===e&&16===t)return A;if(24===e&&16===t)return Q.convert24To16(A);if(16===e&&24===t)return Q.convert16To24(A);if(16===e&&8===t)return Q.convert16To8(A);if(24===e&&8===t)return Q.convert24To8(A);throw new Error("Unsupported bit depth conversion: ".concat(e,"-bit → ").concat(t,"-bit"))}static convert24To16(A){for(var e=new Uint8Array(A),t=Math.floor(e.length/3),n=new Int16Array(t),o=0;o<t;o++){var i=e[3*o],r=e[3*o+1],s=e[3*o+2],a=i|r<<8|(255&s)<<16;128&s&&(a|=4278190080),n[o]=Math.max(-32768,Math.min(32767,Math.round(a/256)))}return n.buffer}static convert16To24(A){for(var e=new Int16Array(A),t=new Uint8Array(3*e.length),n=0;n<e.length;n++){var o=256*e[n];t[3*n]=255&o,t[3*n+1]=o>>8&255,t[3*n+2]=o>>16&255}return t.buffer}static convert16To8(A){for(var e=new Int16Array(A),t=new Uint8Array(e.length),n=0;n<e.length;n++){var o=e[n];t[n]=Math.max(0,Math.min(255,Math.round(o/256+128)))}return t.buffer}static convert24To8(A){var e=Q.convert24To16(A);return Q.convert16To8(e)}}const F=Q;function U(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}const S=class{static resample(A,e,t){return(n=function*(){if(e===t)return A;for(var n=new Int16Array(A),o=new Float32Array(n.length),i=1/32768,r=0;r<n.length;r++)o[r]=n[r]*i;var s=Math.ceil(o.length*t/e),a=new OfflineAudioContext(1,s,t),c=a.createBuffer(1,o.length,e);c.getChannelData(0).set(o);var l=a.createBufferSource();l.buffer=c,l.connect(a.destination),l.start();for(var d=(yield a.startRendering()).getChannelData(0),u=new Int16Array(d.length),g=0;g<d.length;g++){var p=Math.max(-1,Math.min(1,d[g]));u[g]=Math.round(32767*p)}return u.buffer},function(){var A=this,e=arguments;return new Promise(function(t,o){var i=n.apply(A,e);function r(A){U(i,t,o,r,s,"next",A)}function s(A){U(i,t,o,r,s,"throw",A)}r(void 0)})})();var n}};class I{static convert(A,e,t){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:16;if(e===t)return A;if(1===e&&1===t)return A;if(1===e&&2===t)return I.monoToStereo(A,n);if(2===e&&1===t)return I.stereoToMono(A,n);throw new Error("Unsupported channel conversion: ".concat(e," → ").concat(t))}static monoToStereo(A,e){for(var t=e/8,n=A.byteLength/t,o=new ArrayBuffer(n*t*2),i=new Uint8Array(A),r=new Uint8Array(o),s=0;s<n;s++)for(var a=s*t,c=s*t*2,l=0;l<t;l++)r[c+l]=i[a+l],r[c+t+l]=i[a+l];return o}static stereoToMono(A,e){var t=e/8,n=A.byteLength/(2*t),o=new ArrayBuffer(n*t),i=new Uint8Array(A),r=new Uint8Array(o);if(16===e)for(var s=0;s<n;s++){var a=s*t*2,c=a+t,l=(i[a]|i[a+1]<<8)<<16>>16,d=(i[c]|i[c+1]<<8)<<16>>16,u=Math.round((l+d)/2),g=s*t;r[g]=255&u,r[g+1]=u>>8&255}else for(var p=0;p<n;p++)for(var h=p*t*2,B=p*t,m=0;m<t;m++)r[B+m]=i[h+m];return o}}const E=I;function k(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function H(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?k(Object(t),!0).forEach(function(e){T(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):k(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function T(A,e,t){return(e=function(A){var e=function(A){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==typeof e?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function D(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}const K=class{constructor(A,e){this.requestedFormat=A,this.actualFormat=e,this.encodingConverter=new x,this.conversionSteps=[],this._analyzeConversions()}_analyzeConversions(){this.conversionSteps=[],this.actualFormat.container!==this.requestedFormat.container&&("wav"===this.actualFormat.container?this.conversionSteps.push("extract_wav"):"wav"===this.requestedFormat.container&&this.conversionSteps.push("wrap_wav")),this.actualFormat.encoding!==this.requestedFormat.encoding&&("pcm"!==this.actualFormat.encoding&&this.conversionSteps.push("decode_encoding"),"pcm"!==this.requestedFormat.encoding&&this.conversionSteps.push("encode_encoding")),this.actualFormat.sampleRate!==this.requestedFormat.sampleRate&&this.conversionSteps.push("resample"),this.actualFormat.bitDepth!==this.requestedFormat.bitDepth&&this.conversionSteps.push("convert_bitdepth"),this.actualFormat.channels!==this.requestedFormat.channels&&this.conversionSteps.push("convert_channels")}needsConversion(){return this.conversionSteps.length>0}getConversionSteps(){var A=[];return this.conversionSteps.includes("extract_wav")&&A.push("Extract PCM from WAV (".concat(this.actualFormat.container," → raw)")),this.conversionSteps.includes("decode_encoding")&&A.push("Decode ".concat(this.actualFormat.encoding.toUpperCase()," → PCM")),this.conversionSteps.includes("resample")&&A.push("Resample ".concat(this.actualFormat.sampleRate,"Hz → ").concat(this.requestedFormat.sampleRate,"Hz")),this.conversionSteps.includes("convert_bitdepth")&&A.push("Convert bit depth ".concat(this.actualFormat.bitDepth,"-bit → ").concat(this.requestedFormat.bitDepth,"-bit")),this.conversionSteps.includes("convert_channels")&&A.push("Convert channels ".concat(this.actualFormat.channels," → ").concat(this.requestedFormat.channels)),this.conversionSteps.includes("encode_encoding")&&A.push("Encode PCM → ".concat(this.requestedFormat.encoding.toUpperCase())),this.conversionSteps.includes("wrap_wav")&&A.push("Wrap in WAV container (raw → ".concat(this.requestedFormat.container,")")),A}convert(A){var e,t=this;return(e=function*(){if(!t.needsConversion())return A instanceof ArrayBuffer?A:A.buffer;var e=A instanceof ArrayBuffer?A:A.buffer,n=H({},t.actualFormat);if(t.conversionSteps.includes("extract_wav")){var o=b.extractPcmFromWav(e);e=o.pcmData,n=H(H({},n),{},{container:"raw",sampleRate:o.format.sampleRate,channels:o.format.channels,bitDepth:o.format.bitDepth}),console.log("🔄 AudioFormatConverter: Extracted PCM from WAV",o.format)}if(t.conversionSteps.includes("decode_encoding")&&(e=t.encodingConverter.decodeToPcm(e,n.encoding),n.encoding="pcm",n.bitDepth=16,console.log("🔄 AudioFormatConverter: Decoded ".concat(t.actualFormat.encoding.toUpperCase()," → PCM"))),24===n.bitDepth&&n.bitDepth!==t.requestedFormat.bitDepth&&(t.conversionSteps.includes("resample")||t.conversionSteps.includes("convert_channels")||24!==t.requestedFormat.bitDepth)&&(e=F.convert(e,24,16),n.bitDepth=16,console.log("🔄 AudioFormatConverter: Normalized 24-bit → 16-bit PCM")),t.conversionSteps.includes("resample")&&(e=yield S.resample(e,n.sampleRate,t.requestedFormat.sampleRate),n.sampleRate=t.requestedFormat.sampleRate,console.log("🔄 AudioFormatConverter: Resampled ".concat(t.actualFormat.sampleRate,"Hz → ").concat(t.requestedFormat.sampleRate,"Hz"))),t.conversionSteps.includes("convert_channels")&&(e=E.convert(e,n.channels,t.requestedFormat.channels,n.bitDepth),n.channels=t.requestedFormat.channels,console.log("🔄 AudioFormatConverter: Converted channels ".concat(t.actualFormat.channels," → ").concat(t.requestedFormat.channels))),t.conversionSteps.includes("convert_bitdepth")&&(e=F.convert(e,n.bitDepth,t.requestedFormat.bitDepth),n.bitDepth=t.requestedFormat.bitDepth,console.log("🔄 AudioFormatConverter: Converted bit depth ".concat(t.actualFormat.bitDepth,"-bit → ").concat(t.requestedFormat.bitDepth,"-bit"))),t.conversionSteps.includes("encode_encoding")){var i=t.encodingConverter.encodeFromPcm(e,t.requestedFormat.encoding);e=i instanceof ArrayBuffer?i:i.buffer,n.encoding=t.requestedFormat.encoding,console.log("🔄 AudioFormatConverter: Encoded PCM → ".concat(t.requestedFormat.encoding.toUpperCase()))}return t.conversionSteps.includes("wrap_wav")&&(e=b.wrapPcmInWav(e,n),n.container="wav",console.log("🔄 AudioFormatConverter: Wrapped in WAV container")),console.log("✅ AudioFormatConverter: Conversion complete"),e},function(){var A=this,t=arguments;return new Promise(function(n,o){var i=e.apply(A,t);function r(A){D(i,n,o,r,s,"next",A)}function s(A){D(i,n,o,r,s,"throw",A)}r(void 0)})})()}};function L(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}const M=class{constructor(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:()=>null;this.handlers=new Map,this.sendMessage=A,this.getConversationId=e}registerHandler(A,e){if("function"!=typeof e)throw new Error("Handler for tool '".concat(A,"' must be a function"));this.handlers.set(A,e),console.log("🔧 ClientTools: Registered handler for '".concat(A,"'"))}unregisterHandler(A){this.handlers.delete(A),console.log("🔧 ClientTools: Unregistered handler for '".concat(A,"'"))}hasHandler(A){return this.handlers.has(A)}getRegisteredTools(){return Array.from(this.handlers.keys())}handleToolCall(A){var e,t=this;return(e=function*(){var{toolCallId:e,toolName:n,parameters:o}=A,i=Date.now(),r=(new Date).toISOString();console.log("🔧 ClientTools: [".concat(r,"] Received tool call '").concat(n,"' (id: ").concat(e,")")),console.log(" 📋 Full message received:",JSON.stringify(A,null,2)),console.log(" ⏱️ Start time: ".concat(i,"ms (").concat(new Date(i).toISOString(),")"));var s=t.handlers.get(n);if(!s){var a=Array.from(t.handlers.keys());return console.error("🔧 ClientTools: No handler registered for '".concat(n,"'")),console.error(" 📋 Currently registered tools:",a),console.error(" 📋 Total registered: ".concat(a.length)),void t.sendError(e,n,"No handler registered for tool '".concat(n,"'"),"NO_HANDLER",i)}try{var c=yield s(o),l=Date.now()-i;console.log("🔧 ClientTools: Tool '".concat(n,"' completed in ").concat(l,"ms")),t.sendResult(e,n,c,l)}catch(A){var d,u,g=Date.now()-i;console.error("🔧 ClientTools: Tool '".concat(n,"' failed:"),A);var p="EXECUTION_ERROR";"NotAllowedError"===A.name||null!==(d=A.message)&&void 0!==d&&d.includes("permission")?p="PERMISSION_DENIED":("NotSupportedError"===A.name||null!==(u=A.message)&&void 0!==u&&u.includes("not supported"))&&(p="API_UNAVAILABLE"),t.sendError(e,n,A.message||"Unknown error",p,g)}},function(){var A=this,t=arguments;return new Promise(function(n,o){var i=e.apply(A,t);function r(A){L(i,n,o,r,s,"next",A)}function s(A){L(i,n,o,r,s,"throw",A)}r(void 0)})})()}sendResult(A,e,t,n){var o=this.getConversationId(),i=(new Date).toISOString(),r={t:"client_tool_result",toolCallId:A,toolName:e,conversationId:o,result:t,executionTimeMs:n};console.log("🔧 ClientTools: [".concat(i,"] Sending result for tool '").concat(e,"'")),console.log(" 📋 toolCallId: ".concat(A)),console.log(" 📋 conversationId: ".concat(o||"null")),console.log(" 📋 toolName: ".concat(e)),console.log(" 📋 result:",t),console.log(" 📋 Full message:",JSON.stringify(r,null,2)),this.sendMessage(r),console.log("✅ ClientTools: Result message sent at ".concat(i))}sendError(A,e,t,n,o){var i="number"==typeof o?Date.now()-o:o,r=(new Date).toISOString(),s=this.getConversationId(),a={t:"client_tool_error",toolCallId:A,toolName:e,conversationId:s,error:t,errorCode:n,executionTimeMs:i};console.log("🔧 ClientTools: [".concat(r,"] Sending error for tool '").concat(e,"'")),console.log(" 📋 toolCallId: ".concat(A)),console.log(" 📋 conversationId: ".concat(s||"null")),console.log(" 📋 toolName: ".concat(e)),console.log(" 📋 error: ".concat(t,", errorCode: ").concat(n)),console.log(" 📋 Full message:",JSON.stringify(a,null,2)),this.sendMessage(a),console.log("✅ ClientTools: Error message sent at ".concat(r))}setSendMessage(A){this.sendMessage=A}};var R=i(354),P=i.n(R);function O(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function V(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?O(Object(t),!0).forEach(function(e){_(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):O(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function _(A,e,t){return(e=function(A){var e=function(A){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==typeof e?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function N(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}var G={useCORS:!0,allowTaint:!1,backgroundColor:"#ffffff",scale:1,logging:!1,imageTimeout:15e3};function W(){return j.apply(this,arguments)}function j(){var A;return A=function*(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{selector:e=null,format:t="jpeg",quality:n=.85,scale:o=1,maxWidth:i=1280,maxHeight:r=1280,fullPage:s=!1}=A;console.log("📸 SDK Screenshot: Starting capture with options:",A);var a=Date.now();try{var c=document.body;if(e){var l=document.querySelector(e);if(!l)throw new Error("Element not found: ".concat(e));c=l,console.log("📸 SDK Screenshot: Capturing element: ".concat(e))}else console.log("📸 SDK Screenshot: Capturing entire page");var d=V(V({},G),{},{scale:o});s&&!e&&(d.windowHeight=document.documentElement.scrollHeight,d.height=document.documentElement.scrollHeight,d.y=0);var u=yield P()(c,d);console.log("📸 SDK Screenshot: Canvas created (".concat(u.width,"x").concat(u.height,")"));var g=u;(i||r)&&(g=function(A,e,t){var{width:n,height:o}=A,i=1;if(e&&n>e&&(i=Math.min(i,e/n)),t&&o>t&&(i=Math.min(i,t/o)),1===i)return A;var r=Math.round(n*i),s=Math.round(o*i),a=document.createElement("canvas");return a.width=r,a.height=s,a.getContext("2d").drawImage(A,0,0,r,s),a}(u,i,r),g!==u&&console.log("📸 SDK Screenshot: Resized to ".concat(g.width,"x").concat(g.height)));var p="jpeg"===t?"image/jpeg":"image/png",h=g.toDataURL(p,"jpeg"===t?n:void 0).split(",")[1],B=Date.now()-a;return console.log("📸 SDK Screenshot: Capture completed in ".concat(B,"ms")),console.log("📸 SDK Screenshot: Size: ".concat(Math.round(h.length/1024),"KB")),{image:h,mimeType:p,width:g.width,height:g.height,captureTimeMs:B,selector:e||"body"}}catch(A){throw console.error("📸 SDK Screenshot: Capture failed:",A),new Error("Screenshot capture failed: ".concat(A.message))}},j=function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){N(i,n,o,r,s,"next",A)}function s(A){N(i,n,o,r,s,"throw",A)}r(void 0)})},j.apply(this,arguments)}var z={types:["password"],names:["cc","card","credit","cvv","cvc","csc","expir","cardnumber","card-number","card_number","cardholder","card-holder","card_holder","password","pwd","passwd","pass","secret","token","auth","api-key","apikey","api_key","access-key","accesskey","access_key","secret-key","secretkey","secret_key","private-key","privatekey","private_key","bearer","jwt","ssn","social-security","social_security","socialsecurity","tax-id","taxid","tax_id","national-id","nationalid","national_id","credential","private","secure"],autocomplete:["cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc","cc-name","cc-type","current-password","new-password"],dataAttributes:["data-secret","data-sensitive","data-private","data-api-key","data-token","data-auth"]};function X(A){if(!A)return!1;var e=(A.type||"").toLowerCase(),t=(A.name||"").toLowerCase(),n=(A.id||"").toLowerCase(),o=(A.className||"").toLowerCase(),i=(A.autocomplete||"").toLowerCase(),r=(A.placeholder||"").toLowerCase(),s=(A.getAttribute("aria-label")||"").toLowerCase(),a="".concat(t," ").concat(n," ").concat(o," ").concat(r," ").concat(s);if(z.types.includes(e))return!0;if(z.autocomplete.includes(i))return!0;for(var c of z.names)if(a.includes(c))return!0;for(var l of z.dataAttributes)if(A.hasAttribute(l))return!0;return"password"===(A.inputMode||"").toLowerCase()}function J(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function Y(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?J(Object(t),!0).forEach(function(e){q(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):J(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function q(A,e,t){return(e=function(A){var e=function(A){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==typeof e?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function Z(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}var $={buttons:20,links:30,forms:5,fieldsPerForm:15,sections:10,headings:15,maxTextLength:100,maxSummaryLength:150};function AA(A){var e,t;if(!A||!A.tagName)return null;if(null!==(e=A.dataset)&&void 0!==e&&e.testid)return'[data-testid="'.concat(A.dataset.testid,'"]');if(null!==(t=A.dataset)&&void 0!==t&&t.cy)return'[data-cy="'.concat(A.dataset.cy,'"]');var n=A.getAttribute("aria-label");if(n&&n.length<50)return'[aria-label="'.concat(n.replace(/"/g,'\\"'),'"]');if(A.id&&!eA(A.id))return"#".concat(CSS.escape(A.id));if(A.name){var o=A.tagName.toLowerCase();return"".concat(o,'[name="').concat(A.name,'"]')}if(["BUTTON","A"].includes(A.tagName)){var i,r=null===(i=A.innerText)||void 0===i?void 0:i.trim();if(r&&r.length<30&&r.length>0){var s=A.tagName.toLowerCase(),a=document.querySelectorAll("".concat(s));if(1===Array.from(a).filter(A=>{var e;return(null===(e=A.innerText)||void 0===e?void 0:e.trim())===r}).length)return"".concat(s,':contains("').concat(r.replace(/"/g,'\\"'),'")')}}return function(A){for(var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,t=[],n=A,o=0;n&&n!==document.body&&o<e;){var i=n.tagName.toLowerCase();if(n.id&&!eA(n.id)){t.unshift("#".concat(CSS.escape(n.id)));break}var r=tA(n);if(r)t.unshift("".concat(i,".").concat(r));else{var s,a=null===(s=n.parentElement)||void 0===s?void 0:s.children;if(a&&a.length>1){var c=Array.from(a).indexOf(n)+1;t.unshift("".concat(i,":nth-child(").concat(c,")"))}else t.unshift(i)}n=n.parentElement,o++}return t.join(" > ")}(A)}function eA(A){return[/^:r[0-9a-z]+:$/,/^react-/i,/^ng-/i,/^vue-/i,/^ember[0-9]+/i,/^_[a-z0-9]{8,}$/i,/^[a-f0-9]{8}-[a-f0-9]{4}/i,/^uid-/i,/^id[0-9]+$/i].some(e=>e.test(A))}function tA(A){var e=Array.from(A.classList||[]),t=[/^(flex|grid|block|inline|hidden)$/,/^(m|p|w|h|min|max)-/,/^(text|font|bg|border)-/,/^(col|row)-/,/^(sm|md|lg|xl|2xl):/,/^hover:|focus:|active:/,/^[a-z]{1,3}-[0-9]+$/];return e.filter(A=>!t.some(e=>e.test(A))&&A.length>2&&A.length<30)[0]||null}function nA(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,t=A.getBoundingClientRect();return t.bottom>=-e&&t.top<=window.innerHeight+e&&t.right>=0&&t.left<=window.innerWidth}function oA(A){if(!A)return!1;var e=window.getComputedStyle(A);return"none"!==e.display&&"hidden"!==e.visibility&&"0"!==e.opacity&&A.offsetWidth>0&&A.offsetHeight>0}function iA(){return rA.apply(this,arguments)}function rA(){return A=function*(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Y(Y({},$),e.limits),n=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$,e=[],t=document.querySelectorAll('button, [type="submit"], [type="button"], [role="button"], .btn, .button');for(var n of t){if(e.length>=A.buttons)break;if(oA(n)){var o=(n.innerText||n.value||n.getAttribute("aria-label")||"").trim();o&&e.push({selector:AA(n),text:o.substring(0,A.maxTextLength),type:n.type||"button",disabled:n.disabled||!1,inViewport:nA(n,0)})}}return e}(t),o=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$,e=[],t=document.querySelectorAll("a[href]"),n=window.location.origin;for(var o of t){if(e.length>=A.links)break;if(oA(o)){var i=(o.innerText||o.getAttribute("aria-label")||"").trim();if(i&&!(i.length<2)){var r=o.href;if(r&&!r.startsWith("javascript:")&&"#"!==r){var s=!1;try{s=new URL(r).origin===n}catch(A){}e.push({selector:AA(o),text:i.substring(0,A.maxTextLength),href:r,internal:s,inViewport:nA(o,0)})}}}}return e}(t),{forms:i,sensitiveCount:r}=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$,e=[],t=document.querySelectorAll("form"),n=0;for(var o of t){if(e.length>=A.forms)break;if(oA(o)){var i=[],r=o.querySelectorAll("input, textarea, select");for(var s of r){var a,c;if(i.length>=A.fieldsPerForm)break;if("hidden"!==s.type)if(X(s))n++;else{var l=null;if(s.id){var d,u=document.querySelector('label[for="'.concat(s.id,'"]'));l=null==u||null===(d=u.innerText)||void 0===d?void 0:d.trim()}!l&&s.getAttribute("aria-label")&&(l=s.getAttribute("aria-label")),!l&&s.placeholder&&(l=s.placeholder),i.push({selector:AA(s),name:s.name||null,type:s.type||"text",label:(null===(a=l)||void 0===a?void 0:a.substring(0,50))||null,placeholder:(null===(c=s.placeholder)||void 0===c?void 0:c.substring(0,50))||null,required:s.required||!1})}}0!==i.length&&e.push({selector:AA(o),id:o.id||null,action:o.action||null,method:(o.method||"get").toUpperCase(),fields:i})}}return{forms:e,sensitiveCount:n}}(t),s=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$,e=[],t=document.querySelectorAll('section, article, main, [role="main"], [role="region"], .section');for(var n of t){var o,i,r;if(e.length>=A.sections)break;if(oA(n)){var s=n.querySelector("h1, h2, h3"),a=(null==s||null===(o=s.innerText)||void 0===o?void 0:o.trim())||"",c=n.querySelector("p"),l=a||(null==c||null===(i=c.innerText)||void 0===i?void 0:i.trim().substring(0,A.maxSummaryLength))||(null===(r=n.innerText)||void 0===r?void 0:r.trim().substring(0,A.maxSummaryLength))||"";e.push({selector:AA(n),id:n.id||null,tagName:n.tagName.toLowerCase(),summary:l.substring(0,A.maxSummaryLength),inViewport:nA(n,0)})}}return e}(t),a=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:$,e=[],t=document.querySelectorAll("h1, h2, h3");for(var n of t){var o;if(e.length>=A.headings)break;if(oA(n)){var i=null===(o=n.innerText)||void 0===o?void 0:o.trim();i&&e.push({selector:AA(n),level:n.tagName.toLowerCase(),text:i.substring(0,A.maxTextLength),inViewport:nA(n,0)})}}return e}(t),c=n.length+o.length+i.reduce((A,e)=>A+e.fields.length,0)+s.length+a.length,l=n.filter(A=>A.inViewport).length+o.filter(A=>A.inViewport).length+s.filter(A=>A.inViewport).length+a.filter(A=>A.inViewport).length,d=document.documentElement.lang||(null===(A=document.querySelector("html"))||void 0===A?void 0:A.getAttribute("lang"))||null,u=navigator.language||navigator.languages&&navigator.languages[0]||null,g=d||u||null;return{url:window.location.href,title:document.title,timestamp:Date.now(),language:g,viewport:{width:window.innerWidth,height:window.innerHeight,scrollX:window.scrollX,scrollY:window.scrollY,pageHeight:document.documentElement.scrollHeight},buttons:n,links:o,forms:i,sections:s,headings:a,metadata:{totalElements:c,visibleInViewport:l,formsCount:i.length,sensitiveFieldsFiltered:r}}},rA=function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){Z(i,n,o,r,s,"next",A)}function s(A){Z(i,n,o,r,s,"throw",A)}r(void 0)})},rA.apply(this,arguments);var A}function sA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function aA(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){sA(i,n,o,r,s,"next",A)}function s(A){sA(i,n,o,r,s,"throw",A)}r(void 0)})}}function cA(){return cA=aA(function*(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{selector:t,color:n="#6366f1",duration:o=3e3}=e;if(!t)return{success:!1,error:"Selector is required"};var i=document.querySelector(t);if(!i)return{success:!1,error:"Element not found: ".concat(t)};i.scrollIntoView({behavior:"smooth",block:"center",inline:"nearest"}),yield hA(400);var r=i.getBoundingClientRect();lA();var s=document.createElement("div");return s.className="ttp-highlight-overlay",s.style.cssText="\n position: fixed;\n top: ".concat(r.top-4,"px;\n left: ").concat(r.left-4,"px;\n width: ").concat(r.width+8,"px;\n height: ").concat(r.height+8,"px;\n --ttp-highlight-color: ").concat(n,";\n border-color: ").concat(n,";\n box-shadow: 0 0 20px ").concat(n,"80, 0 0 40px ").concat(n,"40;\n pointer-events: none;\n z-index: 2147483647;\n "),document.body.appendChild(s),setTimeout(()=>{s.classList.add("ttp-fade-out"),setTimeout(()=>{s.remove()},300)},o),{success:!0,selector:t,elementInfo:{tag:i.tagName.toLowerCase(),id:i.id||null,text:(null===(A=i.innerText)||void 0===A?void 0:A.trim().substring(0,100))||null,position:{top:r.top,left:r.left,width:r.width,height:r.height}}}}),cA.apply(this,arguments)}function lA(){if(!document.getElementById("ttp-highlight-styles")){var A=document.createElement("style");A.id="ttp-highlight-styles",A.textContent="\n @keyframes ttp-pulse {\n 0%, 100% {\n box-shadow: 0 0 20px var(--ttp-highlight-color, #6366f1)80,\n 0 0 40px var(--ttp-highlight-color, #6366f1)40;\n }\n 50% {\n box-shadow: 0 0 30px var(--ttp-highlight-color, #6366f1)99,\n 0 0 60px var(--ttp-highlight-color, #6366f1)60;\n }\n }\n \n .ttp-highlight-overlay {\n border: 3px solid var(--ttp-highlight-color, #6366f1);\n border-radius: 8px;\n animation: ttp-pulse 1s ease-in-out infinite;\n transition: opacity 0.3s ease;\n }\n \n .ttp-highlight-overlay.ttp-fade-out {\n opacity: 0;\n }\n \n .ttp-fill-success {\n outline: 3px solid #22c55e !important;\n outline-offset: 2px;\n transition: outline 0.3s ease;\n }\n ",document.head.appendChild(A)}}function dA(){return dA=aA(function*(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{selector:e,x:t,y:n,direction:o,amount:i=500,position:r="center",behavior:s="smooth"}=A;if(e){var a=document.querySelector(e);if(!a)return{success:!1,error:"Element not found: ".concat(e)};var c="top"===r?"start":"bottom"===r?"end":"center";a.scrollIntoView({behavior:s,block:c,inline:"nearest"}),yield hA("smooth"===s?500:100);var l=a.getBoundingClientRect();return{success:!0,scrollType:"element",selector:e,elementPosition:{top:l.top,left:l.left}}}if("up"===o||"down"===o){var d,u=i||500,g=window.scrollY,p=document.documentElement.scrollHeight-window.innerHeight;return d="up"===o?Math.max(0,g-u):Math.min(p,g+u),window.scrollTo({top:d,left:window.scrollX,behavior:s}),yield hA("smooth"===s?500:100),{success:!0,scrollType:"relative",direction:o,amount:u,scrolledFrom:{y:g},scrolledTo:{y:window.scrollY},atTop:0===window.scrollY,atBottom:window.scrollY>=p-1}}return void 0!==t||void 0!==n?(window.scrollTo({top:null!=n?n:window.scrollY,left:null!=t?t:window.scrollX,behavior:s}),yield hA("smooth"===s?500:100),{success:!0,scrollType:"position",scrolledTo:{x:null!=t?t:window.scrollX,y:null!=n?n:window.scrollY}}):{success:!1,error:"Either selector, x/y position, or direction (up/down) required"}}),dA.apply(this,arguments)}function uA(){return uA=aA(function*(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{url:t}=e;if(!t)return{success:!1,error:"URL is required"};try{A=new URL(t,window.location.origin)}catch(A){return{success:!1,error:"Invalid URL: ".concat(t)}}if(!["http:","https:"].includes(A.protocol))return{success:!1,error:"Invalid protocol: ".concat(A.protocol)};if(A.origin!==window.location.origin)try{return window.open(A.href,"_blank","noopener,noreferrer"),{success:!0,openedInNewTab:!0,navigatedTo:A.href,message:"Opened external link in a new tab"}}catch(e){return{success:!1,error:"Failed to open external link in new tab: "+e.message,attempted:A.href}}var n=window.location.href;return window.location.href=A.href,{success:!0,navigatedTo:A.href,from:n}}),uA.apply(this,arguments)}function gA(){return gA=aA(function*(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{selector:e,value:t,triggerEvents:n=!0}=A;if(!e)return{success:!1,error:"Selector is required"};if(null==t)return{success:!1,error:"Value is required"};var o=document.querySelector(e);if(!o)return{success:!1,error:"Element not found: ".concat(e)};var i=o.tagName.toLowerCase();if(!["input","textarea","select"].includes(i))return{success:!1,error:"Element is not a form field: ".concat(i)};if(X(o))return{success:!1,error:"Cannot fill sensitive fields (password, credit card, etc.)",blocked:!0,fieldType:o.type,fieldName:o.name};if(o.scrollIntoView({behavior:"smooth",block:"center"}),yield hA(300),o.focus(),"select"===i){var r=Array.from(o.options).find(A=>A.value===t||A.text.toLowerCase()===t.toLowerCase());o.value=r?r.value:t}else if("checkbox"===o.type||"radio"===o.type){var s=!0===t||"true"===t||"1"===t;o.checked=s}else o.value=t;if(n){var a;o.dispatchEvent(new Event("input",{bubbles:!0})),o.dispatchEvent(new Event("change",{bubbles:!0}));var c=null===(a=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value"))||void 0===a?void 0:a.set;c&&(c.call(o,t),o.dispatchEvent(new Event("input",{bubbles:!0})))}return lA(),o.classList.add("ttp-fill-success"),setTimeout(()=>{o.classList.remove("ttp-fill-success")},2e3),{success:!0,selector:e,fieldType:o.type||i,fieldName:o.name||null,filled:!0}}),gA.apply(this,arguments)}function pA(){return pA=aA(function*(){var A,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{selector:t,waitForNavigation:n=!1,openInNewTab:o=!1,isExternal:i=!1,href:r=null}=e;if(!t)return{success:!1,error:"Selector is required"};var s=document.querySelector(t);if(!s)return{success:!1,error:"Element not found: ".concat(t)};var a=s.getBoundingClientRect();if(0===a.width||0===a.height)return{success:!1,error:"Element is not visible (zero size)"};if(s.disabled)return{success:!1,error:"Element is disabled"};s.scrollIntoView({behavior:"smooth",block:"center"}),yield hA(300);var c=document.createElement("div");if(c.style.cssText="\n position: fixed;\n top: ".concat(a.top-2,"px;\n left: ").concat(a.left-2,"px;\n width: ").concat(a.width+4,"px;\n height: ").concat(a.height+4,"px;\n border: 2px solid #22c55e;\n border-radius: 4px;\n pointer-events: none;\n z-index: 2147483647;\n transition: opacity 0.2s;\n "),document.body.appendChild(c),yield hA(200),c.remove(),o||i){var l=r||s.href||("A"===s.tagName?s.getAttribute("href"):null);if(l&&"#"!==l&&!l.startsWith("javascript:"))try{var d;return window.open(l,"_blank","noopener,noreferrer"),{success:!0,selector:t,clicked:!0,openedInNewTab:!0,url:l,elementInfo:{tag:s.tagName.toLowerCase(),text:(null===(d=s.innerText)||void 0===d?void 0:d.trim().substring(0,50))||null},message:"Opened link in a new tab"}}catch(A){console.warn("[TTP] Failed to open in new tab:",A)}}if(n){var u,g=window.location.href,p=new Promise(A=>{var e=setTimeout(()=>{A({navigated:!1})},5e3),t=()=>{clearTimeout(e),window.removeEventListener("beforeunload",t),A({navigated:!0})};window.addEventListener("beforeunload",t)});s.click();var h=yield p;return{success:!0,selector:t,clicked:!0,elementInfo:{tag:s.tagName.toLowerCase(),text:(null===(u=s.innerText)||void 0===u?void 0:u.trim().substring(0,50))||null},navigated:h.navigated||window.location.href!==g}}return s.click(),{success:!0,selector:t,clicked:!0,elementInfo:{tag:s.tagName.toLowerCase(),text:(null===(A=s.innerText)||void 0===A?void 0:A.trim().substring(0,50))||null}}}),pA.apply(this,arguments)}function hA(A){return new Promise(e=>setTimeout(e,A))}function BA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function mA(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){BA(i,n,o,r,s,"next",A)}function s(A){BA(i,n,o,r,s,"throw",A)}r(void 0)})}}function fA(A){A.registerHandler("read_page",mA(function*(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};console.log("[TTP] 📋 Reading page structure...");var e=yield iA(A);return console.log("[TTP] ✅ Page structure extracted:",{buttons:e.buttons.length,links:e.links.length,forms:e.forms.length,headings:e.headings.length}),e})),A.registerHandler("highlight_element",mA(function*(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};console.log("[TTP] ✨ Highlighting element:",A.selector);var e=yield function(){return cA.apply(this,arguments)}(A);return e.success?console.log("[TTP] ✅ Element highlighted"):console.warn("[TTP] ⚠️ Highlight failed:",e.error),e})),A.registerHandler("scroll_to_element",mA(function*(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(A.selector)console.log("[TTP] 📜 Scrolling to element:",A.selector);else if(A.direction)console.log("[TTP] 📜 Scrolling",A.direction,"by",A.amount||500,"px");else if(void 0!==A.x||void 0!==A.y){var e,t;console.log("[TTP] 📜 Scrolling to position:","(".concat(null!==(e=A.x)&&void 0!==e?e:"current",", ").concat(null!==(t=A.y)&&void 0!==t?t:"current",")"))}else console.log("[TTP] 📜 Scroll called with params:",A);var n=yield function(){return dA.apply(this,arguments)}(A);return n.success?console.log("[TTP] ✅ Scrolled successfully"):console.warn("[TTP] ⚠️ Scroll failed:",n.error),n})),A.registerHandler("navigate_to",mA(function*(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};console.log("[TTP] 🔗 Navigating to:",A.url);var e=yield function(){return uA.apply(this,arguments)}(A);return e.success?console.log("[TTP] ✅ Navigation initiated"):console.warn("[TTP] ⚠️ Navigation blocked:",e.error),e})),A.registerHandler("fill_field",mA(function*(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};console.log("[TTP] 📝 Filling field:",A.selector);var e=yield function(){return gA.apply(this,arguments)}(A);return e.success?console.log("[TTP] ✅ Field filled"):console.warn("[TTP] ⚠️ Fill failed:",e.error),e})),A.registerHandler("click_element",mA(function*(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};console.log("[TTP] 👆 Clicking element:",A.selector);var e=yield function(){return pA.apply(this,arguments)}(A);return e.success?console.log("[TTP] ✅ Element clicked"):console.warn("[TTP] ⚠️ Click failed:",e.error),e}));var e=A.getRegisteredTools(),t=["read_page","highlight_element","scroll_to_element","navigate_to","fill_field","click_element"].filter(A=>!e.includes(A));t.length>0?console.error("[TTP] ❌ Some visual tools failed to register:",t):console.log("[TTP] 👁️ Visual assistant tools registered successfully:",e)}function vA(){return(vA=mA(function*(){var A=yield iA();return{url:A.url,title:A.title,timestamp:A.timestamp,language:A.language,viewport:A.viewport,dom:{buttons:A.buttons,links:A.links,forms:A.forms,sections:A.sections,headings:A.headings,metadata:A.metadata}}})).apply(this,arguments)}function wA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function CA(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){wA(i,n,o,r,s,"next",A)}function s(A){wA(i,n,o,r,s,"throw",A)}r(void 0)})}}function yA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function bA(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?yA(Object(t),!0).forEach(function(e){xA(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):yA(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function xA(A,e,t){return(e=function(A){var e=function(A){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==typeof e?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}class QA extends a{constructor(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(),this.version="2.0.0",this.config={signedUrl:A.signedUrl||A.websocketUrl||"wss://speech.talktopc.com/ws/conv",websocketUrl:A.signedUrl||A.websocketUrl||"wss://speech.talktopc.com/ws/conv",agentId:A.agentId,appId:A.appId,sampleRate:A.sampleRate||16e3,channels:A.channels||1,bitDepth:A.bitDepth||16,audioProcessorPath:A.audioProcessorPath,outputContainer:A.outputContainer||this.getDefaultContainer(A),outputEncoding:A.outputEncoding||A.outputCodec||"pcm",outputSampleRate:A.outputSampleRate||16e3,outputChannels:A.outputChannels||1,outputBitDepth:A.outputBitDepth||16,outputFrameDurationMs:A.outputFrameDurationMs||600,outputCodec:A.outputCodec,agentSettingsOverride:A.agentSettingsOverride||null,visualAssistant:A.visualAssistant||null,variables:A.variables||null,autoReconnect:!1!==A.autoReconnect,audioConstraints:A.audioConstraints||null,protocolVersion:A.protocolVersion||2},this.isConnected=!1,this.hasEverConnected=!1,this.isRecording=!1,this.isPlaying=!1,this.isDestroyed=!1,this.outputAudioFormat=null,this.requestedOutputFormat=null,this.formatConverter=null,this.websocket=null,this.conversationId=null,this.transcriptQueue=[],this.currentPlayingSentenceId=null,this.audioFrameCount=0,this.lastAudioStartTime=0,this.wakeLock=null,this._wakeLockRequesting=!1,this.pendingInjections=new Map,this.injectionCounter=0,this.audioPlayer=new p(this.config);var e=bA(bA({},this.config),{},{checkConnection:()=>this.isConnected&&this.websocket&&this.websocket.readyState===WebSocket.OPEN});this.audioRecorder=new C(e),this.setupAudioPlayerEvents(),this.setupAudioRecorderEvents(),this.clientToolsRegistry=new M(A=>this.sendMessage(A),()=>this.conversationId),this._registerBuiltInTools(),this.validateConfig(),this._setupPageUnloadHandler(),console.log("🎵 VoiceSDK v2 initialized:",{version:this.version,outputContainer:this.config.outputContainer,outputEncoding:this.config.outputEncoding,outputSampleRate:this.config.outputSampleRate})}_registerBuiltInTools(){var A=this;console.log("📸 VoiceSDK: _registerBuiltInTools() called"),console.log("📸 VoiceSDK: captureScreenshot available?",void 0!==W);try{if(void 0===W)return console.error("❌ VoiceSDK: captureScreenshot is undefined - import may have failed"),void console.error(" This will prevent capture_screen tool from working");console.log("📸 VoiceSDK: Registering capture_screen tool, captureScreenshot type:",typeof W),this.clientToolsRegistry.registerHandler("capture_screen",CA(function*(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};console.log("📸 VoiceSDK: capture_screen tool called with params:",e);var{selector:t=null,format:n="jpeg",quality:o=.85,scale:i=1,fullPage:r=!1,maxWidth:s=1280,maxHeight:a=1280}=e;try{var c=yield W({selector:t,format:n,quality:o,scale:i,fullPage:r,maxWidth:s,maxHeight:a});return console.log("📸 VoiceSDK: Screenshot captured: ".concat(c.width,"x").concat(c.height,", ").concat(Math.round(c.image.length/1024),"KB")),A.emit("screenshotCaptured",{width:c.width,height:c.height,sizeKB:Math.round(c.image.length/1024),selector:c.selector}),c}catch(e){throw console.error("📸 VoiceSDK: Screenshot capture failed:",e),A.emit("screenshotError",{error:e.message}),e}})),console.log("📸 VoiceSDK: Built-in capture_screen tool registered")}catch(A){console.error("❌ VoiceSDK: Error registering built-in tools:",A),console.error(" Error details:",A.message,A.stack)}try{fA(this.clientToolsRegistry);var e=this.clientToolsRegistry.getRegisteredTools(),t=["read_page","click_element","fill_field","highlight_element","scroll_to_element","navigate_to"],n=e.filter(A=>t.includes(A));if(n.length!==t.length){var o=t.filter(A=>!n.includes(A));console.error("❌ VoiceSDK: Some visual tools failed to register:",o),console.error(" Registered visual tools:",n)}else console.log("✅ VoiceSDK: All visual tools registered:",n)}catch(A){console.error("❌ VoiceSDK: Error registering visual assistant tools:",A),console.error(" Error details:",A.message,A.stack)}var i=this.clientToolsRegistry.getRegisteredTools(),r=["read_page","capture_screen","highlight_element","click_element","fill_field","scroll_to_element","navigate_to"],s=i.filter(A=>r.includes(A));if(s.length!==r.length){var a=r.filter(A=>!s.includes(A));console.error("❌ VoiceSDK: Missing internal tools:",a),console.error(" Expected 7 internal tools:",r),console.error(" Registered:",s)}else console.log("✅ VoiceSDK: All 7 internal tools registered:",s);console.log("🔧 VoiceSDK: All registered tools after _registerBuiltInTools():",i)}getStoredConversationId(){try{if("undefined"==typeof sessionStorage)return console.warn("⚠️ VoiceSDK v2: sessionStorage not available (private mode?)"),null;var A=sessionStorage.getItem(QA.RESUME_STORAGE_KEY);if(A){var e=JSON.parse(A);if(e&&e.conversationId)return console.log("📦 VoiceSDK v2: Found stored conversationId:",e.conversationId),e.conversationId}return null}catch(A){return console.warn("⚠️ VoiceSDK v2: Error reading sessionStorage:",A),null}}storeConversationId(A){if(A)try{if("undefined"==typeof sessionStorage)return void console.warn("⚠️ VoiceSDK v2: sessionStorage not available (private mode?)");var e={},t=sessionStorage.getItem(QA.RESUME_STORAGE_KEY);if(t)try{e=JSON.parse(t)}catch(A){}e.conversationId=A,e.timestamp=Date.now(),e.fromPage=e.fromPage||window.location.pathname+window.location.search,sessionStorage.setItem(QA.RESUME_STORAGE_KEY,JSON.stringify(e)),console.log("💾 VoiceSDK v2: Stored conversationId:",A)}catch(A){console.warn("⚠️ VoiceSDK v2: Error writing to sessionStorage:",A)}}clearStoredConversationId(){try{if("undefined"==typeof sessionStorage)return;sessionStorage.removeItem(QA.RESUME_STORAGE_KEY),console.log("🗑️ VoiceSDK v2: Cleared stored conversationId")}catch(A){console.warn("⚠️ VoiceSDK v2: Error clearing sessionStorage:",A)}}_getResumeState(){try{if("undefined"==typeof sessionStorage)return null;var A=sessionStorage.getItem(QA.RESUME_STORAGE_KEY);if(!A)return null;var e=JSON.parse(A),t=Date.now()-e.timestamp;return t>QA.RESUME_TTL_MS?(console.log("[VoiceSDK] Resume state expired:",t,"ms"),this._clearResumeState(),null):(console.log("[VoiceSDK] Found valid resume state:",e,"age:",t,"ms"),e)}catch(A){return console.warn("[VoiceSDK] Failed to get resume state:",A),null}}_clearResumeState(){try{if("undefined"==typeof sessionStorage)return;sessionStorage.removeItem(QA.RESUME_STORAGE_KEY)}catch(A){}}_setupPageUnloadHandler(){window.addEventListener("beforeunload",()=>{this.conversationId&&this.websocket&&this.websocket.readyState===WebSocket.OPEN&&this.storeConversationId(this.conversationId)}),document.addEventListener("visibilitychange",()=>{"visible"===document.visibilityState&&(this.isRecording&&this.isConnected&&this._requestWakeLock(),this.isRecording&&this.audioRecorder&&this.audioRecorder.resumeAudioContext().catch(A=>{console.error("VoiceSDK v2: Error resuming AudioContext on visibility change:",A)}),this.audioPlayer&&this.audioPlayer.resumeAudioContext().catch(A=>{console.error("VoiceSDK v2: Error resuming playback AudioContext on visibility change:",A)})),"hidden"===document.visibilityState&&this.conversationId&&this.websocket&&this.websocket.readyState===WebSocket.OPEN&&this.storeConversationId(this.conversationId)})}checkAndResume(){var A=this._getResumeState();if(!A)return null;var e=window.location.pathname+window.location.search;return console.log("[VoiceSDK] Auto-resuming conversation:",A.conversationId),console.log("[VoiceSDK] Page change:",A.fromPage,"→",e),{conversationId:A.conversationId,fromPage:A.fromPage,toPage:e}}getDefaultContainer(A){return"wav"===A.outputCodec?"wav":"raw"}validateInputFormat(A){var e;if(!A)return"Input format is required";var t=null===(e=A.encoding)||void 0===e?void 0:e.toLowerCase();return t&&QA.SUPPORTED_INPUT_ENCODINGS.includes(t)?A.sampleRate&&QA.SUPPORTED_INPUT_SAMPLE_RATES.includes(A.sampleRate)?A.bitDepth&&QA.SUPPORTED_INPUT_BIT_DEPTHS.includes(A.bitDepth)?A.channels&&QA.SUPPORTED_INPUT_CHANNELS.includes(A.channels)?null:"Unsupported input channels: ".concat(A.channels,". Supported: ").concat(QA.SUPPORTED_INPUT_CHANNELS.join(", ")):"Unsupported input bit depth: ".concat(A.bitDepth,". Supported: ").concat(QA.SUPPORTED_INPUT_BIT_DEPTHS.join(", ")):"Unsupported input sample rate: ".concat(A.sampleRate,". Supported: ").concat(QA.SUPPORTED_INPUT_SAMPLE_RATES.join(", ")):"Unsupported input encoding: ".concat(A.encoding,". Supported: ").concat(QA.SUPPORTED_INPUT_ENCODINGS.join(", "))}validateOutputFormat(A){var e,t;if(!A)return"Output format is required";var n=null===(e=A.encoding)||void 0===e?void 0:e.toLowerCase();if(!n||!QA.SUPPORTED_OUTPUT_ENCODINGS.includes(n))return"Unsupported output encoding: ".concat(A.encoding,". Supported: ").concat(QA.SUPPORTED_OUTPUT_ENCODINGS.join(", "));if(!A.sampleRate||!QA.SUPPORTED_OUTPUT_SAMPLE_RATES.includes(A.sampleRate))return"Unsupported output sample rate: ".concat(A.sampleRate,". Supported: ").concat(QA.SUPPORTED_OUTPUT_SAMPLE_RATES.join(", "));if(!A.bitDepth||!QA.SUPPORTED_OUTPUT_BIT_DEPTHS.includes(A.bitDepth))return"Unsupported output bit depth: ".concat(A.bitDepth,". Supported: ").concat(QA.SUPPORTED_OUTPUT_BIT_DEPTHS.join(", "));if(!A.channels||!QA.SUPPORTED_OUTPUT_CHANNELS.includes(A.channels))return"Unsupported output channels: ".concat(A.channels,". Supported: ").concat(QA.SUPPORTED_OUTPUT_CHANNELS.join(", "));var o=null===(t=A.container)||void 0===t?void 0:t.toLowerCase();return o&&QA.SUPPORTED_OUTPUT_CONTAINERS.includes(o)?null:"Unsupported output container: ".concat(A.container,". Supported: ").concat(QA.SUPPORTED_OUTPUT_CONTAINERS.join(", "))}validateConfig(){var A={encoding:"pcm",sampleRate:this.config.sampleRate,channels:this.config.channels,bitDepth:this.config.bitDepth},e=this.validateInputFormat(A);if(e)return console.error("❌ VoiceSDK v2: Invalid input format:",e),void this.emit("error",new Error(e));var t={encoding:this.config.outputEncoding,sampleRate:this.config.outputSampleRate,channels:this.config.outputChannels,bitDepth:this.config.outputBitDepth,container:this.config.outputContainer},n=this.validateOutputFormat(t);if(n)return console.error("❌ VoiceSDK v2: Invalid output format:",n),void this.emit("error",new Error(n));console.log("✅ VoiceSDK v2: Format validation passed")}setupAudioPlayerEvents(){this.audioPlayer.on("playbackStarted",()=>{this.isPlaying=!0,this.emit("playbackStarted"),this.isConnected?(console.log("📤 VoiceSDK v2: Sending audio_started_playing message to server"),this.sendMessage({t:"audio_started_playing"})):console.warn("⚠️ VoiceSDK v2: Cannot send audio_started_playing - not connected")}),this.audioPlayer.on("transcriptDisplay",A=>{var e=this.currentPlayingSentenceId?this.currentPlayingSentenceId+1:1;this.currentPlayingSentenceId=e;var t={text:A.text,role:"assistant",sentenceId:e,final:!0,timestamp:Date.now()};console.log("📝 VoiceSDK v2: Emitting synced transcriptDisplay from AudioPlayer:",t),this.emit("transcriptDisplay",t),this.emit("transcript",t)}),this.audioPlayer.on("playbackStopped",()=>{this.isPlaying=!1,this.emit("playbackStopped"),this.isConnected?(console.log("📤 VoiceSDK v2: Sending audio_stopped_playing message to server"),this.sendMessage({t:"audio_stopped_playing"})):console.warn("⚠️ VoiceSDK v2: Cannot send audio_stopped_playing - not connected")}),this.audioPlayer.on("playbackError",A=>{this.emit("playbackError",A),this.emit("error",A)})}setupAudioRecorderEvents(){this.audioRecorder.on("recordingStarted",()=>{this.isRecording=!0,this.emit("recordingStarted")}),this.audioRecorder.on("recordingStopped",()=>{this.isRecording&&(this.isRecording=!1,this.emit("recordingStopped"),console.log("🛑 VoiceSDK v2: Recording stopped (from audioRecorder event)"))}),this.audioRecorder.on("audioData",A=>{this.isConnected&&this.sendBinary(A)}),this.audioRecorder.on("error",A=>{A.isServerRejection||"ServerRejected"===A.name||(console.error("❌ AudioRecorder error:",A),this.emit("error",A))})}buildWebSocketUrl(){var A=this.config.signedUrl||this.config.websocketUrl,e=new URL(A,"wss://placeholder.com"),t=e.searchParams;this.config.agentId&&!t.has("agentId")&&t.append("agentId",this.config.agentId),this.config.appId&&!t.has("appId")&&t.append("appId",this.config.appId);var n=this.getStoredConversationId();n&&!t.has("conversationId")&&(t.append("conversationId",n),console.log("🔄 VoiceSDK v2: Attempting resume via query param:",n));var o=window.location.pathname+window.location.search;o&&!t.has("currentPage")&&t.append("currentPage",o);var i=t.toString();return i?"".concat(e.origin).concat(e.pathname,"?").concat(i):"".concat(e.origin).concat(e.pathname)}connect(){var A=this;return CA(function*(){if(A.isDestroyed)return console.warn("VoiceSDK v2: Cannot connect - SDK is destroyed"),!1;if(A.isConnected)return console.warn("VoiceSDK v2: Already connected"),!0;try{var e=A.buildWebSocketUrl();return"undefined"!=typeof __DEV__&&__DEV__&&(console.log("[TTPAgentSDK] WebSocket URL:",e),console.log("🔌 VoiceSDK v2: Connecting to",e)),yield new Promise((t,n)=>{A.websocket=new WebSocket(e),A.websocket.onopen=()=>{if(console.log("✅ VoiceSDK v2: WebSocket connected"),A.isConnected=!0,A.hasEverConnected=!0,A.clientToolsRegistry){A.clientToolsRegistry.setSendMessage(e=>A.sendMessage(e));var e=A.clientToolsRegistry.getRegisteredTools();console.log("🔧 VoiceSDK v2: Registered tools on connect:",e);var n=["read_page","capture_screen","highlight_element","click_element","fill_field","scroll_to_element","navigate_to"].filter(A=>!e.includes(A));if(n.length>0){console.warn("⚠️ VoiceSDK v2: Missing tools detected, re-registering:",n),A._registerBuiltInTools();var o=A.clientToolsRegistry.getRegisteredTools();console.log("🔧 VoiceSDK v2: Tools after re-registration:",o)}}A.sendHelloMessage(),A.emit("connected"),t(!0)},A.websocket.onerror=A=>{console.error("❌ VoiceSDK v2: WebSocket error:",A),n(A)},A.websocket.onclose=e=>{if(console.log("🔌 VoiceSDK v2: WebSocket closed:",e.code,e.reason),A.isConnected=!1,A.isRecording&&A.stopRecording().catch(A=>console.error("Error stopping recording:",A)),A._releaseWakeLock(),A.pendingInjections.size>0){console.warn("VoiceSDK v2: Rejecting ".concat(A.pendingInjections.size," pending data injections due to disconnect"));var t=new Error("Connection closed - data injection cancelled");t.error="CONNECTION_CLOSED",A.pendingInjections.forEach((e,n)=>{clearTimeout(e.timeout),e.reject(t),A.emit("dataInjectionError",{error:"CONNECTION_CLOSED",message:"Connection closed - data injection cancelled",correlationId:n})}),A.pendingInjections.clear()}A.emit("disconnected",e),A.config.autoReconnect&&!A.isDestroyed&&A.hasEverConnected?(console.log("🔄 VoiceSDK v2: Auto-reconnecting in 3s..."),setTimeout(()=>{A.isDestroyed||A.isConnected||A.connect()},3e3)):A.config.autoReconnect&&!A.hasEverConnected&&console.log("⚠️ VoiceSDK v2: Initial connection failed. Auto-reconnect disabled to prevent retry loop.")},A.websocket.onmessage=e=>{A.handleMessage(e)}})}catch(e){return console.error("🔌 VoiceSDK v2: Connection failed:",e),A.emit("error",e),!1}})()}detectBrowserLocale(){var A,e,t=navigator.language||(null===(A=navigator.languages)||void 0===A?void 0:A[0])||"en-US";return{language:(null===(e=t.split("-")[0])||void 0===e?void 0:e.toLowerCase())||"en",fullLocale:t}}sendHelloMessage(){var A=this;return CA(function*(){if(A.isConnected){var e={encoding:"pcm",sampleRate:A.config.sampleRate,channels:A.config.channels,bitDepth:A.config.bitDepth},t={encoding:A.config.outputEncoding,sampleRate:A.config.outputSampleRate,channels:A.config.outputChannels,bitDepth:A.config.outputBitDepth,container:A.config.outputContainer},n=A.validateInputFormat(e);if(n)return console.error("❌ VoiceSDK v2: Cannot send hello - invalid input format:",n),void A.emit("error",new Error("Invalid input format: ".concat(n)));var o=A.validateOutputFormat(t);if(o)return console.error("❌ VoiceSDK v2: Cannot send hello - invalid output format:",o),void A.emit("error",new Error("Invalid output format: ".concat(o)));var i={t:"hello",v:A.config.protocolVersion,inputFormat:e,requestedOutputFormat:t,outputFrameDurationMs:A.config.outputFrameDurationMs};A.config.agentSettingsOverride&&(i.agentSettingsOverride=A.config.agentSettingsOverride),i.locale=A.detectBrowserLocale(),console.log("🌍 VoiceSDK v2: Auto-detected locale:",i.locale),console.log("🔍 VoiceSDK v2: Checking variables:",{hasVariables:!!A.config.variables,variables:A.config.variables,keys:A.config.variables?Object.keys(A.config.variables):[]}),A.config.variables&&Object.keys(A.config.variables).length>0?(i.variables=A.config.variables,console.log("📝 VoiceSDK v2: Including variables in hello:",Object.keys(A.config.variables))):console.log("⚠️ VoiceSDK v2: Variables NOT included - condition failed"),console.log("📤 VoiceSDK v2: Sending hello:",{version:i.v,requestedFormat:i.requestedOutputFormat,variables:i.variables?Object.keys(i.variables):void 0}),console.log("📤 VoiceSDK v2: Requested output format:",{container:i.requestedOutputFormat.container,encoding:i.requestedOutputFormat.encoding,sampleRate:i.requestedOutputFormat.sampleRate,bitDepth:i.requestedOutputFormat.bitDepth}),console.log("📤 VoiceSDK v2: Full hello message being sent:",JSON.stringify(i,null,2));try{A.sendMessage(i)}catch(e){console.error("VoiceSDK v2: Failed to send hello:",e),A.emit("error",e)}}else console.warn("VoiceSDK v2: Cannot send hello - not connected")})()}handleMessage(A){var e;if(A.data instanceof ArrayBuffer||A.data instanceof Blob)this.handleBinaryMessage(A.data);else try{var t=JSON.parse(A.data);switch("audio"!==t.t&&console.log("📥 VoiceSDK v2: Received message type:",t.t,"Full message:",JSON.stringify(t).substring(0,200)),!this.conversationId&&t.conversationId&&(this.conversationId=t.conversationId,console.log("🔍 VoiceSDK v2: Captured conversationId from message:",this.conversationId),this.emit("conversationIdChanged",this.conversationId)),"audio"!==t.t&&console.log("📨 VoiceSDK v2: Received message type:",t.t,t),t.t){case"hello_ack":this.handleHelloAck(t);break;case"transcript":console.log("📝 VoiceSDK v2: Processing transcript message:",t),this.handleTranscript(t);break;case"user_transcript":console.log("📝 VoiceSDK v2: Received user_transcript:",t),this.emit("message",t);break;case"agent_response":if(console.log("📝 VoiceSDK v2: Received agent_response:",t),(t.text||t.transcript)&&(console.log("📝 VoiceSDK v2: agent_response contains transcript data:",t.text||t.transcript),t.sentenceId&&(t.text||t.transcript))){var n={t:"transcript",sentenceId:t.sentenceId,text:t.text||t.transcript,role:t.role||"assistant",final:!1!==t.final,timestamp:t.timestamp||Date.now()};console.log("📝 VoiceSDK v2: Converting agent_response to transcript:",n),this.handleTranscript(n)}this.emit("message",t);break;case"error":this.emit("message",t);break;case"barge_in":this.emit("bargeIn",t),this.stopAudioPlayback();break;case"stop_playing":var o=Date.now()-this.lastAudioStartTime;if(o<200){console.warn("⚠️ VoiceSDK v2: Ignoring premature stop_playing (".concat(o,"ms after audio_start, minimum ").concat(200,"ms required)"));break}this.emit("stopPlaying",t),this.stopAudioPlayback();break;case"audio_start":console.log("📝 VoiceSDK v2: Received audio_start with text:",t.text),this.lastAudioStartTime=Date.now(),this.audioPlayer&&(this.audioPlayer.isPlaying||(null===(e=this.audioPlayer.scheduledSources)||void 0===e?void 0:e.size)>0)&&console.log("📝 VoiceSDK v2: New sentence received while audio playing - will queue and wait for current sentence to finish"),t.text&&this.audioPlayer&&this.audioPlayer.markNewSentence(t.text),this.emit("message",t);break;case"client_tool_call":this.clientToolsRegistry.handleToolCall(t);break;case"text_inject_ack":this.handleTextInjectAck(t);break;case"data_inject_ack":this.handleDataInjectAck(t);break;case"data_inject_error":this.handleDataInjectError(t);break;case"hangup_ack":console.log("📞 VoiceSDK v2: Hangup acknowledged by server"),this.websocket&&this.websocket.readyState===WebSocket.OPEN&&(this.websocket.close(1e3,"User hangup"),this.websocket=null),this.isConnected=!1,this.emit("hangupAcknowledged");break;case"get_page_context":console.log("📖 [VISUAL ASSISTANT] Backend requested page context"),function(){return vA.apply(this,arguments)}().then(A=>{this.sendMessage({t:"page_context",pageContext:A}),console.log("📖 [VISUAL ASSISTANT] Page context sent:",A.url)}).catch(A=>{console.error("❌ [VISUAL ASSISTANT] Failed to scan page:",A),this.sendMessage({t:"page_context",pageContext:null,error:A.message})});break;case"get_screenshot":console.log("📸 [VISUAL ASSISTANT] Backend requested screenshot");try{W().then(A=>{this.sendMessage({t:"screenshot",screenshot:{image:A.base64,mimeType:A.mimeType||"image/png",width:A.width,height:A.height}}),console.log("📸 [VISUAL ASSISTANT] Screenshot sent:",A.width+"x"+A.height)}).catch(A=>{console.error("❌ [VISUAL ASSISTANT] Screenshot capture failed:",A),this.sendMessage({t:"screenshot",screenshot:null,error:A.message})})}catch(A){console.error("❌ [VISUAL ASSISTANT] Screenshot error:",A),this.sendMessage({t:"screenshot",screenshot:null,error:A.message})}break;case"page_context_ack":t.ok?console.log("✅ [VISUAL ASSISTANT] Page context acknowledged"):console.warn("⚠️ [VISUAL ASSISTANT] Page context error:",t.error);break;case"screenshot_ack":t.ok?console.log("✅ [VISUAL ASSISTANT] Screenshot acknowledged"):console.warn("⚠️ [VISUAL ASSISTANT] Screenshot error:",t.error);break;default:if(console.log("VoiceSDK v2: Unknown message type:",t.t,"Full message:",JSON.stringify(t).substring(0,300)),(t.text||t.transcript||t.transcription)&&(console.log("📝 VoiceSDK v2: Unknown message contains transcript-like data:",{text:t.text,transcript:t.transcript,transcription:t.transcription,sentenceId:t.sentenceId,role:t.role}),t.sentenceId&&(t.text||t.transcript||t.transcription))){var i={t:"transcript",sentenceId:t.sentenceId,text:t.text||t.transcript||t.transcription,role:t.role||"assistant",final:!1!==t.final,timestamp:t.timestamp||Date.now()};console.log("📝 VoiceSDK v2: Attempting to process unknown message as transcript:",i),this.handleTranscript(i)}this.emit("message",t)}}catch(e){var r,s,a="string"==typeof A.data?A.data:String(A.data),c=(null===(r=e.message)||void 0===r||null===(r=r.match(/position (\d+)/))||void 0===r?void 0:r[1])||"unknown",l=parseInt(c,10);if(console.error("VoiceSDK v2: Error parsing message:",e),console.error("VoiceSDK v2: Raw message length:",a.length),console.error("VoiceSDK v2: Error at position:",l),"unknown"!==l&&l>0){var d=Math.max(0,l-50),u=Math.min(a.length,l+50),g=a.substring(d,u),p=" ".repeat(l-d)+"^";console.error("VoiceSDK v2: Context around error:"),console.error(g),console.error(p);var h=a.charAt(l),B=h.charCodeAt(0);console.error('VoiceSDK v2: Problematic character: "'.concat(h,'" (charCode: ').concat(B,")")),B<32&&9!==B&&10!==B&&13!==B&&console.error("VoiceSDK v2: This is an unescaped control character. The backend should escape it in JSON strings.")}var m=a.includes("client_tool_call")||a.includes('"t":"client_tool_call"');if(m){console.error("⚠️ VoiceSDK v2: CRITICAL - Failed to parse client_tool_call message!"),console.error("⚠️ VoiceSDK v2: This means a tool execution (like form filling) was lost due to JSON parsing error."),console.error("⚠️ VoiceSDK v2: The backend sent malformed JSON with unescaped control characters.");var f=a.match(/"toolName"\s*:\s*"([^"]+)"/);f&&console.error('⚠️ VoiceSDK v2: Attempted tool: "'.concat(f[1],'"'));var v=a.match(/"toolCallId"\s*:\s*"([^"]+)"/);v&&console.error('⚠️ VoiceSDK v2: Tool call ID: "'.concat(v[1],'"'))}if(null!==(s=e.message)&&void 0!==s&&s.includes("Bad control character")){console.warn("VoiceSDK v2: Attempting to recover by sanitizing control characters...");try{var w=a;w=w.replace(/([^\\])([\x00-\x08\x0B\x0C\x0E-\x1F])/g,(A,e,t)=>{var n=t.charCodeAt(0);return e+({0:"\\u0000",1:"\\u0001",2:"\\u0002",3:"\\u0003",4:"\\u0004",5:"\\u0005",6:"\\u0006",7:"\\u0007",8:"\\b",11:"\\u000B",12:"\\f",14:"\\u000E",15:"\\u000F",16:"\\u0010",17:"\\u0011",18:"\\u0012",19:"\\u0013",20:"\\u0014",21:"\\u0015",22:"\\u0016",23:"\\u0017",24:"\\u0018",25:"\\u0019",26:"\\u001A",27:"\\u001B",28:"\\u001C",29:"\\u001D",30:"\\u001E",31:"\\u001F"}[n]||"\\u".concat(n.toString(16).padStart(4,"0")))});var C=JSON.parse(w);if(console.warn("✅ VoiceSDK v2: Successfully recovered message after sanitization!"),console.warn("✅ VoiceSDK v2: Processing recovered message..."),"client_tool_call"===C.t&&this.clientToolsRegistry)console.warn("✅ VoiceSDK v2: Recovered client_tool_call - executing tool"),this.clientToolsRegistry.handleToolCall(C);else{var y=C;"audio"!==y.t&&console.log("📥 VoiceSDK v2: Received message type:",y.t,"Full message:",JSON.stringify(y).substring(0,200)),!this.conversationId&&y.conversationId&&(this.conversationId=y.conversationId,console.log("🔍 VoiceSDK v2: Captured conversationId from message:",this.conversationId),this.emit("conversationIdChanged",this.conversationId)),"audio"!==y.t&&console.log("📨 VoiceSDK v2: Received message type:",y.t,y),"client_tool_call"===y.t?this.clientToolsRegistry.handleToolCall(y):this.emit("message",y)}return}catch(A){console.error("❌ VoiceSDK v2: Recovery attempt failed:",A)}}console.error("VoiceSDK v2: First 500 chars of raw message:",a.substring(0,500)),this.emit("error",{type:"json_parse_error",error:e,rawMessage:a.substring(0,1e3),position:l,wasToolCall:m})}}handleHelloAck(A){if(console.log("📥 VoiceSDK v2: Received hello_ack:",{hasOutputFormat:!!A.outputAudioFormat,outputFormat:A.outputAudioFormat,hasConversationId:!!A.conversationId,messageType:A.t}),A.conversationId&&(this.conversationId=A.conversationId,console.log("🔍 VoiceSDK v2: Received conversationId:",this.conversationId),this.emit("conversationIdChanged",this.conversationId),this.storeConversationId(this.conversationId)),!0===A.resumed?(console.log("✅ VoiceSDK v2: Conversation resumed successfully"),this.emit("callResumed",{conversationId:this.conversationId,timestamp:Date.now()})):!1===A.resumed&&A.resumeRejectedReason&&(console.warn("⚠️ VoiceSDK v2: Resume rejected:",A.resumeRejectedReason),this.clearStoredConversationId(),this.emit("resumeRejected",{reason:A.resumeRejectedReason,conversationId:A.conversationId||null,timestamp:Date.now()})),A.outputAudioFormat){this.outputAudioFormat=A.outputAudioFormat,this.audioPlayer.setOutputFormat(A.outputAudioFormat),console.log("✅ VoiceSDK v2: Format negotiated by server:",this.outputAudioFormat),this.requestedOutputFormat={container:this.config.outputContainer||"wav",encoding:this.config.outputEncoding||"pcm",sampleRate:this.config.outputSampleRate||16e3,bitDepth:this.config.outputBitDepth||16,channels:this.config.outputChannels||1};var e={container:this.outputAudioFormat.container||"unknown",encoding:this.outputAudioFormat.encoding||"unknown",sampleRate:this.outputAudioFormat.sampleRate||0,bitDepth:this.outputAudioFormat.bitDepth||0,channels:this.outputAudioFormat.channels||0},t=[];if(this.requestedOutputFormat.container!==e.container&&t.push('container: "'.concat(this.requestedOutputFormat.container,'" → "').concat(e.container,'"')),this.requestedOutputFormat.encoding!==e.encoding&&t.push('encoding: "'.concat(this.requestedOutputFormat.encoding,'" → "').concat(e.encoding,'"')),this.requestedOutputFormat.sampleRate!==e.sampleRate&&t.push("sampleRate: ".concat(this.requestedOutputFormat.sampleRate,"Hz → ").concat(e.sampleRate,"Hz")),this.requestedOutputFormat.bitDepth!==e.bitDepth&&t.push("bitDepth: ".concat(this.requestedOutputFormat.bitDepth,"-bit → ").concat(e.bitDepth,"-bit")),this.requestedOutputFormat.channels!==e.channels&&t.push("channels: ".concat(this.requestedOutputFormat.channels," → ").concat(e.channels)),t.length>0){console.warn("⚠️ VoiceSDK v2: Format negotiation mismatch!"),console.warn(" Requested:",this.requestedOutputFormat),console.warn(" Negotiated:",e),console.warn(" Differences:",t.join(", "));try{if(this.formatConverter=new K(this.requestedOutputFormat,e),this.formatConverter.needsConversion()){var n=this.formatConverter.getConversionSteps();console.log("🔄 VoiceSDK v2: Format conversion enabled"),console.log(" Conversion steps:",n.join(", ")),console.log(" Audio will be automatically converted to requested format")}}catch(A){console.error("❌ VoiceSDK v2: Failed to create format converter:",A),console.warn(" Will use backend format without conversion"),this.formatConverter=null}}else console.log("✅ VoiceSDK v2: Format perfectly matched!",e),this.formatConverter=null;this.emit("formatNegotiated",this.outputAudioFormat)}else{this.config.protocolVersion>=2&&(console.warn("⚠️ VoiceSDK v2: hello_ack received but no outputAudioFormat in response."),console.warn(" This may happen if:"),console.warn(" 1. Backend is not sending outputAudioFormat (check backend logs)"),console.warn(" 2. Hello message missing v2 fields (v, inputFormat, requestedOutputFormat)"),console.warn(" 3. Backend validation failed (check backend error logs)"),console.warn(" Using default format from config..."));var o={container:this.config.outputContainer||"wav",encoding:this.config.outputEncoding||"pcm",sampleRate:this.config.outputSampleRate||16e3,channels:this.config.outputChannels||1,bitDepth:this.config.outputBitDepth||16};this.outputAudioFormat=o,this.requestedOutputFormat=o,this.audioPlayer.setOutputFormat(o),this.formatConverter=null}}handleTextInjectAck(A){console.log("📝 VoiceSDK v2: Text inject ack received:",A),this.emit("textInjectAck",A)}injectData(A){var e=arguments,t=this;return CA(function*(){var n=e.length>1&&void 0!==e[1]?e[1]:{},o=null==A?void 0:A.trim();if(!o){var i={error:"EMPTY_DATA",message:"Cannot inject empty data"};throw console.warn("VoiceSDK v2: Cannot inject empty data"),t.emit("dataInjectionError",i),new Error(i.message)}if(!t.isConnected||!t.websocket){var r={error:"NOT_CONNECTED",message:"Voice call is not active"};throw console.warn("VoiceSDK v2: Cannot inject data - not connected"),t.emit("dataInjectionError",r),new Error(r.message)}if(o.length>5e3){var s={error:"DATA_TOO_LONG",message:"Data exceeds maximum length of 5000 characters",maxLength:5e3,currentLength:o.length};throw console.warn("VoiceSDK v2: Data too long (max 5000 characters)"),t.emit("dataInjectionError",s),new Error(s.message)}var a=t.generateCorrelationId(),c=n.timeout||1e4,l=n.source||"programmatic",d={t:"data_inject",data:o,correlationId:a,source:l,timestamp:Date.now()};return n.metadata&&(d.metadata=n.metadata),new Promise((A,e)=>{var n=setTimeout(()=>{t.pendingInjections.delete(a);var A={error:"TIMEOUT",message:"Data injection timeout - no response from server",correlationId:a,timeout:c};console.warn("VoiceSDK v2: Data injection timeout:",a),t.emit("dataInjectionError",A),e(new Error(A.message))},c);if(t.pendingInjections.set(a,{resolve:e=>{clearTimeout(n),A(e)},reject:A=>{clearTimeout(n),e(A)},timeout:n}),t.sendMessage(d))console.log("📤 VoiceSDK v2: Sent data_inject message:",{correlationId:a,dataLength:o.length,source:l});else{t.pendingInjections.delete(a),clearTimeout(n);var i={error:"SEND_FAILED",message:"Failed to send data injection message"};console.warn("VoiceSDK v2: Failed to send data injection message"),t.emit("dataInjectionError",i),e(new Error(i.message))}})})()}handleDataInjectAck(A){var e=A.correlationId;if(e){var t=this.pendingInjections.get(e);t?(this.pendingInjections.delete(e),t.resolve(A),this.emit("dataInjected",{correlationId:e,data:A.data,metadata:A.metadata}),console.log("✅ VoiceSDK v2: Data injection acknowledged:",e)):console.warn("VoiceSDK v2: data_inject_ack received for unknown correlationId:",e)}else console.warn("VoiceSDK v2: data_inject_ack received without correlationId")}handleDataInjectError(A){var e=A.correlationId;if(e){var t=this.pendingInjections.get(e);if(t){this.pendingInjections.delete(e);var n=new Error(A.message||"Data injection failed");n.error=A.error,n.correlationId=e,t.reject(n),this.emit("dataInjectionError",{error:A.error,message:A.message,correlationId:e}),console.warn("❌ VoiceSDK v2: Data injection error:",e,A.error)}else console.warn("VoiceSDK v2: data_inject_error received for unknown correlationId:",e)}else console.warn("VoiceSDK v2: data_inject_error received without correlationId")}handleTranscript(A){if(A.sentenceId&&A.text){var e=A.sentenceId,t={text:A.text,role:A.role||"assistant",sentenceId:e,final:!1!==A.final,timestamp:A.timestamp||Date.now()};this.transcriptQueue.push(t),console.log("📝 VoiceSDK v2: Received transcript for sentence",e,":",t.text),console.log(" Transcript queue length:",this.transcriptQueue.length),console.log(" Current playing sentence:",this.currentPlayingSentenceId),console.log("📝 VoiceSDK v2: Displaying transcript for completed sentence",e),this.emit("transcriptDisplay",t),this.currentPlayingSentenceId=e,this.emit("transcript",t)}else console.warn("⚠️ VoiceSDK v2: Invalid transcript message:",A)}handleBinaryMessage(A){var e=this;return CA(function*(){var t,n=t=A instanceof Blob?yield A.arrayBuffer():A;if(e.formatConverter&&e.formatConverter.needsConversion())try{n=yield e.formatConverter.convert(t),console.log("✅ VoiceSDK v2: Audio converted to requested format")}catch(A){console.error("❌ VoiceSDK v2: Format conversion failed:",A),console.warn(" Using backend format without conversion"),n=t}var o=e.formatConverter&&e.formatConverter.needsConversion()?e.requestedOutputFormat:e.outputAudioFormat||{container:e.config.outputContainer||"raw",encoding:e.config.outputEncoding||"pcm",sampleRate:e.config.outputSampleRate||16e3,bitDepth:e.config.outputBitDepth||16,channels:e.config.outputChannels||1},i=o.container||"raw",r=(o.encoding||"pcm").toLowerCase();if("raw"===i){var s=n;if("pcm"!==r){var a=e.audioPlayer.getCodec(r);if(a){var c=a.decode(new Uint8Array(n));s=c.buffer,console.log("🔄 VoiceSDK v2: Decoded ".concat(r.toUpperCase()," to PCM (").concat(c.byteLength," bytes)"))}else console.warn("⚠️ VoiceSDK v2: No codec for ".concat(r,", treating as PCM"))}e.audioPlayer.outputFormat||(console.warn("⚠️ VoiceSDK v2: outputFormat not set on AudioPlayer, setting from playbackFormat"),e.audioPlayer.setOutputFormat(o)),e.audioFrameCount++,e.audioPlayer.playChunk(s)}else e.audioFrameCount++,e.audioPlayer.playAudio(n)})()}sendMessage(A){if(!this.websocket||this.websocket.readyState!==WebSocket.OPEN)return console.warn("VoiceSDK v2: Cannot send message - not connected"),!1;try{var e=(new Date).toISOString(),t=this.websocket?this.websocket.readyState:"NO_WEBSOCKET",n=this.websocket?{0:"CONNECTING",1:"OPEN",2:"CLOSING",3:"CLOSED"}[t]:"NO_WEBSOCKET";if("client_tool_result"!==A.t&&"client_tool_error"!==A.t||(console.log("📤 VoiceSDK v2: [".concat(e,"] Sending tool ").concat(A.t)),console.log(" 🔌 WebSocket state: ".concat(n," (").concat(t,")")),console.log(" 📋 toolCallId: ".concat(A.toolCallId)),console.log(" 📋 conversationId: ".concat(A.conversationId||"null")),console.log(" 📋 toolName: ".concat(A.toolName)),"client_tool_result"===A.t?console.log(" 📋 result:",A.result):console.log(" 📋 error: ".concat(A.error,", errorCode: ").concat(A.errorCode)),console.log(" 📋 Full message:",JSON.stringify(A,null,2))),!this.websocket||this.websocket.readyState!==WebSocket.OPEN)return console.error("❌ VoiceSDK v2: Cannot send message - WebSocket not open (state: ".concat(n,")")),!1;var o=JSON.stringify(A);return this.websocket.send(o),"client_tool_result"!==A.t&&"client_tool_error"!==A.t||console.log("✅ VoiceSDK v2: [".concat(e,"] Tool ").concat(A.t," message sent successfully (").concat(o.length," bytes)")),!0}catch(A){return console.error("VoiceSDK v2: Error sending message:",A),this.emit("error",A),!1}}sendBinary(A){if(!this.websocket||this.websocket.readyState!==WebSocket.OPEN)return console.warn("VoiceSDK v2: Cannot send audio - not connected"),!1;try{return this.websocket.send(A),!0}catch(A){return console.error("VoiceSDK v2: Error sending audio:",A),this.emit("error",A),!1}}hangup(){if(this.websocket&&this.websocket.readyState===WebSocket.OPEN){console.log("📞 VoiceSDK v2: Hanging up call..."),this.clearStoredConversationId(),this.stopRecording(),this._releaseWakeLock(),this.audioPlayer&&this.stopAudioPlayback();try{this.sendMessage({t:"hangup"}),setTimeout(()=>{this.websocket&&this.websocket.readyState===WebSocket.OPEN&&(this.websocket.close(1e3,"User hangup"),this.websocket=null),this.isConnected=!1},100)}catch(A){console.error("VoiceSDK v2: Error sending hangup message:",A),this.websocket&&(this.websocket.close(1e3,"User hangup"),this.websocket=null),this.isConnected=!1}}}startRecording(){var A=this;return CA(function*(){if(!A.isConnected){var e=new Error("Not connected to voice server");throw A.emit("error",e),e}if(A.isRecording)return console.warn("VoiceSDK v2: Already recording"),!0;console.log("🎤 VoiceSDK v2: Starting recording...");try{if(console.log("🎤 VoiceSDK v2: Requesting microphone permission (mobile-friendly)..."),yield A.audioRecorder.start(),!A.isConnected||!A.websocket||A.websocket.readyState!==WebSocket.OPEN){try{yield A.audioRecorder.stop()}catch(A){}var t=new Error("Connection lost - server may have rejected the call");throw t.name="ServerRejected",t.isServerRejection=!0,t}return yield A.audioPlayer.resumeAudioContext(),A.sendMessage({t:"start_continuous_mode",ttpId:A.generateTtpId()}),A._requestWakeLock(),!0}catch(e){if(A.audioRecorder&&A.audioRecorder.isRecording)try{yield A.audioRecorder.stop()}catch(A){}if(e.isServerRejection||"ServerRejected"===e.name)return!1;if(console.error("❌ VoiceSDK v2: Failed to start recording:",e),"NotAllowedError"===e.name||"PermissionDeniedError"===e.name){var n=new Error("Microphone permission denied. Please allow microphone access in your browser settings and try again.");n.name=e.name,n.originalError=e,A.emit("error",n)}else A.emit("error",e);return!1}})()}stopRecording(){var A=this;return CA(function*(){if(!A.isRecording)return console.warn("VoiceSDK v2: Not recording"),!0;console.log("🛑 VoiceSDK v2: Stopping recording...");try{return A.sendMessage({t:"stop_continuous_mode",ttpId:A.generateTtpId()}),A.isRecording=!1,A.emit("recordingStopped"),console.log("🛑 VoiceSDK v2: Recording stopped (emitted before audioRecorder.stop())"),A._releaseWakeLock(),yield A.audioRecorder.stop(),A.stopAudioPlayback(),!0}catch(e){return console.error("VoiceSDK v2: Error stopping recording:",e),A.emit("error",e),!1}})()}toggleRecording(){var A=this;return CA(function*(){return A.isRecording?yield A.stopRecording():yield A.startRecording()})()}clearTranscriptState(){this.currentPlayingSentenceId=null,console.log("📝 VoiceSDK v2: Cleared transcript state")}_requestWakeLock(){var A=this;return CA(function*(){if("wakeLock"in navigator)if(null!==A.wakeLock||A._wakeLockRequesting)console.log("📱 VoiceSDK v2: Wake lock already active or being requested");else try{A._wakeLockRequesting=!0,A.wakeLock=yield navigator.wakeLock.request("screen"),console.log("📱 VoiceSDK v2: Screen wake lock activated - screen will stay on during call"),A.wakeLock.addEventListener("release",()=>{console.log("📱 VoiceSDK v2: Wake lock released by system"),A.wakeLock=null})}catch(e){console.warn("📱 VoiceSDK v2: Failed to request wake lock:",e.message),A.wakeLock=null}finally{A._wakeLockRequesting=!1}else console.log("📱 VoiceSDK v2: Wake Lock API not available in this browser")})()}_releaseWakeLock(){var A=this;return CA(function*(){if(null!==A.wakeLock)try{yield A.wakeLock.release(),A.wakeLock=null,console.log("📱 VoiceSDK v2: Screen wake lock released")}catch(e){console.warn("📱 VoiceSDK v2: Error releasing wake lock:",e.message),A.wakeLock=null}})()}stopAudioPlayback(){this.audioPlayer.stopImmediate(),this.clearTranscriptState()}handleBargeIn(){var A=this;return CA(function*(){A.stopAudioPlayback(),A.isRecording||(yield A.startRecording())})()}getStatus(){return{version:this.version,isConnected:this.isConnected,isRecording:this.isRecording,isPlaying:this.isPlaying,outputFormat:this.outputAudioFormat,conversationId:this.conversationId,audioPlayer:this.audioPlayer.getStatus(),audioRecorder:this.audioRecorder.getStatus()}}updateConfig(A){this.config=bA(bA({},this.config),A)}generateTtpId(){return"sdk_"+Math.random().toString(36).substr(2,9)+"_"+Date.now()}generateCorrelationId(){if("undefined"!=typeof crypto&&crypto.randomUUID)return crypto.randomUUID();this.injectionCounter++;var A=Date.now(),e=Math.random().toString(36).substr(2,9);return"inj_".concat(A,"_").concat(this.injectionCounter,"_").concat(e)}registerToolHandler(A,e){return this.clientToolsRegistry.registerHandler(A,e)}unregisterToolHandler(A){return this.clientToolsRegistry.unregisterHandler(A)}hasToolHandler(A){return this.clientToolsRegistry.hasHandler(A)}getRegisteredTools(){return this.clientToolsRegistry.getRegisteredTools()}destroy(){if(!this.isDestroyed){if(console.log("🗑️ VoiceSDK v2: Destroying..."),this.isDestroyed=!0,this.isRecording&&this.stopRecording(),this._releaseWakeLock(),this._wakeLockRequesting=!1,this.audioPlayer&&this.stopAudioPlayback(),this.websocket&&(this.websocket.close(),this.websocket=null),this.isConnected=!1,this.pendingInjections.size>0){console.warn("VoiceSDK v2: Rejecting ".concat(this.pendingInjections.size," pending data injections due to destroy"));var A=new Error("SDK destroyed - data injection cancelled");A.error="SDK_DESTROYED",this.pendingInjections.forEach((e,t)=>{clearTimeout(e.timeout),e.reject(A)}),this.pendingInjections.clear()}this.audioPlayer&&this.audioPlayer.destroy(),this.audioRecorder&&this.audioRecorder.destroy(),this.clientToolsRegistry&&this.clientToolsRegistry.getRegisteredTools().forEach(A=>this.clientToolsRegistry.unregisterHandler(A)),this.removeAllListeners()}}}xA(QA,"RESUME_STORAGE_KEY","voice_resume_state"),xA(QA,"RESUME_TTL_MS",1e4),xA(QA,"SUPPORTED_INPUT_ENCODINGS",["pcm","pcmu","pcma"]),xA(QA,"SUPPORTED_INPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),xA(QA,"SUPPORTED_INPUT_BIT_DEPTHS",[8,16,24]),xA(QA,"SUPPORTED_INPUT_CHANNELS",[1]),xA(QA,"SUPPORTED_OUTPUT_ENCODINGS",["pcm","pcmu","pcma"]),xA(QA,"SUPPORTED_OUTPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),xA(QA,"SUPPORTED_OUTPUT_BIT_DEPTHS",[8,16,24]),xA(QA,"SUPPORTED_OUTPUT_CHANNELS",[1]),xA(QA,"SUPPORTED_OUTPUT_CONTAINERS",["raw","wav"]);const FA=QA;function UA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function SA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function IA(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?SA(Object(t),!0).forEach(function(e){EA(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):SA(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function EA(A,e,t){return(e=function(A){var e=function(A){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==typeof e?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}class kA extends h{constructor(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super();var e=this.readScriptTagConfig();this.config=IA({baseWsUrl:"wss://backend.talktopc.com/chat/websocket",appId:A.appId||e.appId,agentId:A.agentId||e.agentId,conversationId:void 0!==A.conversationId?A.conversationId:this.getPersistedConversationId(),forceConversationId:A.forceConversationId,queue:[],inFlight:!1},A),this.fullResponseBuffer=""}readScriptTagConfig(){try{var A=Array.from(document.getElementsByTagName("script")).reverse().find(A=>A.dataset&&(A.dataset.appId||A.dataset.agentId)||A.src&&A.src.includes("agent-widget"));return A?{appId:A.dataset.appId,agentId:A.dataset.agentId}:{}}catch(A){return{}}}buildWebSocketUrl(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.config.baseWsUrl,e=new URLSearchParams;return this.config.appId&&e.append("appId",this.config.appId),this.config.agentId&&e.append("agentId",this.config.agentId),this.config.conversationId&&e.append("conversationId",this.config.conversationId),"".concat(A,"?").concat(e.toString())}sendMessage(A){var e,t=this;return(e=function*(){return new Promise((e,n)=>{if(A&&A.trim())if(t.config.appId&&t.config.agentId){var o={text:A,resolve:e,reject:n};t.config.inFlight?t.config.queue.push(o):t.executeTask(o)}else n(new Error("Missing appId or agentId"));else n(new Error("Message is empty"))})},function(){var A=this,t=arguments;return new Promise(function(n,o){var i=e.apply(A,t);function r(A){UA(i,n,o,r,s,"next",A)}function s(A){UA(i,n,o,r,s,"throw",A)}r(void 0)})})()}executeTask(A){if(this.config.inFlight=!0,this.fullResponseBuffer="",!this.config.conversationId){var e=this.getPersistedConversationId();e&&(this.config.conversationId=e,console.log("🔍 TextChatSDK hydrated conversationId from storage:",e))}var t=this.buildWebSocketUrl(this.config.baseWsUrl);"undefined"!=typeof __DEV__&&__DEV__&&console.log("[TTPAgentSDK] WebSocket URL:",t);var n=this.config.baseWsUrl.endsWith("/websocket")?this.config.baseWsUrl.replace(/\/websocket$/,""):"".concat(this.config.baseWsUrl,"/websocket"),o=this.buildWebSocketUrl(n),i=!1,r=!1,s=null,a=e=>{if(!r)try{var t={message:A.text},n=this.config.forceConversationId||this.config.conversationId;n&&(t.conversationId=n,this.config.forceConversationId&&!this.config.conversationId&&(this.config.conversationId=n,this.persistConversationId(n))),console.log("🔍 TextChatSDK sending payload:",t,"conversationId in config:",this.config.conversationId),e.send(JSON.stringify(t)),r=!0}catch(t){A.reject(t),this.emit("error",t);try{e.close()}catch(A){}}},c=A=>()=>{this.config.conversationId?a(A):s=setTimeout(()=>a(A),200)},l=e=>t=>{try{try{console.log("🔎 [TextChatSDK] WS <= raw:",t.data)}catch(A){}var n=JSON.parse(t.data);try{console.log("🔎 [TextChatSDK] WS <= parsed:",n)}catch(A){}if("hello"===n.type&&n.conversationId){if(console.log("🔍 TextChatSDK received conversationId:",n.conversationId),this.config.conversationId=n.conversationId,this.persistConversationId(n.conversationId),this.emit&&this.emit("conversationIdChanged",n.conversationId),!r&&e&&1===e.readyState){if(s)try{clearTimeout(s)}catch(A){}a(e)}return}if(!this.config.conversationId&&n.conversationId&&(console.log("🔍 TextChatSDK captured conversationId from message:",n.conversationId),this.config.conversationId=n.conversationId,this.persistConversationId(n.conversationId)),"chunk"===n.type&&"string"==typeof n.content)this.fullResponseBuffer+=n.content,this.emit("chunk",n.content);else if("done"===n.type){try{var o=n.text||n.content||n.answer||n.message||"";o&&!this.fullResponseBuffer&&(this.fullResponseBuffer=o)}catch(A){}!this.config.conversationId&&n.conversationId&&(console.log("🔍 TextChatSDK captured conversationId from done:",n.conversationId),this.config.conversationId=n.conversationId),this.persistConversationId(this.config.conversationId),this.emit("done",{text:this.fullResponseBuffer}),A.resolve({conversationId:this.config.conversationId,fullText:this.fullResponseBuffer});try{e.close()}catch(A){}}else if("error"===n.type){var i=new Error(n.message||"Server error");this.emit("error",i),A.reject(i);try{e.close()}catch(A){}}}catch(A){}},d=e=>{if(1008===e.code&&e.reason&&(e.reason.includes("Domain not whitelisted")||e.reason.includes("domain")||e.reason.includes("whitelist"))){var t=new Error("DOMAIN_NOT_WHITELISTED");return t.reason=e.reason,t.code=e.code,this.emit("domainError",t),A.reject(t),this.config.inFlight=!1,void this.drainQueue()}this.config.inFlight=!1,this.drainQueue()},u=new WebSocket(t);u.onopen=c(u),u.onmessage=l(u),u.onerror=(e=>t=>{if(!i){i=!0;try{e.close()}catch(A){}var n=new WebSocket(o);return n.onopen=c(n),n.onmessage=l(n),n.onerror=e=>{this.emit("error",e),A.reject(e)},void(n.onclose=d)}this.emit("error",t),A.reject(t)})(u),u.onclose=d}drainQueue(){if(0!==this.config.queue.length&&!this.config.inFlight){var A=this.config.queue.shift();this.executeTask(A)}}persistConversationId(A){try{A&&localStorage.setItem("ttp_text_chat_conversation_id",A)}catch(A){}}getPersistedConversationId(){try{return localStorage.getItem("ttp_text_chat_conversation_id")||null}catch(A){return null}}updateConfig(A){this.config=IA(IA({},this.config),A)}destroy(){this.config.queue=[],this.config.inFlight=!1,this.removeAllListeners()}}function HA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}const TA=new class extends h{constructor(){super(),this.connections=new Map,this.connectionCounts=new Map,this.creatingConnections=new Set}getConnection(A){var e,t=this;return(e=function*(){if(t.connections.has(A)){var e=t.connections.get(A);return t.connectionCounts.set(A,(t.connectionCounts.get(A)||0)+1),e}if(t.creatingConnections&&t.creatingConnections.has(A))return new Promise(e=>{var n=()=>{if(t.connections.has(A)){var o=t.connections.get(A);t.connectionCounts.set(A,(t.connectionCounts.get(A)||0)+1),e(o)}else setTimeout(n,50)};n()});t.creatingConnections.add(A);var n=new WebSocket(A);return t.connections.set(A,n),t.connectionCounts.set(A,1),n.addEventListener("open",e=>{t.creatingConnections.delete(A),t.emit("open",e,A)}),n.addEventListener("close",e=>{t.creatingConnections.delete(A),t.connections.delete(A),t.connectionCounts.delete(A),t.emit("close",e,A)}),n.addEventListener("error",e=>{t.creatingConnections.delete(A),t.emit("error",e,A)}),n.addEventListener("message",e=>{t.emit("message",e,A)}),n},function(){var A=this,t=arguments;return new Promise(function(n,o){var i=e.apply(A,t);function r(A){HA(i,n,o,r,s,"next",A)}function s(A){HA(i,n,o,r,s,"throw",A)}r(void 0)})})()}releaseConnection(A){if(this.connections.has(A)){var e=this.connectionCounts.get(A)||0,t=Math.max(0,e-1);if(this.connectionCounts.set(A,t),0===t){var n=this.connections.get(A);n&&n.readyState===WebSocket.OPEN&&n.close(1e3,"No more subscribers"),this.connections.delete(A),this.connectionCounts.delete(A)}}}forceClose(A){if(this.connections.has(A)){var e=this.connections.get(A);e&&e.readyState===WebSocket.OPEN&&e.close(1e3,"Force close"),this.connections.delete(A),this.connectionCounts.delete(A)}}getConnectionStatus(A){return this.connections.has(A)?{exists:!0,readyState:this.connections.get(A).readyState,subscribers:this.connectionCounts.get(A)||0}:{exists:!1,readyState:null,subscribers:0}}getAllConnections(){var A={};for(var[e,t]of this.connections.entries())A[e]={readyState:t.readyState,subscribers:this.connectionCounts.get(e)||0};return A}clearAll(){for(var[A,e]of this.connections.entries())e&&e.readyState===WebSocket.OPEN&&e.close(1e3,"Clear all");this.connections.clear(),this.connectionCounts.clear(),this.creatingConnections.clear()}};function DA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}class KA extends h{constructor(A){super(),this.config=A,this.ws=null,this.isConnected=!1,this.connectionId=null}connect(){var A,e=this;return(A=function*(){return new Promise((A,t)=>{try{e.connectionId=Date.now()+"_"+Math.random().toString(36).substr(2,9),e.connectResolve=A,e.connectReject=t;var n=e.config.signedUrl||e.config.websocketUrl;TA.getConnection(n,e.config).then(t=>{e.ws=t,e.setupEventListeners(),t.readyState===WebSocket.OPEN&&(e.isConnected=!0,e.emit("connected"),A(),e.connectResolve=null,e.connectReject=null)}).catch(A=>{console.error("🔌 WebSocketManager: Connection failed ".concat(e.connectionId),A),t(A),e.connectResolve=null,e.connectReject=null})}catch(A){console.error("🔌 WebSocketManager: Connection error ".concat(e.connectionId),A),t(A),e.connectResolve=null,e.connectReject=null}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){DA(i,n,o,r,s,"next",A)}function s(A){DA(i,n,o,r,s,"throw",A)}r(void 0)})})()}setupEventListeners(){if(this.ws){var A=(A,e)=>{e===(this.config.signedUrl||this.config.websocketUrl)&&(this.isConnected=!0,this.emit("connected"),this.connectResolve&&(this.connectResolve(),this.connectResolve=null,this.connectReject=null))},e=(A,e)=>{e===(this.config.signedUrl||this.config.websocketUrl)&&(this.isConnected=!1,this.emit("disconnected",A))},t=(A,e)=>{e===(this.config.signedUrl||this.config.websocketUrl)&&(this.emit("error",A),this.connectReject&&(this.connectReject(A),this.connectResolve=null,this.connectReject=null))},n=(A,e)=>{e===(this.config.signedUrl||this.config.websocketUrl)&&this.handleMessage(A)};TA.on("open",A),TA.on("close",e),TA.on("error",t),TA.on("message",n),this.eventHandlers={open:A,close:e,error:t,message:n}}}disconnect(){this.eventHandlers&&(TA.off("open",this.eventHandlers.open),TA.off("close",this.eventHandlers.close),TA.off("error",this.eventHandlers.error),TA.off("message",this.eventHandlers.message));var A=this.config.signedUrl||this.config.websocketUrl;A&&TA.releaseConnection(A),this.ws=null,this.isConnected=!1}sendMessage(A){if(this.isConnected&&this.ws)try{this.ws.send(JSON.stringify(A))}catch(A){console.warn("🔌 WebSocketManager: Failed to send message:",A.message)}}sendBinary(A){if(this.isConnected&&this.ws)try{this.ws.send(A)}catch(A){console.warn("🔌 WebSocketManager: Failed to send binary data:",A.message)}}handleMessage(A){if(A.data instanceof ArrayBuffer)this.emit("binaryAudio",A.data);else if(A.data instanceof Blob)A.data.arrayBuffer().then(A=>{this.emit("binaryAudio",A)}).catch(A=>{console.error("🔌 WebSocketManager: Error converting Blob to ArrayBuffer:",A)});else try{var e=JSON.parse(A.data);"barge_in_ack"!==e.t&&"stop_sending"!==e.t||this.emit("bargeIn",e),"stop_playing"===e.t&&this.emit("stopPlaying",e),this.emit("message",e)}catch(A){this.emit("error",A)}}getStatus(){return{isConnected:this.isConnected,readyState:this.ws?this.ws.readyState:null,connectionId:this.connectionId}}static getSingletonStatus(){return TA.getAllConnections()}static clearAllConnections(){TA.clearAll()}}function LA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function MA(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){LA(i,n,o,r,s,"next",A)}function s(A){LA(i,n,o,r,s,"throw",A)}r(void 0)})}}class RA extends h{constructor(A){super(),this.config=A,this.audioContext=null,this.audioQueue=[],this.isPlaying=!1,this.isProcessingQueue=!1,this.currentSource=null,this.audioContextReady=!1,this.initializeAudioContext().catch(()=>{})}initializeAudioContext(){var A=this;return MA(function*(){if(!A.audioContext||"closed"===A.audioContext.state)try{var e={sampleRate:A.config.sampleRate||A.config.outputSampleRate||44100};if(A.audioContext=new(window.AudioContext||window.webkitAudioContext)(e),"suspended"===A.audioContext.state&&(yield A.audioContext.resume()),"running"===A.audioContext.state)try{var t=A.audioContext.sampleRate,n=A.audioContext.createBuffer(1,.01*t,t),o=A.audioContext.createBufferSource();o.buffer=n,o.connect(A.audioContext.destination),o.start(0),o.stop(A.audioContext.currentTime+.01)}catch(A){console.debug("AudioPlayer: AudioContext warmup skipped:",A)}A.audioContextReady=!0}catch(e){console.warn("AudioPlayer: Failed to pre-initialize AudioContext:",e),A.audioContextReady=!1}})()}playAudio(A){try{var e=this.createAudioBlob(A);if(this.audioQueue.push(e),!this.isPlaying&&!this.isProcessingQueue&&!this.currentSource){var t=this.audioContextReady?0:50;setTimeout(()=>this.processQueue(),t)}}catch(A){this.emit("playbackError",A)}}createAudioBlob(A){var e=new Uint8Array(A);if(e.length>=4){if(82===e[0]&&73===e[1]&&70===e[2]&&70===e[3])return new Blob([A],{type:"audio/wav"});if(255===e[0]&&!(224&~e[1]))return new Blob([A],{type:"audio/mpeg"});if(79===e[0]&&103===e[1]&&103===e[2]&&83===e[3])return new Blob([A],{type:"audio/ogg"})}return new Blob([A],{type:"audio/wav"})}processQueue(){var A=this;return MA(function*(){if(!A.isProcessingQueue&&0!==A.audioQueue.length){A.isProcessingQueue=!0;var e=A.audioQueue.shift();if(e)try{var t=!A.isPlaying&&null===A.currentSource;A.audioContext&&"closed"!==A.audioContext.state||(yield A.initializeAudioContext());var n=A.audioContext;"suspended"===n.state&&(yield n.resume(),t&&(yield new Promise(A=>setTimeout(A,10)))),"running"!==n.state&&(console.warn("AudioPlayer: AudioContext not in running state:",n.state),"suspended"===n.state&&(yield n.resume(),yield new Promise(A=>setTimeout(A,10))));var o=yield e.arrayBuffer(),i=yield n.decodeAudioData(o),r=t&&!A.isPlaying&&null===A.currentSource,s=n.createBufferSource();s.buffer=i,s.connect(n.destination),A.currentSource=s,A.isPlaying=!0,r&&A.emit("playbackStarted"),s.onended=()=>{A.currentSource=null,A.isProcessingQueue=!1,A.audioQueue.length>0?setTimeout(()=>A.processQueue(),0):setTimeout(()=>{0!==A.audioQueue.length||A.currentSource||(A.isPlaying=!1,A.emit("playbackStopped"))},100)},s.start()}catch(e){A.currentSource=null,A.emit("playbackError",e),A.audioQueue.length>0?(A.isProcessingQueue=!1,setTimeout(()=>A.processQueue(),100)):(A.isPlaying=!1,A.isProcessingQueue=!1,A.emit("playbackStopped"))}else A.isProcessingQueue=!1}})()}stop(){this.stopImmediate()}stopImmediate(){var A=this.isPlaying||null!==this.currentSource;if(this.currentSource){try{this.currentSource.stop()}catch(A){}this.currentSource=null}this.isPlaying=!1,this.isProcessingQueue=!1,this.audioQueue=[],A&&this.emit("playbackStopped")}resumeAudioContext(){var A=this;return MA(function*(){if(A.audioContext&&"closed"!==A.audioContext.state){if("suspended"===A.audioContext.state)try{yield A.audioContext.resume(),console.log("✅ AudioPlayer: AudioContext resumed after mic permission")}catch(A){console.warn("⚠️ AudioPlayer: Failed to resume AudioContext:",A)}}else yield A.initializeAudioContext()})()}getStatus(){return{isPlaying:this.isPlaying,isProcessingQueue:this.isProcessingQueue,queueLength:this.audioQueue.length,audioContextState:this.audioContext?this.audioContext.state:"closed"}}destroy(){this.stop(),this.audioContext&&"closed"!==this.audioContext.state&&(this.audioContext.close(),this.audioContext=null),this.audioContextReady=!1}}var PA=i(848);function OA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function VA(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?OA(Object(t),!0).forEach(function(e){_A(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):OA(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function _A(A,e,t){return(e=function(A){var e=function(A){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==typeof e?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function NA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}const GA=n=>{var{signedUrl:o,websocketUrl:i,agentId:r,appId:s,voice:a="default",language:c="en",autoReconnect:l=!0,agentSettingsOverride:d=null,visualAssistant:u=null,onConnected:g,onDisconnected:p,onRecordingStarted:h,onRecordingStopped:B,onPlaybackStarted:m,onPlaybackStopped:f,onError:v,onMessage:w,onBargeIn:C,onStopPlaying:y,onStartConversation:b,onEndConversation:x,className:Q="",style:F={},children:U}=n,[S,I]=t(!1),[E,k]=t(!1),[H,T]=t(!1),[D,K]=t("Disconnected"),L=e(null);A(()=>{console.log("🎙️ VoiceButton: Creating VoiceSDK_v2 instance for ".concat(i||o)),L.current&&(console.log("🎙️ VoiceButton: Destroying existing VoiceSDK_v2 instance"),L.current.destroy(),L.current=null);var A=new FA({signedUrl:i||o,websocketUrl:i||o,agentId:r,appId:s,voice:a,language:c,autoReconnect:l,agentSettingsOverride:d,visualAssistant:u,onStartConversation:b,onEndConversation:x});return A.on("connected",()=>{I(!0),K("Connected"),null==g||g()}),A.on("disconnected",()=>{I(!1),K("Disconnected"),null==p||p()}),A.on("recordingStarted",()=>{k(!0),null==h||h()}),A.on("recordingStopped",()=>{k(!1),null==B||B()}),A.on("playbackStarted",()=>{T(!0),null==m||m()}),A.on("playbackStopped",()=>{T(!1),null==f||f()}),A.on("error",A=>{null==v||v(A)}),A.on("message",A=>{null==w||w(A)}),A.on("bargeIn",A=>{null==C||C(A)}),A.on("stopPlaying",A=>{null==y||y(A)}),L.current=A,A.connect(),()=>{var A=o||i;console.log("🎙️ VoiceButton: Cleaning up VoiceSDK instance for ".concat(A)),L.current&&(L.current.destroy(),L.current=null)}},[o,i,r,s,a,c,d,u]);var M=function(){var A,e=(A=function*(){if(L.current)try{yield L.current.toggleRecording()}catch(A){console.error("Error toggling recording:",A)}},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){NA(i,n,o,r,s,"next",A)}function s(A){NA(i,n,o,r,s,"throw",A)}r(void 0)})});return function(){return e.apply(this,arguments)}}(),R=(0,PA.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,PA.jsx)("div",{style:{fontSize:"20px"},children:E?"🔴":"🎤"}),(0,PA.jsx)("div",{children:E?"Stop Listening":"Start Listening"})]});return(0,PA.jsx)("button",{className:"voice-button ".concat(E?"recording":""," ").concat(Q),style:VA({padding:"12px 24px",border:"none",borderRadius:"8px",backgroundColor:E?"#dc3545":"#007bff",color:"white",cursor:"pointer",fontSize:"16px",fontWeight:"500",transition:"all 0.2s ease"},F),onClick:M,disabled:!S,children:U||R})};function WA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function jA(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){WA(i,n,o,r,s,"next",A)}function s(A){WA(i,n,o,r,s,"throw",A)}r(void 0)})}}function zA(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function XA(A,e,t){return(e=function(A){var e=function(A){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==typeof e?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}class JA{constructor(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.options=function(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?zA(Object(t),!0).forEach(function(e){XA(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):zA(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}({websocketUrl:A.websocketUrl||"wss://speech.talktopc.com/ws/conv",agentId:A.agentId,voice:A.voice||"default",language:A.language||"en",container:A.container||document.body,buttonText:A.buttonText||"Start Listening",buttonClass:A.buttonClass||"voice-button"},A),this.isConnected=!1,this.isRecording=!1,this.isPlaying=!1;var e=this.options.websocketUrl||this.options.signedUrl;"undefined"!=typeof __DEV__&&__DEV__&&console.log("[TTPAgentSDK] WebSocket URL:",e),this.voiceSDK=new FA({signedUrl:e,websocketUrl:e,agentId:this.options.agentId,appId:this.options.appId,voice:this.options.voice,language:this.options.language,visualAssistant:this.options.visualAssistant}),this.setupEventListeners(),this.createButton(),this.connect()}setupEventListeners(){this.voiceSDK.on("connected",()=>{var A,e;this.isConnected=!0,this.updateButton(),null===(A=(e=this.options).onConnected)||void 0===A||A.call(e)}),this.voiceSDK.on("disconnected",()=>{var A,e;this.isConnected=!1,this.updateButton(),null===(A=(e=this.options).onDisconnected)||void 0===A||A.call(e)}),this.voiceSDK.on("recordingStarted",()=>{var A,e;this.isRecording=!0,this.updateButton(),null===(A=(e=this.options).onRecordingStarted)||void 0===A||A.call(e)}),this.voiceSDK.on("recordingStopped",()=>{var A,e;this.isRecording=!1,this.updateButton(),null===(A=(e=this.options).onRecordingStopped)||void 0===A||A.call(e)}),this.voiceSDK.on("playbackStarted",()=>{var A,e;this.isPlaying=!0,null===(A=(e=this.options).onPlaybackStarted)||void 0===A||A.call(e)}),this.voiceSDK.on("playbackStopped",()=>{var A,e;this.isPlaying=!1,null===(A=(e=this.options).onPlaybackStopped)||void 0===A||A.call(e)}),this.voiceSDK.on("error",A=>{var e,t;null===(e=(t=this.options).onError)||void 0===e||e.call(t,A)}),this.voiceSDK.on("message",A=>{var e,t;null===(e=(t=this.options).onMessage)||void 0===e||e.call(t,A)}),this.voiceSDK.on("bargeIn",A=>{var e,t;null===(e=(t=this.options).onBargeIn)||void 0===e||e.call(t,A)}),this.voiceSDK.on("stopPlaying",A=>{var e,t;null===(e=(t=this.options).onStopPlaying)||void 0===e||e.call(t,A)})}createButton(){this.button=document.createElement("button"),this.button.className=this.options.buttonClass,this.button.style.cssText="\n padding: 12px 24px;\n border: none;\n border-radius: 8px;\n background-color: #6c757d;\n color: white;\n cursor: pointer;\n font-size: 16px;\n font-weight: 500;\n transition: all 0.2s ease;\n display: flex;\n align-items: center;\n gap: 8px;\n ",this.button.addEventListener("click",()=>this.toggleRecording()),this.options.container.appendChild(this.button),this.updateButton()}updateButton(){if(this.button){var A=this.isRecording?"🔴":"🎤",e=this.isRecording?"Stop Listening":"Start Listening";this.button.innerHTML='\n <span style="font-size: 20px;">'.concat(A,"</span>\n <span>").concat(e,"</span>\n "),this.button.disabled=!this.isConnected,this.button.style.backgroundColor=this.isRecording?"#dc3545":this.isConnected?"#007bff":"#6c757d"}}connect(){var A=this;return jA(function*(){try{yield A.voiceSDK.connect()}catch(A){console.error("Failed to connect:",A)}})()}toggleRecording(){var A=this;return jA(function*(){if(A.voiceSDK)try{yield A.voiceSDK.toggleRecording()}catch(A){console.error("Error toggling recording:",A)}})()}getStatus(){return{isConnected:this.isConnected,isRecording:this.isRecording,isPlaying:this.isPlaying}}updateConfig(A){this.voiceSDK.updateConfig(A)}destroy(){this.button&&this.button.parentNode&&this.button.parentNode.removeChild(this.button),this.voiceSDK&&this.voiceSDK.destroy()}}function YA(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function qA(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){YA(i,n,o,r,s,"next",A)}function s(A){YA(i,n,o,r,s,"throw",A)}r(void 0)})}}class ZA{constructor(A){console.log("🚀 AgentSDK v2.1.8 initialized with config:",A),this.config=A,this.voiceSDK=null,this.isConnected=!1,this.isListening=!1,this.wasListening=!1,this._resumeInfo=null,this.onConnected=()=>{},this.onDisconnected=()=>{},this.onError=A=>console.error("SDK Error:",A),this.onTranscript=A=>{},this.onAgentSpeaking=A=>{},this.onConversationStart=A.onConversationStart||(()=>{}),this.onConversationEnd=A.onConversationEnd||(()=>{}),this.onBargeIn=A.onBargeIn||(()=>{}),this.onAudioStartPlaying=A.onAudioStartPlaying||(()=>{}),this.onAudioStoppedPlaying=A.onAudioStoppedPlaying||(()=>{}),this.onSubtitleDisplay=A.onSubtitleDisplay||(()=>{})}checkResumeBeforeConnect(){if(void 0!==this._resumeChecked)return this._resumeInfo;try{var A,e=this.config.visualAssistant||(null===(A=this.config.agentSettingsOverride)||void 0===A?void 0:A.visualAssistant),t=new FA({signedUrl:"wss://placeholder",autoReconnect:!1,agentId:this.config.agentId,appId:this.config.appId,language:this.config.language||"en",visualAssistant:e,protocolVersion:2}).checkAndResume();return this._resumeChecked=!0,t?(console.log("🔄 [AGENT SDK] Found resume state before connect:",t),this._resumeInfo=t,t):(this._resumeInfo=null,null)}catch(A){return console.warn("⚠️ [AGENT SDK] Error checking resume:",A),this._resumeChecked=!0,this._resumeInfo=null,null}}connect(A){var e=this;return qA(function*(){try{var t;if(!A)throw new Error("signedUrl is required");e.voiceSDK&&(console.log("🔌 AgentSDK: Cleaning up existing connection"),e.voiceSDK.destroy(),e.voiceSDK=null);var n=e.config.visualAssistant||(null===(t=e.config.agentSettingsOverride)||void 0===t?void 0:t.visualAssistant);if(e.voiceSDK=new FA({signedUrl:A,autoReconnect:!1,agentId:e.config.agentId,appId:e.config.appId,language:e.config.language||"en",agentSettingsOverride:e.config.agentSettingsOverride,visualAssistant:n,protocolVersion:2,outputContainer:e.config.outputContainer||"raw",outputEncoding:e.config.outputEncoding||"pcm",outputSampleRate:e.config.outputSampleRate||44100,outputChannels:e.config.outputChannels||1,outputBitDepth:e.config.outputBitDepth||16}),e._resumeInfo&&(console.log("🔄 [AGENT SDK] Using stored resume info:",e._resumeInfo),console.log(" From:",e._resumeInfo.fromPage,"→ To:",e._resumeInfo.toPage)),e.voiceSDK.on("connected",()=>{e.isConnected=!0,e.onConnected()}),setTimeout(()=>{e.voiceSDK&&e.voiceSDK.isConnected&&!e.isConnected&&(e.isConnected=!0,e.onConnected())},10),e.voiceSDK.on("disconnected",A=>{if(e.isConnected=!1,A&&1008===A.code&&A.reason&&(A.reason.includes("Domain not whitelisted")||A.reason.includes("domain")||A.reason.includes("whitelist"))){var t=new Error("DOMAIN_NOT_WHITELISTED");t.reason=A.reason,t.code=A.code,e.onError(t)}if((e.isListening||e.wasListening)&&(console.log("🎤 [AGENT SDK] disconnected event - calling onConversationEnd hook (isListening:",e.isListening,", wasListening:",e.wasListening,")"),e.onConversationEnd&&"function"==typeof e.onConversationEnd))try{e.onConversationEnd(),console.log("🎤 [AGENT SDK] ✅ onConversationEnd hook called from disconnected event"),e.wasListening=!1}catch(A){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationEnd from disconnected:",A)}e.onDisconnected()}),e.voiceSDK.on("domainError",A=>{e.onError(A)}),e.voiceSDK.on("error",A=>{e.onError(A)}),e.voiceSDK.on("message",A=>{e.handleWebSocketMessage(A)}),e.voiceSDK.on("recordingStarted",()=>{if(e.isListening=!0,e.wasListening=!0,e.onConversationStart&&"function"==typeof e.onConversationStart)try{e.onConversationStart()}catch(A){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationStart:",A)}}),e.voiceSDK.on("recordingStopped",()=>{console.log("🎤 [AGENT SDK] recordingStopped event received");var A=e.isListening;if(e.isListening=!1,A&&e.onConversationEnd&&"function"==typeof e.onConversationEnd)try{console.log("🎤 [AGENT SDK] ✅ Calling onConversationEnd hook from recordingStopped"),e.onConversationEnd(),console.log("🎤 [AGENT SDK] ✅ onConversationEnd hook called successfully"),e.wasListening=!1}catch(A){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationEnd:",A)}}),e.voiceSDK.on("playbackStarted",()=>{e.onAgentSpeaking(!0),e.onAudioStartPlaying(),e.onPlaybackStarted&&"function"==typeof e.onPlaybackStarted&&e.onPlaybackStarted()}),e.voiceSDK.on("playbackStopped",()=>{e.onAgentSpeaking(!1),e.onAudioStoppedPlaying()}),e.voiceSDK.on("bargeIn",A=>{e.onBargeIn(A)}),e.voiceSDK.on("transcriptDisplay",A=>{console.log("📝 [AGENT SDK] transcriptDisplay event received:",A),A&&A.text&&(console.log("📝 [AGENT SDK] Calling onTranscript with text:",A.text),e.onTranscript&&"function"==typeof e.onTranscript?e.onTranscript(A.text):console.warn("📝 [AGENT SDK] ⚠️ onTranscript is not a function!",typeof e.onTranscript)),e.onSubtitleDisplay(A)}),e._pendingToolHandlers&&e._pendingToolHandlers.size>0)for(var[o,i]of(console.log("🔧 AgentSDK: Registering ".concat(e._pendingToolHandlers.size," pending tool handlers")),e._pendingToolHandlers))e.voiceSDK.registerToolHandler(o,i);yield e.voiceSDK.connect()}catch(A){throw e.onError(A),A}})()}handleWebSocketMessage(A){switch(A.t||A.type){case"connected":case"hello_ack":console.log("Session started successfully");break;case"user_transcript":this.onTranscript(A.user_transcription||A.text||A.transcript);break;case"agent_response":case"barge_in":case"stop_playing":default:break;case"error":this.onError(new Error(A.message||A.error||"Unknown error"))}}startListening(){var A=this;return qA(function*(){if(console.log("🎤 AgentSDK: startListening() called"),!A.voiceSDK)throw console.error("❌ AgentSDK: No voiceSDK instance available"),new Error("No voiceSDK instance available");try{console.log("🎤 AgentSDK: Starting recording..."),(yield A.voiceSDK.startRecording())&&console.log("✅ AgentSDK: Recording started successfully")}catch(A){if(A.isServerRejection||"ServerRejected"===A.name)throw A;throw console.error("❌ AgentSDK: Failed to start recording:",A),A}})()}stopListening(){this.voiceSDK&&this.voiceSDK.stopRecording()}hangup(){this.voiceSDK&&this.voiceSDK.hangup()}updateVariables(A){this.voiceSDK&&this.isConnected&&this.voiceSDK.sendMessage({t:"update_variables",variables:A})}disconnect(){this.voiceSDK&&(this.voiceSDK.destroy(),this.voiceSDK=null),this.isConnected=!1,this.isListening=!1}registerToolHandler(A,e){if(this.voiceSDK)return this.voiceSDK.registerToolHandler(A,e);this._pendingToolHandlers||(this._pendingToolHandlers=new Map),this._pendingToolHandlers.set(A,e),console.log("🔧 AgentSDK: Queued tool handler '".concat(A,"' for registration after connect"))}unregisterToolHandler(A){if(this.voiceSDK)return this.voiceSDK.unregisterToolHandler(A);this._pendingToolHandlers&&this._pendingToolHandlers.delete(A)}hasToolHandler(A){var e;return this.voiceSDK?this.voiceSDK.hasToolHandler(A):(null===(e=this._pendingToolHandlers)||void 0===e?void 0:e.has(A))||!1}getRegisteredTools(){return this.voiceSDK?this.voiceSDK.getRegisteredTools():this._pendingToolHandlers?Array.from(this._pendingToolHandlers.keys()):[]}}function $A(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function Ae(){var A=navigator.userAgent,e=/iPad|iPhone|iPod/.test(A)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1,t=/Android/.test(A),n=/Mac/.test(A)&&!e,o=/Win/.test(A),i=/Chrome/.test(A)&&!/Edg|OPR/.test(A),r=/Safari/.test(A)&&!/Chrome/.test(A),s=/Firefox/.test(A),a=/Edg/.test(A),c=/SamsungBrowser/.test(A),l="unknown";e?l="safari":c?l="samsung":i?l="chrome":r?l="safari":s?l="firefox":a&&(l="edge");var d="unknown";return e?d="ios":t?d="android":n?d="mac":o&&(d="windows"),{platform:d,browser:l,isIOS:e,isAndroid:t,isMac:n,isWindows:o,isMobile:e||t,isDesktop:!e&&!t}}function ee(){return te.apply(this,arguments)}function te(){var A;return A=function*(){try{if(navigator.permissions&&navigator.permissions.query)return(yield navigator.permissions.query({name:"microphone"})).state}catch(A){console.log("⚠️ MicPermissionUtils: Permissions API not available or not supported for microphone")}return"unknown"},te=function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){$A(i,n,o,r,s,"next",A)}function s(A){$A(i,n,o,r,s,"throw",A)}r(void 0)})},te.apply(this,arguments)}function ne(A){var{platform:e,browser:t}=A,n={ios:{title:"Enable Microphone on iPhone/iPad",icon:"📱",steps:["Tap the <strong>lock icon 🔒</strong>, <strong>information icon ℹ️</strong>, or <strong>AA icon</strong> in the address bar","Tap <strong>Website Settings</strong> or <strong>Permissions</strong>","Find <strong>Microphone</strong> and set it to <strong>Allow</strong>","Return to this page and refresh"],altTitle:"Alternative Method",altSteps:["Open the <strong>Settings</strong> app on your device","Scroll down and tap <strong>Safari</strong> (or your browser app)",'Tap <strong>Microphone</strong> under "Settings for Websites"',"Set it to <strong>Allow</strong> or <strong>Ask</strong>","Return to this page and refresh"],note:"On iOS, you can also change permissions in the browser address bar or in device Settings.",canOpenSettings:!0,settingsButtonText:"Open Settings App"},android_chrome:{title:"Enable Microphone in Chrome",icon:"🤖",steps:["Tap the <strong>lock icon 🔒</strong>, <strong>information icon ℹ️</strong>, or <strong>settings icon ⋮</strong> in the address bar","Tap <strong>Permissions</strong>","Tap <strong>Microphone</strong>","Select <strong>Allow</strong>","The page will refresh automatically"],altTitle:"Alternative Method",altSteps:["Tap the <strong>⋮ menu</strong> (three dots)","Tap <strong>Settings → Site settings → Microphone</strong>","Find this website and set to <strong>Allow</strong>"],canOpenSettings:!0,settingsButtonText:"Open App Settings"},android_firefox:{title:"Enable Microphone in Firefox",icon:"🦊",steps:["Tap the <strong>lock icon 🔒</strong> or <strong>information icon ℹ️</strong> in the address bar","Tap <strong>Edit Site Permissions</strong>","Toggle <strong>Microphone</strong> to enabled","Refresh the page"],canOpenSettings:!1},android_samsung:{title:"Enable Microphone in Samsung Browser",icon:"📱",steps:["Tap the <strong>menu icon</strong> (three lines)","Tap <strong>Settings → Sites and downloads</strong>","Tap <strong>Site permissions → Microphone</strong>","Find this website and set to <strong>Allow</strong>","Return and refresh the page"],canOpenSettings:!1},desktop_chrome:{title:"Enable Microphone in Chrome",icon:"🌐",steps:["Click the <strong>lock icon 🔒</strong> or <strong>information icon ℹ️</strong> in the address bar (left side)","Find <strong>Microphone</strong> in the dropdown menu",'Change it from "Block" to <strong>Allow</strong>',"Click the <strong>Refresh</strong> button or press F5"],showAddressBarHint:!0,canOpenSettings:!1},desktop_safari:{title:"Enable Microphone in Safari",icon:"🧭",steps:["Click <strong>Safari</strong> in the menu bar (top of screen)","Click <strong>Settings for This Website...</strong>","Find <strong>Microphone</strong> in the popup","Change it to <strong>Allow</strong>","Close settings and refresh the page"],canOpenSettings:!1},desktop_firefox:{title:"Enable Microphone in Firefox",icon:"🦊",steps:["Click the <strong>lock icon 🔒</strong> in the address bar",'Click the <strong>X</strong> next to "Blocked" for Microphone',"Refresh the page (press F5)","Click <strong>Allow</strong> when prompted again"],note:"Firefox requires you to clear the block and then re-allow on the next prompt.",showAddressBarHint:!0,canOpenSettings:!1},desktop_edge:{title:"Enable Microphone in Edge",icon:"🌐",steps:["Click the <strong>lock icon 🔒</strong> in the address bar","Find <strong>Microphone</strong> in the permissions list","Change it to <strong>Allow</strong>","Refresh the page"],showAddressBarHint:!0,canOpenSettings:!1},unknown:{title:"Enable Microphone Access",icon:"🎤",steps:["Look for a <strong>lock icon 🔒</strong>, <strong>information icon ℹ️</strong>, or <strong>settings icon</strong> in your browser's address bar","Find the <strong>Microphone</strong> permission setting","Change it to <strong>Allow</strong>","Refresh this page"],canOpenSettings:!1}};return"ios"===e?n.ios:"android"===e?n["android_".concat(t)]||n.android_chrome:n["desktop_".concat(t)]||n.desktop_chrome}function oe(A){var{isIOS:e,isAndroid:t,browser:n}=A;if(e)try{return window.location.href="app-settings:",!0}catch(A){return console.warn("Could not open iOS settings:",A),!1}if(t&&"chrome"===n)try{return window.location.href="intent:#Intent;action=android.settings.APPLICATION_DETAILS_SETTINGS;data=package:com.android.chrome;end",!0}catch(A){return console.warn("Could not open Android settings:",A),!1}return!1}class ie{constructor(){this.overlay=null,this.modal=null}createOverlay(){var A=document.createElement("div");return A.className="mic-permission-overlay",A.style.cssText="\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.6);\n backdrop-filter: blur(4px);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n padding: 20px;\n animation: mic-fadeIn 0.2s ease-out;\n ",document.getElementById("mic-permission-styles")||this.injectStyles(),A}injectStyles(){if(!document.getElementById("mic-permission-styles")){var A=document.createElement("style");A.id="mic-permission-styles",A.textContent="\n @keyframes mic-fadeIn {\n from { opacity: 0; }\n to { opacity: 1; }\n }\n \n @keyframes mic-slideUp {\n from {\n opacity: 0;\n transform: translateY(20px);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n \n @keyframes mic-bounce {\n 0%, 100% { transform: translateY(0); }\n 50% { transform: translateY(-5px); }\n }\n \n .mic-permission-overlay {\n position: fixed;\n inset: 0;\n background: rgba(0, 0, 0, 0.6);\n backdrop-filter: blur(4px);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n padding: 20px;\n animation: mic-fadeIn 0.2s ease-out;\n }\n \n .mic-permission-modal {\n background: #ffffff;\n border-radius: 16px;\n box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);\n max-width: 480px;\n width: 100%;\n padding: 32px;\n position: relative;\n animation: mic-slideUp 0.3s ease-out;\n max-height: 90vh;\n overflow-y: auto;\n }\n \n .mic-permission-modal__close {\n position: absolute;\n top: 16px;\n right: 16px;\n background: none;\n border: none;\n font-size: 20px;\n cursor: pointer;\n color: #6b7280;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background 0.2s;\n }\n \n .mic-permission-modal__close:hover {\n background: #e5e7eb;\n }\n \n .mic-permission-modal__icon {\n font-size: 48px;\n text-align: center;\n margin-bottom: 16px;\n }\n \n .mic-permission-modal__title {\n font-size: 24px;\n font-weight: 700;\n color: #111827;\n margin: 0 0 12px;\n line-height: 1.3;\n text-align: center;\n }\n \n .mic-permission-modal__description {\n color: #6b7280;\n font-size: 16px;\n line-height: 1.6;\n margin: 0 0 20px;\n text-align: center;\n }\n \n .mic-permission-modal__highlight {\n display: flex;\n align-items: center;\n gap: 12px;\n background: linear-gradient(135deg, #dbeafe, #ede9fe);\n padding: 16px 20px;\n border-radius: 8px;\n margin-bottom: 20px;\n border: 1px solid #bfdbfe;\n }\n \n .mic-permission-modal__highlight-icon {\n font-size: 24px;\n animation: mic-bounce 1s infinite;\n }\n \n .mic-permission-modal__status {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n background: #fef2f2;\n color: #ef4444;\n padding: 12px 16px;\n border-radius: 8px;\n margin-bottom: 20px;\n font-weight: 500;\n }\n \n .mic-permission-modal__note {\n display: flex;\n align-items: flex-start;\n gap: 10px;\n background: #fffbeb;\n color: #92400e;\n padding: 12px 16px;\n border-radius: 8px;\n margin-bottom: 20px;\n font-size: 14px;\n line-height: 1.5;\n border: 1px solid #fde68a;\n }\n \n .mic-permission-modal__steps {\n margin-bottom: 20px;\n }\n \n .mic-permission-modal__steps h3 {\n font-size: 14px;\n font-weight: 600;\n color: #6b7280;\n text-transform: uppercase;\n letter-spacing: 0.5px;\n margin: 0 0 12px;\n }\n \n .mic-permission-modal__steps ol {\n margin: 0;\n padding-left: 24px;\n counter-reset: step-counter;\n list-style: none;\n }\n \n .mic-permission-modal__steps li {\n position: relative;\n padding: 12px 0 12px 16px;\n border-left: 2px solid #e5e7eb;\n color: #111827;\n font-size: 15px;\n line-height: 1.5;\n counter-increment: step-counter;\n }\n \n .mic-permission-modal__steps li::before {\n content: counter(step-counter);\n position: absolute;\n left: -14px;\n top: 10px;\n width: 24px;\n height: 24px;\n background: #4f46e5;\n color: white;\n border-radius: 50%;\n font-size: 12px;\n font-weight: 600;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n .mic-permission-modal__steps li:last-child {\n border-left-color: transparent;\n }\n \n .mic-permission-modal__actions {\n display: flex;\n flex-direction: column;\n gap: 10px;\n margin-top: 24px;\n }\n \n .mic-permission-modal__btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n padding: 14px 24px;\n border-radius: 8px;\n font-size: 16px;\n font-weight: 600;\n cursor: pointer;\n transition: all 0.2s;\n border: none;\n width: 100%;\n }\n \n .mic-permission-modal__btn--primary {\n background: #4f46e5;\n color: white;\n }\n \n .mic-permission-modal__btn--primary:hover {\n background: #4338ca;\n transform: translateY(-1px);\n }\n \n .mic-permission-modal__btn--secondary {\n background: #e5e7eb;\n color: #111827;\n }\n \n .mic-permission-modal__btn--secondary:hover {\n background: #d1d5db;\n }\n \n .mic-permission-modal__footer {\n text-align: center;\n font-size: 13px;\n color: #6b7280;\n margin-top: 20px;\n margin-bottom: 0;\n }\n \n .mic-permission-modal__visual-guide {\n width: 100%;\n max-width: 380px;\n height: auto;\n margin: 20px auto;\n border-radius: 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);\n display: block;\n }\n \n .mic-permission-modal__visual-guide-container {\n text-align: center;\n margin: 20px 0;\n }\n \n @media (max-width: 480px) {\n .mic-permission-modal {\n padding: 24px 20px;\n margin: 10px;\n max-height: 85vh;\n }\n \n .mic-permission-modal__title {\n font-size: 20px;\n }\n \n .mic-permission-modal__icon {\n font-size: 40px;\n }\n \n .mic-permission-modal__visual-guide {\n max-width: 100%;\n }\n }\n ",document.head.appendChild(A)}}close(){this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.overlay=null,this.modal=null}show(){this.overlay&&this.modal&&document.body.appendChild(this.overlay)}}function re(A,e){var t=new ie,n=t.createOverlay(),o=Ae(),i=document.createElement("div");return i.className="mic-permission-modal",i.innerHTML='\n <div class="mic-permission-modal__icon">🎤</div>\n <h2 class="mic-permission-modal__title">Enable Your Microphone</h2>\n <p class="mic-permission-modal__description">\n To start a voice call with our agent, we need access to your microphone.\n </p>\n <div class="mic-permission-modal__highlight">\n <span class="mic-permission-modal__highlight-icon">👆</span>\n <span>Please click <strong>"Allow"</strong> on the next popup</span>\n </div>\n '.concat(o.isIOS?'\n <div class="mic-permission-modal__note">\n <span>ℹ️</span>\n <span>On iPhone/iPad, you may need to allow microphone access in your device Settings.</span>\n </div>\n ':"",'\n <div class="mic-permission-modal__actions">\n <button class="mic-permission-modal__btn mic-permission-modal__btn--primary" data-action="accept">\n Continue\n </button>\n <button class="mic-permission-modal__btn mic-permission-modal__btn--secondary" data-action="cancel">\n Not Now\n </button>\n </div>\n '),n.appendChild(i),t.overlay=n,t.modal=i,i.querySelector('[data-action="accept"]').addEventListener("click",()=>{t.close(),A()}),i.querySelector('[data-action="cancel"]').addEventListener("click",()=>{t.close(),e()}),n.addEventListener("click",A=>{A.target===n&&(t.close(),e())}),t.show(),t}function se(A,e){var t,n,o,i=new ie,r=i.createOverlay(),s=Ae(),a=ne(s),c=document.createElement("div");c.className="mic-permission-modal";var l="";a.altSteps&&a.altSteps.length>0&&(l='\n <div style="margin-top: 20px; border-top: 1px solid #e5e7eb; padding-top: 16px;">\n <button class="mic-permission-modal__alt-toggle" style="background: none; border: none; color: #4f46e5; font-size: 14px; font-weight: 500; cursor: pointer; padding: 0; margin-bottom: 12px;">\n ▼ '.concat(a.altTitle||"Alternative method",'\n </button>\n <ol style="margin: 0; padding-left: 20px; display: none;">\n ').concat(a.altSteps.map(A=>'<li style="padding: 8px 0; font-size: 14px; color: #6b7280;">'.concat(A,"</li>")).join(""),"\n </ol>\n </div>\n "));var d=function(A){var{platform:e,browser:t}=A,n=document.getElementsByTagName("script"),o="";for(var i of n){var r=i.src;if(r&&(r.includes("agent-widget.js")||r.includes("ttp-agent-sdk")||r.includes("ttp-sdk-front")))try{new URL(r),o=r.substring(0,r.lastIndexOf("/"));break}catch(A){var s=r.match(/^(.*\/)[^\/]+$/);if(s){o=s[1];break}}}var a;if(a="ios"===e?"ios-settings.svg":"android"===e?"android-chrome.svg":"chrome"===t?"desktop-chrome.svg":"safari"===t?"desktop-safari.svg":"firefox"===t?"desktop-firefox.svg":"edge"===t?"desktop-edge.svg":"desktop-chrome.svg",!o||""===o||o.startsWith("/")){for(var c of n){var l=c.src;if(l&&(l.includes("cdn.talktopc.com")||l.includes("talktopc.com"))){if(l.includes("/ttp-agent-sdk/")||l.includes("/ttp-sdk-front/")){var d=l.match(/(https?:\/\/[^\/]+(?:\/[^\/]+)*)/);if(d){o=d[1].replace(/\/[^\/]+\.js$/,"");break}}if(!o&&(l.includes("cdn.talktopc.com")||l.includes("talktopc.com"))){o="https://cdn.talktopc.com/ttp-agent-sdk";break}}}if(!o||""===o)if(window.location.hostname.includes("cdn.talktopc.com")||window.location.hostname.includes("talktopc.com"))o="https://cdn.talktopc.com/ttp-agent-sdk";else{var u=window.location.pathname.split("/");u.pop(),(o=window.location.origin+u.join("/"))&&o!==window.location.origin||(o=window.location.origin)}}o=o.replace(/\/$/,"");var g="".concat(o,"/shared/mic-permission-assets/").concat(a);return"undefined"!=typeof console&&console.log&&console.log("[MicPermission] Visual guide path:",g,"Base path:",o,"Platform:",e,"Browser:",t),g}(s);c.innerHTML='\n <button class="mic-permission-modal__close" data-action="close">✕</button>\n <div style="display: flex; align-items: center; gap: 12px; margin-bottom: 20px;">\n <span style="font-size: 32px;">'.concat(a.icon,'</span>\n <h2 class="mic-permission-modal__title" style="text-align: left; margin: 0;">').concat(a.title,'</h2>\n </div>\n <div class="mic-permission-modal__status">\n <span>🚫</span>\n <span>Microphone access is currently blocked</span>\n </div>\n ').concat(a.note?'\n <div class="mic-permission-modal__note">\n <span>ℹ️</span>\n <span>'.concat(a.note,"</span>\n </div>\n "):"",'\n <div class="mic-permission-modal__visual-guide-container">\n <img src="').concat(d,'" alt="Visual guide for enabling microphone" class="mic-permission-modal__visual-guide" \n onerror="console.error(\'[MicPermission] Failed to load image:\', this.src); this.style.display=\'none\';" \n onload="console.log(\'[MicPermission] Image loaded successfully:\', this.src);" />\n </div>\n <div class="mic-permission-modal__steps">\n <h3>Follow these steps:</h3>\n <ol>\n ').concat(a.steps.map(A=>"<li>".concat(A,"</li>")).join(""),"\n </ol>\n </div>\n ").concat(l,'\n <div class="mic-permission-modal__actions">\n ').concat(a.canOpenSettings?'\n <button class="mic-permission-modal__btn mic-permission-modal__btn--primary" data-action="open-settings">\n '.concat(a.settingsButtonText||"Open Settings","\n </button>\n "):"","\n ").concat(a.showAddressBarHint?'\n <button class="mic-permission-modal__btn mic-permission-modal__btn--primary" data-action="show-hint">\n Show Me Where\n </button>\n ':"",'\n <button class="mic-permission-modal__btn mic-permission-modal__btn--secondary" data-action="refresh">\n 🔄 Refresh Page\n </button>\n </div>\n <p class="mic-permission-modal__footer">\n After enabling microphone access, return here and click "Refresh Page"\n </p>\n '),r.appendChild(c),i.overlay=r,i.modal=c,null===(t=c.querySelector('[data-action="close"]'))||void 0===t||t.addEventListener("click",()=>{i.close(),A()}),null===(n=c.querySelector('[data-action="open-settings"]'))||void 0===n||n.addEventListener("click",()=>{oe(s)}),null===(o=c.querySelector('[data-action="refresh"]'))||void 0===o||o.addEventListener("click",()=>{window.location.reload()});var u=c.querySelector('[data-action="show-hint"]');u&&u.addEventListener("click",()=>{i.close(),A(),function(){var A=document.getElementById("mic-address-bar-hint");A&&A.remove(),Ae();var e=document.getElementsByTagName("script"),t="";for(var n of e){var o=n.src;if(o&&(o.includes("agent-widget.js")||o.includes("ttp-agent-sdk")||o.includes("ttp-sdk-front")))try{new URL(o),t=o.substring(0,o.lastIndexOf("/"));break}catch(A){var i=o.match(/^(.*\/)[^\/]+$/);if(i){t=i[1];break}}}if(!t||""===t||t.startsWith("/")){for(var r of e){var s=r.src;if(s&&(s.includes("cdn.talktopc.com")||s.includes("talktopc.com"))){if(s.includes("/ttp-agent-sdk/")||s.includes("/ttp-sdk-front/")){var a=s.match(/(https?:\/\/[^\/]+(?:\/[^\/]+)*)/);if(a){t=a[1].replace(/\/[^\/]+\.js$/,"");break}}if(!t&&(s.includes("cdn.talktopc.com")||s.includes("talktopc.com"))){t="https://cdn.talktopc.com/ttp-agent-sdk";break}}}if(!t||""===t)if(window.location.hostname.includes("cdn.talktopc.com")||window.location.hostname.includes("talktopc.com"))t="https://cdn.talktopc.com/ttp-agent-sdk";else{var c=window.location.pathname.split("/");c.pop(),(t=window.location.origin+c.join("/"))&&t!==window.location.origin||(t=window.location.origin)}}t=t.replace(/\/$/,"");var l="".concat(t,"/shared/mic-permission-assets/address-bar-hint.svg"),d=document.createElement("div");d.id="mic-address-bar-hint",d.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n z-index: 10001;\n padding: 10px 20px;\n pointer-events: none;\n animation: mic-fadeIn 0.3s ease-out;\n display: flex;\n justify-content: center;\n ";var u=document.createElement("div");u.style.cssText="\n display: flex;\n align-items: center;\n gap: 12px;\n background: #f59e0b;\n color: white;\n padding: 12px 20px;\n border-radius: 0 0 8px 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n pointer-events: all;\n animation: mic-slideDown 0.3s ease-out;\n max-width: 540px;\n ";var g=document.createElement("div");g.style.cssText="\n flex-shrink: 0;\n ";var p=document.createElement("img");p.src=l,p.alt="Address bar hint",p.style.cssText="\n width: auto;\n height: 80px;\n display: block;\n ",p.onerror=()=>{g.style.display="none"},g.appendChild(p);var h=document.createElement("div");h.style.cssText="\n display: flex;\n flex-direction: column;\n gap: 4px;\n flex: 1;\n ";var B=document.createElement("div");B.style.cssText="\n font-size: 15px;\n font-weight: 500;\n ",B.innerHTML="Click the <strong>lock icon 🔒</strong>, <strong>information icon ℹ️</strong>, or <strong>settings icon ⋮</strong> in the address bar to enable microphone";var m=document.createElement("button");if(m.style.cssText="\n background: rgba(255, 255, 255, 0.2);\n border: none;\n color: white;\n width: 28px;\n height: 28px;\n border-radius: 50%;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 14px;\n transition: background 0.2s;\n flex-shrink: 0;\n ",m.textContent="✕",m.addEventListener("click",()=>{d.remove()}),m.addEventListener("mouseenter",()=>{m.style.background="rgba(255, 255, 255, 0.3)"}),m.addEventListener("mouseleave",()=>{m.style.background="rgba(255, 255, 255, 0.2)"}),!document.getElementById("mic-address-bar-hint-styles")){var f=document.createElement("style");f.id="mic-address-bar-hint-styles",f.textContent="\n @keyframes mic-slideDown {\n from {\n opacity: 0;\n transform: translateY(-100%);\n }\n to {\n opacity: 1;\n transform: translateY(0);\n }\n }\n \n @keyframes mic-pointUp {\n 0%, 100% {\n transform: translate(0, 0);\n }\n 50% {\n transform: translate(-5px, -5px);\n }\n }\n ",document.head.appendChild(f)}h.appendChild(B),u.appendChild(g),u.appendChild(h),u.appendChild(m),d.appendChild(u),document.body.appendChild(d),setTimeout(()=>{d.parentNode&&(d.style.opacity="0",d.style.transition="opacity 0.3s ease-out",setTimeout(()=>{d.parentNode&&d.remove()},300))},1e4)}()});var g=c.querySelector(".mic-permission-modal__alt-toggle");if(g&&a.altSteps){var p=g.nextElementSibling;p&&(p.style.display="none",g.addEventListener("click",()=>{"none"===p.style.display?(p.style.display="block",g.innerHTML="▼ ".concat(a.altTitle||"Alternative method")):(p.style.display="none",g.innerHTML="▶ ".concat(a.altTitle||"Alternative method"))}))}return r.addEventListener("click",e=>{e.target===r&&(i.close(),A())}),i.show(),i}function ae(A){var e=new ie,t=e.createOverlay(),n=document.createElement("div");return n.className="mic-permission-modal",n.innerHTML='\n <div class="mic-permission-modal__icon">🎤❌</div>\n <h2 class="mic-permission-modal__title">No Microphone Found</h2>\n <p class="mic-permission-modal__description">\n We couldn\'t detect a microphone on your device. Please make sure:\n </p>\n <ul style="list-style: none; padding: 0; margin: 0 0 24px;">\n <li style="padding: 10px 0 10px 32px; position: relative; color: #111827; border-bottom: 1px solid #e5e7eb;">\n <span style="position: absolute; left: 0; font-size: 18px;">☐</span>\n Your microphone is properly connected\n </li>\n <li style="padding: 10px 0 10px 32px; position: relative; color: #111827; border-bottom: 1px solid #e5e7eb;">\n <span style="position: absolute; left: 0; font-size: 18px;">☐</span>\n Your microphone is not muted at the hardware level\n </li>\n <li style="padding: 10px 0 10px 32px; position: relative; color: #111827;">\n <span style="position: absolute; left: 0; font-size: 18px;">☐</span>\n No other app is exclusively using the microphone\n </li>\n </ul>\n <div class="mic-permission-modal__actions">\n <button class="mic-permission-modal__btn mic-permission-modal__btn--primary" data-action="retry">\n Retry\n </button>\n <button class="mic-permission-modal__btn mic-permission-modal__btn--secondary" data-action="close">\n Close\n </button>\n </div>\n ',t.appendChild(n),e.overlay=t,e.modal=n,n.querySelector('[data-action="retry"]').addEventListener("click",()=>{window.location.reload()}),n.querySelector('[data-action="close"]').addEventListener("click",()=>{e.close(),A()}),t.addEventListener("click",n=>{n.target===t&&(e.close(),A())}),e.show(),e}class ce{constructor(A){this.voiceInterface=A,this.config=A.config}t(A){return this.voiceInterface.t(A)}getText(A,e){return this.voiceInterface.getText(A,e)}getTooltip(A){return this.voiceInterface.getTooltip(A)}generateHTML(){return this.voiceInterface.isMobile?this.generateMobileHTML():'<div class="voice-interface" id="voiceInterface">\n \x3c!-- Before Call State --\x3e\n <div id="voiceIdleState">\n <div class="voice-avatar" id="voiceAvatar">🤖</div>\n <div class="voice-status">\n <div class="voice-status-title">'.concat(this.getText("startCallTitle","clickToStartCall"),'</div>\n <div class="voice-status-subtitle">').concat(this.getText("startCallSubtitle","realTimeVoice"),'</div>\n </div>\n <button class="start-call-btn" id="startCallBtn">\n <svg width="32" height="32" viewBox="0 0 24 24" fill="currentColor">\n <path d="M20.01 15.38c-1.23 0-2.42-.2-3.53-.56-.35-.12-.74-.03-1.01.24l-1.57 1.97c-2.83-1.35-5.48-3.9-6.89-6.83l1.95-1.66c.27-.28.35-.67.24-1.02-.37-1.11-.56-2.3-.56-3.53 0-.54-.45-.99-.99-.99H4.19C3.65 3 3 3.24 3 3.99 3 13.28 10.73 21 20.01 21c.71 0 .99-.63.99-1.18v-3.45c0-.54-.45-.99-.99-.99z"/>\n </svg>\n <span>').concat(this.getText("startCallButtonText","startCall"),'</span>\n </button>\n </div>\n \x3c!-- During Call State - Desktop View --\x3e\n <div id="voiceActiveState" style="display: none;">\n \x3c!-- Original Multi-Row Voice Section (shown when history is collapsed) --\x3e\n <div class="desktop-voice-section" id="desktopVoiceSection">\n \x3c!-- Timer --\x3e\n <div class="desktop-timer">\n <div class="timer-dot"></div>\n <span id="desktopTimerText">00:00</span>\n </div>\n\n \x3c!-- Main Waveform --\x3e\n <div class="desktop-main-waveform" id="desktopMainWaveform">\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n </div>\n\n \x3c!-- Status --\x3e\n <div class="desktop-status" id="desktopStatus">\n <div class="status-dot"></div>\n <span id="desktopStatusText">').concat(this.t("listening")||"Listening...",'</span>\n </div>\n\n \x3c!-- Controls --\x3e\n <div class="desktop-controls">\n <button class="desktop-control-btn secondary" id="desktopMuteBtn" title="').concat(this.getTooltip("mute"),'">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" class="desktop-mic-icon">\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" y1="19" x2="12" y2="23"/>\n </svg>\n <svg fill="none" viewBox="0 0 24 24" class="desktop-mic-off-icon" style="display: none; position: absolute;">\n \x3c!-- Original mic icon (same as normal state) --\x3e\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2" stroke="currentColor" stroke-width="2" fill="none"/>\n <line x1="12" y1="19" x2="12" y2="23" stroke="currentColor" stroke-width="2"/>\n \x3c!-- Red circle surrounding the icon --\x3e\n <circle cx="12" cy="12" r="11.8" fill="none" stroke="#ef4444" stroke-width="2"/>\n \x3c!-- Red diagonal strike line --\x3e\n <line x1="4" y1="4" x2="20" y2="20" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round"/>\n </svg>\n </button>\n <button class="desktop-control-btn danger" id="desktopEndCallBtn" title="').concat(this.getTooltip("endCall"),'">\n <svg fill="none" stroke="currentColor" stroke-width="1.8" viewBox="0 0 24 24" style="overflow: visible;">\n <path d="M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 16.92z" transform="rotate(135 12 12)"/>\n </svg>\n </button>\n <button class="desktop-control-btn secondary" id="desktopSpeakerBtn" title="').concat(this.getTooltip("speaker"),'">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" class="desktop-speaker-icon">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <path d="M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07"/>\n </svg>\n <svg fill="none" viewBox="0 0 24 24" class="desktop-speaker-off-icon" style="display: none; position: absolute;">\n \x3c!-- Original speaker icon (same as normal state) --\x3e\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M19.07 4.93a10 10 0 010 14.14" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M15.54 8.46a5 5 0 010 7.07" stroke="currentColor" stroke-width="2" fill="none"/>\n \x3c!-- Red circle surrounding the icon --\x3e\n <circle cx="12" cy="12" r="11.8" fill="none" stroke="#ef4444" stroke-width="2"/>\n \x3c!-- Red diagonal strike line --\x3e\n <line x1="4" y1="4" x2="20" y2="20" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round"/>\n </svg>\n </button>\n </div>\n </div>\n\n \x3c!-- Compact Voice Section - Single Row Layout (shown only when history is expanded) --\x3e\n <div class="compact-voice-section" id="compactVoiceSection" style="display: none;">\n \x3c!-- Left side: Avatar + Info --\x3e\n <div class="compact-left">\n \x3c!-- Avatar container with waveform --\x3e\n <div class="compact-avatar" id="desktopAvatarCompact">\n \x3c!-- Main Waveform - Scaled down for compact view --\x3e\n <div class="desktop-main-waveform" id="desktopMainWaveformCompact">\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n <div class="waveform-bar"></div>\n </div>\n </div>\n \n \x3c!-- Timer and Status stacked vertically --\x3e\n <div class="compact-info">\n <div class="compact-timer" id="desktopTimerCompact">\n <span class="timer-dot"></span>\n <span id="compactTimerText">00:00</span>\n </div>\n <div class="compact-status" id="desktopStatusCompact">\n <span class="status-dot"></span>\n <span id="compactStatusText">').concat(this.t("listening")||"Listening",'</span>\n </div>\n </div>\n </div>\n \n \x3c!-- Right side: Control buttons (reuse same IDs, handlers will work for both) --\x3e\n <div class="compact-controls">\n <button class="compact-control-btn secondary" id="desktopMuteBtnCompact" title="').concat(this.getTooltip("mute"),'">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" class="desktop-mic-icon">\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" y1="19" x2="12" y2="23"/>\n </svg>\n <svg fill="none" viewBox="0 0 24 24" class="desktop-mic-off-icon" style="display: none; position: absolute;">\n \x3c!-- Original mic icon (same as normal state) --\x3e\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2" stroke="currentColor" stroke-width="2" fill="none"/>\n <line x1="12" y1="19" x2="12" y2="23" stroke="currentColor" stroke-width="2"/>\n \x3c!-- Red circle surrounding the icon --\x3e\n <circle cx="12" cy="12" r="11.8" fill="none" stroke="#ef4444" stroke-width="2"/>\n \x3c!-- Red diagonal strike line --\x3e\n <line x1="4" y1="4" x2="20" y2="20" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round"/>\n </svg>\n </button>\n <button class="compact-control-btn danger" id="desktopEndCallBtnCompact" title="').concat(this.getTooltip("endCall"),'">\n <svg fill="none" stroke="currentColor" stroke-width="1.8" viewBox="0 0 24 24" style="overflow: visible;">\n <path d="M22 16.92v3a2 2 0 01-2.18 2 19.79 19.79 0 01-8.63-3.07 19.5 19.5 0 01-6-6 19.79 19.79 0 01-3.07-8.67A2 2 0 014.11 2h3a2 2 0 012 1.72c.127.96.361 1.903.7 2.81a2 2 0 01-.45 2.11L8.09 9.91a16 16 0 006 6l1.27-1.27a2 2 0 012.11-.45c.907.339 1.85.573 2.81.7A2 2 0 0122 16.92z" transform="rotate(135 12 12)"/>\n </svg>\n </button>\n <button class="compact-control-btn secondary" id="desktopSpeakerBtnCompact" title="').concat(this.getTooltip("speaker"),'">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24" class="desktop-speaker-icon">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <path d="M19.07 4.93a10 10 0 010 14.14M15.54 8.46a5 5 0 010 7.07"/>\n </svg>\n <svg fill="none" viewBox="0 0 24 24" class="desktop-speaker-off-icon" style="display: none; position: absolute;">\n \x3c!-- Original speaker icon (same as normal state) --\x3e\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M19.07 4.93a10 10 0 010 14.14" stroke="currentColor" stroke-width="2" fill="none"/>\n <path d="M15.54 8.46a5 5 0 010 7.07" stroke="currentColor" stroke-width="2" fill="none"/>\n \x3c!-- Red circle surrounding the icon --\x3e\n <circle cx="12" cy="12" r="11.8" fill="none" stroke="#ef4444" stroke-width="2"/>\n \x3c!-- Red diagonal strike line --\x3e\n <line x1="4" y1="4" x2="20" y2="20" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round"/>\n </svg>\n </button>\n </div>\n </div>\n\n \x3c!-- Conversation Panel --\x3e\n <div class="desktop-conversation-panel collapsed" id="desktopConversationPanel">\n \x3c!-- Header --\x3e\n <div class="conversation-header" id="conversationHeader">\n <span class="conversation-label">').concat(this.t("conversation")||"Conversation",'</span>\n <span class="conversation-toggle">\n <span id="conversationToggleText">Show history</span>\n <svg width="12" height="12" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">\n <path d="M6 9l6 6 6-6"/>\n </svg>\n </span>\n </div>\n\n \x3c!-- Collapsed: Live transcript only (2 lines) --\x3e\n <div class="live-transcript-collapsed" id="liveTranscriptCollapsed">\n <div class="live-indicator">\n <div class="live-dot"></div>\n <span>Live</span>\n </div>\n <div class="live-text-collapsed muted" id="liveTextCollapsed">\n ').concat(this.t("transcriptWillAppear")||"Transcript will appear here...",'<span class="typing-cursor"></span>\n </div>\n </div>\n\n \x3c!-- Expanded: Full conversation history --\x3e\n <div class="conversation-history" id="conversationHistory">\n <div class="conversation-messages" id="conversationMessages">\n \x3c!-- Messages will be rendered here --\x3e\n </div>\n \n \x3c!-- Live message at bottom --\x3e\n <div class="live-message-row" id="liveMessageRow" style="display: none;">\n <div class="message-avatar assistant">\n <div class="orb"></div>\n </div>\n <div class="message-bubble">\n <span class="live-badge">Live</span>\n <span id="liveMessageText"></span><span class="typing-cursor"></span>\n </div>\n </div>\n </div>\n\n \x3c!-- Text Input --\x3e\n <div class="voice-text-input-area">\n <div class="voice-input-wrapper">\n <input type="text" class="voice-text-input" id="voiceTextInput" placeholder="').concat(this.getText("inputPlaceholder","typeMessage")||"Type a message...",'">\n <button class="voice-send-btn" id="voiceSendBtn">\n <svg width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">\n <line x1="22" y1="2" x2="11" y2="13"/>\n <polygon points="22 2 15 22 11 13 2 9 22 2"/>\n </svg>\n </button>\n </div>\n <div class="voice-input-hint" id="voiceInputHint">\n <svg fill="none" stroke="currentColor" stroke-width="2" viewBox="0 0 24 24">\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>\n </svg>\n ').concat(this.getText("voiceActiveHint","voiceActive")||"Voice is still active • Type or speak","\n </div>\n </div>\n </div>\n </div>\n </div>")}generateMobileHTML(){return'<div class="voice-interface mobile-voice-interface" id="voiceInterface">\n \x3c!-- Before Call State (same as desktop) --\x3e\n <div id="voiceIdleState">\n <div class="voice-avatar" id="voiceAvatar">🤖</div>\n <div class="voice-status">\n <div class="voice-status-title">'.concat(this.getText("startCallTitle","clickToStartCall"),'</div>\n <div class="voice-status-subtitle">').concat(this.getText("startCallSubtitle","realTimeVoice"),'</div>\n </div>\n <button class="start-call-btn" id="startCallBtn">\n <svg width="32" height="32" viewBox="0 0 24 24" fill="currentColor">\n <path d="M20.01 15.38c-1.23 0-2.42-.2-3.53-.56-.35-.12-.74-.03-1.01.24l-1.57 1.97c-2.83-1.35-5.48-3.9-6.89-6.83l1.95-1.66c.27-.28.35-.67.24-1.02-.37-1.11-.56-2.3-.56-3.53 0-.54-.45-.99-.99-.99H4.19C3.65 3 3 3.24 3 3.99 3 13.28 10.73 21 20.01 21c.71 0 .99-.63.99-1.18v-3.45c0-.54-.45-.99-.99-.99z"/>\n </svg>\n <span>').concat(this.getText("startCallButtonText","startCall"),'</span>\n </button>\n </div>\n \n \x3c!-- Mobile Active Call State - Hidden placeholder (actual bar will be appended to body) --\x3e\n <div id="voiceActiveState" class="mobile-active-state" style="display: none;">\n \x3c!-- Duration Badge --\x3e\n <div class="mobile-duration-badge" id="mobileDurationBadge">\n <div class="mobile-duration-dot"></div>\n <span id="mobileDurationText">00:00</span>\n </div>\n \n \x3c!-- Main Bar --\x3e\n <div class="mobile-voice-bar">\n \x3c!-- Top Row: Status, Waveform, Controls --\x3e\n <div class="mobile-top-row">\n \x3c!-- Status Indicator --\x3e\n <div class="mobile-status-indicator">\n <div class="mobile-status-dot" id="mobileStatusDot"></div>\n <span class="mobile-status-text" id="mobileStatusText">Listening...</span>\n </div>\n \n \x3c!-- Centered Waveform --\x3e\n <div class="mobile-waveform-center" id="mobileWaveform">\n ').concat(Array(8).fill(0).map((A,e)=>'<div class="mobile-waveform-bar" data-index="'.concat(e,'"></div>')).join(""),'\n </div>\n \n \x3c!-- Controls --\x3e\n <div class="mobile-controls">\n <button class="mobile-control-btn" id="mobileMuteBtn" aria-label="Mute microphone">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-mic-icon">\n <path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" x2="12" y1="19" y2="22"/>\n </svg>\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-mic-off-icon" style="display: none;">\n <line x1="2" x2="22" y1="2" y2="22"/>\n <path d="M18.89 13.23A7.12 7.12 0 0 0 19 12v-2"/>\n <path d="M5 10v2a7 7 0 0 0 12 5"/>\n <path d="M15 9.34V5a3 3 0 0 0-5.68-1.33"/>\n <path d="M9 9v3a3 3 0 0 0 5.12 2.12"/>\n <line x1="12" x2="12" y1="19" y2="22"/>\n </svg>\n </button>\n \n <button class="mobile-control-btn" id="mobileSpeakerBtn" aria-label="Toggle speaker">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-speaker-icon">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>\n </svg>\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-speaker-off-icon" style="display: none;">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <line x1="22" x2="16" y1="9" y2="15"/>\n <line x1="16" x2="22" y1="9" y2="15"/>\n </svg>\n </button>\n \n <button class="mobile-end-call-btn" id="mobileEndCallBtn" aria-label="End call">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"/>\n <line x1="22" x2="2" y1="2" y2="22"/>\n </svg>\n </button>\n </div>\n </div>\n \n \x3c!-- Bottom Row: Transcript (expandable) --\x3e\n <button class="mobile-transcript-row" id="mobileTranscriptRow">\n <p class="mobile-transcript-text" id="mobileTranscriptText">').concat(this.t("transcriptWillAppear"),'</p>\n <div class="mobile-transcript-footer">\n <span class="mobile-expand-hint">tap to expand & type</span>\n <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="opacity: 0.6;">\n <path d="M7 17L17 7M17 7H7M17 7V17"/>\n </svg>\n </div>\n </button>\n </div>\n </div>\n \n \x3c!-- Expanded Transcript Overlay --\x3e\n <div class="mobile-transcript-overlay" id="mobileTranscriptOverlay" style="display: none;">\n <div class="mobile-expanded-transcript" id="mobileExpandedTranscript">\n \x3c!-- Header --\x3e\n <div class="mobile-transcript-header">\n <div class="mobile-header-left">\n <div class="mobile-header-status">\n <div class="mobile-header-status-dot"></div>\n <span class="mobile-header-status-text" id="mobileHeaderStatusText">Listening...</span>\n <span class="mobile-header-duration" id="mobileHeaderDuration">00:00</span>\n </div>\n <span class="mobile-transcript-label">CONVERSATION</span>\n </div>\n <button class="mobile-close-transcript-btn" id="mobileCloseTranscriptBtn">\n <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 6L6 18M6 6l12 12"/>\n </svg>\n </button>\n </div>\n \n \x3c!-- Messages Container --\x3e\n <div class="mobile-messages-container" id="mobileMessagesContainer">\n \x3c!-- Messages will be dynamically added here --\x3e\n </div>\n \n \x3c!-- Text Input Area --\x3e\n <div class="mobile-input-area">\n <div class="mobile-input-wrapper">\n <input\n type="text"\n placeholder="Type a message..."\n id="mobileTextInput"\n class="mobile-text-input"\n />\n <button class="mobile-send-btn" id="mobileSendBtn" disabled>\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"/>\n </svg>\n </button>\n </div>\n <p class="mobile-input-hint">🎙️ Voice is still active • Type or speak</p>\n </div>\n </div>\n </div>\n </div>')}}class le{constructor(A){this.voiceInterface=A,this.config=A.config}generateCSS(){var A,e=this.config.avatarBackgroundColor||"#667eea",t=this.config.avatarActiveBackgroundColor||this.config.avatarBackgroundColor||"#667eea",n=this.config.statusTitleColor||"#1e293b",o=this.config.statusSubtitleColor||"#64748b",i=this.config.statusDotColor||"#10b981",r=(this.config.statusText,this.config.startCallButtonColor||"#667eea"),s=this.config.startCallButtonTextColor||"#FFFFFF",a=this.config.transcriptBackgroundColor||"#FFFFFF",c=this.config.transcriptTextColor||"#1e293b",l=this.config.transcriptLabelColor||"#94a3b8",d=this.config.controlButtonColor||"#FFFFFF",u=this.config.liveTranscriptTextColor||this.config.transcriptTextColor||"#64748b",g=this.config.liveTranscriptFontSize||"14px",p=this.config.controlButtonSecondaryColor||"#64748b",h=this.config.liveIndicatorDotColor||"#10b981",B=this.config.liveIndicatorTextColor||"#10b981",m=this.config.micButtonColor||d,f=this.config.speakerButtonColor||d,v=this.config.endCallButtonColor||"#ef4444",w=this.config.sendButtonColor||(null===(A=this.config.text)||void 0===A?void 0:A.sendButtonColor)||this.config.voiceSendButtonColor||"#7C3AED",C=" !important";return"\n /* Voice Interface Styles - Ultra-compact for Wix iframes */\n .voice-interface { \n display: none".concat(C,"; \n flex: 1; \n flex-direction: column;\n align-items: stretch; \n justify-content: flex-start; \n padding: 0; \n background: linear-gradient(180deg, #f8fafc 0%, #e0e7ff 100%);\n overflow: hidden;\n min-height: 0;\n height: 100%;\n width: 100%;\n box-sizing: border-box;\n }\n .voice-interface.active { display: flex").concat(C,'; }\n \n /* Voice States - Better scaling gaps */\n #voiceIdleState {\n display: flex;\n flex-direction: column;\n align-items: center;\n width: 100%;\n height: 100%;\n min-height: 0;\n justify-content: center;\n overflow: hidden;\n flex: 1;\n box-sizing: border-box;\n gap: clamp(6px, 1.5vh, 12px);\n }\n \n #voiceActiveState {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n width: 100%;\n height: 100%;\n min-height: 0;\n justify-content: flex-start;\n overflow: hidden;\n flex: 1;\n box-sizing: border-box;\n gap: 0;\n padding: 0;\n }\n \n #voiceActiveState[style*="display: none"] {\n display: none !important;\n }\n \n /* Voice Avatar - Scales better from small to large */\n .voice-avatar,\n .voice-avatar-active {\n width: clamp(80px, 18vh, 160px);\n height: clamp(80px, 18vh, 160px);\n aspect-ratio: 1;\n border-radius: 50%;\n background: linear-gradient(135deg, ').concat(e," 0%, ").concat(t," 100%);\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: clamp(40px, 9vh, 80px);\n margin: 0;\n box-shadow: 0 8px 30px rgba(102, 126, 234, 0.3);\n transition: all 0.3s ease;\n flex-shrink: 0;\n position: relative;\n }\n \n .voice-avatar-active {\n animation: avatarPulse 2s ease-in-out infinite;\n }\n \n @keyframes avatarPulse {\n 0%, 100% { \n transform: scale(1);\n }\n 50% { \n transform: scale(1.05);\n }\n }\n \n .voice-avatar-active.speaking {\n animation: avatarSpeak 0.5s ease-in-out infinite;\n }\n \n @keyframes avatarSpeak {\n 0%, 100% { transform: scale(1); }\n 50% { transform: scale(1.08); }\n }\n \n /* Voice Rings Animation */\n .voice-rings {\n position: absolute;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n }\n \n .voice-ring {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n border: 2px solid rgba(102, 126, 234, 0.3);\n border-radius: 50%;\n opacity: 0;\n animation: ringExpand 2s ease-out infinite;\n }\n \n .voice-ring:nth-child(2) { animation-delay: 0.5s; }\n .voice-ring:nth-child(3) { animation-delay: 1s; }\n \n @keyframes ringExpand {\n 0% {\n width: 100%;\n height: 100%;\n opacity: 0.6;\n }\n 100% {\n width: 160%;\n height: 160%;\n opacity: 0;\n }\n }\n \n /* Voice Status - Scales with container */\n .voice-status {\n text-align: center;\n margin: 0;\n flex-shrink: 0;\n min-height: 0;\n }\n \n .voice-status-title {\n font-size: clamp(12px, 3vh, 20px);\n font-weight: 600;\n color: ").concat(n,";\n margin-bottom: clamp(2px, 0.5vh, 4px);\n line-height: 1.2;\n }\n \n .voice-status-subtitle {\n font-size: clamp(10px, 2vh, 14px);\n color: ").concat(o,";\n line-height: 1.2;\n }\n \n /* Start Call Button - Scales with container */\n .start-call-btn {\n margin: 0;\n width: min(280px, 70vw)").concat(C,";\n height: clamp(48px, 8vh, 64px)").concat(C,";\n border-radius: clamp(24px, 4vh, 32px)").concat(C,";\n border: none").concat(C,";\n background: ").concat(r).concat(C,";\n color: ").concat(s).concat(C,";\n font-size: clamp(14px, 2.5vh, 18px)").concat(C,";\n font-weight: 600").concat(C,";\n cursor: pointer").concat(C,";\n display: flex").concat(C,";\n align-items: center").concat(C,";\n justify-content: center").concat(C,";\n gap: clamp(8px, 1.5vh, 12px);\n box-shadow: 0 12px 30px rgba(102, 126, 234, 0.4);\n transition: all 0.3s ease;\n flex-shrink: 0;\n }\n \n .start-call-btn svg {\n display: block").concat(C,";\n visibility: visible").concat(C,";\n opacity: 1").concat(C,";\n width: auto").concat(C,";\n height: auto").concat(C,";\n }\n \n .start-call-btn svg {\n width: clamp(22px, 4vh, 32px);\n height: clamp(22px, 4vh, 32px);\n }\n \n .start-call-btn:hover {\n transform: translateY(-2px);\n box-shadow: 0 12px 28px rgba(102, 126, 234, 0.5);\n }\n \n .start-call-btn:active {\n transform: translateY(-1px);\n }\n .start-call-btn:disabled {\n cursor: not-allowed").concat(C,";\n opacity: 0.6").concat(C,";\n }\n \n /* Connecting Spinner */\n .connecting-spinner {\n display: inline-block;\n width: 16px;\n height: 16px;\n border: 2px solid rgba(255, 255, 255, 0.3);\n border-top-color: ").concat(s,";\n border-radius: 50%;\n animation: spin 1s linear infinite;\n margin-right: 8px;\n vertical-align: middle;\n }\n \n @keyframes spin {\n to { transform: rotate(360deg); }\n }\n\n \n /* Voice Transcript - Scales with container */\n .voice-transcript {\n background: ").concat(a,";\n padding: clamp(6px, 1.5vh, 12px);\n border-radius: 10px;\n width: min(360px, calc(100% - 40px));\n margin: 0;\n min-height: clamp(80px, 15vh, 120px);\n max-height: clamp(100px, 18vh, 140px);\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);\n flex-shrink: 1;\n overflow-y: auto;\n overflow-x: hidden;\n display: flex;\n flex-direction: column;\n box-sizing: border-box;\n }\n \n .transcript-label {\n font-size: clamp(8px, 1.4vh, 11px);\n color: ").concat(l,";\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.3px;\n margin-bottom: clamp(3px, 0.6vh, 6px);\n flex-shrink: 0;\n word-wrap: break-word;\n }\n \n .transcript-text {\n font-size: clamp(11px, 2vh, 15px);\n color: ").concat(c,";\n line-height: 1.4;\n flex: 1;\n overflow-y: auto;\n overflow-x: hidden;\n word-wrap: break-word;\n overflow-wrap: break-word;\n }\n \n .transcript-text.empty {\n color: #cbd5e1;\n font-style: italic;\n }\n \n /* Voice Text Input Area - Type while on voice call */\n .voice-text-input-area {\n width: 100%;\n padding: 14px 16px;\n margin: 0;\n flex-shrink: 0;\n background: #ffffff;\n border-top: 1px solid rgba(0, 0, 0, 0.06);\n box-sizing: border-box;\n }\n \n .voice-input-wrapper {\n display: flex;\n align-items: center;\n gap: 10px;\n background: #f1f5f9;\n border-radius: 12px;\n padding: 4px 4px 4px 14px;\n border: 1px solid transparent;\n transition: all 0.2s ease;\n }\n \n .voice-input-wrapper:focus-within {\n background: #fff;\n border-color: #a855f7;\n box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);\n }\n \n .voice-text-input {\n flex: 1;\n border: none;\n outline: none;\n font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;\n font-size: 14px;\n color: ").concat(u).concat(C,";\n background: transparent;\n padding: 10px 0;\n }\n \n .voice-text-input::placeholder {\n color: #94a3b8;\n }\n \n .voice-send-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 38px;\n height: 38px;\n border-radius: 10px;\n border: none;\n background: ").concat(w).concat(C,";\n color: #fff;\n cursor: pointer;\n transition: transform 0.2s ease;\n flex-shrink: 0;\n }\n \n .voice-send-btn:hover:not(:disabled) {\n transform: scale(1.05);\n }\n \n .voice-send-btn:active:not(:disabled) {\n transform: scale(0.95);\n }\n \n .voice-send-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n transform: none;\n }\n \n .voice-send-btn svg {\n width: 16px;\n height: 16px;\n }\n \n .voice-input-hint {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 5px;\n margin-top: 10px;\n font-size: 11px;\n color: #64748b;\n transition: color 0.2s ease;\n }\n \n .voice-input-hint svg {\n width: 12px;\n height: 12px;\n color: #10b981;\n }\n \n /* Text input status states */\n .voice-input-hint--sending {\n color: #666;\n }\n \n .voice-input-hint--success {\n color: #28a745;\n }\n \n .voice-input-hint--queued {\n color: #ffc107;\n }\n \n .voice-input-hint--error {\n color: #dc3545;\n }\n \n /* Disabled input styling */\n .voice-text-input:disabled,\n #mobileTextInput:disabled {\n background-color: #f5f5f5;\n cursor: not-allowed;\n }\n \n .voice-send-btn:disabled,\n #mobileSendBtn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n \n /* Voice Controls - Scales with container */\n .voice-controls {\n display: flex;\n gap: clamp(8px, 1.8vh, 14px);\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n margin: 0;\n padding-top: 0;\n }\n \n .voice-control-btn {\n width: clamp(48px, 9vh, 72px)").concat(C,";\n height: clamp(48px, 9vh, 72px)").concat(C,";\n min-width: clamp(48px, 9vh, 72px)").concat(C,";\n min-height: clamp(48px, 9vh, 72px)").concat(C,";\n max-width: clamp(48px, 9vh, 72px)").concat(C,";\n max-height: clamp(48px, 9vh, 72px)").concat(C,";\n aspect-ratio: 1").concat(C,";\n border-radius: 50%").concat(C,";\n border: none").concat(C,";\n cursor: pointer").concat(C,";\n display: flex").concat(C,";\n align-items: center").concat(C,";\n justify-content: center").concat(C,";\n transition: all 0.2s;\n position: relative").concat(C,";\n flex-shrink: 0;\n overflow: hidden").concat(C,";\n padding: 0").concat(C,";\n margin: 0").concat(C,";\n box-sizing: border-box").concat(C,";\n }\n \n .voice-control-btn svg {\n width: 48%").concat(C,";\n height: 48%").concat(C,";\n min-width: 48%").concat(C,";\n min-height: 48%").concat(C,";\n max-width: 48%").concat(C,";\n max-height: 48%").concat(C,";\n display: block").concat(C,";\n visibility: visible").concat(C,";\n opacity: 1").concat(C,";\n margin: 0").concat(C,";\n padding: 0").concat(C,";\n position: relative").concat(C,";\n flex-shrink: 0").concat(C,";\n }\n \n .voice-control-btn.primary {\n width: clamp(54px, 10vh, 80px)").concat(C,";\n height: clamp(54px, 10vh, 80px)").concat(C,";\n min-width: clamp(54px, 10vh, 80px)").concat(C,";\n min-height: clamp(54px, 10vh, 80px)").concat(C,";\n max-width: clamp(54px, 10vh, 80px)").concat(C,";\n max-height: clamp(54px, 10vh, 80px)").concat(C,";\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%)").concat(C,";\n color: white").concat(C,";\n box-shadow: 0 6px 18px rgba(102, 126, 234, 0.4);\n }\n \n .voice-control-btn.primary:hover {\n transform: scale(1.05);\n }\n \n .voice-control-btn.primary.active {\n background: ").concat(v).concat(C,";\n animation: recordingPulse 1.5s ease-in-out infinite;\n }\n .voice-control-btn.primary.active svg {\n fill: white").concat(C,";\n }\n \n /* More specific selectors for WordPress compatibility */\n #endCallBtn.voice-control-btn.primary.active,\n #muteBtn.voice-control-btn.secondary,\n #speakerBtn.voice-control-btn.secondary {\n border-radius: 50% !important;\n width: clamp(48px, 9vh, 72px) !important;\n height: clamp(48px, 9vh, 72px) !important;\n min-width: clamp(48px, 9vh, 72px) !important;\n min-height: clamp(48px, 9vh, 72px) !important;\n max-width: clamp(48px, 9vh, 72px) !important;\n max-height: clamp(48px, 9vh, 72px) !important;\n aspect-ratio: 1 !important;\n overflow: hidden !important;\n }\n \n #endCallBtn.voice-control-btn.primary.active {\n width: clamp(54px, 10vh, 80px) !important;\n height: clamp(54px, 10vh, 80px) !important;\n min-width: clamp(54px, 10vh, 80px) !important;\n min-height: clamp(54px, 10vh, 80px) !important;\n max-width: clamp(54px, 10vh, 80px) !important;\n max-height: clamp(54px, 10vh, 80px) !important;\n }\n \n \n /* Microphone button specific background color */\n #muteBtn.voice-control-btn.secondary {\n background: ").concat(m).concat(C,";\n }\n \n /* Speaker button specific background color */\n #speakerBtn.voice-control-btn.secondary {\n background: ").concat(f).concat(C,";\n }\n \n #endCallBtn.voice-control-btn.primary.active svg,\n #muteBtn.voice-control-btn.secondary svg,\n #speakerBtn.voice-control-btn.secondary svg {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 48% !important;\n height: 48% !important;\n margin: 0 !important;\n padding: 0 !important;\n position: relative !important;\n }\n \n @keyframes recordingPulse {\n 0%, 100% { \n box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);\n }\n 50% { \n box-shadow: 0 6px 24px rgba(239, 68, 68, 0.7);\n }\n }\n \n .voice-control-btn.secondary {\n background: ").concat(d).concat(C,";\n color: ").concat(p).concat(C,";\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);\n width: clamp(48px, 9vh, 72px)").concat(C,";\n height: clamp(48px, 9vh, 72px)").concat(C,";\n min-width: clamp(48px, 9vh, 72px)").concat(C,";\n min-height: clamp(48px, 9vh, 72px)").concat(C,";\n max-width: clamp(48px, 9vh, 72px)").concat(C,";\n max-height: clamp(48px, 9vh, 72px)").concat(C,";\n }\n \n .voice-control-btn.secondary:hover {\n background: #f8fafc").concat(C,";\n transform: scale(1.05);\n }\n \n .voice-control-btn.secondary.muted {\n background: #f3f4f6").concat(C,";\n }\n \n .voice-control-btn.secondary.muted .mute-icon {\n stroke: #9ca3af !important;\n }\n \n .voice-control-btn.secondary svg {\n width: 48%").concat(C,";\n height: 48%").concat(C,";\n display: block").concat(C,";\n visibility: visible").concat(C,";\n opacity: 1").concat(C,";\n margin: 0").concat(C,";\n padding: 0").concat(C,";\n position: relative").concat(C,";\n }\n \n .voice-timer {\n position: absolute;\n bottom: clamp(-18px, -3vh, -24px);\n font-size: clamp(9px, 1.6vh, 12px);\n color: #64748b;\n font-weight: 500;\n white-space: nowrap;\n }\n \n /* ===== DESKTOP VOICE SECTION - New Design ===== */\n .desktop-voice-section {\n padding: 16px 20px;\n background: linear-gradient(180deg, #ffffff 0%, rgba(168, 85, 247, 0.04) 100%);\n width: 100%;\n flex-shrink: 0;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: 12px;\n box-sizing: border-box;\n text-align: center;\n }\n \n /* Ensure all children are centered */\n .desktop-voice-section > * {\n margin-left: auto;\n margin-right: auto;\n }\n \n .desktop-timer {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 5px 10px;\n background: rgba(0, 0, 0, 0.05);\n border-radius: 20px;\n font-family: 'JetBrains Mono', 'Courier New', monospace;\n font-size: 11px;\n color: #64748b;\n margin: 0 auto;\n }\n \n .desktop-timer .timer-dot {\n width: 5px;\n height: 5px;\n background: #ef4444;\n border-radius: 50%;\n animation: timerPulse 1s ease-in-out infinite;\n }\n \n @keyframes timerPulse {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0.4; }\n }\n \n .desktop-avatar-container {\n margin-bottom: 12px;\n }\n \n .desktop-avatar-large {\n width: 80px !important;\n height: 80px !important;\n border-radius: 20px !important;\n margin: 0 auto 12px !important;\n box-shadow: 0 8px 24px rgba(168, 85, 247, 0.35) !important;\n background: linear-gradient(135deg, ").concat(e," 0%, ").concat(t,' 100%) !important;\n }\n \n .desktop-waveform {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n height: 36px;\n width: 100%;\n }\n \n .desktop-waveform-bar {\n width: 4px;\n background: rgba(255, 255, 255, 0.9);\n border-radius: 2px;\n animation: waveformAnimation 0.8s ease-in-out infinite;\n }\n \n .desktop-waveform-bar[data-index="0"] { height: 14px; animation-delay: 0s; }\n .desktop-waveform-bar[data-index="1"] { height: 26px; animation-delay: 0.1s; }\n .desktop-waveform-bar[data-index="2"] { height: 36px; animation-delay: 0.2s; }\n .desktop-waveform-bar[data-index="3"] { height: 22px; animation-delay: 0.3s; }\n .desktop-waveform-bar[data-index="4"] { height: 16px; animation-delay: 0.4s; }\n \n @keyframes waveformAnimation {\n 0%, 100% { transform: scaleY(0.5); }\n 50% { transform: scaleY(1); }\n }\n \n .desktop-waveform.paused .desktop-waveform-bar {\n animation-play-state: paused;\n }\n\n /* New main waveform (used in updated template) */\n .desktop-main-waveform {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 3px;\n height: 48px;\n width: 100%;\n max-width: 200px;\n margin: 0 auto;\n padding: 0 20px;\n }\n\n .desktop-main-waveform .waveform-bar {\n width: 3px;\n background: #a855f7;\n border-radius: 2px;\n height: 8px;\n animation: waveformAnimation 0.8s ease-in-out infinite;\n }\n\n .desktop-main-waveform .waveform-bar:nth-child(1) { height: 12px; animation-delay: 0s; }\n .desktop-main-waveform .waveform-bar:nth-child(2) { height: 20px; animation-delay: 0.05s; }\n .desktop-main-waveform .waveform-bar:nth-child(3) { height: 28px; animation-delay: 0.1s; }\n .desktop-main-waveform .waveform-bar:nth-child(4) { height: 36px; animation-delay: 0.15s; }\n .desktop-main-waveform .waveform-bar:nth-child(5) { height: 44px; animation-delay: 0.2s; }\n .desktop-main-waveform .waveform-bar:nth-child(6) { height: 50px; animation-delay: 0.25s; }\n .desktop-main-waveform .waveform-bar:nth-child(7) { height: 54px; animation-delay: 0.3s; }\n .desktop-main-waveform .waveform-bar:nth-child(8) { height: 56px; animation-delay: 0.35s; }\n .desktop-main-waveform .waveform-bar:nth-child(9) { height: 54px; animation-delay: 0.4s; }\n .desktop-main-waveform .waveform-bar:nth-child(10) { height: 50px; animation-delay: 0.45s; }\n .desktop-main-waveform .waveform-bar:nth-child(11) { height: 44px; animation-delay: 0.5s; }\n .desktop-main-waveform .waveform-bar:nth-child(12) { height: 36px; animation-delay: 0.55s; }\n .desktop-main-waveform .waveform-bar:nth-child(13) { height: 28px; animation-delay: 0.6s; }\n .desktop-main-waveform .waveform-bar:nth-child(14) { height: 20px; animation-delay: 0.65s; }\n .desktop-main-waveform .waveform-bar:nth-child(15) { height: 12px; animation-delay: 0.7s; }\n\n .desktop-status {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 5px;\n font-size: 12px;\n color: ').concat(n,";\n font-weight: 500;\n width: 100%;\n text-align: center;\n margin: 0 auto;\n }\n \n .desktop-status .status-dot {\n width: 5px;\n height: 5px;\n background: ").concat(i,";\n border-radius: 50%;\n animation: statusPulse 1.5s ease-in-out infinite;\n }\n \n @keyframes statusPulse {\n 0%, 100% { transform: scale(1); opacity: 1; }\n 50% { transform: scale(1.15); opacity: 0.8; }\n }\n \n .desktop-live-waveform {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 3px;\n height: 48px;\n margin-bottom: 20px;\n }\n \n .desktop-live-bar {\n width: 3px;\n background: linear-gradient(180deg, ").concat(e,", ").concat(t,");\n border-radius: 2px;\n transition: height 0.1s ease;\n height: 8px;\n }\n \n .desktop-controls {\n display: flex;\n gap: 8px;\n align-items: center;\n justify-content: center;\n width: 100%;\n margin: 0 auto;\n }\n \n .desktop-control-btn {\n width: 46px;\n height: 46px;\n border-radius: 50%;\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);\n }\n \n .desktop-control-btn svg {\n width: 20px;\n height: 20px;\n }\n \n .desktop-mic-icon,\n .desktop-speaker-icon {\n width: 20px !important;\n height: 20px !important;\n display: block;\n flex-shrink: 0;\n }\n \n .desktop-control-btn.secondary.muted .desktop-mic-icon,\n .desktop-control-btn.secondary.muted .desktop-speaker-icon {\n width: 20px !important;\n height: 20px !important;\n }\n \n \n .desktop-control-btn.secondary:hover {\n background: rgba(0, 0, 0, 0.1);\n color: #1e293b;\n transform: scale(1.05);\n }\n .desktop-control-btn.secondary.muted {\n background: #f3f4f6;\n color: #9ca3af;\n }\n \n .desktop-control-btn.secondary.muted .desktop-mic-icon,\n .desktop-control-btn.secondary.muted .desktop-speaker-icon {\n stroke: #9ca3af;\n }\n \n .desktop-control-btn.secondary {\n position: relative;\n }\n \n \n /* Desktop microphone button background color */\n #desktopMuteBtn.desktop-control-btn.secondary,\n #desktopMuteBtnCompact.compact-control-btn.secondary {\n background: ").concat(m).concat(C,";\n }\n \n /* Desktop speaker button background color */\n #desktopSpeakerBtn.desktop-control-btn.secondary,\n #desktopSpeakerBtnCompact.compact-control-btn.secondary {\n background: ").concat(f).concat(C,";\n }\n .desktop-mic-off-icon,\n .desktop-speaker-off-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n width: 46px;\n height: 46px;\n transform: translate(-50%, -50%);\n z-index: 10;\n }\n .desktop-control-btn.danger {\n width: 50px;\n height: 50px;\n background: ").concat(v).concat(C,";\n color: #ffffff;\n box-shadow: 0 4px 14px rgba(239, 68, 68, 0.4);\n overflow: visible;\n }\n \n .desktop-control-btn.danger svg {\n width: 20px;\n height: 20px;\n overflow: visible;\n }\n \n .desktop-control-btn.danger:hover {\n transform: scale(1.06);\n box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);\n }\n \n .desktop-control-btn.danger:hover {\n transform: scale(1.06);\n box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);\n }\n \n \n /* ===== COMPACT VOICE SECTION (Single-row layout) ===== */\n .compact-voice-section {\n padding: 10px 14px;\n background: linear-gradient(180deg, #ffffff, rgba(168, 85, 247, 0.04));\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 12px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.06);\n min-height: 62px;\n flex-shrink: 0;\n }\n \n .compact-left {\n display: flex;\n align-items: center;\n gap: 10px;\n }\n \n .compact-avatar {\n width: 42px;\n height: 42px;\n min-width: 42px;\n min-height: 42px;\n border-radius: 12px;\n background: transparent;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n overflow: visible;\n position: relative;\n }\n \n /* Waveform container in compact avatar - ensure it's visible */\n .compact-avatar .desktop-main-waveform {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 2px;\n height: 100%;\n width: 100%;\n padding: 4px;\n transform: scale(0.75);\n transform-origin: center;\n }\n \n /* Ensure waveform bars are visible and animated in compact mode */\n .compact-avatar .desktop-main-waveform .waveform-bar {\n width: 2px;\n min-width: 2px;\n background: #a855f7;\n border-radius: 1px;\n flex-shrink: 0;\n animation: waveformAnimation 0.8s ease-in-out infinite;\n }\n \n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(1) { height: 6px; animation-delay: 0s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(2) { height: 10px; animation-delay: 0.05s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(3) { height: 14px; animation-delay: 0.1s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(4) { height: 18px; animation-delay: 0.15s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(5) { height: 22px; animation-delay: 0.2s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(6) { height: 26px; animation-delay: 0.25s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(7) { height: 28px; animation-delay: 0.3s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(8) { height: 30px; animation-delay: 0.35s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(9) { height: 28px; animation-delay: 0.4s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(10) { height: 26px; animation-delay: 0.45s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(11) { height: 22px; animation-delay: 0.5s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(12) { height: 18px; animation-delay: 0.55s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(13) { height: 14px; animation-delay: 0.6s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(14) { height: 10px; animation-delay: 0.65s; }\n .compact-avatar .desktop-main-waveform .waveform-bar:nth-child(15) { height: 6px; animation-delay: 0.7s; }\n\n }\n \n .compact-info {\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n \n .compact-timer {\n display: flex;\n align-items: center;\n gap: 5px;\n font-family: 'JetBrains Mono', 'Courier New', monospace;\n font-size: 13px;\n font-weight: 600;\n color: ").concat(u).concat(C,";\n }\n \n .compact-timer .timer-dot {\n width: 6px;\n height: 6px;\n background: #ef4444;\n border-radius: 50%;\n animation: timerPulse 1s ease-in-out infinite;\n }\n \n .compact-status {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 11px;\n color: ").concat(n,";\n }\n \n .compact-status .status-dot {\n width: 5px;\n height: 5px;\n background: ").concat(i,";\n border-radius: 50%;\n animation: statusPulse 1.5s ease-in-out infinite;\n }\n \n @keyframes statusPulse {\n 0%, 100% { opacity: 1; transform: scale(1); }\n 50% { opacity: 0.7; transform: scale(1.1); }\n }\n \n .compact-controls {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n \n .compact-control-btn {\n width: 36px;\n height: 36px;\n min-width: 36px;\n min-height: 36px;\n border-radius: 50%;\n border: none;\n display: flex;\n align-items: center;\n justify-content: center;\n cursor: pointer;\n transition: all 0.2s ease;\n padding: 0;\n position: relative;\n }\n \n .compact-control-btn svg {\n width: 16px;\n height: 16px;\n }\n \n .compact-control-btn.secondary {\n background: #f1f5f9;\n color: #64748b;\n }\n \n \n /* Compact speaker button background color */\n #desktopSpeakerBtnCompact.compact-control-btn.secondary {\n background: ").concat(f).concat(C,";\n }\n /* Compact microphone button background color */\n #desktopMuteBtnCompact.compact-control-btn.secondary {\n background: ").concat(m).concat(C,";\n }\n \n .compact-control-btn.secondary:hover {\n background: #e2e8f0;\n color: #475569;\n }\n \n .compact-control-btn.secondary.muted {\n background: rgba(239, 68, 68, 0.1);\n color: #ef4444;\n }\n \n \n .compact-control-btn.secondary.muted .desktop-mic-icon,\n .compact-control-btn.secondary.muted .desktop-speaker-icon {\n stroke: #ef4444;\n }\n \n .compact-control-btn.secondary.muted .desktop-mic-off-icon,\n .compact-control-btn.secondary.muted .desktop-speaker-off-icon {\n width: 46px;\n height: 46px;\n }\n\n .compact-control-btn.danger {\n width: 40px;\n height: 40px;\n min-width: 40px;\n min-height: 40px;\n background: ").concat(v).concat(C,";\n color: white;\n box-shadow: 0 3px 10px rgba(239, 68, 68, 0.35);\n }\n \n .compact-control-btn.danger:hover {\n transform: scale(1.05);\n box-shadow: 0 4px 14px rgba(239, 68, 68, 0.45);\n }\n \n .compact-control-btn.danger svg {\n width: 18px;\n height: 18px;\n overflow: visible;\n }\n \n/* ===== CONVERSATION PANEL ===== */\n .desktop-conversation-panel {\n border-top: 1px solid rgba(0, 0, 0, 0.06);\n width: 100%;\n display: flex;\n flex-direction: column;\n min-height: 0;\n overflow: hidden;\n flex: 1;\n }\n \n .conversation-header {\n padding: 10px 16px;\n display: flex;\n align-items: center;\n justify-content: space-between;\n background: #fafafa;\n cursor: pointer;\n flex-shrink: 0;\n border-bottom: 1px solid rgba(0, 0, 0, 0.04);\n transition: background 0.2s ease;\n }\n \n .conversation-header:hover {\n background: #f5f5f5;\n }\n \n .conversation-label {\n font-size: 11px;\n font-weight: 600;\n color: #64748b;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n }\n \n .conversation-toggle {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 11px;\n color: #94a3b8;\n font-weight: 500;\n }\n \n .conversation-toggle svg {\n transition: transform 0.2s ease;\n }\n \n .conversation-header.expanded .conversation-toggle svg {\n transform: rotate(180deg);\n }\n \n /* ===== COLLAPSED: Live Transcript Only (2 lines) ===== */\n .live-transcript-collapsed {\n padding: 12px 16px;\n background: #fafafa;\n display: flex;\n flex-direction: column;\n gap: 6px;\n flex-shrink: 0;\n min-height: 50px;\n }\n \n .live-indicator {\n display: flex;\n align-items: center;\n gap: 5px;\n font-size: 9px;\n font-weight: 700;\n color: ").concat(B).concat(C,";\n text-transform: uppercase;\n letter-spacing: 0.08em;\n }\n \n .live-indicator .live-dot {\n height: 5px;\n width: 5px;\n background: ").concat(h).concat(C,";\n border-radius: 50%;\n animation: statusPulse 1.5s ease-in-out infinite;\n }\n \n .live-text-collapsed {\n font-size: ").concat(g).concat(C,";\n color: ").concat(u).concat(C,";\n line-height: 1.5;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n \n .live-text-collapsed.muted {\n color: #94a3b8;\n font-style: italic;\n }\n \n .typing-cursor {\n display: inline-block;\n width: 2px;\n height: 14px;\n background: #a855f7;\n margin-left: 2px;\n animation: blink 1s step-end infinite;\n vertical-align: middle;\n }\n \n @keyframes blink {\n 0%, 100% { opacity: 1; }\n 50% { opacity: 0; }\n }\n \n /* ===== EXPANDED: Full Conversation History ===== */\n .conversation-history {\n flex: 1;\n flex-direction: column;\n gap: 10px;\n overflow-y: auto;\n padding: 14px 16px;\n min-height: 0;\n }\n .conversation-history.visible {\n display: flex;\n }\n\n .conversation-messages {\n display: flex;\n flex-direction: column;\n gap: 10px;\n }\n\n /* Message Rows */\n .message-row {\n display: flex;\n gap: 8px;\n animation: msgIn 0.25s ease;\n }\n \n @keyframes msgIn {\n from { opacity: 0; transform: translateY(8px); }\n to { opacity: 1; transform: translateY(0); }\n }\n @keyframes slideIn {\n from { opacity: 0; transform: translateY(-10px); }\n to { opacity: 1; transform: translateY(0); }\n }\n \n @keyframes slideOut {\n from { opacity: 1; transform: translateY(0); }\n to { opacity: 0; transform: translateY(-10px); }\n }\n \n .message-row.user {\n flex-direction: row-reverse;\n }\n \n .message-avatar {\n width: 28px;\n height: 28px;\n border-radius: 8px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .message-avatar.assistant {\n background: linear-gradient(135deg, #c084fc, #a855f7);\n }\n\n .message-avatar.assistant .orb {\n width: 12px;\n height: 12px;\n background: rgba(255, 255, 255, 0.9);\n border-radius: 50%;\n }\n\n .message-avatar.user {\n background: linear-gradient(135deg, #64748b, #475569);\n color: #fff;\n font-size: 11px;\n font-weight: 600;\n }\n\n .message-bubble {\n max-width: 80%;\n padding: 9px 13px;\n border-radius: 12px;\n font-size: 13px;\n line-height: 1.5;\n }\n \n .message-row.assistant .message-bubble {\n background: #fff;\n color: ").concat(u).concat(C,";\n border: 1px solid rgba(0, 0, 0, 0.06);\n border-bottom-left-radius: 4px;\n }\n \n .message-row.user .message-bubble {\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);\n color: #fff;\n border-bottom-right-radius: 4px;\n }\n \n /* Live message at bottom of history */\n .live-message-row {\n display: flex;\n gap: 8px;\n padding-top: 8px;\n border-top: 1px dashed rgba(0, 0, 0, 0.08);\n margin-top: auto;\n }\n \n .live-message-row .message-bubble {\n background: #fff;\n border: 1px solid rgba(16, 185, 129, 0.3);\n color: ").concat(u).concat(C,";\n position: relative;\n border-radius: 14px;\n border-bottom-left-radius: 4px;\n }\n \n .live-message-row .live-badge {\n position: absolute;\n top: -8px;\n left: 10px;\n background: #10b981;\n color: #fff;\n font-size: 8px;\n font-weight: 700;\n padding: 2px 6px;\n border-radius: 4px;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n }\n \n /* Hide/show based on expanded state */\n .desktop-conversation-panel.collapsed .conversation-history {\n display: none;\n }\n \n .desktop-conversation-panel.collapsed .live-transcript-collapsed {\n display: flex;\n }\n \n .desktop-conversation-panel.expanded .conversation-history {\n display: flex;\n max-height: 400px;\n }\n \n .desktop-conversation-panel.expanded .live-transcript-collapsed {\n display: none;\n }\n \n /* ===== DARK MODE SUPPORT ===== */\n @media (prefers-color-scheme: dark) {\n .desktop-voice-section {\n background: linear-gradient(180deg, #1e1e2e 0%, rgba(168, 85, 247, 0.08) 100%);\n }\n\n .desktop-timer {\n color: #94a3b8;\n }\n\n .desktop-status {\n color: #34d399;\n }\n\n .desktop-status .status-dot {\n \n .desktop-control-btn.secondary.muted {\n background: rgba(255, 255, 255, 0.1);\n color: #9ca3af;\n \n .compact-voice-section {\n background: linear-gradient(180deg, #1e1e2e 0%, rgba(168, 85, 247, 0.08) 100%);\n border-bottom: 1px solid rgba(255, 255, 255, 0.08);\n }\n \n .compact-timer {\n color: #e2e8f0;\n }\n \n .compact-status {\n color: #34d399;\n }\n \n .compact-status .status-dot {\n background: #34d399;\n }\n \n .compact-control-btn.secondary {\n background: rgba(255, 255, 255, 0.08);\n color: #94a3b8;\n }\n \n .compact-control-btn.secondary:hover {\n background: rgba(255, 255, 255, 0.15);\n color: #e2e8f0;\n }\n \n .compact-control-btn.secondary.muted {\n background: rgba(239, 68, 68, 0.2);\n color: #f87171;\n }\n\n }\n \n .desktop-control-btn.secondary.muted svg {\n \n .desktop-control-btn.secondary {\n position: relative;\n }\n \n /* Desktop microphone button background color */\n #desktopMuteBtn.desktop-control-btn.secondary,\n #desktopMuteBtnCompact.compact-control-btn.secondary {\n background: ").concat(m).concat(C,";\n }\n \n .desktop-mic-off-icon,\n .desktop-speaker-off-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 20px;\n height: 20px;\n }\n \n .desktop-control-btn.secondary.muted {\n background: #f3f4f6;\n color: #9ca3af;\n }\n \n .desktop-control-btn.secondary.muted svg {\n \n .desktop-control-btn.secondary {\n position: relative;\n }\n \n /* Desktop microphone button background color */\n #desktopMuteBtn.desktop-control-btn.secondary,\n #desktopMuteBtnCompact.compact-control-btn.secondary {\n background: ").concat(m).concat(C,";\n }\n \n .desktop-mic-off-icon,\n .desktop-speaker-off-icon {\n position: absolute;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n width: 20px;\n height: 20px;\n }\n stroke: #9ca3af;\n }\n stroke: #9ca3af;\n }\n background: #34d399;\n }\n\n .desktop-control-btn.secondary {\n background: rgba(255, 255, 255, 0.08);\n color: #94a3b8;\n }\n\n .desktop-control-btn.secondary:hover {\n background: rgba(255, 255, 255, 0.15);\n color: #e2e8f0;\n }\n\n .desktop-conversation-panel {\n border-top: 1px solid rgba(255, 255, 255, 0.08);\n }\n\n .conversation-header {\n background: #1a1a2e;\n }\n\n .conversation-header:hover {\n background: #252540;\n }\n\n .conversation-label {\n color: #94a3b8;\n }\n\n .conversation-toggle {\n color: #64748b;\n }\n\n .live-transcript-preview {\n background: #1a1a2e;\n }\n .live-indicator {\n color: ").concat(B).concat(C,";\n }\n .live-indicator .live-dot {\n background: ").concat(h).concat(C,";\n }\n\n .live-text {\n color: #e2e8f0;\n }\n\n .live-text.muted {\n color: #64748b;\n }\n\n .conversation-history {\n background: #1a1a2e;\n }\n\n .conversation-msg.assistant .conversation-msg-bubble {\n background: #252540;\n color: #e2e8f0;\n border: 1px solid rgba(255, 255, 255, 0.08);\n }\n\n .voice-text-input-area {\n background: #1a1a2e;\n }\n\n .voice-text-input {\n background: #252540 !important;\n color: #e2e8f0 !important;\n border-color: rgba(255, 255, 255, 0.1) !important;\n }\n\n .voice-text-input::placeholder {\n color: #64748b !important;\n }\n\n .voice-text-input:focus {\n border-color: ").concat(e," !important;\n box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2) !important;\n }\n\n .voice-input-hint {\n color: #64748b !important;\n }\n\n .voice-send-btn {\n background: ").concat(w," !important;\n }\n\n .voice-send-btn:disabled {\n background: #374151 !important;\n color: #4b5563 !important;\n }\n }\n\n /* Mobile optimization */\n @media (max-width: 768px) {\n .voice-interface {\n padding: 6px 10px;\n }\n }\n \n @media (max-width: 480px) {\n .voice-interface {\n padding: 5px 8px;\n }\n }\n \n /* Mobile Voice Call UI - Shared styles (also used in generateMobileCSS) */\n ").concat(this._getSharedMobileCSS(C),"\n ")}_getSharedMobileCSS(A){return"\n .mobile-duration-dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background-color: #ef4444;\n animation: mobilePulse 1.5s ease-in-out infinite;\n }\n\n @keyframes mobilePulse {\n 0%, 100% { opacity: 1; transform: scale(1); }\n 50% { opacity: 0.5; transform: scale(0.95); }\n }\n\n .mobile-voice-bar {\n display: flex;\n flex-direction: column;\n gap: 10px;\n padding: 14px;\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #c084fc 100%);\n border-radius: 24px 24px 0 0;\n box-shadow: 0 -8px 32px rgba(124, 58, 237, 0.5), 0 -2px 8px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.2);\n width: 100%;\n max-width: 100%;\n pointer-events: auto;\n }\n\n .mobile-top-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n position: relative;\n }\n\n .mobile-status-indicator {\n display: flex;\n align-items: center;\n gap: 5px;\n min-width: 85px;\n }\n\n .mobile-status-dot {\n width: 7px;\n height: 7px;\n border-radius: 50%;\n background-color: #22c55e;\n box-shadow: 0 0 8px #22c55e;\n transition: all 0.3s ease;\n }\n\n .mobile-status-text {\n font-size: 11px;\n font-weight: 700;\n color: rgba(255,255,255,0.95);\n text-transform: uppercase;\n letter-spacing: 0.3px;\n }\n\n .mobile-waveform-center {\n position: absolute;\n left: 50%;\n transform: translateX(-50%);\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 3px;\n height: 24px;\n }\n\n .mobile-waveform-bar {\n width: 4px;\n height: 4px;\n background-color: #fff;\n border-radius: 2px;\n transition: height 0.15s ease;\n box-shadow: 0 0 8px rgba(255,255,255,0.5);\n }\n\n .mobile-controls {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n\n .mobile-control-btn {\n display: flex".concat(A,";\n align-items: center").concat(A,";\n justify-content: center").concat(A,";\n width: 32px").concat(A,";\n height: 32px").concat(A,";\n min-width: 32px").concat(A,";\n min-height: 32px").concat(A,";\n max-width: 32px").concat(A,";\n max-height: 32px").concat(A,";\n border-radius: 50%").concat(A,";\n border: none").concat(A,";\n cursor: pointer").concat(A,";\n transition: all 0.2s ease;\n background-color: rgba(255,255,255,0.15)").concat(A,";\n position: relative").concat(A,";\n overflow: hidden").concat(A,";\n padding: 0").concat(A,";\n margin: 0").concat(A,";\n box-sizing: border-box").concat(A,";\n }\n\n .mobile-control-btn:hover {\n background-color: rgba(255,255,255,0.25)").concat(A,";\n }\n\n .mobile-control-btn.muted {\n background-color: rgba(239, 68, 68, 0.3)").concat(A,";\n }\n\n .mobile-control-btn svg {\n position: absolute").concat(A,";\n top: 50%").concat(A,";\n left: 50%").concat(A,";\n transform: translate(-50%, -50%)").concat(A,";\n display: block").concat(A,";\n visibility: visible").concat(A,";\n opacity: 1").concat(A,";\n width: 15px").concat(A,";\n height: 15px").concat(A,";\n margin: 0").concat(A,";\n padding: 0").concat(A,";\n }\n\n .mobile-mic-off-icon,\n .mobile-speaker-off-icon {\n display: none !important;\n }\n\n .mobile-control-btn.muted .mobile-mic-icon,\n .mobile-control-btn.muted .mobile-speaker-icon {\n display: none !important;\n }\n\n .mobile-control-btn.muted .mobile-mic-off-icon,\n .mobile-control-btn.muted .mobile-speaker-off-icon {\n display: block !important;\n }\n\n .mobile-end-call-btn {\n display: flex").concat(A,";\n align-items: center").concat(A,";\n justify-content: center").concat(A,";\n width: 36px").concat(A,";\n height: 36px").concat(A,";\n min-width: 36px").concat(A,";\n min-height: 36px").concat(A,";\n max-width: 36px").concat(A,";\n max-height: 36px").concat(A,";\n border-radius: 50%").concat(A,";\n border: none").concat(A,";\n cursor: pointer").concat(A,";\n background-color: #ef4444").concat(A,";\n box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);\n transition: all 0.2s ease;\n overflow: hidden").concat(A,";\n padding: 0").concat(A,";\n margin: 0").concat(A,";\n box-sizing: border-box").concat(A,";\n }\n\n .mobile-end-call-btn svg {\n display: block").concat(A,";\n visibility: visible").concat(A,";\n opacity: 1").concat(A,";\n width: 15px").concat(A,";\n height: 15px").concat(A,";\n margin: 0").concat(A,";\n padding: 0").concat(A,";\n position: relative").concat(A,";\n }\n\n /* ID-specific selectors for WordPress compatibility */\n #mobileMuteBtn.mobile-control-btn,\n #mobileSpeakerBtn.mobile-control-btn,\n #mobileEndCallBtn.mobile-end-call-btn {\n border-radius: 50% !important;\n overflow: hidden !important;\n }\n\n #mobileMuteBtn.mobile-control-btn,\n #mobileSpeakerBtn.mobile-control-btn {\n width: 32px !important;\n height: 32px !important;\n min-width: 32px !important;\n min-height: 32px !important;\n max-width: 32px !important;\n max-height: 32px !important;\n }\n\n #mobileEndCallBtn.mobile-end-call-btn {\n width: 36px !important;\n height: 36px !important;\n min-width: 36px !important;\n min-height: 36px !important;\n max-width: 36px !important;\n max-height: 36px !important;\n }\n\n #mobileMuteBtn.mobile-control-btn svg,\n #mobileSpeakerBtn.mobile-control-btn svg,\n #mobileEndCallBtn.mobile-end-call-btn svg {\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 15px !important;\n height: 15px !important;\n margin: 0 !important;\n padding: 0 !important;\n }\n\n .mobile-end-call-btn:hover {\n transform: scale(1.05);\n }\n\n .mobile-transcript-row {\n width: 100%;\n display: flex;\n flex-direction: column;\n gap: 6px;\n padding: 10px 12px;\n background: rgba(255,255,255,0.18);\n border-radius: 14px;\n border: none;\n cursor: pointer;\n text-align: left;\n backdrop-filter: blur(4px);\n transition: background 0.2s ease;\n }\n\n .mobile-transcript-row:hover {\n background: rgba(255,255,255,0.25);\n }\n\n .mobile-transcript-text {\n margin: 0;\n font-size: 13px;\n color: #fff;\n line-height: 1.4;\n font-weight: 500;\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n }\n\n .mobile-transcript-footer {\n display: flex;\n align-items: center;\n justify-content: space-between;\n }\n\n .mobile-expand-hint {\n font-size: 10px;\n color: rgba(255,255,255,0.6);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n font-weight: 600;\n }\n\n .mobile-transcript-overlay {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background-color: rgba(0,0,0,0.6);\n display: flex;\n align-items: flex-end;\n padding: 12px;\n z-index: 100000;\n pointer-events: auto;\n }\n\n .mobile-expanded-transcript {\n width: 100%;\n max-height: 75%;\n background: #fff;\n border-radius: 24px 24px 16px 16px;\n overflow: hidden;\n box-shadow: 0 -8px 40px rgba(0,0,0,0.3);\n display: flex;\n flex-direction: column;\n }\n\n .mobile-transcript-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 14px 16px;\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);\n flex-shrink: 0;\n }\n\n .mobile-header-left {\n display: flex;\n flex-direction: column;\n gap: 2px;\n }\n\n .mobile-header-status {\n display: flex;\n align-items: center;\n gap: 6px;\n }\n\n .mobile-header-status-dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background-color: #22c55e;\n box-shadow: 0 0 6px #22c55e;\n }\n\n .mobile-header-status-text {\n font-size: 10px;\n font-weight: 700;\n color: rgba(255,255,255,0.9);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n }\n\n .mobile-header-duration {\n font-size: 10px;\n font-weight: 600;\n color: rgba(255,255,255,0.7);\n margin-left: 8px;\n }\n\n .mobile-transcript-label {\n font-size: 11px;\n font-weight: 800;\n color: rgba(255,255,255,0.7);\n letter-spacing: 1px;\n }\n\n .mobile-close-transcript-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n border: none;\n background: rgba(255,255,255,0.2);\n color: #fff;\n cursor: pointer;\n }\n\n .mobile-close-transcript-btn:hover {\n background: rgba(255,255,255,0.3);\n }\n\n .mobile-messages-container {\n flex: 1;\n padding: 16px;\n overflow-y: auto;\n display: flex;\n flex-direction: column;\n gap: 12px;\n }\n\n .mobile-message-bubble {\n max-width: 85%;\n padding: 12px 16px;\n border-radius: 18px;\n font-size: 14px;\n line-height: 1.5;\n word-wrap: break-word;\n }\n\n .mobile-message-bubble.assistant {\n align-self: flex-start;\n background-color: #f3f4f6;\n color: #374151;\n border-bottom-left-radius: 4px;\n }\n\n .mobile-message-bubble.user {\n align-self: flex-end;\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);\n color: #fff;\n border-bottom-right-radius: 4px;\n }\n\n .mobile-input-area {\n padding: 12px 16px 16px;\n border-top: 1px solid #e5e7eb;\n background: #f9fafb;\n flex-shrink: 0;\n }\n\n .mobile-input-wrapper {\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 4px 4px 4px 16px;\n background: #fff;\n border-radius: 24px;\n border: 2px solid #e5e7eb;\n }\n\n .mobile-text-input {\n flex: 1;\n border: none;\n outline: none;\n font-size: 14px;\n color: #374151;\n background: transparent;\n padding: 10px 0;\n }\n\n .mobile-text-input::placeholder {\n color: #9ca3af;\n }\n\n .mobile-send-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 40px;\n height: 40px;\n border-radius: 50%;\n border: none;\n background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);\n color: #fff;\n cursor: pointer;\n transition: all 0.2s ease;\n }\n\n .mobile-send-btn:hover:not(:disabled) {\n transform: scale(1.05);\n }\n\n .mobile-send-btn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n\n .mobile-input-hint {\n margin: 8px 0 0;\n font-size: 11px;\n color: #9ca3af;\n text-align: center;\n transition: color 0.2s ease;\n }\n\n /* Mobile text input status states */\n .mobile-input-hint--sending {\n color: #666;\n }\n\n .mobile-input-hint--success {\n color: #28a745;\n }\n\n .mobile-input-hint--queued {\n color: #ffc107;\n }\n\n .mobile-input-hint--error {\n color: #dc3545;\n }\n\n /* Disabled mobile input styling */\n #mobileTextInput:disabled {\n background-color: #f5f5f5;\n cursor: not-allowed;\n }\n\n #mobileSendBtn:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n ")}generateMobileCSS(){var A=!1===this.config.useShadowDOM?" !important":"";return"\n /* Mobile Voice Call UI - Container positioning */\n #mobile-voice-call-bar-container {\n position: fixed;\n bottom: 0;\n left: 0;\n right: 0;\n z-index: 99999;\n font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;\n padding: 0 12px 12px;\n pointer-events: none;\n }\n\n .mobile-duration-badge {\n position: absolute;\n top: -28px;\n left: 50%;\n transform: translateX(-50%);\n display: flex;\n align-items: center;\n gap: 6px;\n padding: 5px 14px;\n background: rgba(0,0,0,0.75);\n border-radius: 20px;\n font-size: 12px;\n font-weight: 700;\n color: #fff;\n backdrop-filter: blur(8px);\n z-index: 10;\n pointer-events: auto;\n }\n\n /* Shared mobile styles */\n ".concat(this._getSharedMobileCSS(A),"\n ")}}class de{constructor(A){this.voiceInterface=A,this.config=A.config,this.conversationMessages=[],this.currentLiveMessage=null}t(A){return this.voiceInterface.t(A)}escapeHtml(A){return this.voiceInterface.escapeHtml(A)}updateTranscript(A){if(console.log("📝 [TRANSCRIPT] updateTranscript() called with text:",A?A.substring(0,50)+"...":"null/empty"),this.voiceInterface.isMobile){var e=document.getElementById("mobileTranscriptText");e&&(e.textContent=A),this.voiceInterface.messages.length>0&&"assistant"===this.voiceInterface.messages[this.voiceInterface.messages.length-1].type?this.voiceInterface.messages[this.voiceInterface.messages.length-1].text=A:this.voiceInterface.messages.push({type:"assistant",text:A});var t=document.getElementById("mobileMessagesContainer");if(t){var n=t.querySelector(".mobile-message-bubble.assistant:last-child");n?n.textContent=A:this.voiceInterface.addMobileMessage("assistant",A)}}else{var o=this.voiceInterface.shadowRoot.getElementById("liveTextCollapsed");if(o)if(A&&A.trim()){o.textContent=A,o.classList.remove("muted");var i=document.createElement("span");i.className="typing-cursor",o.appendChild(i)}else o.textContent=this.t("transcriptWillAppear")||"Transcript will appear here...",o.classList.add("muted");if(A&&A.trim()?(this.currentLiveMessage&&"assistant"===this.currentLiveMessage.role&&A.startsWith(this.currentLiveMessage.content)?this.currentLiveMessage.content=A:(this.currentLiveMessage&&this.finalizeLiveMessage(),this.currentLiveMessage={role:"assistant",content:A}),this.updateLiveMessageRow()):(this.currentLiveMessage=null,this.updateLiveMessageRow()),this.voiceInterface.conversationExpanded){var r=this.voiceInterface.shadowRoot.getElementById("conversationHistory");r&&setTimeout(()=>{r.scrollTop=r.scrollHeight},10)}}}toggleConversationPanel(){if(!this.voiceInterface.isMobile){this.voiceInterface.conversationExpanded=!this.voiceInterface.conversationExpanded;var A=this.voiceInterface.shadowRoot.getElementById("desktopConversationPanel"),e=this.voiceInterface.shadowRoot.getElementById("conversationHeader"),t=this.voiceInterface.shadowRoot.getElementById("conversationToggleText"),n=this.voiceInterface.shadowRoot.querySelector(".voice-interface");if(A){var o,i=this.voiceInterface.shadowRoot.getElementById("desktopVoiceSection"),r=this.voiceInterface.shadowRoot.getElementById("compactVoiceSection");this.voiceInterface.conversationExpanded?(A.classList.remove("collapsed"),A.classList.add("expanded"),e&&e.classList.add("expanded"),t&&(t.textContent="Hide history"),n&&n.classList.add("expanded"),i&&(i.style.display="none"),r&&(r.style.display="flex"),console.log("📝 [TRANSCRIPT] Expanding panel, rendering",(null===(o=this.conversationMessages)||void 0===o?void 0:o.length)||0,"messages"),this.renderConversationMessages()):(A.classList.remove("expanded"),A.classList.add("collapsed"),e&&e.classList.remove("expanded"),t&&(t.textContent="Show history"),n&&n.classList.remove("expanded"),i&&(i.style.display=""),r&&(r.style.display="none"))}}}finalizeLiveMessage(){this.currentLiveMessage&&this.currentLiveMessage.content&&this.currentLiveMessage.content.trim()&&(this.conversationMessages||(this.conversationMessages=[]),this.conversationMessages.push({role:this.currentLiveMessage.role,content:this.currentLiveMessage.content}),console.log("📝 [TRANSCRIPT] Finalized live message:",this.currentLiveMessage.role,this.currentLiveMessage.content.substring(0,50)+"..."),this.currentLiveMessage=null,this.voiceInterface.conversationExpanded&&this.renderConversationMessages())}addConversationMessage(A,e){if(!this.voiceInterface.isMobile&&e&&e.trim()){if(this.currentLiveMessage&&this.finalizeLiveMessage(),this.conversationMessages||(this.conversationMessages=[]),"user"!==A)return this.currentLiveMessage={role:A,content:e},this.updateLiveMessageRow(),void console.log("📝 [TRANSCRIPT] Assistant message set as live (via addConversationMessage)");this.conversationMessages.push({role:A,content:e}),console.log("📝 [TRANSCRIPT] User message added to history"),this.voiceInterface.conversationExpanded&&this.renderConversationMessages()}}updateLiveMessageRow(){var A=this.voiceInterface.shadowRoot.getElementById("liveMessageRow"),e=this.voiceInterface.shadowRoot.getElementById("liveMessageText"),t=null==A?void 0:A.querySelector(".message-avatar");if(A&&e)if(this.currentLiveMessage&&this.currentLiveMessage.content&&this.currentLiveMessage.content.trim()){t&&("user"===this.currentLiveMessage.role?(t.textContent="U",t.className="message-avatar user"):(t.innerHTML='<div class="orb"></div>',t.className="message-avatar assistant")),e.textContent=this.currentLiveMessage.content,A.style.display="flex";var n=e.querySelector(".typing-cursor")||document.createElement("span");n.className="typing-cursor",e.querySelector(".typing-cursor")||e.appendChild(n)}else A.style.display="none"}clearConversationMessages(){this.conversationMessages=[],this.currentLiveMessage=null;var A=this.voiceInterface.shadowRoot.getElementById("liveMessageRow");A&&(A.style.display="none")}renderConversationMessages(){var A=this.voiceInterface.shadowRoot.getElementById("conversationMessages");if(A){if(!this.conversationMessages||0===this.conversationMessages.length)return console.log("📝 [TRANSCRIPT] No messages to render"),void(A.innerHTML="");var e=[...this.conversationMessages];if(this.currentLiveMessage&&e.length>0){var t=e[e.length-1];t.role===this.currentLiveMessage.role&&t.content===this.currentLiveMessage.content&&(e=e.slice(0,-1))}console.log("📝 [TRANSCRIPT] Rendering",e.length,"messages (live message excluded)"),A.innerHTML=e.map(A=>{var e="user"===A.role;return'\n <div class="message-row '.concat(A.role,'">\n <div class="message-avatar ').concat(A.role,'">\n ').concat(e?"U":'<div class="orb"></div>','\n </div>\n <div class="message-bubble">').concat(this.escapeHtml(A.content),"</div>\n </div>\n ")}).join("");var n=this.voiceInterface.shadowRoot.getElementById("conversationHistory");n&&setTimeout(()=>{n.scrollTop=n.scrollHeight},10)}else console.warn("📝 [TRANSCRIPT] conversationMessages container not found")}}class ue{constructor(A){this.voiceInterface=A,this.config=A.config,this.shadowRoot=A.shadowRoot,this._textInjectTimeout=null,this._mobileTextInjectTimeout=null,this._statusClearTimeout=null,this._mobileStatusClearTimeout=null,this._originalHintText=null,this._originalMobileHintText=null,this._textInjectAckHandler=null}t(A){return this.voiceInterface.t(A)}setupTextInjectAckHandler(){var A;null!==(A=this.voiceInterface.sdk)&&void 0!==A&&A.voiceSDK&&(this._textInjectAckHandler&&this.voiceInterface.sdk.voiceSDK.off("textInjectAck",this._textInjectAckHandler),this._textInjectAckHandler=A=>{this.handleTextInjectAck(A)},this.voiceInterface.sdk.voiceSDK.on("textInjectAck",this._textInjectAckHandler))}cleanup(){this._textInjectTimeout&&(clearTimeout(this._textInjectTimeout),this._textInjectTimeout=null),this._mobileTextInjectTimeout&&(clearTimeout(this._mobileTextInjectTimeout),this._mobileTextInjectTimeout=null),this._statusClearTimeout&&(clearTimeout(this._statusClearTimeout),this._statusClearTimeout=null),this._mobileStatusClearTimeout&&(clearTimeout(this._mobileStatusClearTimeout),this._mobileStatusClearTimeout=null),this._originalHintText=null,this._originalMobileHintText=null}handleTextInjectAck(A){var e,t;this._textInjectTimeout&&(clearTimeout(this._textInjectTimeout),this._textInjectTimeout=null),this._mobileTextInjectTimeout&&(clearTimeout(this._mobileTextInjectTimeout),this._mobileTextInjectTimeout=null);var n=this.shadowRoot.getElementById("voiceTextInput"),o=this.shadowRoot.getElementById("voiceSendBtn");n&&(n.disabled=!1),o&&(o.disabled=!(null!=n&&null!==(e=n.value)&&void 0!==e&&e.trim()));var i=document.getElementById("mobileTextInput"),r=document.getElementById("mobileSendBtn");if(i&&(i.disabled=!1),r&&(r.disabled=!(null!=i&&null!==(t=i.value)&&void 0!==t&&t.trim())),A.success){var s,a=null===(s=A.message)||void 0===s?void 0:s.toLowerCase().includes("queued"),c=a?"queued":"success",l=a?"Message queued":"Message sent";this.voiceInterface.isMobile?this.showMobileTextInputStatus(c,l):this.showDesktopTextInputStatus(c,l)}else{var d=A.message||"Failed to send";this.voiceInterface.isMobile?this.showMobileTextInputStatus("error",d):this.showDesktopTextInputStatus("error",d)}}sendDesktopTextMessage(){var A=this.shadowRoot.getElementById("voiceTextInput"),e=this.shadowRoot.getElementById("voiceSendBtn");if(A&&e){var t=A.value.trim();t&&this._sendTextMessage(t,A,e,!1)}else console.warn("VoiceInterface: Missing UI elements for desktop text send")}sendMobileTextMessage(){var A=document.getElementById("mobileTextInput"),e=document.getElementById("mobileSendBtn");A&&e?this._sendTextMessage(A.value,A,e,!0):console.warn("VoiceInterface: Missing UI elements for mobile text send")}_sendTextMessage(A,e,t,n){var o;if(this.voiceInterface.isActive&&null!==(o=this.voiceInterface.sdk)&&void 0!==o&&o.voiceSDK){var i=null==A?void 0:A.trim();if(i){e.value="",t&&(t.disabled=!0),this.showTextInputStatus(n?"mobile":"desktop","sending","Sending...");try{if(this.voiceInterface.sdk.voiceSDK.sendMessage({t:"text_inject",text:i})){var r=setTimeout(()=>{n?this._mobileTextInjectTimeout=null:this._textInjectTimeout=null,e.disabled=!1,t&&(t.disabled=!1),this.showTextInputStatus(n?"mobile":"desktop","error","No response")},5e3);n?this._mobileTextInjectTimeout=r:this._textInjectTimeout=r,n?this.voiceInterface.addMobileMessage("user",i):this.voiceInterface.addConversationMessage("user",i)}else e.disabled=!1,t&&(t.disabled=!1),this.showTextInputStatus(n?"mobile":"desktop","error","Failed to send")}catch(A){console.error("Error sending text message:",A),e.disabled=!1,t&&(t.disabled=!1),this.showTextInputStatus(n?"mobile":"desktop","error","Error sending")}}else this.showTextInputStatus(n?"mobile":"desktop","error","Enter text first")}else console.warn("VoiceInterface: Cannot send text - call not active")}showTextInputStatus(A,e,t){"mobile"===A?this.showMobileTextInputStatus(e,t):this.showDesktopTextInputStatus(e,t)}showDesktopTextInputStatus(A,e){var t=this.shadowRoot.querySelector(".voice-input-hint");t&&(this._originalHintText||(this._originalHintText=t.textContent),t.classList.remove("voice-input-hint--sending","voice-input-hint--success","voice-input-hint--queued","voice-input-hint--error"),"sending"===A?(t.classList.add("voice-input-hint--sending"),t.textContent=e||"Sending..."):"success"===A?(t.classList.add("voice-input-hint--success"),t.textContent=e||"Sent",this.clearTextInputStatusAfterDelay(3e3)):"queued"===A?(t.classList.add("voice-input-hint--queued"),t.textContent=e||"Queued"):"error"===A?(t.classList.add("voice-input-hint--error"),t.textContent=e||"Error",this.clearTextInputStatusAfterDelay(3e3)):"clear"===A&&(t.textContent=this._originalHintText||this.t("voiceActive")||"Voice is still active • Type or speak",this._originalHintText=null))}showMobileTextInputStatus(A,e){var t=document.querySelector(".mobile-input-hint");t&&(this._originalMobileHintText||(this._originalMobileHintText=t.textContent),t.classList.remove("mobile-input-hint--sending","mobile-input-hint--success","mobile-input-hint--queued","mobile-input-hint--error"),"sending"===A?(t.classList.add("mobile-input-hint--sending"),t.textContent=e||"Sending..."):"success"===A?(t.classList.add("mobile-input-hint--success"),t.textContent=e||"Sent",this.clearMobileTextInputStatusAfterDelay(3e3)):"queued"===A?(t.classList.add("mobile-input-hint--queued"),t.textContent=e||"Queued"):"error"===A?(t.classList.add("mobile-input-hint--error"),t.textContent=e||"Error",this.clearMobileTextInputStatusAfterDelay(3e3)):"clear"===A&&(t.textContent=this._originalMobileHintText||"🎙️ Voice is still active • Type or speak",this._originalMobileHintText=null))}clearTextInputStatusAfterDelay(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;this._statusClearTimeout&&clearTimeout(this._statusClearTimeout),this._statusClearTimeout=setTimeout(()=>{this.showDesktopTextInputStatus("clear"),this._statusClearTimeout=null},A)}clearMobileTextInputStatusAfterDelay(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e3;this._mobileStatusClearTimeout&&clearTimeout(this._mobileStatusClearTimeout),this._mobileStatusClearTimeout=setTimeout(()=>{this.showMobileTextInputStatus("clear"),this._mobileStatusClearTimeout=null},A)}}class ge{constructor(A){this.voiceInterface=A,this.config=A.config,this.shadowRoot=A.shadowRoot}setupEventHandlers(A){var e=this.shadowRoot.getElementById("startCallBtn"),t=this.shadowRoot.getElementById("desktopEndCallBtn"),n=this.shadowRoot.getElementById("desktopMuteBtn"),o=this.shadowRoot.getElementById("desktopSpeakerBtn"),i=this.shadowRoot.getElementById("desktopEndCallBtnCompact"),r=this.shadowRoot.getElementById("desktopMuteBtnCompact"),s=this.shadowRoot.getElementById("desktopSpeakerBtnCompact");if(e&&(e.onclick=()=>this.voiceInterface.startVoiceCall()),t&&(t.onclick=()=>this.voiceInterface.endVoiceCall()),n&&(n.onclick=()=>this.voiceInterface.toggleMute()),o&&(o.onclick=()=>this.voiceInterface.toggleSpeaker()),i&&(i.onclick=()=>this.voiceInterface.endVoiceCall()),r&&(r.onclick=()=>this.voiceInterface.toggleMute()),s&&(s.onclick=()=>this.voiceInterface.toggleSpeaker()),!this.voiceInterface.isMobile){var a=this.shadowRoot.getElementById("voiceTextInput"),c=this.shadowRoot.getElementById("voiceSendBtn");a&&(a.addEventListener("input",()=>{c&&(c.disabled=!a.value.trim())}),a.addEventListener("keypress",A=>{"Enter"===A.key&&!A.shiftKey&&a.value.trim()&&(A.preventDefault(),c&&!c.disabled&&c.click())})),c&&(c.onclick=()=>{this.voiceInterface.sendDesktopTextMessage()});var l=this.shadowRoot.getElementById("conversationHeader");l&&l.addEventListener("click",()=>{this.voiceInterface.transcript.toggleConversationPanel()})}}setupMobileEventHandlers(){if(this.voiceInterface.isMobile){var A=document.getElementById("mobileMuteBtn"),e=document.getElementById("mobileSpeakerBtn"),t=document.getElementById("mobileEndCallBtn"),n=document.getElementById("mobileTranscriptRow"),o=document.getElementById("mobileCloseTranscriptBtn"),i=document.getElementById("mobileTextInput"),r=document.getElementById("mobileSendBtn");A&&(A.onclick=()=>this.voiceInterface.toggleMute()),e&&(e.onclick=()=>this.voiceInterface.toggleSpeaker()),t&&(t.onclick=()=>this.voiceInterface.endVoiceCall()),n&&(n.onclick=()=>{this.voiceInterface.expandMobileTranscript()}),o&&(o.onclick=()=>{this.voiceInterface.collapseMobileTranscript()}),i&&(i.addEventListener("input",()=>{r&&(r.disabled=!i.value.trim())}),i.addEventListener("keypress",A=>{"Enter"===A.key&&!A.shiftKey&&i.value.trim()&&(A.preventDefault(),r&&!r.disabled&&r.click())})),r&&(r.onclick=()=>{this.voiceInterface.sendMobileTextMessage()})}}}class pe{constructor(A){this.voiceInterface=A,this.config=A.config,this.shadowRoot=A.shadowRoot,this._liveWaveformInterval=null}t(A){return this.voiceInterface.t(A)}adjustSizesForContainer(){var A=this.shadowRoot.getElementById("voiceInterface");if(A){var e,t,n,o,i,r,s=A.clientHeight||A.offsetHeight||400,a=A.clientWidth||A.offsetWidth||400;s<=350?(e=80,t=80,n=48,o=54,i=6,r=12):s<=450?(e=100,t=100,n=56,o=62,i=8,r=14):s<=550?(e=120,t=120,n=64,o=70,i=10,r=16):s<=700?(e=140,t=140,n=72,o=78,i=12,r=18):(e=160,t=160,n=80,o=86,i=14,r=20);var c=this.shadowRoot.querySelector(".voice-avatar, .voice-avatar-active");c&&(c.style.width="".concat(e,"px"),c.style.height="".concat(e,"px"),c.style.fontSize="".concat(.5*e,"px"));var l=this.shadowRoot.querySelector(".voice-status-title"),d=this.shadowRoot.querySelector(".voice-status-subtitle");l&&(l.style.fontSize="".concat(r,"px")),d&&(d.style.fontSize="".concat(Math.max(10,r-4),"px"));var u=this.shadowRoot.querySelector(".voice-transcript");u&&(u.style.minHeight="".concat(t,"px"),u.style.maxHeight="".concat(t,"px"),u.style.height="".concat(t,"px"),u.style.width="min(360px, ".concat(a-40,"px)"),u.style.boxSizing="border-box");var g=this.shadowRoot.querySelector(".transcript-label");g&&(g.style.fontSize="".concat(Math.max(8,r-4),"px"));var p=this.shadowRoot.querySelector(".transcript-text");p&&(p.style.fontSize="".concat(Math.max(10,r-2),"px"));var h=this.shadowRoot.querySelector(".voice-text-input-area");if(h){var B=h.querySelector(".voice-input-wrapper"),m=h.querySelector(".voice-text-input"),f=h.querySelector(".voice-send-btn"),v=h.querySelector(".voice-input-hint");if(B&&f){var w=Math.max(32,Math.min(40,.7*n));f.style.width="".concat(w,"px"),f.style.height="".concat(w,"px");var C=f.querySelector("svg");if(C){var y=Math.max(14,Math.min(18,.45*w));C.style.width="".concat(y,"px"),C.style.height="".concat(y,"px")}}m&&(m.style.fontSize="".concat(Math.max(11,Math.min(14,r)),"px"),m.style.padding="".concat(Math.max(6,Math.min(10,Math.floor(.15*n))),"px 0")),v&&(v.style.fontSize="".concat(Math.max(8,Math.min(11,r-4)),"px"),v.style.marginTop="".concat(Math.max(3,Math.min(6,Math.floor(.6*i))),"px"))}this.shadowRoot.querySelectorAll(".voice-control-btn.secondary").forEach(A=>{A.style.width="".concat(n,"px"),A.style.height="".concat(n,"px");var e=A.querySelector("svg");if(e){var t=.65*n;e.style.setProperty("width","".concat(t,"px"),"important"),e.style.setProperty("height","".concat(t,"px"),"important"),e.style.setProperty("min-width","".concat(t,"px"),"important"),e.style.setProperty("min-height","".concat(t,"px"),"important")}});var b=this.shadowRoot.querySelector(".voice-control-btn.primary");if(b){b.style.width="".concat(o,"px"),b.style.height="".concat(o,"px");var x=b.querySelector("svg");if(x){var Q=.7*o;x.style.setProperty("width","".concat(Q,"px"),"important"),x.style.setProperty("height","".concat(Q,"px"),"important"),x.style.setProperty("min-width","".concat(Q,"px"),"important"),x.style.setProperty("min-height","".concat(Q,"px"),"important")}}var F=this.shadowRoot.querySelector(".start-call-btn");if(F){var U,S;s<=350?(U=48,S=14):s<=450?(U=52,S=15):s<=550?(U=58,S=17):s<=700?(U=62,S=18):(U=64,S=18),F.style.height="".concat(U,"px"),F.style.fontSize="".concat(S,"px");var I=F.querySelector("svg");if(I){var E=Math.max(22,.5*U);I.style.width="".concat(E,"px"),I.style.height="".concat(E,"px")}}}}startDesktopWaveformAnimation(){if(!this.voiceInterface.isMobile){var A=this.shadowRoot.getElementById("desktopWaveform");A&&(A.classList.remove("paused"),this.updateDesktopStatus())}}stopDesktopWaveformAnimation(){if(!this.voiceInterface.isMobile){var A=this.shadowRoot.getElementById("desktopWaveform");A&&A.classList.add("paused")}}updateDesktopStatus(){if(!this.voiceInterface.isMobile){var A=this.shadowRoot.getElementById("compactStatusText")||this.shadowRoot.getElementById("desktopStatusText");if(A){var e,t=this.config.statusText;e=t||(this.voiceInterface.isActive&&!this.voiceInterface.isMicMuted?this.t("listening"):this.t("connected")),A.textContent=e;var n=this.shadowRoot.getElementById("desktopStatusText");n&&n!==A&&(n.textContent=e)}}}updateLiveWaveform(A){if(!this.voiceInterface.isMobile){var e=this.shadowRoot.getElementById("desktopLiveWaveform");e&&e.querySelectorAll(".desktop-live-bar").forEach((e,t)=>{if(A){var n=40*Math.random()+8;e.style.height="".concat(n,"px")}else e.style.height="8px"})}}showError(A){var e=this.shadowRoot.getElementById("transcriptText");e&&(e.textContent="".concat(this.t("error"),": ").concat(A),e.classList.remove("empty"))}showDomainError(){console.log("🚫 Showing domain error in widget UI...");var A=this.shadowRoot.getElementById("voiceIdleState");if(A){var e=A.querySelector(".voice-status-title"),t=A.querySelector(".voice-status-subtitle"),n=A.querySelector("#startCallBtn"),o=this.t("domainNotValidated"),i=this.t("domainErrorMessage");console.log("🚫 Domain error title:",o),console.log("🚫 Domain error message:",i),e?(e.textContent=o,e.style.color="#991B1B",e.style.fontSize="20px",e.style.fontWeight="600",e.style.marginLeft="20px",e.style.marginRight="20px",e.style.textAlign="center",console.log("✅ Updated statusTitle with domain error")):console.warn("⚠️ .voice-status-title element not found"),t?(t.textContent=i,t.style.color="#991B1B",t.style.fontSize="16px",t.style.marginLeft="20px",t.style.marginRight="20px",t.style.marginTop="12px",t.style.textAlign="center",t.style.lineHeight="1.5",console.log("✅ Updated statusSubtitle with domain error")):console.warn("⚠️ .voice-status-subtitle element not found"),n?(n.style.display="none",console.log("✅ Hidden start call button")):console.warn("⚠️ #startCallBtn element not found");var r=A.querySelector("#domainErrorBackBtn");if(r)r.style.display="flex";else{(r=document.createElement("button")).id="domainErrorBackBtn",r.className="domain-error-back-btn",r.innerHTML='\n <svg width="20" height="20" viewBox="0 0 24 24" fill="currentColor" style="margin-right: 8px;">\n <path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/>\n </svg>\n <span>'.concat(this.t("back")||"Back","</span>\n ");var s=A.querySelector(".voice-status");s&&s.parentNode?s.parentNode.insertBefore(r,s.nextSibling):t&&t.parentNode?t.parentNode.insertBefore(r,t.nextSibling):A.appendChild(r),r.style.cssText="\n display: flex;\n align-items: center;\n justify-content: center;\n margin: 24px auto 0;\n padding: 12px 24px;\n background-color: #7C3AED;\n color: white;\n border: none;\n border-radius: 8px;\n font-size: 16px;\n font-weight: 500;\n cursor: pointer;\n transition: background-color 0.2s;\n max-width: 200px;\n ",r.addEventListener("mouseenter",()=>{r.style.backgroundColor="#6D28D9"}),r.addEventListener("mouseleave",()=>{r.style.backgroundColor="#7C3AED"}),r.onclick=()=>{console.log("🔙 Domain error back button clicked"),this.voiceInterface.isShowingDomainError=!1,this.voiceInterface.resetConnectingState(),r&&r.parentNode&&r.parentNode.removeChild(r),this.voiceInterface.config.onShowLanding&&"function"==typeof this.voiceInterface.config.onShowLanding&&this.voiceInterface.config.onShowLanding()},console.log("✅ Created domain error back button")}A.style.display="flex",console.log("✅ Domain error displayed in widget UI");var a=this.shadowRoot.getElementById("transcriptText");if(a){var c=this.t("domainNotValidated"),l=this.t("domainErrorMessage");a.innerHTML='<div style="font-weight: 600; font-size: 16px; margin-bottom: 8px; color: #991B1B;">'.concat(c,'</div><div style="font-size: 14px; color: #991B1B; line-height: 1.5;">').concat(l,"</div>"),a.classList.remove("empty")}}else console.warn("⚠️ voiceIdleState element not found, cannot show domain error")}showBackButtonWarning(){var A=this.shadowRoot.getElementById("transcriptText"),e=this.shadowRoot.getElementById("liveTextCollapsed");if(A){var t=A.textContent,n=A.innerHTML;A.innerHTML='\n <div style="font-weight: 600; font-size: 16px; margin-bottom: 8px; color: #92400e; display: flex; align-items: center; gap: 8px;">\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" style="flex-shrink: 0;">\n <path d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"/>\n </svg>\n Please end the call first\n </div>\n <div style="font-size: 14px; color: #92400e; line-height: 1.5;">\n You need to end the current call before going back.\n </div>\n ',A.classList.remove("empty"),setTimeout(()=>{A&&(A.innerHTML=n,A.textContent=t,t&&""!==t.trim()||A.classList.add("empty"))},5e3)}else if(e){var o=e.textContent;e.innerHTML='\n <span style="color: #92400e; font-weight: 600;">⚠️ Please end the call first - You need to end the current call before going back.</span>\n ',setTimeout(()=>{e&&(e.textContent=o)},5e3)}}startLiveWaveformInterval(){this.voiceInterface.isMobile||(this._liveWaveformInterval&&clearInterval(this._liveWaveformInterval),this._liveWaveformInterval=setInterval(()=>{this.updateLiveWaveform(this.voiceInterface.isActive&&!this.voiceInterface.isMicMuted)},100))}stopLiveWaveformInterval(){this._liveWaveformInterval&&(clearInterval(this._liveWaveformInterval),this._liveWaveformInterval=null)}cleanup(){this.stopLiveWaveformInterval(),this.stopDesktopWaveformAnimation()}}class he{constructor(A){this.voiceInterface=A,this.config=A.config,this.waveformBars=[.3,.5,.8,.4,.6,.9,.5,.7],this.waveformInterval=null,this.isTranscriptExpanded=!1,this.voiceInterface.messages||(this.voiceInterface.messages=[])}t(A){return this.voiceInterface.t(A)}createMobileMinimizedBar(){var A=document.getElementById("mobile-voice-call-bar-container");if(A&&A.remove(),!document.getElementById("mobile-voice-call-bar-styles")){var e=document.createElement("style");e.id="mobile-voice-call-bar-styles",e.textContent=this.voiceInterface.styles.generateMobileCSS(),document.head.appendChild(e)}var t=document.createElement("div");t.id="mobile-voice-call-bar-container",t.innerHTML='\n \x3c!-- Duration Badge --\x3e\n <div class="mobile-duration-badge" id="mobileDurationBadge">\n <div class="mobile-duration-dot"></div>\n <span id="mobileDurationText">00:00</span>\n </div>\n \n \x3c!-- Main Bar --\x3e\n <div class="mobile-voice-bar">\n \x3c!-- Top Row: Status, Waveform, Controls --\x3e\n <div class="mobile-top-row">\n \x3c!-- Status Indicator --\x3e\n <div class="mobile-status-indicator">\n <div class="mobile-status-dot" id="mobileStatusDot"></div>\n <span class="mobile-status-text" id="mobileStatusText">'.concat(this.t("listening"),'</span>\n </div>\n \n \x3c!-- Centered Waveform --\x3e\n <div class="mobile-waveform-center" id="mobileWaveform">\n ').concat(Array(8).fill(0).map((A,e)=>'<div class="mobile-waveform-bar" data-index="'.concat(e,'"></div>')).join(""),'\n </div>\n \n \x3c!-- Controls --\x3e\n <div class="mobile-controls">\n <button class="mobile-control-btn" id="mobileMuteBtn" aria-label="Mute microphone">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-mic-icon">\n <path d="M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" x2="12" y1="19" y2="22"/>\n </svg>\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-mic-off-icon" style="display: none;">\n <line x1="2" x2="22" y1="2" y2="22"/>\n <path d="M18.89 13.23A7.12 7.12 0 0 0 19 12v-2"/>\n <path d="M5 10v2a7 7 0 0 0 12 5"/>\n <path d="M15 9.34V5a3 3 0 0 0-5.68-1.33"/>\n <path d="M9 9v3a3 3 0 0 0 5.12 2.12"/>\n <line x1="12" x2="12" y1="19" y2="22"/>\n </svg>\n </button>\n \n <button class="mobile-control-btn" id="mobileSpeakerBtn" aria-label="Toggle speaker">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-speaker-icon">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>\n </svg>\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#ef4444" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mobile-speaker-off-icon" style="display: none;">\n <polygon points="11 5 6 9 2 9 2 15 6 15 11 19 11 5"/>\n <line x1="22" x2="16" y1="9" y2="15"/>\n <line x1="16" x2="22" y1="9" y2="15"/>\n </svg>\n </button>\n \n <button class="mobile-end-call-btn" id="mobileEndCallBtn" aria-label="End call">\n <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91"/>\n <line x1="22" x2="2" y1="2" y2="22"/>\n </svg>\n </button>\n </div>\n </div>\n \n \x3c!-- Bottom Row: Transcript (expandable) --\x3e\n <button class="mobile-transcript-row" id="mobileTranscriptRow">\n <p class="mobile-transcript-text" id="mobileTranscriptText">').concat(this.t("transcriptWillAppear"),'</p>\n <div class="mobile-transcript-footer">\n <span class="mobile-expand-hint">tap to expand & type</span>\n <svg width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" style="opacity: 0.6;">\n <path d="M7 17L17 7M17 7H7M17 7V17"/>\n </svg>\n </div>\n </button>\n </div>\n \n \x3c!-- Expanded Transcript Overlay --\x3e\n <div class="mobile-transcript-overlay" id="mobileTranscriptOverlay" style="display: none;">\n <div class="mobile-expanded-transcript" id="mobileExpandedTranscript">\n \x3c!-- Header --\x3e\n <div class="mobile-transcript-header">\n <div class="mobile-header-left">\n <div class="mobile-header-status">\n <div class="mobile-header-status-dot"></div>\n <span class="mobile-header-status-text" id="mobileHeaderStatusText">').concat(this.t("listening"),'</span>\n <span class="mobile-header-duration" id="mobileHeaderDuration">00:00</span>\n </div>\n <span class="mobile-transcript-label">CONVERSATION</span>\n </div>\n <button class="mobile-close-transcript-btn" id="mobileCloseTranscriptBtn">\n <svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M18 6L6 18M6 6l12 12"/>\n </svg>\n </button>\n </div>\n \n \x3c!-- Messages Container --\x3e\n <div class="mobile-messages-container" id="mobileMessagesContainer">\n \x3c!-- Messages will be dynamically added here --\x3e\n </div>\n \n \x3c!-- Text Input Area --\x3e\n <div class="mobile-input-area">\n <div class="mobile-input-wrapper">\n <input\n type="text"\n placeholder="Type a message..."\n id="mobileTextInput"\n class="mobile-text-input"\n />\n <button class="mobile-send-btn" id="mobileSendBtn" disabled>\n <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\n <path d="M22 2L11 13M22 2l-7 20-4-9-9-4 20-7z"/>\n </svg>\n </button>\n </div>\n <p class="mobile-input-hint">🎙️ ').concat(this.t("voiceActive")||"Voice is still active"," • ").concat(this.t("typeOrSpeak")||"Type or speak","</p>\n </div>\n </div>\n </div>\n "),document.body.appendChild(t);var n=document.getElementById("mobileMuteBtn"),o=document.getElementById("mobileSpeakerBtn"),i=document.getElementById("mobileEndCallBtn");if(n){n.style.cssText="\n width: 32px !important;\n height: 32px !important;\n min-width: 32px !important;\n min-height: 32px !important;\n max-width: 32px !important;\n max-height: 32px !important;\n aspect-ratio: 1 !important;\n border-radius: 50% !important;\n overflow: hidden !important;\n padding: 0 !important;\n margin: 0 !important;\n box-sizing: border-box !important;\n ";var r=n.querySelector(".mobile-mic-icon"),s=n.querySelector(".mobile-mic-off-icon");r&&(r.style.cssText="\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 15px !important;\n height: 15px !important;\n margin: 0 !important;\n padding: 0 !important;\n position: absolute !important;\n top: 50% !important;\n left: 50% !important;\n transform: translate(-50%, -50%) !important;\n "),s&&(s.style.cssText="\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n position: absolute !important;\n top: 50% !important;\n left: 50% !important;\n transform: translate(-50%, -50%) !important;\n ")}if(o){o.style.cssText="\n width: 32px !important;\n height: 32px !important;\n min-width: 32px !important;\n min-height: 32px !important;\n max-width: 32px !important;\n max-height: 32px !important;\n aspect-ratio: 1 !important;\n border-radius: 50% !important;\n overflow: hidden !important;\n padding: 0 !important;\n margin: 0 !important;\n box-sizing: border-box !important;\n ";var a=o.querySelector(".mobile-speaker-icon"),c=o.querySelector(".mobile-speaker-off-icon");a&&(a.style.cssText="\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 15px !important;\n height: 15px !important;\n margin: 0 !important;\n padding: 0 !important;\n position: absolute !important;\n top: 50% !important;\n left: 50% !important;\n transform: translate(-50%, -50%) !important;\n "),c&&(c.style.cssText="\n display: none !important;\n visibility: hidden !important;\n opacity: 0 !important;\n position: absolute !important;\n top: 50% !important;\n left: 50% !important;\n transform: translate(-50%, -50%) !important;\n ")}if(i){i.style.cssText="\n width: 36px !important;\n height: 36px !important;\n min-width: 36px !important;\n min-height: 36px !important;\n max-width: 36px !important;\n max-height: 36px !important;\n aspect-ratio: 1 !important;\n border-radius: 50% !important;\n overflow: hidden !important;\n padding: 0 !important;\n margin: 0 !important;\n box-sizing: border-box !important;\n ";var l=i.querySelector("svg");l&&(l.style.cssText="\n display: block !important;\n visibility: visible !important;\n opacity: 1 !important;\n width: 15px !important;\n height: 15px !important;\n margin: 0 !important;\n padding: 0 !important;\n ")}this.voiceInterface.setupMobileEventHandlers()}removeMobileMinimizedBar(){var A=document.getElementById("mobile-voice-call-bar-container");A&&A.remove()}expandMobileTranscript(){var A=document.getElementById("mobileTranscriptOverlay");if(A){A.style.display="flex",this.isTranscriptExpanded=!0;var e=document.getElementById("mobileTextInput");e&&setTimeout(()=>e.focus(),100);var t=document.getElementById("mobileMessagesContainer");t&&setTimeout(()=>{t.scrollTop=t.scrollHeight},100)}}collapseMobileTranscript(){var A=document.getElementById("mobileTranscriptOverlay");A&&(A.style.display="none",this.isTranscriptExpanded=!1)}updateMobileStatus(A){var e=document.getElementById("mobileStatusText"),t=document.getElementById("mobileHeaderStatusText"),n=document.getElementById("mobileStatusDot");if(e||t){var o=this.config.statusText,i="",r="#6b7280";o?(i=o,r=this.config.statusDotColor||"#10b981"):"connecting"===A?(i=this.t("connecting")||"Connecting...",r="#3b82f6"):"listening"===A||"recording"===A?(i=this.t("listening")||"Listening...",r="#22c55e"):"speaking"===A?(i=this.t("speaking")||"Speaking...",r="#a855f7"):(i=this.t("paused")||"Paused",r="#facc15"),e&&(e.textContent=i),t&&(t.textContent=i),n&&(n.style.backgroundColor=r,n.style.boxShadow="paused"===A?"none":"0 0 8px ".concat(r))}}addMobileMessage(A,e){this.voiceInterface.messages.push({type:A,text:e});var t=document.getElementById("mobileMessagesContainer");if(t){var n=document.createElement("div");n.className="mobile-message-bubble ".concat(A),n.textContent=e,t.appendChild(n),t.scrollTop=t.scrollHeight}}startWaveformAnimation(){this.waveformInterval&&clearInterval(this.waveformInterval);var A=document.getElementById("mobileWaveform");A&&(this.waveformInterval=setInterval(()=>{A.querySelectorAll(".mobile-waveform-bar").forEach((A,e)=>{var t=60*Math.random()+10;A.style.height="".concat(t,"px")})},100))}stopWaveformAnimation(){this.waveformInterval&&(clearInterval(this.waveformInterval),this.waveformInterval=null);var A=document.getElementById("mobileWaveform");A&&A.querySelectorAll(".mobile-waveform-bar").forEach(A=>{A.style.height="10px"})}cleanup(){this.stopWaveformAnimation(),this.collapseMobileTranscript(),this.removeMobileMinimizedBar(),this.voiceInterface.messages=[]}}function Be(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function me(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){Be(i,n,o,r,s,"next",A)}function s(A){Be(i,n,o,r,s,"throw",A)}r(void 0)})}}class fe{constructor(A){var e;this.config=A,this.audioStream=null,this.callStartTime=null,this.callTimerInterval=null,this.sdk=null,this.isActive=!1,this.isShowingDomainError=!1,this.shadowRoot=A.shadowRoot||document,this.textSDK=A.textSDK||null,this.deviceInfo=Ae(),this.isMobile=this.deviceInfo.isMobile,this.conversationExpanded=!1,this.isMicMuted=!1,this.isSpeakerMuted=!1;var t=A.visualAssistant||(null===(e=A.agentSettingsOverride)||void 0===e?void 0:e.visualAssistant);this.sdk=new ZA({agentId:A.agentId,appId:A.appId,signedUrl:A.signedUrl,agentSettingsOverride:A.agentSettingsOverride,visualAssistant:t,variables:A.variables||{},language:A.language||"en",outputContainer:A.outputContainer,outputEncoding:A.outputEncoding,outputSampleRate:A.outputSampleRate,outputChannels:A.outputChannels,outputBitDepth:A.outputBitDepth,onConversationStart:A.onConversationStart,onConversationEnd:A.onConversationEnd,onBargeIn:A.onBargeIn,onAudioStartPlaying:A.onAudioStartPlaying,onAudioStoppedPlaying:A.onAudioStoppedPlaying,onSubtitleDisplay:A.onSubtitleDisplay}),this.templates=new ce(this),this.styles=new le(this),this.transcript=new de(this),this.textHandlers=new ue(this),this.handlers=new ge(this),this.desktop=new pe(this),this.mobile=new he(this),this.setupSDKEventHandlers(),this.checkAndHandleResume()}getVoiceSDK(){var A;return(null===(A=this.sdk)||void 0===A?void 0:A.voiceSDK)||null}checkAndHandleResume(){if(void 0!==this._resumeInfo)return console.log("🔄 [VOICE INTERFACE] Returning cached resume info:",this._resumeInfo),this._resumeInfo;var A=this.sdk.checkResumeBeforeConnect();return this._resumeInfo=A,A?(console.log("🔄 [WIDGET] Auto-resuming call:",A),console.log(" From:",A.fromPage,"→ To:",A.toPage),this.config.onResume&&this.config.onResume(A),A):null}setupSDKEventHandlers(){var A=this;this.sdk.onTranscript=A=>{console.log("📝 [VOICE INTERFACE] onTranscript called with text:",A),this.updateTranscript(A)},this.sdk.onPlaybackStarted=()=>{console.log("🔊 [VOICE INTERFACE] Playback started - updating status to listening"),this.isMobile?this.updateMobileStatus("listening"):this.updateDesktopStatus()},this.sdk.onAgentSpeaking=A=>{var e=this.shadowRoot.getElementById("voiceAvatarActive");e&&(A?(e.classList.add("speaking"),this.isMobile?(this.updateMobileStatus("speaking"),this.startWaveformAnimation()):(this.updateDesktopStatus(),this.startDesktopWaveformAnimation())):(e.classList.remove("speaking"),this.isMobile?(this.updateMobileStatus("listening"),this.startWaveformAnimation()):(this.updateDesktopStatus(),this.startDesktopWaveformAnimation())))},this.sdk.onDisconnected=function(){var e=me(function*(e){console.log("🔌 WebSocket disconnected, hanging up call..."),e&&(1008===e.code&&e.reason&&(e.reason.includes("Domain not whitelisted")||e.reason.includes("domain")||e.reason.includes("whitelist"))||1008===e.code&&e.reason&&e.reason.includes("localhost"))?(console.error("❌ Domain not whitelisted - WebSocket closed:",e.code,e.reason),yield A.endCallOnServerRejection()):A.isActive&&(A.isActive=!1,A.endVoiceCall())});return function(A){return e.apply(this,arguments)}}(),this.sdk.onError=function(){var e=me(function*(e){if(e&&("DOMAIN_NOT_WHITELISTED"===e.message||e.message&&e.message.includes("Domain not whitelisted")))return console.error("❌ Voice SDK Error: Domain not whitelisted:",e),void(yield A.endCallOnServerRejection());e.isServerRejection||"ServerRejected"===e.name||(console.error("❌ Voice SDK Error:",e),A.showError(e.message||e))});return function(A){return e.apply(this,arguments)}}()}setupTextInjectAckHandler(){return this.textHandlers.setupTextInjectAckHandler()}handleTextInjectAck(A){return this.textHandlers.handleTextInjectAck(A)}sendDesktopTextMessage(){return this.textHandlers.sendDesktopTextMessage()}sendMobileTextMessage(){return this.textHandlers.sendMobileTextMessage()}t(A){var e,t,n=this.config.language||"en";return((null===(e=this.config.translations)||void 0===e?void 0:e[n])||(null===(t=this.config.translations)||void 0===t?void 0:t.en)||{})[A]||A}getText(A,e){return void 0!==this.config[A]&&null!==this.config[A]?this.config[A]:this.t(e)}getTooltip(A){var e,t=null===(e=this.config.tooltips)||void 0===e?void 0:e[A];return null!=t?t:{mute:this.t("mute"),speaker:this.t("speaker"),endCall:this.t("endCall")}[A]||""}_updateTimerElements(A,e){var t=this.shadowRoot.getElementById("voiceTimer");t&&(t.textContent=A);var n=this.shadowRoot.getElementById("desktopTimerText"),o=this.shadowRoot.getElementById("compactTimerText");if(n&&(n.textContent=A),o&&(o.textContent=A),!o&&!n&&e<2e3){console.warn("⚠️ Timer elements not found - compactTimerText:",!!o,"desktopTimerText:",!!n,"elapsed:",e);var i=this.shadowRoot.querySelectorAll('[id*="Timer"], [id*="timer"]');console.log("Found timer-like elements:",Array.from(i).map(A=>A.id))}if(this.isMobile){var r=document.getElementById("mobileDurationText"),s=document.getElementById("mobileHeaderDuration");r&&(r.textContent=A),s&&(s.textContent=A)}}generateHTML(){return this.templates.generateHTML()}generateMobileHTML(){return this.templates.generateMobileHTML()}generateCSS(){return this.styles.generateCSS()}setupEventHandlers(A){return this.handlers.setupEventHandlers(A)}setupMobileEventHandlers(){return this.handlers.setupMobileEventHandlers()}adjustSizesForContainer(){return this.desktop.adjustSizesForContainer()}startDesktopWaveformAnimation(){return this.desktop.startDesktopWaveformAnimation()}stopDesktopWaveformAnimation(){return this.desktop.stopDesktopWaveformAnimation()}updateDesktopStatus(){return this.desktop.updateDesktopStatus()}updateLiveWaveform(A){return this.desktop.updateLiveWaveform(A)}showError(A){return this.desktop.showError(A)}showDomainError(){return this.desktop.showDomainError()}startVoiceCall(){var A=this;return me(function*(){if(A.isActive)console.log("⚠️ Voice call already active");else{console.log("🎤 Starting voice call...");var e=yield ee();if(console.log("📋 Current permission state: ".concat(e)),"denied"===e)throw console.log("🚫 Permission is denied, showing blocked modal..."),A.resetConnectingState(),Ae(),se(()=>{console.log("Blocked modal closed")}),new Error("Microphone permission denied");if("prompt"===e||"unknown"===e)return console.log("📋 Permission is in prompt state, showing pre-prompt modal..."),new Promise((e,t)=>{re(me(function*(){console.log("✅ Pre-prompt accepted, proceeding with voice call...");try{yield A.proceedWithVoiceCall(),e()}catch(A){t(A)}}),()=>{console.log("❌ Pre-prompt cancelled"),A.resetConnectingState(),t(new Error("Call cancelled by user"))})});yield A.proceedWithVoiceCall()}})()}proceedWithVoiceCall(){var A=this;return me(function*(){try{if(null!==A._resumeInfo&&void 0!==A._resumeInfo)console.log("🔄 Resume call detected - preserving conversation history");else{console.log("🆕 New call detected - clearing conversation history"),A.transcript.clearConversationMessages(),A.conversationExpanded=!1;var e=A.shadowRoot.getElementById("desktopConversationPanel"),t=A.shadowRoot.getElementById("conversationHeader"),n=A.shadowRoot.getElementById("conversationToggleText"),o=A.shadowRoot.querySelector(".voice-interface"),i=A.shadowRoot.getElementById("desktopVoiceSection"),r=A.shadowRoot.getElementById("compactVoiceSection");e&&(e.classList.remove("expanded"),e.classList.add("collapsed")),t&&t.classList.remove("expanded"),n&&(n.textContent="Show history"),o&&o.classList.remove("expanded"),i&&(i.style.display=""),r&&(r.style.display="none")}if(A.isMobile){var s=A.shadowRoot.getElementById("voiceIdleState");s&&(s.style.display="none");var a=A.shadowRoot.getElementById("text-chat-panel");if(a)a.classList.remove("open"),a.style.display="none",console.log("✅ Widget panel hidden (waiting for permission)");else{var c=document.getElementById("text-chat-panel");c&&(c.classList.remove("open"),c.style.display="none",console.log("✅ Widget panel hidden (waiting for permission, fallback)"))}console.log("📱 Mobile device - requesting mic permission before connecting...");try{var l=A.config.outputSampleRate||44100;(yield navigator.mediaDevices.getUserMedia({audio:{sampleRate:l,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}})).getTracks().forEach(A=>A.stop()),console.log("✅ Mobile: Microphone permission granted - proceeding with connection");var d=A.shadowRoot.getElementById("text-chat-button");if(d)d.style.display="none",console.log("✅ Floating button hidden (permission granted)");else{var u=document.getElementById("text-chat-button");u&&(u.style.display="none",console.log("✅ Floating button hidden (permission granted, fallback)"))}}catch(S){console.error("❌ Mobile: Permission denied before connecting:",S),A.resetConnectingState(),document.getElementById("mobile-voice-call-bar-container")&&A.removeMobileMinimizedBar();var g=A.shadowRoot.getElementById("text-chat-button");if(g)g.style.display="";else{var p=document.getElementById("text-chat-button");p&&(p.style.display="")}var h=A.shadowRoot.getElementById("voiceIdleState");h&&(h.style.display="flex");var B=A.shadowRoot.getElementById("text-chat-panel");if(B)B.style.display="";else{var m=document.getElementById("text-chat-panel");m&&(m.style.display="")}return Ae(),void se(()=>{A.resetUIState()})}}else{A.resetConnectingState();var f=A.shadowRoot.getElementById("voiceIdleState"),v=A.shadowRoot.getElementById("voiceActiveState");f&&(f.style.display="none"),v&&(v.style.display="flex")}var w=A.shadowRoot.getElementById("voiceInterface");setTimeout(()=>A.adjustSizesForContainer(),50),w&&(w.scrollTop=0);var C=A.config.signedUrl||(A.config.agentId&&A.config.appId?"wss://speech.talktopc.com/ws/conv?agentId=".concat(A.config.agentId,"&appId=").concat(A.config.appId):null);if(!C)throw new Error("signedUrl or agentId+appId required for voice calls");if(console.log("🔗 Got signed URL:",C),A.sdk&&A.sdk.isConnected){console.log("🔄 SDK already connected, disconnecting for clean retry...");try{A.sdk.disconnect(),yield new Promise(A=>setTimeout(A,100))}catch(A){console.warn("Warning: Error disconnecting existing connection:",A)}}var y=yield A.sdk.connect(C);console.log("✅ Connected to WebSocket, connected:",y),A.setupTextInjectAckHandler();var b=!1,x=A.sdk.onError,Q=A.sdk.onDisconnected;A.sdk.onError=e=>{e&&("DOMAIN_NOT_WHITELISTED"===e.message||e.message&&e.message.includes("Domain not whitelisted"))&&(b=!0,console.log("🚫 Server rejected connection before starting audio capture")),x&&x.call(A.sdk,e)},A.sdk.onDisconnected=e=>{e&&1008===e.code&&e.reason&&(e.reason.includes("Domain not whitelisted")||e.reason.includes("domain")||e.reason.includes("whitelist"))&&(b=!0,console.log("🚫 Server disconnected due to domain error before starting audio capture")),Q&&Q.call(A.sdk,e)};for(var F=0;F<50;){if(b)throw console.log("🚫 Server rejected connection, aborting audio capture"),new Error("DOMAIN_NOT_WHITELISTED");if(A.sdk.isConnected&&A.sdk.voiceSDK&&A.sdk.voiceSDK.isConnected&&A.sdk.voiceSDK.websocket&&A.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN)break;yield new Promise(A=>setTimeout(A,100)),F++}if(b)throw A.sdk.onError=x,A.sdk.onDisconnected=Q,console.log("🚫 Server rejected connection, aborting audio capture"),new Error("DOMAIN_NOT_WHITELISTED");if(!(A.sdk.isConnected&&A.sdk.voiceSDK&&A.sdk.voiceSDK.isConnected&&A.sdk.voiceSDK.websocket&&A.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN))throw A.sdk.onError=x,A.sdk.onDisconnected=Q,console.warn("⚠️ Connection lost before starting audio capture"),new Error("Connection lost before starting audio capture");if(A.sdk.onError=x,A.sdk.onDisconnected=Q,A.sdk.isConnected&&A.sdk.voiceSDK&&A.sdk.voiceSDK.websocket&&A.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN){console.log("✅ WebSocket ready, starting listening...");try{if(yield A.sdk.startListening(),!(A.sdk.isConnected&&A.sdk.voiceSDK&&A.sdk.voiceSDK.isConnected&&A.sdk.voiceSDK.websocket&&A.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN)){var U;if(null!==(U=A.sdk.voiceSDK)&&void 0!==U&&U.isRecording)try{yield A.sdk.voiceSDK.stopRecording()}catch(A){}var S=new Error("Connection lost - server may have rejected the call");throw S.name="ServerRejected",S.isServerRejection=!0,S}console.log("🎤 Started listening - permission granted"),A.isActive=!0,A.isMobile?(document.getElementById("mobile-voice-call-bar-container")?console.log("📱 Mobile device - bar already exists, updating status"):(console.log("📱 Mobile device - permission granted, creating minimized bar"),A.createMobileMinimizedBar()),0===A.messages.length&&A.messages.push({type:"assistant",text:A.t("transcriptWillAppear")}),A.startWaveformAnimation()):(A.startDesktopWaveformAnimation(),A.desktop.startLiveWaveformInterval())}catch(S){if(S.isServerRejection||"ServerRejected"===S.name)throw A.resetConnectingState(),S;if(console.error("❌ Failed to start listening - permission denied or error:",S),A.resetConnectingState(),A.isMobile){document.getElementById("mobile-voice-call-bar-container")&&A.removeMobileMinimizedBar();var I=A.shadowRoot.getElementById("voiceIdleState");I&&(I.style.display="flex");var E=A.shadowRoot.getElementById("text-chat-panel");if(E)E.style.display="";else{var k=document.getElementById("text-chat-panel");k&&(k.style.display="")}var H=A.shadowRoot.getElementById("text-chat-button");if(H)H.style.display="";else{var T=document.getElementById("text-chat-button");T&&(T.style.display="")}}throw S}A.callStartTime=Date.now(),console.log("⏱️ Starting call timer at",new Date(A.callStartTime).toISOString());var D=()=>{if(A.callStartTime){var e=Date.now()-A.callStartTime,t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3),o="".concat(t.toString().padStart(2,"0"),":").concat(n.toString().padStart(2,"0"));A._updateTimerElements(o,e)}else console.warn("⚠️ Timer update called but callStartTime is not set")};setTimeout(()=>{console.log("⏱️ Starting timer interval"),D(),A.callTimerInterval=setInterval(D,1e3)},100)}else{if(b)throw console.log("🚫 Server rejected connection, aborting audio capture"),new Error("DOMAIN_NOT_WHITELISTED");if(!(A.sdk.isConnected&&A.sdk.voiceSDK&&A.sdk.voiceSDK.isConnected&&A.sdk.voiceSDK.websocket&&A.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN))throw console.warn("⚠️ Connection not valid, aborting audio capture"),new Error("Connection lost before starting audio capture");console.warn("⚠️ Connection not fully ready, but trying to start listening anyway...");try{yield A.sdk.startListening(),console.log("🎤 Started listening - permission granted"),A.isActive=!0,A.isMobile?(document.getElementById("mobile-voice-call-bar-container")?console.log("📱 Mobile device - bar already exists, updating status"):(console.log("📱 Mobile device - permission granted, creating minimized bar"),A.createMobileMinimizedBar()),0===A.messages.length&&A.messages.push({type:"assistant",text:A.t("transcriptWillAppear")}),A.startWaveformAnimation()):(A.startDesktopWaveformAnimation(),A.desktop.startLiveWaveformInterval())}catch(S){if(S.isServerRejection||"ServerRejected"===S.name)throw A.resetConnectingState(),S;if(console.error("❌ Failed to start listening - permission denied or error:",S),A.resetConnectingState(),A.isMobile){document.getElementById("mobile-voice-call-bar-container")&&A.removeMobileMinimizedBar();var K=A.shadowRoot.getElementById("voiceIdleState");K&&(K.style.display="flex");var L=A.shadowRoot.getElementById("text-chat-panel");if(L)L.style.display="";else{var M=document.getElementById("text-chat-panel");M&&(M.style.display="")}var R=A.shadowRoot.getElementById("text-chat-button");if(R)R.style.display="";else{var P=document.getElementById("text-chat-button");P&&(P.style.display="")}}throw S}A.callStartTime=Date.now(),console.log("⏱️ Starting call timer at",new Date(A.callStartTime).toISOString());var O=()=>{if(A.callStartTime){var e=Date.now()-A.callStartTime,t=Math.floor(e/6e4),n=Math.floor(e%6e4/1e3),o="".concat(t.toString().padStart(2,"0"),":").concat(n.toString().padStart(2,"0"));A._updateTimerElements(o,e)}else console.warn("⚠️ Timer update called but callStartTime is not set")};setTimeout(()=>{console.log("⏱️ Starting timer interval"),O(),A.callTimerInterval=setInterval(O,1e3)},100)}console.log("✅ Voice call started successfully")}catch(S){if(S.isServerRejection||"ServerRejected"===S.name||console.error("❌ Error starting voice call:",S),A.resetConnectingState(),A.isActive=!1,A.callTimerInterval&&(clearInterval(A.callTimerInterval),A.callTimerInterval=null),A.sdk&&A.sdk.isConnected)try{A.sdk.disconnect()}catch(A){console.warn("Error disconnecting SDK on error:",A)}"NotAllowedError"===S.name||"PermissionDeniedError"===S.name?(Ae(),se(()=>{A.resetUIState()})):"NotFoundError"===S.name||"DevicesNotFoundError"===S.name?ae(()=>{A.resetUIState()}):S&&("DOMAIN_NOT_WHITELISTED"===S.message||S.message&&S.message.includes("Domain not whitelisted"))?yield A.endCallOnServerRejection():(A.showError(S.message||S),A.resetUIState())}})()}resetUIState(){if(this.resetConnectingState(),this.isMobile){this.removeMobileMinimizedBar(),this.stopWaveformAnimation(),this.messages=[];var A=this.shadowRoot.getElementById("text-chat-panel");if(A)A.style.display="";else{var e=document.getElementById("text-chat-panel");e&&(e.style.display="")}}var t=this.shadowRoot.getElementById("voiceIdleState"),n=this.shadowRoot.getElementById("voiceActiveState");t&&(t.style.display="flex"),n&&(n.style.display="none")}endCallOnServerRejection(){var A=this;return me(function*(){console.log("🚫 Server rejected call - ending call and stopping audio capture/VAD..."),console.log("🚫 Calling endCallOnServerRejection() - will show domain error message");var e=A.shadowRoot.getElementById("voiceInterface"),t=A.shadowRoot.getElementById("landingScreen");if(e&&(e.classList.add("active"),console.log("✅ Made voice interface visible")),t&&(t.classList.remove("active"),console.log("✅ Hid landing screen")),A.config.onShowVoice&&"function"==typeof A.config.onShowVoice&&(console.log("🚫 Calling onShowVoice callback to ensure voice interface is visible..."),A.config.onShowVoice()),A.sdk){try{var n,o,i=null===(n=A.sdk.voiceSDK)||void 0===n?void 0:n.audioRecorder;if(A.sdk.isListening||(null===(o=A.sdk.voiceSDK)||void 0===o?void 0:o.isRecording)||i&&i.isRecording||i&&null!==i.audioWorkletNode||i){if(console.log("🛑 Stopping audio capture/VAD..."),null!=i&&i.audioWorkletNode){console.log("🛑 Sending stop message to AudioWorklet to stop VAD...");try{i.audioWorkletNode.port.postMessage({type:"stop"}),yield new Promise(A=>setTimeout(A,150))}catch(A){console.warn("Error sending stop message to AudioWorklet:",A)}}if(A.sdk.voiceSDK&&"function"==typeof A.sdk.voiceSDK.stopRecording)try{yield A.sdk.voiceSDK.stopRecording(),console.log("✅ stopRecording() completed")}catch(A){console.warn("Error calling stopRecording:",A)}else if(A.sdk.stopListening)try{A.sdk.stopListening(),yield new Promise(A=>setTimeout(A,200))}catch(A){console.warn("Error calling stopListening:",A)}if(i&&"function"==typeof i.stop)try{yield i.stop(),console.log("✅ AudioRecorder.stop() completed")}catch(A){console.warn("Error calling AudioRecorder.stop():",A)}console.log("✅ Audio capture/VAD stopped")}null!=i&&i.mediaStream&&(console.log("🛑 Force stopping media stream tracks (backup cleanup)..."),i.mediaStream.getTracks().forEach(A=>{"ended"!==A.readyState&&(A.stop(),console.log("✅ Force stopped track:",A.kind))})),A.audioStream&&(console.log("🛑 Stopping stored audio stream..."),A.audioStream.getTracks().forEach(A=>{"ended"!==A.readyState&&A.stop()}),A.audioStream=null),A.sdk.hangup()}catch(e){console.warn("Error stopping listening on server rejection:",e);try{var r;null!==(r=A.sdk.voiceSDK)&&void 0!==r&&null!==(r=r.audioRecorder)&&void 0!==r&&r.mediaStream&&A.sdk.voiceSDK.audioRecorder.mediaStream.getTracks().forEach(A=>A.stop()),A.audioStream&&(A.audioStream.getTracks().forEach(A=>A.stop()),A.audioStream=null)}catch(A){console.warn("Error force-stopping media streams:",A)}}if(A.sdk.isConnected)try{A.sdk.disconnect()}catch(A){console.warn("Error disconnecting SDK on server rejection:",A)}}A.isActive=!1,A.config.onCallEnd&&A.config.onCallEnd,A.callTimerInterval&&(clearInterval(A.callTimerInterval),A.callTimerInterval=null);var s=A.shadowRoot.getElementById("voiceActiveState"),a=A.shadowRoot.getElementById("voiceIdleState");if(s&&(s.style.display="none"),a&&(a.style.display="flex",A.isShowingDomainError=!0,console.log("🚫 Setting isShowingDomainError flag to true"),console.log("🚫 Calling showDomainError() to display domain error in widget..."),A.showDomainError(),console.log("🚫 showDomainError() completed, isShowingDomainError:",A.isShowingDomainError)),A.isMobile){var c=A.shadowRoot.getElementById("text-chat-panel");if(c)c.style.display="";else{var l=document.getElementById("text-chat-panel");l&&(l.style.display="")}var d=A.shadowRoot.getElementById("text-chat-button");if(d)d.style.display="";else{var u=document.getElementById("text-chat-button");u&&(u.style.display="")}A.removeMobileMinimizedBar(),A.stopWaveformAnimation()}})()}endVoiceCall(){var A;if(console.log("🔴 Ending voice call..."),this._resumeInfo=null,this.sdk&&this.isActive&&(this.sdk.stopListening(),this.sdk.hangup(),this.isActive=!1),this.audioStream&&(this.audioStream.getTracks().forEach(A=>A.stop()),this.audioStream=null),this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null),this._textInjectTimeout&&(clearTimeout(this._textInjectTimeout),this._textInjectTimeout=null),this._statusClearTimeout&&(clearTimeout(this._statusClearTimeout),this._statusClearTimeout=null),this._mobileTextInjectTimeout&&(clearTimeout(this._mobileTextInjectTimeout),this._mobileTextInjectTimeout=null),this._mobileStatusClearTimeout&&(clearTimeout(this._mobileStatusClearTimeout),this._mobileStatusClearTimeout=null),null!==(A=this.sdk)&&void 0!==A&&A.voiceSDK&&this.textHandlers._textInjectAckHandler&&(this.sdk.voiceSDK.off("textInjectAck",this.textHandlers._textInjectAckHandler),this.textHandlers._textInjectAckHandler=null),this._originalHintText=null,this._originalMobileHintText=null,this.isMobile||(this.stopDesktopWaveformAnimation(),this.desktop.stopLiveWaveformInterval(),this.transcript.clearConversationMessages(),this.conversationExpanded=!1),this.isMobile){this.stopWaveformAnimation(),this.collapseMobileTranscript(),this.removeMobileMinimizedBar(),this.messages=[];var e=this.shadowRoot.getElementById("text-chat-panel");if(e)e.style.display="";else{var t=document.getElementById("text-chat-panel");t&&(t.style.display="")}}var n=this.shadowRoot.getElementById("text-chat-button");if(n)n.style.display="",console.log("✅ Floating button restored (call ended)");else{var o=document.getElementById("text-chat-button");o&&(o.style.display="",console.log("✅ Floating button restored (call ended, fallback)"))}var i=this.shadowRoot.getElementById("voiceActiveState");if(i&&(i.style.display="none"),"function"==typeof this.config.onVoiceCallButtonClick)try{this.config.onVoiceCallButtonClick({timestamp:Date.now(),widgetState:"end"})}catch(A){console.error("Error in onVoiceCallButtonClick callback:",A)}if(this.config.onCallEnd)this.config.onCallEnd();else{var r=this.shadowRoot.getElementById("voiceIdleState");r&&(r.style.display="flex"),setTimeout(()=>this.adjustSizesForContainer(),50)}var s=this.shadowRoot.getElementById("transcriptText");if(s&&(s.textContent=this.t("transcriptWillAppear"),s.classList.add("empty")),this.isMobile){var a=document.getElementById("mobileTranscriptText");a&&(a.textContent=this.t("transcriptWillAppear"))}var c=this.shadowRoot.getElementById("voiceAvatarActive");c&&c.classList.remove("speaking"),console.log("✅ Voice call ended")}showConnectingState(){var A=this.shadowRoot.getElementById("voiceIdleState"),e=this.shadowRoot.getElementById("voiceActiveState");if(A){var t=A.querySelector(".voice-status-title"),n=A.querySelector(".voice-status-subtitle"),o=A.querySelector("#startCallBtn");if(t&&(t.textContent=this.t("connecting")),n&&(n.textContent=this.t("connectingSubtitle")),o){o.disabled=!0,o.style.opacity="0.6",o.style.cursor="not-allowed";var i=o.querySelector("span");if(i){var r=document.createElement("span");r.className="connecting-spinner",i.textContent="",i.appendChild(r),i.appendChild(document.createTextNode(" "+this.t("connecting")))}}A.style.display="flex"}e&&(e.style.display="none")}resetConnectingState(){if(this.isShowingDomainError)console.log("🚫 resetConnectingState() called but domain error is displayed - skipping reset");else{var A=this.shadowRoot.getElementById("voiceIdleState");if(A){var e=A.querySelector("#domainErrorBackBtn");e&&e.parentNode&&e.parentNode.removeChild(e);var t=A.querySelector(".voice-status-title"),n=A.querySelector(".voice-status-subtitle"),o=A.querySelector("#startCallBtn");if(t&&(t.textContent=this.getText("startCallTitle","clickToStartCall"),t.style.color="",t.style.fontSize="",t.style.fontWeight="",t.style.marginLeft="",t.style.marginRight="",t.style.textAlign=""),n&&(n.textContent=this.getText("startCallSubtitle","realTimeVoice"),n.style.color="",n.style.fontSize="",n.style.marginLeft="",n.style.marginRight="",n.style.marginTop="",n.style.textAlign="",n.style.lineHeight=""),o){o.disabled=!1,o.style.opacity="",o.style.cursor="",o.style.display="";var i=o.querySelector("span");i&&(i.textContent=this.getText("startCallButtonText","startCall"))}}}}updateTranscript(A){return this.transcript.updateTranscript(A)}toggleConversationPanel(){return this.transcript.toggleConversationPanel()}addConversationMessage(A,e){return this.transcript.addConversationMessage(A,e)}renderConversationMessages(){return this.transcript.renderConversationMessages()}escapeHtml(A){var e=document.createElement("div");return e.textContent=A,e.innerHTML}toggleMute(){if(this.sdk&&this.isActive){var A=null;if(this.sdk.voiceSDK&&this.sdk.voiceSDK.audioRecorder&&this.sdk.voiceSDK.audioRecorder.mediaStream&&(A=this.sdk.voiceSDK.audioRecorder.mediaStream.getAudioTracks()[0]),!A&&this.audioStream&&(A=this.audioStream.getAudioTracks()[0]),A){A.enabled=!A.enabled,this.isMicMuted=!A.enabled;var e=this.shadowRoot.getElementById("desktopMuteBtn"),t=this.shadowRoot.getElementById("desktopMuteBtnCompact");if(this.isMobile||this.updateDesktopStatus(),e){var n=e.querySelector(".desktop-mic-icon"),o=e.querySelector(".desktop-mic-off-icon");n&&o&&(A.enabled?(e.classList.remove("muted"),n.style.display="block",o.style.display="none"):(e.classList.add("muted"),n.style.display="none",o.style.display="block"))}if(t){var i=t.querySelector(".desktop-mic-icon"),r=t.querySelector(".desktop-mic-off-icon");i&&r&&(A.enabled?(t.classList.remove("muted"),i.style.display="block",r.style.display="none"):(t.classList.add("muted"),i.style.display="none",r.style.display="block"))}if(this.isMobile){var s=document.getElementById("mobileMuteBtn"),a=null==s?void 0:s.querySelector(".mobile-mic-icon"),c=null==s?void 0:s.querySelector(".mobile-mic-off-icon");s&&a&&c&&(A.enabled?(s.classList.remove("muted"),a.style.cssText="display: block !important; visibility: visible !important; opacity: 1 !important; width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important;",c.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;"):(s.classList.add("muted"),a.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;",c.style.cssText="display: block !important; visibility: visible !important; opacity: 1 !important; width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important;"))}console.log(A.enabled?"🔊 Unmuted":"🔇 Muted")}else console.warn("⚠️ No audio track available for mute toggle")}}toggleSpeaker(){if(this.sdk&&this.isActive){if(this.isSpeakerMuted=!this.isSpeakerMuted,this.sdk.voiceSDK&&this.sdk.voiceSDK.audioPlayer?(this.sdk.voiceSDK.audioPlayer.setMuted(this.isSpeakerMuted),console.log("🔊 Speaker toggle:",this.isSpeakerMuted?"muted":"unmuted")):console.warn("⚠️ Cannot toggle speaker - audioPlayer not available"),!this.isMobile){var A=this.shadowRoot.getElementById("desktopSpeakerBtn"),e=this.shadowRoot.getElementById("desktopSpeakerBtnCompact");if(A){var t=A.querySelector(".desktop-speaker-icon"),n=A.querySelector(".desktop-speaker-off-icon");t&&n&&(this.isSpeakerMuted?(A.classList.add("muted"),t.style.display="none",n.style.display="block"):(A.classList.remove("muted"),t.style.display="block",n.style.display="none"))}if(e){var o=e.querySelector(".desktop-speaker-icon"),i=e.querySelector(".desktop-speaker-off-icon");o&&i&&(this.isSpeakerMuted?(e.classList.add("muted"),o.style.display="none",i.style.display="block"):(e.classList.remove("muted"),o.style.display="block",i.style.display="none"))}}if(this.isMobile){var r=document.getElementById("mobileSpeakerBtn"),s=null==r?void 0:r.querySelector(".mobile-speaker-icon"),a=null==r?void 0:r.querySelector(".mobile-speaker-off-icon");r&&s&&a&&(this.isSpeakerMuted?(r.classList.add("muted"),s.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;",a.style.cssText="display: block !important; visibility: visible !important; opacity: 1 !important; width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important;"):(r.classList.remove("muted"),s.style.cssText="display: block !important; visibility: visible !important; opacity: 1 !important; width: 15px !important; height: 15px !important; margin: 0 !important; padding: 0 !important;",a.style.cssText="display: none !important; visibility: hidden !important; opacity: 0 !important;"))}}}updateMobileStatus(A){return this.mobile.updateMobileStatus(A)}createMobileMinimizedBar(){return this.mobile.createMobileMinimizedBar()}removeMobileMinimizedBar(){return this.mobile.removeMobileMinimizedBar()}expandMobileTranscript(){return this.mobile.expandMobileTranscript()}collapseMobileTranscript(){return this.mobile.collapseMobileTranscript()}addMobileMessage(A,e){return this.mobile.addMobileMessage(A,e)}startWaveformAnimation(){return this.mobile.startWaveformAnimation()}stopWaveformAnimation(){return this.mobile.stopWaveformAnimation()}destroy(){this.isActive&&this.endVoiceCall(),this.audioStream&&(this.audioStream.getTracks().forEach(A=>A.stop()),this.audioStream=null),this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null),this.sdk&&(this.sdk.disconnect(),this.sdk=null)}}function ve(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function we(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){ve(i,n,o,r,s,"next",A)}function s(A){ve(i,n,o,r,s,"throw",A)}r(void 0)})}}class Ce{constructor(A,e){this.config=A,this.sdk=e,this.streamingEl=null,this.hasStartedStreaming=!1,this.isActive=!1,this.shadowRoot=A.shadowRoot||document,this.eventHandlers={autoResize:null,keydown:null},this.eventHandlersSetup=!1}t(A){var e,t,n=this.config.language||"en";return((null===(e=this.config.translations)||void 0===e?void 0:e[n])||(null===(t=this.config.translations)||void 0===t?void 0:t.en)||{})[A]||A}generateHTML(){var A,e,t,n,o,i,r,s,a,c=this.config.inputPlaceholder||(null===(A=this.config.panel)||void 0===A?void 0:A.inputPlaceholder)||this.t("typeMessage")||"Type your message...";return'<div class="text-interface" id="textInterface">\n <div class="messages-container" id="messagesContainer">\n <div class="empty-state">\n <div class="empty-state-icon">💬</div>\n <div class="empty-state-title">'.concat(this.t("hello"),'</div>\n <div class="empty-state-text">').concat(this.t("sendMessage"),'</div>\n </div>\n </div>\n <div class="input-container">\n <div class="input-wrapper" style="flex:1;">\n <textarea class="message-input" id="messageInput" placeholder="').concat(c,'" rows="1" dir="').concat(this.config.direction||"ltr",'"></textarea>\n </div>\n <button class="send-button" id="sendButton" aria-label="').concat(this.t("sendMessageAria"),'">').concat(this.config.sendButtonText||"➤","</button>\n ").concat(null!==(e=this.config.sendButtonHint)&&void 0!==e&&e.text||null!==(t=this.config.panel)&&void 0!==t&&null!==(t=t.sendButtonHint)&&void 0!==t&&t.text?'\n <div class="send-button-hint" style="color: '.concat((null===(n=this.config.sendButtonHint)||void 0===n?void 0:n.color)||(null===(o=this.config.panel)||void 0===o||null===(o=o.sendButtonHint)||void 0===o?void 0:o.color)||"#6B7280","; font-size: ").concat((null===(i=this.config.sendButtonHint)||void 0===i?void 0:i.fontSize)||(null===(r=this.config.panel)||void 0===r||null===(r=r.sendButtonHint)||void 0===r?void 0:r.fontSize)||"12px",'; text-align: center; margin-top: 4px;">\n ').concat((null===(s=this.config.sendButtonHint)||void 0===s?void 0:s.text)||(null===(a=this.config.panel)||void 0===a||null===(a=a.sendButtonHint)||void 0===a?void 0:a.text),"\n </div>\n "):"","\n </div>\n </div>")}generateCSS(){var A,e,t,n,o,i,r,s,a,c,l,d,u,g=this.config.messages,p=(this.config.panel,this.config.animation,this.config.sendButtonColor||(null===(A=this.config.panel)||void 0===A?void 0:A.sendButtonColor)||"#7C3AED"),h=this.config.sendButtonHoverColor||(null===(e=this.config.panel)||void 0===e?void 0:e.sendButtonHoverColor)||"#6D28D9",B=this.config.sendButtonTextColor||(null===(t=this.config.panel)||void 0===t?void 0:t.sendButtonTextColor)||"#FFFFFF",m=(this.config.inputPlaceholder||null===(n=this.config.panel)||void 0===n||n.inputPlaceholder,this.config.inputBorderColor||(null===(o=this.config.panel)||void 0===o?void 0:o.inputBorderColor)||"#E5E7EB"),f=this.config.inputFocusColor||(null===(i=this.config.panel)||void 0===i?void 0:i.inputFocusColor)||"#7C3AED",v=this.config.inputBackgroundColor||(null===(r=this.config.panel)||void 0===r?void 0:r.inputBackgroundColor)||"#FFFFFF",w=this.config.inputTextColor||(null===(s=this.config.panel)||void 0===s?void 0:s.inputTextColor)||"#1F2937",C=this.config.inputFontSize||(null===(a=this.config.panel)||void 0===a?void 0:a.inputFontSize)||"14px",y=this.config.inputBorderRadius||(null===(c=this.config.panel)||void 0===c?void 0:c.inputBorderRadius)||20,b=this.config.inputPadding||(null===(l=this.config.panel)||void 0===l?void 0:l.inputPadding)||"6px 14px",x=!1===this.config.useShadowDOM?" !important":"";return"\n /* Messages container using new classes */\n #messagesContainer { \n flex: 1; \n overflow-y: auto; \n overflow-x: hidden; \n padding: 20px; \n background: #f8fafc; \n display: flex; \n flex-direction: column; \n gap: 16px; \n min-height: 0; \n }\n .empty-state { \n flex: 1; \n display: flex; \n flex-direction: column; \n align-items: center; \n justify-content: center; \n gap: 12px; \n color: #64748b; \n text-align: center; \n padding: 20px; \n }\n .empty-state-icon { font-size: 48px; opacity: 0.3; }\n .empty-state-title { font-size: 20px; font-weight: 700; color: #334155; }\n .empty-state-text { font-size: 13px; max-width: 280px; }\n\n .text-interface { \n display: none".concat(x,"; \n flex: 1; \n flex-direction: column; \n min-height: 0; \n overflow: hidden; \n }\n .text-interface.active { display: flex").concat(x,"; }\n \n .message { \n display: flex; \n gap: 8px; \n padding: 4px 0; \n max-width: 100%; \n align-items: center; \n }\n .message.edge-left { flex-direction: row; }\n .message.edge-right { flex-direction: row-reverse; }\n .message-bubble { \n padding: 12px; \n border-radius: ").concat(g.borderRadius,"px").concat(x,"; \n max-width: 80%; \n font-size: ").concat(g.fontSize,"; \n word-wrap: break-word; \n text-align: ").concat("rtl"===this.config.direction?"right":"left","; \n direction: ").concat(this.config.direction||"ltr",";\n }\n .message.user .message-bubble { \n background: ").concat(g.userBackgroundColor).concat(x,"; \n color: ").concat(g.userTextColor||g.textColor).concat(x,"; \n }\n .message.agent .message-bubble { \n background: ").concat(g.agentBackgroundColor).concat(x,"; \n color: ").concat(g.agentTextColor||g.textColor).concat(x,"; \n }\n .message.user { \n align-self: ").concat("rtl"===this.config.direction?"flex-start":"flex-end","; \n }\n .message.agent { \n align-self: ").concat("rtl"===this.config.direction?"flex-end":"flex-start","; \n }\n .message .message-bubble { \n text-align: ").concat("rtl"===this.config.direction?"right":"left"," !important; \n }\n ").concat("rtl"===this.config.direction?"\n .message-bubble {\n text-align: right !important;\n }\n ":"","\n .message-avatar { \n width: 20px; \n height: 20px; \n display: flex; \n align-items: center; \n justify-content: center; \n flex-shrink: 0; \n color: inherit; \n font-size: 18px; \n line-height: 1; \n background: transparent; \n border: none; \n }\n .message-avatar.user { background: transparent; }\n .message-avatar.agent { background: transparent; }\n \n .message.system {\n background: ").concat(g.systemBackgroundColor,";\n align-self: flex-start;\n }\n .message.error {\n background: ").concat(g.errorBackgroundColor,";\n align-self: flex-start;\n }\n \n .input-container {\n display: flex;\n gap: 8px;\n padding: 12px 16px;\n background: #FFFFFF;\n border-top: 1px solid #E5E7EB;\n align-items: center;\n flex-shrink: 0;\n flex-direction: ").concat("rtl"===this.config.direction?"row-reverse":"row",";\n }\n \n .input-wrapper {\n position: relative;\n display: flex;\n align-items: center;\n }\n \n .message-input {\n width: 100%;\n min-height: 32px;\n max-height: 120px;\n padding: ").concat(b,";\n border: 1px solid ").concat(m,";\n border-radius: ").concat(y,"px;\n font-size: ").concat(C,";\n font-family: inherit;\n line-height: 1.3;\n resize: none;\n overflow-y: auto;\n background: ").concat(v,";\n color: ").concat(w,";\n vertical-align: top;\n margin: 0;\n display: block;\n white-space: pre-wrap;\n word-wrap: break-word;\n text-align: ").concat("rtl"===this.config.direction?"right":"left",";\n direction: ").concat(this.config.direction||"ltr",";\n -webkit-appearance: none;\n appearance: none;\n box-sizing: border-box;\n }\n \n .message-input:focus {\n outline: none;\n border-color: ").concat(f,";\n background: ").concat("#FFFFFF"===v?"#FFFFFF":v,";\n box-shadow: 0 0 0 3px ").concat(f,"33;\n }\n \n .message-input::placeholder {\n color: #9CA3AF;\n text-align: ").concat("rtl"===this.config.direction?"right":"left",";\n }\n \n .send-button {\n width: 40px;\n height: 40px;\n border-radius: 50%;\n border: none;\n background: ").concat(p,";\n color: ").concat(B,";\n font-size: ").concat(this.config.sendButtonFontSize||(null===(d=this.config.panel)||void 0===d?void 0:d.sendButtonFontSize)||"18px",";\n font-weight: ").concat(this.config.sendButtonFontWeight||(null===(u=this.config.panel)||void 0===u?void 0:u.sendButtonFontWeight)||"500",";\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n transition: all 0.2s ease;\n box-shadow: 0 4px 12px rgba(124, 60, 237, 0.3);\n }\n \n .send-button:hover:not(:disabled) {\n background: ").concat(h,";\n transform: scale(1.05);\n box-shadow: 0 6px 16px rgba(124, 60, 237, 0.4);\n }\n \n .send-button-hint {\n width: 100%;\n text-align: center;\n margin-top: 4px;\n }\n \n .send-button:disabled {\n opacity: 0.5;\n cursor: not-allowed;\n }\n \n .typing-indicator {\n display: inline-flex;\n gap: 4px;\n align-items: center;\n }\n \n .typing-dot {\n width: 6px;\n height: 6px;\n border-radius: 50%;\n background: #64748b;\n animation: typingDot 1.4s ease-in-out infinite;\n }\n \n .typing-dot:nth-child(2) { animation-delay: 0.2s; }\n .typing-dot:nth-child(3) { animation-delay: 0.4s; }\n \n @keyframes typingDot {\n 0%, 60%, 100% { transform: translateY(0); opacity: 0.7; }\n 30% { transform: translateY(-8px); opacity: 1; }\n }\n \n .error-message {\n padding: 12px;\n background: ").concat(g.errorBackgroundColor,";\n border-radius: ").concat(g.borderRadius,"px;\n color: #991B1B;\n font-size: ").concat(g.fontSize,";\n margin: 8px 0;\n }\n \n @media (max-width: 768px) {\n #messagesContainer {\n padding: 12px;\n gap: 12px;\n }\n \n .message-bubble {\n max-width: 85%;\n font-size: 14px;\n padding: 10px;\n }\n \n .text-input-container {\n padding: 10px;\n gap: 8px;\n }\n \n #text-chat-input {\n font-size: 16px !important; /* Prevents iOS zoom on focus */\n padding: 10px 14px;\n min-height: 44px;\n }\n \n #text-chat-send {\n min-width: 56px;\n min-height: 44px;\n width: 56px;\n height: 44px;\n }\n \n .empty-state-icon {\n font-size: 40px;\n }\n \n .empty-state-title {\n font-size: 18px;\n }\n \n .empty-state-text {\n font-size: 12px;\n }\n }\n \n @media (max-width: 480px) {\n #messagesContainer {\n padding: 10px;\n gap: 10px;\n }\n \n .message-bubble {\n max-width: 90%;\n font-size: 13px;\n padding: 8px;\n }\n \n .text-input-container {\n padding: 8px;\n }\n \n #text-chat-input {\n font-size: 16px !important;\n padding: 8px 12px;\n }\n }\n ")}setupEventHandlers(){var A=this.shadowRoot.getElementById("sendButton"),e=this.shadowRoot.getElementById("messageInput"),t=this.shadowRoot.getElementById("newChatBtn");if(A&&(A.onclick=()=>this.sendMessage()),t&&(t.onclick=()=>this.startNewChat()),this.updateInputAttributes(),e){e.style.height="32px",e.style.overflow="hidden";var n=()=>{e.style.height="auto";var A=Math.min(e.scrollHeight,120);e.style.height=A+"px",e.style.overflowY=A>=120?"auto":"hidden",A>=120&&setTimeout(()=>{e.scrollTop=e.scrollHeight},0)};e.addEventListener("input",n),e.addEventListener("keydown",A=>{"Enter"!==A.key||A.shiftKey?"Enter"===A.key&&A.shiftKey&&setTimeout(n,0):(A.preventDefault(),this.sendMessage())})}}startNewChat(){try{localStorage.removeItem("ttp_text_chat_conversation_id")}catch(A){}this.sdk&&(this.sdk.config.conversationId=null);var A=this.shadowRoot.getElementById("messagesContainer");A&&(A.innerHTML='\n <div class="empty-state">\n <div class="empty-state-icon">💬</div>\n <div class="empty-state-title">'.concat(this.t("hello"),'</div>\n <div class="empty-state-text">').concat(this.t("sendMessage"),"</div>\n </div>"));var e=this.shadowRoot.getElementById("messageInput");e&&e.focus()}updateInputAttributes(){var A=this.shadowRoot.getElementById("messageInput");if(A){var e,t=this.config.inputPlaceholder||(null===(e=this.config.panel)||void 0===e?void 0:e.inputPlaceholder)||this.t("typeMessage")||"Type your message...";A.placeholder=t,A.dir=this.config.direction||"ltr",A.style.textAlign="rtl"===this.config.direction?"right":"left"}}show(){var A=this.shadowRoot.getElementById("textInterface");A&&A.classList.add("active"),setTimeout(()=>{var A=this.shadowRoot.getElementById("messageInput");A&&A.focus()},50)}hide(){var A=this.shadowRoot.getElementById("textInterface");A&&A.classList.remove("active")}startChat(){var A=this;return we(function*(){A.isActive=!0,A.updateSendButtonState()})()}sendMessage(){var A=this;return we(function*(){var e=A.shadowRoot.getElementById("messageInput"),t=e.value.trim();if(t){A.isActive||(yield A.startChat()),A.addMessage("user",t),e.value="",e.style.height="32px",e.style.overflow="hidden";try{A.beginStreaming(),yield A.sdk.sendMessage(t)}catch(e){console.error("❌ Failed to send message:",e),e&&("DOMAIN_NOT_WHITELISTED"===e.message||e.message&&e.message.includes("Domain not whitelisted"))||A.showError(e),A.stopStreamingState()}}})()}updateSendButtonState(){var A=this.shadowRoot.getElementById("sendButton");A&&(A.disabled=!this.isActive)}addMessage(A,e){var t,n,o=this.shadowRoot.getElementById("messagesContainer");if(o){var i=o.querySelector(".empty-state");i&&i.remove();var r=document.createElement("div"),s="rtl"===this.config.direction?"user"===A?"edge-left":"edge-right":"user"===A?"edge-right":"edge-left";r.className="message ".concat(A," ").concat(s);var a=document.createElement("div");a.className="message-avatar ".concat(A);var c="user"===A?(null===(t=this.config.messages)||void 0===t?void 0:t.userAvatarIcon)||"👤":(null===(n=this.config.messages)||void 0===n?void 0:n.agentAvatarIcon)||"🤖";a.textContent=c;var l=document.createElement("div");l.className="message-bubble",l.textContent=e,r.appendChild(a),r.appendChild(l),o.appendChild(r),o.scrollTop=o.scrollHeight}}beginStreaming(){var A,e=this.shadowRoot.getElementById("messagesContainer");if(e){this.stopStreamingState();var t=document.createElement("div"),n="rtl"===this.config.direction?"edge-right":"edge-left";t.className="message agent ".concat(n),t.id="agent-streaming";var o=document.createElement("div");o.className="message-avatar agent",o.textContent=(null===(A=this.config.messages)||void 0===A?void 0:A.agentAvatarIcon)||"🤖";var i=document.createElement("div");i.className="message-bubble",i.innerHTML='<span class="typing-indicator"><span class="typing-dot"></span><span class="typing-dot"></span><span class="typing-dot"></span></span>',t.appendChild(o),t.appendChild(i),e.appendChild(t),this.streamingEl=i,this.hasStartedStreaming=!1,e.scrollTop=e.scrollHeight}}appendStreamingChunk(A){if(this.streamingEl){this.hasStartedStreaming||(this.streamingEl.textContent="",this.hasStartedStreaming=!0),this.streamingEl.textContent+=A;var e=this.shadowRoot.getElementById("messagesContainer");e&&(e.scrollTop=e.scrollHeight)}}finalizeStreaming(A){if(this.streamingEl){this.streamingEl.textContent=A||this.streamingEl.textContent;var e=this.shadowRoot.getElementById("agent-streaming");e&&(e.id=""),this.streamingEl=null}this.updateSendButtonState()}stopStreamingState(){var A=this.shadowRoot.getElementById("agent-streaming");A&&A.remove(),this.streamingEl=null,this.hasStartedStreaming=!1}showError(A){var e=this.shadowRoot.getElementById("messagesContainer");if(e){if(A&&("DOMAIN_NOT_WHITELISTED"===A.message||"string"==typeof A&&A.includes("DOMAIN_NOT_WHITELISTED")||A.message&&A.message.includes("Domain not whitelisted")||"string"==typeof A&&A.includes("Domain not whitelisted"))){var t,n=document.createElement("div");n.className="error-message",n.style.cssText="padding: 16px; margin: 12px; border-radius: 8px; background: "+((null===(t=this.config.messages)||void 0===t?void 0:t.errorBackgroundColor)||"#FEE2E2")+";";var o=document.createElement("div");o.style.cssText="font-weight: 600; font-size: 16px; margin-bottom: 8px; color: #991B1B;",o.textContent=this.t("domainNotValidated");var i=document.createElement("div");i.style.cssText="font-size: 14px; color: #991B1B; line-height: 1.5;",i.textContent=this.t("domainErrorMessage"),n.appendChild(o),n.appendChild(i),e.appendChild(n)}else{var r=document.createElement("div");r.className="error-message",r.textContent="string"==typeof A?A:(null==A?void 0:A.message)||A,e.appendChild(r)}e.scrollTop=e.scrollHeight}}setActive(A){this.isActive=A,this.updateSendButtonState()}}class ye{constructor(A){this.config=A,this.translations=A.translations||{},this.shadowRoot=A.shadowRoot}t(A){var e=this.config.language||"en";return(this.translations[e]||this.translations.en||{})[A]||A}generateHTML(){var A,e=this.config.landing||{};return A="image"===e.logoType&&e.logoImageUrl?'<img src="'.concat(e.logoImageUrl,'" alt="Logo" style="max-width: 44px; max-height: 44px; object-fit: contain; border: none; outline: none;">'):'<span class="landing-avatar-emoji">'.concat(e.logoIcon||e.logo||"🤖","</span>"),'\n <div class="landing-screen" id="landingScreen">\n \x3c!-- Avatar --\x3e\n <div class="landing-avatar">\n '.concat(A,'\n </div>\n\n \x3c!-- Title --\x3e\n <h2 class="landing-title">').concat(e.title||this.t("landingTitle"),'</h2>\n <p class="landing-subtitle">').concat(e.subtitle||this.t("landingSubtitle")||"Choose your preferred method",'</p>\n\n \x3c!-- Mode Selection - Side by Side --\x3e\n <div class="mode-selection">\n \x3c!-- Voice Call Option --\x3e\n <button class="mode-card" id="mode-card-voice">\n <div class="mode-card-icon">\n <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M12 1a3 3 0 0 0-3 3v8a3 3 0 0 0 6 0V4a3 3 0 0 0-3-3z"/>\n <path d="M19 10v2a7 7 0 0 1-14 0v-2"/>\n <line x1="12" y1="19" x2="12" y2="23"/>\n <line x1="8" y1="23" x2="16" y2="23"/>\n </svg>\n </div>\n <span class="mode-card-title">').concat(e.voiceCardTitle||this.t("voiceCall"),'</span>\n </button>\n\n \x3c!-- Text Chat Option --\x3e\n <button class="mode-card" id="mode-card-text">\n <div class="mode-card-icon">\n <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <path d="M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z"/>\n </svg>\n </div>\n <span class="mode-card-title">').concat(e.textCardTitle||this.t("textChat"),"</span>\n </button>\n </div>\n </div>\n ")}generateCSS(){var A=this.config.landing||{},e=(this.config.animation,!1===this.config.useShadowDOM?" !important":"");return"\n /* ===== LANDING SCREEN - New Design ===== */\n .landing-screen { \n display: none".concat(e,"; \n flex: 1; \n padding: 32px 24px; \n background: ").concat(A.backgroundColor||"linear-gradient(180deg, #ffffff 0%, rgba(168, 85, 247, 0.03) 100%)","; \n align-items: center; \n justify-content: flex-start; \n flex-direction: column; \n gap: 0; \n overflow-y: auto; \n min-height: 0;\n text-align: center;\n }\n \n .landing-screen.active { \n display: flex").concat(e,"; \n }\n\n /* Avatar - Richer purple gradient */\n .landing-avatar {\n width: 88px;\n height: 88px;\n border-radius: 22px;\n margin-bottom: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n ").concat((()=>{if("image"===A.logoType){if(!1!==A.logoBackgroundEnabled){var e=A.logoBackgroundColor||A.avatarBackground||"linear-gradient(135deg, #667eea 0%, #764ba2 100%)";return"background: ".concat(e,"; box-shadow: 0 8px 28px rgba(102, 126, 234, 0.35); border: none;")}return"background: transparent; box-shadow: none; border: none; outline: none;"}var t=A.avatarBackground||"linear-gradient(135deg, #667eea 0%, #764ba2 100%)";return"background: ".concat(t,"; box-shadow: 0 8px 28px rgba(102, 126, 234, 0.35); border: none;")})(),"\n }\n \n .landing-avatar img {\n border: none !important;\n outline: none !important;\n }\n\n .landing-avatar-emoji {\n font-size: 44px;\n line-height: 1;\n }\n\n /* Title & Subtitle */\n .landing-title { \n font-size: 20px; \n color: ").concat(A.titleColor||"#1e1b4b","; \n font-weight: 600; \n margin-bottom: 6px; \n text-align: center;\n line-height: 1.3;\n }\n\n .landing-subtitle {\n font-size: 14px;\n color: ").concat(A.subtitleColor||"#64748b",";\n margin-bottom: 28px;\n text-align: center;\n }\n\n /* Mode Selection - Side by Side */\n .mode-selection { \n display: flex; \n gap: 12px; \n width: 100%; \n justify-content: center; \n }\n\n .mode-card { \n flex: 1; \n max-width: 160px; \n padding: 20px 16px;\n background: ").concat(A.modeCardBackgroundColor||"#ffffff","; \n border: 1px solid ").concat(A.modeCardBorderColor||"rgba(0, 0, 0, 0.06)","; \n border-radius: 18px; \n cursor: pointer; \n display: flex; \n flex-direction: column; \n align-items: center; \n gap: 12px; \n transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); \n box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06); \n font-family: inherit;\n }\n\n .mode-card:hover { \n transform: translateY(-4px); \n box-shadow: 0 8px 24px rgba(124, 58, 237, 0.2); \n border-color: rgba(124, 58, 237, 0.3); \n }\n\n .mode-card:active {\n transform: translateY(-2px);\n }\n\n /* Mode Card Icon - Vibrant purple gradient */\n .mode-card-icon { \n width: 56px; \n height: 56px; \n display: flex; \n align-items: center; \n justify-content: center; \n border-radius: 16px; \n background: ").concat(A.modeCardIconBackgroundColor||"linear-gradient(135deg, #7c3aed, #a855f7)","; \n color: #fff; \n box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);\n }\n\n .mode-card-icon svg {\n width: 26px;\n height: 26px;\n stroke: white;\n fill: none;\n }\n\n .mode-card-title { \n color: ").concat(A.modeCardTitleColor||"#1e1b4b","; \n font-weight: 600; \n font-size: 14px;\n text-align: center;\n }\n\n /* Mobile Responsive */\n @media (max-width: 768px) {\n .landing-screen {\n padding: 24px 16px;\n }\n\n .landing-avatar {\n width: 72px;\n height: 72px;\n border-radius: 18px;\n margin-bottom: 16px;\n }\n\n .landing-avatar-emoji {\n font-size: 36px;\n }\n\n .landing-title {\n font-size: 18px;\n }\n\n .landing-subtitle {\n font-size: 13px;\n margin-bottom: 20px;\n }\n\n .mode-selection {\n gap: 10px;\n }\n\n .mode-card {\n padding: 16px 12px;\n max-width: 140px;\n }\n\n .mode-card-icon {\n width: 48px;\n height: 48px;\n border-radius: 14px;\n }\n\n .mode-card-icon svg {\n width: 22px;\n height: 22px;\n }\n\n .mode-card-title {\n font-size: 13px;\n }\n }\n\n @media (max-width: 380px) {\n .mode-selection {\n flex-direction: column;\n align-items: center;\n }\n\n .mode-card {\n max-width: 100%;\n width: 100%;\n flex-direction: row;\n padding: 14px 18px;\n gap: 14px;\n }\n\n .mode-card-icon {\n flex-shrink: 0;\n }\n\n .mode-card-title {\n text-align: left;\n }\n }\n ")}show(){var A,e=null===(A=this.shadowRoot)||void 0===A?void 0:A.getElementById("landingScreen");e&&e.classList.add("active")}hide(){var A,e=null===(A=this.shadowRoot)||void 0===A?void 0:A.getElementById("landingScreen");e&&e.classList.remove("active")}setupEventHandlers(){var A,e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=null===(A=this.shadowRoot)||void 0===A?void 0:A.getElementById("mode-card-voice"),o=null===(e=this.shadowRoot)||void 0===e?void 0:e.getElementById("mode-card-text");n&&t.onSelectVoice&&(n.onclick=t.onSelectVoice),o&&t.onSelectText&&(o.onclick=t.onSelectText)}}const be={en:{landingTitle:"How would you like to communicate?",landingSubtitle:"Choose your preferred method",voiceCall:"Voice Call",textChat:"Text Chat",clickToStartCall:"Click to Start Call",realTimeVoice:"Real-time voice conversation",startCall:"Start Call",connecting:"Connecting...",connectingSubtitle:"Please wait",listening:"Listening...",speakFreely:"Speak freely",liveTranscript:"Live Transcript",transcriptWillAppear:"Transcript will appear here during the call...",mute:"Mute",speaker:"Speaker",endCall:"End Call",hello:"Hello! How can I help?",sendMessage:"Send a message to get started",online:"Online",newChat:"New Chat",back:"Back",close:"Close",error:"Error",typeMessage:"Type your message...",sendMessageAria:"Send message",domainNotValidated:"Domain not validated",domainErrorMessage:"This domain is not whitelisted. Please contact the administrator to whitelist your website URL."},he:{landingTitle:"איך תרצה לתקשר?",landingSubtitle:"בחר את השיטה המועדפת עליך",voiceCall:"שיחה קולית",textChat:"צ'אט טקסט",clickToStartCall:"לחץ להתחלת שיחה",realTimeVoice:"שיחה קולית בזמן אמת",startCall:"התחל שיחה",connecting:"מתחבר...",connectingSubtitle:"אנא המתן",listening:"מקשיב...",speakFreely:"דבר בחופשיות",liveTranscript:"תמלול בזמן אמת",transcriptWillAppear:"התמלול יופיע כאן במהלך השיחה...",mute:"השתק",speaker:"רמקול",endCall:"סיים שיחה",hello:"שלום! איך אפשר לעזור?",sendMessage:"שלח הודעה או עבור למצב קולי לשיחה בזמן אמת",online:"מקוון",newChat:"צ'אט חדש",back:"חזור",close:"סגור",error:"שגיאה",typeMessage:"הקלד הודעה...",sendMessageAria:"שלח הודעה",domainNotValidated:"דומיין לא מאומת",domainErrorMessage:"דומיין זה לא ברשימת המורשים. אנא פנה למנהל המערכת כדי להוסיף את כתובת האתר שלך לרשימה."},ar:{landingTitle:"كيف تريد التواصل؟",landingSubtitle:"اختر الطريقة المفضلة لديك",voiceCall:"مكالمة صوتية",textChat:"دردشة نصية",clickToStartCall:"انقر لبدء المكالمة",realTimeVoice:"محادثة صوتية في الوقت الفعلي",startCall:"ابدأ المكالمة",connecting:"جارٍ الاتصال...",connectingSubtitle:"يرجى الانتظار",listening:"الاستماع...",speakFreely:"تكلم بحرية",liveTranscript:"نص مباشر",transcriptWillAppear:"سيظهر النص هنا أثناء المكالمة...",mute:"كتم الصوت",speaker:"مكبر الصوت",endCall:"إنهاء المكالمة",hello:"مرحبا! كيف يمكنني المساعدة؟",sendMessage:"أرسل رسالة للبدء",online:"متصل",newChat:"محادثة جديدة",back:"رجوع",close:"إغلاق",error:"خطأ",typeMessage:"اكتب رسالة...",sendMessageAria:"إرسال رسالة",domainNotValidated:"النطاق غير معتمد",domainErrorMessage:"هذا النطاق غير مسموح به. يرجى الاتصال بالمسؤول لإضافة عنوان موقع الويب الخاص بك إلى القائمة."},ru:{landingTitle:"Как вы хотите общаться?",landingSubtitle:"Выберите предпочтительный способ",voiceCall:"Голосовой звонок",textChat:"Текстовый чат",clickToStartCall:"Нажмите, чтобы начать звонок",realTimeVoice:"Голосовой разговор в реальном времени",startCall:"Начать звонок",connecting:"Подключение...",connectingSubtitle:"Пожалуйста, подождите",listening:"Слушаю...",speakFreely:"Говорите свободно",liveTranscript:"Живая транскрипция",transcriptWillAppear:"Транскрипция появится здесь во время звонка...",mute:"Отключить звук",speaker:"Динамик",endCall:"Завершить звонок",hello:"Привет! Как я могу помочь?",sendMessage:"Отправьте сообщение для начала",online:"В сети",newChat:"Новый чат",back:"Назад",close:"Закрыть",error:"Ошибка",typeMessage:"Введите сообщение...",sendMessageAria:"Отправить сообщение",domainNotValidated:"Домен не проверен",domainErrorMessage:"Этот домен не в белом списке. Пожалуйста, свяжитесь с администратором, чтобы добавить URL вашего веб-сайта в список."},es:{landingTitle:"¿Cómo te gustaría comunicarte?",landingSubtitle:"Elige tu método preferido",voiceCall:"Llamada de voz",textChat:"Chat de texto",clickToStartCall:"Haz clic para iniciar la llamada",realTimeVoice:"Conversación de voz en tiempo real",startCall:"Iniciar llamada",connecting:"Conectando...",connectingSubtitle:"Por favor espere",listening:"Escuchando...",speakFreely:"Habla libremente",liveTranscript:"Transcripción en vivo",transcriptWillAppear:"La transcripción aparecerá aquí durante la llamada...",mute:"Silenciar",speaker:"Altavoz",endCall:"Terminar llamada",hello:"¡Hola! ¿Cómo puedo ayudarte?",sendMessage:"Envía un mensaje para comenzar",online:"En línea",newChat:"Nuevo chat",back:"Atrás",close:"Cerrar",error:"Error",typeMessage:"Escribe un mensaje...",sendMessageAria:"Enviar mensaje",domainNotValidated:"Dominio no validado",domainErrorMessage:"Este dominio no está en la lista blanca. Por favor, contacte al administrador para agregar la URL de su sitio web a la lista."},fr:{landingTitle:"Comment souhaitez-vous communiquer?",landingSubtitle:"Choisissez votre méthode préférée",voiceCall:"Appel vocal",textChat:"Chat texte",clickToStartCall:"Cliquez pour démarrer l'appel",realTimeVoice:"Conversation vocale en temps réel",startCall:"Démarrer l'appel",connecting:"Connexion...",connectingSubtitle:"Veuillez patienter",listening:"Écoute...",speakFreely:"Parlez librement",liveTranscript:"Transcripción en direct",transcriptWillAppear:"La transcription apparaîtra ici pendant l'appel...",mute:"Muet",speaker:"Haut-parleur",endCall:"Terminer l'appel",hello:"Bonjour! Comment puis-je vous aider?",sendMessage:"Envoyez un message pour commencer",online:"En ligne",newChat:"Nouveau chat",back:"Retour",close:"Fermer",error:"Erreur",typeMessage:"Tapez votre message...",sendMessageAria:"Envoyer un message",domainNotValidated:"Domaine non validé",domainErrorMessage:"Ce domaine n'est pas sur la liste blanche. Veuillez contacter l'administrateur pour ajouter l'URL de votre site Web à la liste."},de:{landingTitle:"Wie möchten Sie kommunizieren?",landingSubtitle:"Wählen Sie Ihre bevorzugte Methode",voiceCall:"Sprachanruf",textChat:"Text-Chat",clickToStartCall:"Klicken Sie, um den Anruf zu starten",realTimeVoice:"Sprachanruf in Echtzeit",startCall:"Anruf starten",connecting:"Verbinden...",connectingSubtitle:"Bitte warten",listening:"Hören...",speakFreely:"Sprechen Sie frei",liveTranscript:"Live-Transkription",transcriptWillAppear:"Die Transkription erscheint hier während des Anrufs...",mute:"Stumm",speaker:"Lautsprecher",endCall:"Anruf beenden",hello:"Hallo! Wie kann ich helfen?",sendMessage:"Senden Sie eine Nachricht zum Starten",online:"Online",newChat:"Neuer Chat",back:"Zurück",close:"Schließen",error:"Fehler",typeMessage:"Geben Sie eine Nachricht ein...",sendMessageAria:"Nachricht senden",domainNotValidated:"Domain nicht validiert",domainErrorMessage:"Diese Domain steht nicht auf der Whitelist. Bitte kontaktieren Sie den Administrator, um die URL Ihrer Website zur Liste hinzuzufügen."}};function xe(A,e,t,n,o,i,r){try{var s=A[i](r),a=s.value}catch(A){return void t(A)}s.done?e(a):Promise.resolve(a).then(n,o)}function Qe(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var i=A.apply(e,t);function r(A){xe(i,n,o,r,s,"next",A)}function s(A){xe(i,n,o,r,s,"throw",A)}r(void 0)})}}function Fe(A,e){var t=Object.keys(A);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(A);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(A,e).enumerable})),t.push.apply(t,n)}return t}function Ue(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?Fe(Object(t),!0).forEach(function(e){Se(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):Fe(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function Se(A,e,t){return(e=function(A){var e=function(A){if("object"!=typeof A||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=typeof t)return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==typeof e?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}class Ie{constructor(){var A,e,t,n,o,i,r,s,a,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.config=this.mergeWithDefaults(c),this.sdk=new kA(this.config),this.isOpen=!1,this.isActive=!1,this.translations=be,this.currentView="landing",this.isStartingCall=!1,this.shadowRoot=null,this.container=null,this._pendingClientTools=null,this.config.useShadowDOM?(this.createShadowHost(),this.container=this.shadowRoot):(this.createRegularContainer(),this.container=this.regularContainer,this.shadowRoot=document);var l=Ue(Ue(Ue({},this.config),this.config.voice),{},{inputPlaceholder:(null===(A=this.config.text)||void 0===A?void 0:A.inputPlaceholder)||this.config.inputPlaceholder||"Type your message...",sendButtonColor:(null===(e=this.config.text)||void 0===e?void 0:e.sendButtonColor)||this.config.sendButtonColor||"#7C3AED",language:(null===(t=this.config.voice)||void 0===t?void 0:t.language)||this.config.language||"en",signedUrl:this.config.signedUrl,agentSettingsOverride:this.config.agentSettingsOverride,visualAssistant:this.config.visualAssistant,translations:this.translations,shadowRoot:this.shadowRoot,textSDK:this.sdk,outputContainer:(null===(n=this.config.voice)||void 0===n?void 0:n.outputContainer)||"raw",outputEncoding:(null===(o=this.config.voice)||void 0===o?void 0:o.outputEncoding)||"pcm",outputSampleRate:(null===(i=this.config.voice)||void 0===i?void 0:i.outputSampleRate)||44100,outputChannels:(null===(r=this.config.voice)||void 0===r?void 0:r.outputChannels)||1,outputBitDepth:(null===(s=this.config.voice)||void 0===s?void 0:s.outputBitDepth)||16,onConversationStart:this.config.onConversationStart,onConversationEnd:this.config.onConversationEnd,onBargeIn:this.config.onBargeIn,onAudioStartPlaying:this.config.onAudioStartPlaying,onAudioStoppedPlaying:this.config.onAudioStoppedPlaying,onSubtitleDisplay:this.config.onSubtitleDisplay,onVoiceCallButtonClick:this.config.onVoiceCallButtonClick,onCallEnd:()=>{var A,e,t=null===(A=this.voiceInterface)||void 0===A||null===(A=A.shadowRoot)||void 0===A?void 0:A.getElementById("voiceIdleState");if(t&&"none"!==t.style.display){var n=t.querySelector(".voice-status-title");if(n){var o,i=n.textContent.trim();if(i===(null===(o=this.voiceInterface)||void 0===o?void 0:o.t("domainNotValidated"))||i.includes("Domain not")||i.includes("not whitelisted"))return void console.log("🚫 Domain error is displayed - NOT returning to landing screen from onCallEnd")}}"unified"===((null===(e=this.config.behavior)||void 0===e?void 0:e.mode)||"unified")&&this.showLanding()},onShowVoice:()=>{this.showVoice()},onShowLanding:()=>{this.showLanding()},onErrorToast:(A,e)=>{this.showErrorToast(A,e)}});this.voiceInterface=new fe(l);var d=Ue(Ue(Ue({},this.config),this.config.text),{},{translations:this.translations,shadowRoot:this.shadowRoot});if(this.textInterface=new Ce(d,this.sdk),"unified"===((null===(a=this.config.behavior)||void 0===a?void 0:a.mode)||"unified")){var u=Ue(Ue({},this.config),{},{translations:this.translations,shadowRoot:this.shadowRoot});this.landingScreen=new ye(u)}else this.landingScreen=null;if(this.createWidget(),this.setupEventHandlers(),this.config.behavior.startOpen||this.config.behavior.autoOpen){var g,p=null===(g=this.shadowRoot)||void 0===g?void 0:g.getElementById("text-chat-panel");p&&(this.isOpen=!0,p.classList.add("open"))}this.checkAndHandleResume()}checkAndHandleResume(){var A=this.voiceInterface.checkAndHandleResume();A&&(console.log("🔄 [WIDGET] Auto-resuming call from page navigation"),console.log(" From:",A.fromPage,"→ To:",A.toPage),this.open(),this.showVoice(),this.currentView="voice",setTimeout(()=>{this.startVoiceCall().then(()=>{console.log("✅ [WIDGET] Auto-resumed call successfully")}).catch(A=>{var e;console.error("❌ [WIDGET] Failed to auto-resume call:",A),"unified"===((null===(e=this.config.behavior)||void 0===e?void 0:e.mode)||"unified")&&this.showLanding()})},100))}open(){var A;if(!this.isOpen){var e=null===(A=this.shadowRoot)||void 0===A?void 0:A.getElementById("text-chat-panel");e&&(this.isOpen=!0,e.classList.add("open"))}}mergeWithDefaults(A){var e,t,n,o,i,r,s,a,c,l,d,u,g,p,h,B,m,f,v,w,C,y,b,x,Q,F,U,S,I,E,k,H,T,D,K,L,M,R,P,O,V,_,N,G,W,j,z,X,J,Y,q,Z,$,AA,eA,tA,nA,oA,iA,rA,sA,aA,cA,lA,dA,uA,gA,pA,hA,BA,mA,fA,vA,wA,CA,yA,bA,xA,QA,FA,UA,SA,IA,EA,kA,HA,TA,DA,KA,LA,MA,RA,PA,OA,VA,_A,NA,GA,WA,jA,zA,XA,JA,YA,qA,ZA,$A,Ae,ee,te,ne,oe,ie,re,se,ae,ce,le,de,ue,ge,pe,he,Be,me,fe,ve,we,Ce,ye,be,xe,Qe,Fe,Se,Ie,Ee,ke,He,Te=A.position||"bottom-right";if("string"==typeof Te){var De=Te.split("-");Te={vertical:De[0]||"bottom",horizontal:De[1]||"right",offset:A.positionOffset||{x:20,y:20}}}var Ke,Le,Me=A.primaryColor||(null===(e=A.button)||void 0===e?void 0:e.primaryColor)||(null===(t=A.button)||void 0===t?void 0:t.backgroundColor)||"#FFFFFF";return Ue({agentId:A.agentId,appId:A.appId,signedUrl:A.signedUrl,agentSettingsOverride:A.agentSettingsOverride,demo:!1!==A.demo,direction:A.direction||"ltr",language:A.language||"en",icon:Ue({type:(null===(n=A.icon)||void 0===n?void 0:n.type)||"custom",customImage:(null===(o=A.icon)||void 0===o?void 0:o.customImage)||"https://talktopc.com/logo192.png",emoji:(null===(i=A.icon)||void 0===i?void 0:i.emoji)||"🎤",text:(null===(r=A.icon)||void 0===r?void 0:r.text)||"AI",size:(null===(s=A.icon)||void 0===s?void 0:s.size)||"medium",backgroundColor:(null===(a=A.icon)||void 0===a?void 0:a.backgroundColor)||"#FFFFFF"},A.icon),position:Ue({vertical:Te.vertical||"bottom",horizontal:Te.horizontal||"right",offset:Te.offset||{x:20,y:20}},"object"==typeof A.position?A.position:{}),button:Ue({size:(null===(c=A.button)||void 0===c?void 0:c.size)||"medium",shape:(null===(l=A.button)||void 0===l?void 0:l.shape)||"circle",backgroundColor:(null===(d=A.button)||void 0===d?void 0:d.backgroundColor)||(null===(u=A.icon)||void 0===u?void 0:u.backgroundColor)||"#FFFFFF",hoverColor:(null===(g=A.button)||void 0===g?void 0:g.hoverColor)||"#D3D3D3",shadow:!1!==(null===(p=A.button)||void 0===p?void 0:p.shadow),shadowColor:(null===(h=A.button)||void 0===h?void 0:h.shadowColor)||"rgba(0,0,0,0.15)",primaryColor:(null===(B=A.button)||void 0===B?void 0:B.backgroundColor)||(null===(m=A.icon)||void 0===m?void 0:m.backgroundColor)||"#FFFFFF"},A.button),panel:Ue({width:(null===(f=A.panel)||void 0===f?void 0:f.width)||360,height:(null===(v=A.panel)||void 0===v?void 0:v.height)||500,borderRadius:(null===(w=A.panel)||void 0===w?void 0:w.borderRadius)||24,backgroundColor:(null===(C=A.panel)||void 0===C?void 0:C.backgroundColor)||"#FFFFFF",backdropFilter:(null===(y=A.panel)||void 0===y?void 0:y.backdropFilter)||null,border:(null===(b=A.panel)||void 0===b?void 0:b.border)||"1px solid #E5E7EB"},A.panel),voice:Ue({micButtonColor:(null===(x=A.voice)||void 0===x?void 0:x.micButtonColor)||(null===(Q=A.panel)||void 0===Q?void 0:Q.micButtonColor)||Me,micButtonActiveColor:(null===(F=A.voice)||void 0===F?void 0:F.micButtonActiveColor)||(null===(U=A.panel)||void 0===U?void 0:U.micButtonActiveColor)||"#EF4444",micButtonHint:Ue(Ue({text:(null===(S=A.voice)||void 0===S||null===(S=S.micButtonHint)||void 0===S?void 0:S.text)||(null===(I=A.panel)||void 0===I||null===(I=I.micButtonHint)||void 0===I?void 0:I.text)||"Click the button to start voice conversation",color:(null===(E=A.voice)||void 0===E||null===(E=E.micButtonHint)||void 0===E?void 0:E.color)||(null===(k=A.panel)||void 0===k||null===(k=k.micButtonHint)||void 0===k?void 0:k.color)||"#6B7280",fontSize:(null===(H=A.voice)||void 0===H||null===(H=H.micButtonHint)||void 0===H?void 0:H.fontSize)||(null===(T=A.panel)||void 0===T||null===(T=T.micButtonHint)||void 0===T?void 0:T.fontSize)||"12px"},null===(D=A.voice)||void 0===D?void 0:D.micButtonHint),null===(K=A.panel)||void 0===K?void 0:K.micButtonHint),avatarBackgroundColor:(null===(L=A.voice)||void 0===L?void 0:L.avatarBackgroundColor)||"#667eea",avatarActiveBackgroundColor:(null===(M=A.voice)||void 0===M?void 0:M.avatarActiveBackgroundColor)||"#667eea",statusTitleColor:(null===(R=A.voice)||void 0===R?void 0:R.statusTitleColor)||"#1e293b",statusSubtitleColor:(null===(P=A.voice)||void 0===P?void 0:P.statusSubtitleColor)||"#64748b",statusDotColor:(null===(O=A.voice)||void 0===O?void 0:O.statusDotColor)||"#10b981",statusText:(null===(V=A.voice)||void 0===V?void 0:V.statusText)||null,startCallButtonColor:(null===(_=A.voice)||void 0===_?void 0:_.startCallButtonColor)||"#667eea",startCallButtonTextColor:(null===(N=A.voice)||void 0===N?void 0:N.startCallButtonTextColor)||"#FFFFFF",startCallTitle:(null===(G=A.voice)||void 0===G?void 0:G.startCallTitle)||null,startCallSubtitle:(null===(W=A.voice)||void 0===W?void 0:W.startCallSubtitle)||null,startCallButtonText:(null===(j=A.voice)||void 0===j?void 0:j.startCallButtonText)||null,transcriptBackgroundColor:(null===(z=A.voice)||void 0===z?void 0:z.transcriptBackgroundColor)||"#FFFFFF",transcriptTextColor:(null===(X=A.voice)||void 0===X?void 0:X.transcriptTextColor)||"#1e293b",transcriptLabelColor:(null===(J=A.voice)||void 0===J?void 0:J.transcriptLabelColor)||"#94a3b8",controlButtonColor:(null===(Y=A.voice)||void 0===Y?void 0:Y.controlButtonColor)||"#FFFFFF",controlButtonSecondaryColor:(null===(q=A.voice)||void 0===q?void 0:q.controlButtonSecondaryColor)||"#64748b",endCallButtonColor:(null===(Z=A.voice)||void 0===Z?void 0:Z.endCallButtonColor)||"#ef4444",language:(null===($=A.voice)||void 0===$?void 0:$.language)||A.language||"en"},A.voice),text:Ue({sendButtonColor:(null===(AA=A.text)||void 0===AA?void 0:AA.sendButtonColor)||(null===(eA=A.panel)||void 0===eA?void 0:eA.sendButtonColor)||"#7C3AED",sendButtonHoverColor:(null===(tA=A.text)||void 0===tA?void 0:tA.sendButtonHoverColor)||(null===(nA=A.panel)||void 0===nA?void 0:nA.sendButtonHoverColor)||"#6D28D9",sendButtonActiveColor:(null===(oA=A.text)||void 0===oA?void 0:oA.sendButtonActiveColor)||(null===(iA=A.panel)||void 0===iA?void 0:iA.sendButtonActiveColor)||"#6D28D9",sendButtonText:(null===(rA=A.text)||void 0===rA?void 0:rA.sendButtonText)||(null===(sA=A.panel)||void 0===sA?void 0:sA.sendButtonText)||"➤",sendButtonTextColor:(null===(aA=A.text)||void 0===aA?void 0:aA.sendButtonTextColor)||(null===(cA=A.panel)||void 0===cA?void 0:cA.sendButtonTextColor)||"#FFFFFF",sendButtonFontSize:(null===(lA=A.text)||void 0===lA?void 0:lA.sendButtonFontSize)||(null===(dA=A.panel)||void 0===dA?void 0:dA.sendButtonFontSize)||"18px",sendButtonFontWeight:(null===(uA=A.text)||void 0===uA?void 0:uA.sendButtonFontWeight)||(null===(gA=A.panel)||void 0===gA?void 0:gA.sendButtonFontWeight)||"500",sendButtonHint:Ue(Ue({text:(null===(pA=A.text)||void 0===pA||null===(pA=pA.sendButtonHint)||void 0===pA?void 0:pA.text)||(null===(hA=A.panel)||void 0===hA||null===(hA=hA.sendButtonHint)||void 0===hA?void 0:hA.text)||"",color:(null===(BA=A.text)||void 0===BA||null===(BA=BA.sendButtonHint)||void 0===BA?void 0:BA.color)||(null===(mA=A.panel)||void 0===mA||null===(mA=mA.sendButtonHint)||void 0===mA?void 0:mA.color)||"#6B7280",fontSize:(null===(fA=A.text)||void 0===fA||null===(fA=fA.sendButtonHint)||void 0===fA?void 0:fA.fontSize)||(null===(vA=A.panel)||void 0===vA||null===(vA=vA.sendButtonHint)||void 0===vA?void 0:vA.fontSize)||"12px"},null===(wA=A.text)||void 0===wA?void 0:wA.sendButtonHint),null===(CA=A.panel)||void 0===CA?void 0:CA.sendButtonHint),inputPlaceholder:(null===(yA=A.text)||void 0===yA?void 0:yA.inputPlaceholder)||(null===(bA=A.panel)||void 0===bA?void 0:bA.inputPlaceholder)||"Type your message...",inputBorderColor:(null===(xA=A.text)||void 0===xA?void 0:xA.inputBorderColor)||(null===(QA=A.panel)||void 0===QA?void 0:QA.inputBorderColor)||"#E5E7EB",inputFocusColor:(null===(FA=A.text)||void 0===FA?void 0:FA.inputFocusColor)||(null===(UA=A.panel)||void 0===UA?void 0:UA.inputFocusColor)||"#7C3AED",inputBackgroundColor:(null===(SA=A.text)||void 0===SA?void 0:SA.inputBackgroundColor)||(null===(IA=A.panel)||void 0===IA?void 0:IA.inputBackgroundColor)||"#FFFFFF",inputTextColor:(null===(EA=A.text)||void 0===EA?void 0:EA.inputTextColor)||(null===(kA=A.panel)||void 0===kA?void 0:kA.inputTextColor)||"#1F2937",inputFontSize:(null===(HA=A.text)||void 0===HA?void 0:HA.inputFontSize)||(null===(TA=A.panel)||void 0===TA?void 0:TA.inputFontSize)||"14px",inputBorderRadius:(null===(DA=A.text)||void 0===DA?void 0:DA.inputBorderRadius)||(null===(KA=A.panel)||void 0===KA?void 0:KA.inputBorderRadius)||20,inputPadding:(null===(LA=A.text)||void 0===LA?void 0:LA.inputPadding)||(null===(MA=A.panel)||void 0===MA?void 0:MA.inputPadding)||"6px 14px"},A.text),landing:(Le={},A.landing&&Object.keys(A.landing).forEach(e=>{var t=A.landing[e];(null!=t&&""!==t||!1===t)&&(Le[e]=t)}),Ue({backgroundColor:Le.backgroundColor||"linear-gradient(180deg, #f8fafc 0%, #e0e7ff 100%)",logo:Le.logo||"🤖",title:Le.title||null,titleColor:Le.titleColor||"#1e293b",modeCardBackgroundColor:Le.modeCardBackgroundColor||"#FFFFFF",modeCardBorderColor:Le.modeCardBorderColor||"#E2E8F0",modeCardHoverBorderColor:Le.modeCardHoverBorderColor||"#7C3AED",modeCardIconBackgroundColor:Le.modeCardIconBackgroundColor||"#7C3AED",modeCardTitleColor:Le.modeCardTitleColor||"#111827",voiceCardIcon:Le.voiceCardIcon||"🎤",textCardIcon:Le.textCardIcon||"💬",voiceCardTitle:Le.voiceCardTitle||null,textCardTitle:Le.textCardTitle||null},Le)),header:(Ke={},A.header&&Object.keys(A.header).forEach(e=>{var t=A.header[e];e.startsWith("onlineIndicator")?null!=t&&(Ke[e]=t):null!=t&&""!==t&&(Ke[e]=t)}),Ue({title:Ke.title||"Chat Assistant",showTitle:!1!==Ke.showTitle,backgroundColor:Ke.backgroundColor||"#7C3AED",textColor:Ke.textColor||"#FFFFFF",showCloseButton:!1!==Ke.showCloseButton},Ke)),footer:Ue({show:!1!==(null===(RA=A.footer)||void 0===RA?void 0:RA.show),backgroundColor:(null===(PA=A.footer)||void 0===PA?void 0:PA.backgroundColor)||"#f9fafb",textColor:(null===(OA=A.footer)||void 0===OA?void 0:OA.textColor)||"#9ca3af",hoverColor:(null===(VA=A.footer)||void 0===VA?void 0:VA.hoverColor)||"#7C3AED"},A.footer),tooltips:Ue({newChat:(null===(_A=A.tooltips)||void 0===_A?void 0:_A.newChat)||null,back:(null===(NA=A.tooltips)||void 0===NA?void 0:NA.back)||null,close:(null===(GA=A.tooltips)||void 0===GA?void 0:GA.close)||null,mute:(null===(WA=A.tooltips)||void 0===WA?void 0:WA.mute)||null,speaker:(null===(jA=A.tooltips)||void 0===jA?void 0:jA.speaker)||null,endCall:(null===(zA=A.tooltips)||void 0===zA?void 0:zA.endCall)||null},A.tooltips),messages:Ue({userBackgroundColor:(null===(XA=A.messages)||void 0===XA?void 0:XA.userBackgroundColor)||"#E5E7EB",agentBackgroundColor:(null===(JA=A.messages)||void 0===JA?void 0:JA.agentBackgroundColor)||"#F3F4F6",systemBackgroundColor:(null===(YA=A.messages)||void 0===YA?void 0:YA.systemBackgroundColor)||"#DCFCE7",errorBackgroundColor:(null===(qA=A.messages)||void 0===qA?void 0:qA.errorBackgroundColor)||"#FEE2E2",textColor:(null===(ZA=A.messages)||void 0===ZA?void 0:ZA.textColor)||"#1F2937",userTextColor:(null===($A=A.messages)||void 0===$A?void 0:$A.userTextColor)||(null===(Ae=A.messages)||void 0===Ae?void 0:Ae.textColor)||"#1F2937",agentTextColor:(null===(ee=A.messages)||void 0===ee?void 0:ee.agentTextColor)||(null===(te=A.messages)||void 0===te?void 0:te.textColor)||"#1F2937",userAvatarIcon:(null===(ne=A.messages)||void 0===ne?void 0:ne.userAvatarIcon)||"👤",agentAvatarIcon:(null===(oe=A.messages)||void 0===oe?void 0:oe.agentAvatarIcon)||"🤖",fontSize:(null===(ie=A.messages)||void 0===ie?void 0:ie.fontSize)||"14px",borderRadius:(null===(re=A.messages)||void 0===re?void 0:re.borderRadius)||16},A.messages),animation:Ue({enableHover:!1!==(null===(se=A.animation)||void 0===se?void 0:se.enableHover),enablePulse:!1!==(null===(ae=A.animation)||void 0===ae?void 0:ae.enablePulse),enableSlide:!1!==(null===(ce=A.animation)||void 0===ce?void 0:ce.enableSlide),duration:(null===(le=A.animation)||void 0===le?void 0:le.duration)||.3},A.animation),promptAnimation:Ue({enabled:!0===(null===(de=A.promptAnimation)||void 0===de?void 0:de.enabled),text:(null===(ue=A.promptAnimation)||void 0===ue?void 0:ue.text)||"Try me!",backgroundColor:(null===(ge=A.promptAnimation)||void 0===ge?void 0:ge.backgroundColor)||"linear-gradient(135deg, #7c3aed, #4f46e5)",textColor:(null===(pe=A.promptAnimation)||void 0===pe?void 0:pe.textColor)||"#ffffff",animationType:(null===(he=A.promptAnimation)||void 0===he?void 0:he.animationType)||"bounce",showShimmer:!1!==(null===(Be=A.promptAnimation)||void 0===Be?void 0:Be.showShimmer),showPulseRings:!1!==(null===(me=A.promptAnimation)||void 0===me?void 0:me.showPulseRings),hideAfterClick:!1!==(null===(fe=A.promptAnimation)||void 0===fe?void 0:fe.hideAfterClick),hideAfterSeconds:void 0!==(null===(ve=A.promptAnimation)||void 0===ve?void 0:ve.hideAfterSeconds)?A.promptAnimation.hideAfterSeconds:null,position:(null===(we=A.promptAnimation)||void 0===we?void 0:we.position)||"top"},A.promptAnimation),behavior:Ue({autoOpen:(null===(Ce=A.behavior)||void 0===Ce?void 0:Ce.autoOpen)||!1,startOpen:(null===(ye=A.behavior)||void 0===ye?void 0:ye.startOpen)||!1,hidden:(null===(be=A.behavior)||void 0===be?void 0:be.hidden)||!1,autoConnect:(null===(xe=A.behavior)||void 0===xe?void 0:xe.autoConnect)||!1,showWelcomeMessage:!1!==(null===(Qe=A.behavior)||void 0===Qe?void 0:Qe.showWelcomeMessage),welcomeMessage:(null===(Fe=A.behavior)||void 0===Fe?void 0:Fe.welcomeMessage)||"Hello! How can I help you today?",enableVoiceMode:void 0===(null===(Se=A.behavior)||void 0===Se?void 0:Se.enableVoiceMode)||A.behavior.enableVoiceMode,mode:(null===(Ie=A.behavior)||void 0===Ie?void 0:Ie.mode)||"unified"},A.behavior),accessibility:Ue({ariaLabel:(null===(Ee=A.accessibility)||void 0===Ee?void 0:Ee.ariaLabel)||"Chat Assistant",ariaDescription:(null===(ke=A.accessibility)||void 0===ke?void 0:ke.ariaDescription)||"Click to open chat assistant",keyboardNavigation:!1!==(null===(He=A.accessibility)||void 0===He?void 0:He.keyboardNavigation)},A.accessibility),customStyles:A.customStyles||"",useShadowDOM:!1!==A.useShadowDOM,variables:A.variables||{},forceConversationId:A.forceConversationId,visualAssistant:A.visualAssistant,onConversationStart:A.onConversationStart,onConversationEnd:A.onConversationEnd,onBargeIn:A.onBargeIn,onAudioStartPlaying:A.onAudioStartPlaying,onAudioStoppedPlaying:A.onAudioStoppedPlaying,onSubtitleDisplay:A.onSubtitleDisplay,onVoiceCallButtonClick:A.onVoiceCallButtonClick,primaryColor:Me},"string"==typeof A.position?{positionString:A.position}:{})}setupEventHandlers(){this.sdk.on("domainError",A=>{this.textInterface.showError(A),this.textInterface.stopStreamingState()}),this.sdk.on("error",A=>{A&&("DOMAIN_NOT_WHITELISTED"===A.message||A.message&&A.message.includes("Domain not whitelisted"))||(this.textInterface.showError(A.message||A),this.textInterface.stopStreamingState())}),this.sdk.on("chunk",A=>{this.textInterface.appendStreamingChunk(A)}),this.sdk.on("done",A=>{var{text:e}=A;this.textInterface.finalizeStreaming(e)})}createShadowHost(){var A=document.getElementById("ttp-widget-shadow-host");A&&A.remove();var e=document.createElement("div");e.id="ttp-widget-shadow-host",e.style.cssText="position: fixed; z-index: 10000; pointer-events: none; top: 0; left: 0; width: 100%; height: 100%; overflow: visible;",this.shadowRoot=e.attachShadow({mode:"open"}),document.body.appendChild(e)}createRegularContainer(){var A=document.getElementById("ttp-widget-container");A&&A.remove();var e=document.createElement("div");e.id="ttp-widget-container",e.style.cssText="position: fixed; z-index: 10000; pointer-events: none; top: 0; left: 0; width: 100%; height: 100%; overflow: visible;",document.body.appendChild(e),this.regularContainer=e}createWidget(){this.container||(this.config.useShadowDOM?(this.createShadowHost(),this.container=this.shadowRoot):(this.createRegularContainer(),this.container=this.regularContainer,this.shadowRoot=document));var A;A=this.config.useShadowDOM?"\n :host {\n all: initial;\n display: block;\n pointer-events: none;\n }\n img {\n max-width: none !important;\n }\n #text-chat-button img {\n width: 28px !important;\n height: 28px !important;\n }\n #text-chat-button {\n pointer-events: auto;\n }\n #text-chat-panel {\n pointer-events: auto;\n }\n ":'\n /* Reset only problematic inherited styles, not all styles */\n #text-chat-button,\n #text-chat-panel,\n #text-chat-panel * {\n box-sizing: border-box;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n }\n \n /* Prevent theme CSS from affecting images */\n #text-chat-button img,\n #text-chat-panel img {\n max-width: none !important;\n width: auto;\n height: auto;\n }\n \n #text-chat-button img {\n width: 28px !important;\n height: 28px !important;\n }\n \n /* Ensure button and panel can receive clicks */\n #text-chat-button,\n #text-chat-panel {\n pointer-events: auto;\n }\n \n /* Reset any inherited text styles that might break layout */\n #text-chat-panel {\n text-align: left;\n line-height: normal;\n letter-spacing: normal;\n word-spacing: normal;\n text-transform: none;\n text-indent: 0;\n text-shadow: none;\n white-space: normal;\n }\n \n /* Ensure flexbox works properly */\n #text-chat-panel .widget-shell,\n #text-chat-panel .panel-inner,\n #text-chat-panel .widget-container,\n #text-chat-panel .landing-screen,\n #text-chat-panel .voice-interface,\n #text-chat-panel .text-interface,\n #text-chat-panel .widget-header,\n #text-chat-panel .mode-selection {\n display: flex;\n }\n \n #text-chat-panel .widget-shell,\n #text-chat-panel .panel-inner,\n #text-chat-panel .widget-container,\n #text-chat-panel .landing-screen,\n #text-chat-panel .voice-interface,\n #text-chat-panel .text-interface {\n flex-direction: column;\n }\n \n #text-chat-panel .mode-selection {\n flex-direction: row;\n }\n \n /* Ensure proper stacking */\n #text-chat-button {\n z-index: 10001 !important;\n }\n \n #text-chat-panel {\n z-index: 10000 !important;\n }\n ';var e=this.generateWidgetHTML();if(this.config.useShadowDOM){var t="\n <style>".concat(A,"</style>\n ").concat(e,"\n ");this.shadowRoot.innerHTML=t}else this.injectStylesIntoHead(A),this.container.innerHTML=e;this.setupWidgetEvents();var n=this.shadowRoot.getElementById("text-chat-panel");n?this.config.behavior.startOpen||this.config.behavior.autoOpen?(this.isOpen=!0,n.classList.add("open"),this.hidePrompt()):this.showPrompt():setTimeout(()=>{this.showPrompt()},100),setTimeout(()=>{this.isOpen?this.hidePrompt():this.showPrompt()},200)}injectStylesIntoHead(A){var e,t,n=document.getElementById("ttp-widget-styles");n&&n.remove();var o={small:50,medium:60,large:70,xl:80}[null===(e=this.config.button)||void 0===e?void 0:e.size]||60,i={small:20,medium:28,large:36,xl:44}[null===(t=this.config.icon)||void 0===t?void 0:t.size]||28,r=this.generatePositionStyles(),s=this.generateCSS(r,o,i),a=document.createElement("style");a.id="ttp-widget-styles",a.textContent=A+"\n"+s,this.config.customStyles&&(a.textContent+="\n"+this.config.customStyles),document.head.appendChild(a)}generateWidgetHTML(){this.config.position;var A,e=this.config.button,t=this.config.icon,n=(this.config.panel,this.config.header),o=(this.config.animation,{small:50,medium:60,large:70,xl:80}[e.size]||60),i={small:20,medium:28,large:36,xl:44}[t.size]||28,r=this.generatePositionStyles(),s=this.generateIconHTML(i),a=(null===(A=this.config.behavior)||void 0===A?void 0:A.mode)||"unified",c="unified"===a,l="unified"===a||"voice-only"===a,d="unified"===a||"text-only"===a,u=A=>{var e=this.config.language||"en";return(this.translations[e]||this.translations.en)[A]||A},g=A=>{var e,t=null===(e=this.config.tooltips)||void 0===e?void 0:e[A];return null!=t?t:{newChat:u("newChat"),back:u("back"),close:u("close"),mute:u("mute"),speaker:u("speaker"),endCall:u("endCall")}[A]||""},p=this.config.useShadowDOM?"\n <style>\n ".concat(this.generateCSS(r,o,i),"\n ").concat(this.config.customStyles,"\n </style>\n "):"",h=this.config.promptAnimation||{},B=!0===h.enabled,m=B?this.generatePromptBubbleHTML(h,o):"";return console.log("📝 generateWidgetHTML - promptAnimation:",{hasConfig:!!this.config.promptAnimation,promptConfig:h,enabled:h.enabled,isPromptEnabled:B,willGenerateHTML:!!m}),"\n ".concat(p,"\n \n ").concat(this.config.behavior.hidden?"":'\n <div id="text-chat-button-container">\n '.concat(m,"\n ").concat(B&&!1!==h.showPulseRings?this.generatePulseRingsHTML(h):"",'\n <button id="text-chat-button" \n aria-label="').concat(this.config.accessibility.ariaLabel,'"\n aria-description="').concat(this.config.accessibility.ariaDescription,'">\n ').concat(s,"\n </button>\n </div>\n "),'\n \n <div id="text-chat-panel">\n <div class="widget-shell">\n <div class="panel-inner widget-container" style="direction: ').concat(this.config.direction,';">\n <div class="widget-header" style="background: ').concat(n.backgroundColor||"#7C3AED"," !important; color: ").concat(n.textColor||"#FFFFFF",' !important;">\n <div>\n ').concat(n.showTitle?'<div class="header-title">'.concat(n.title,"</div>"):"",'\n <div class="header-status" style="color: ').concat(n.onlineIndicatorColor||"rgba(255,255,255,0.7)",' !important;">\n <span class="status-dot" style="background: ').concat(n.onlineIndicatorDotColor||"#10b981",' !important;"></span>\n <span>').concat(void 0!==n.onlineIndicatorText&&null!==n.onlineIndicatorText?n.onlineIndicatorText:u("online"),'</span>\n </div>\n </div>\n \n <div style="display: flex; gap: 6px; align-items: center; position: relative; z-index: 1;">\n \x3c!-- New Chat Button (hide on landing screen, show otherwise) --\x3e\n <button class="header-icon new-chat-btn" id="newChatBtn" title="').concat(g("newChat"),'" style="').concat(c?"display: none;":"",'">\n <span style="font-size: 18px; font-weight: bold;">+</span>\n </button>\n \n \x3c!-- Back Button (only show in unified mode) --\x3e\n ').concat("unified"===a?'<button class="header-icon back-btn" id="backBtn" title="'.concat(g("back"),'" style="display: none;">\n <span style="font-size: 16px;">‹</span>\n </button>'):"","\n \n \x3c!-- Close Button --\x3e\n ").concat(n.showCloseButton?'<button class="header-icon close-btn" id="closeBtn" title="'+g("close")+'"><span style="font-size: 18px; font-weight: bold;">×</span></button>':"","\n </div>\n </div>\n\n ").concat(c&&this.landingScreen?this.landingScreen.generateHTML():"","\n\n ").concat(l?this.voiceInterface.generateHTML():"","\n ").concat(d?this.textInterface.generateHTML():"","\n ").concat(this.generateFooterHTML(),"\n </div>\n </div>\n </div>\n ")}generateFooterHTML(){if(!this.config.footer.show)return"";var A=encodeURIComponent(window.location.hostname||"widget"),e="https://talktopc.com?ref=widget&source=".concat(A);return'\n <div class="widget-footer" style="\n padding: 10px 16px;\n text-align: center;\n border-top: 1px solid rgba(0,0,0,0.06);\n font-size: 11px;\n color: #64748b;\n background: #fff;\n flex-shrink: 0;\n ">\n <div class="powered-by" style="\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 4px;\n ">\n <svg viewBox="0 0 24 24" fill="currentColor" style="width: 11px; height: 11px; color: #f59e0b;">\n <polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"/>\n </svg>\n Powered by <a href="'.concat(e,'" target="_blank" rel="noopener noreferrer" style="color: #a855f7; text-decoration: none; font-weight: 500;" onmouseover="this.style.color=\'#9333ea\'" onmouseout="this.style.color=\'#a855f7\'">TalkToPC</a>\n </div>\n </div>\n ')}generatePositionStyles(){var A=this.config.position,e=A.offset||{x:20,y:20},t="";return"top"===A.vertical?t+="top: ".concat(e.y,"px;"):"bottom"===A.vertical?t+="bottom: ".concat(e.y,"px;"):"center"===A.vertical&&(t+="top: 50%; transform: translateY(-50%);"),"left"===A.horizontal?t+="left: ".concat(e.x,"px;"):"right"===A.horizontal?t+="right: ".concat(e.x,"px;"):"center"===A.horizontal&&(t+="left: 50%; transform: translateX(-50%);"),t}generateIconHTML(A){var e=this.config.icon;switch(e.type){case"custom":return'<img src="'.concat(e.customImage,'" alt="Chat Assistant" style="width: ').concat(A,"px; height: ").concat(A,'px; object-fit: contain;" />');case"emoji":return'<span style="font-size: '.concat(A,'px; line-height: 1;">').concat(e.emoji,"</span>");case"text":return'<span style="font-size: '.concat(Math.floor(.6*A),'px; font-weight: bold; color: white;">').concat(e.text,"</span>");case"microphone":default:return'<svg viewBox="0 0 24 24" style="width: '.concat(A,"px; height: ").concat(A,'px; fill: white;">\n <path d="M12 14c1.66 0 3-1.34 3-3V5c0-1.66-1.34-3-3-3S9 3.34 9 5v6c0 1.66 1.34 3 3 3z"/>\n <path d="M17 11c0 2.76-2.24 5-5 5s-5-2.24-5-5H5c0 3.53 2.61 6.43 6 6.92V21h2v-3.08c3.39-.49 6-3.39 6-6.92h-2z"/>\n </svg>');case"chat":return'<svg viewBox="0 0 24 24" style="width: '.concat(A,"px; height: ").concat(A,'px; fill: white;">\n <path d="M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H6l-2 2V4h16v12z"/>\n </svg>')}}generatePromptBubbleHTML(A,e){var t="#7c3aed";if(A.backgroundColor&&A.backgroundColor.includes("gradient")){var n=A.backgroundColor.match(/#[0-9a-fA-F]{6}/);n&&(t=n[0])}else t=A.backgroundColor;var o="none"===A.animationType?"":"animation-".concat(A.animationType),i=A.showShimmer?'<div class="prompt-bubble-shimmer"></div>':"";return'\n <div class="prompt-bubble '.concat(A.position," ").concat(o,'" \n id="prompt-bubble"\n role="tooltip"\n style="--prompt-bubble-bg-color: ').concat(t,';">\n <div class="prompt-bubble-content" \n style="background: ').concat(A.backgroundColor,"; color: ").concat(A.textColor,';">\n ').concat(i,'\n <span style="position: relative; z-index: 1;">').concat(A.text,'</span>\n </div>\n <div class="prompt-bubble-arrow"></div>\n </div>\n ')}generatePulseRingsHTML(A){var e="#7c3aed";if(A.backgroundColor&&A.backgroundColor.includes("gradient")){var t=A.backgroundColor.match(/#[0-9a-fA-F]{6}/);t&&(e=t[0])}else e=A.backgroundColor;return'\n <div class="prompt-pulse-rings" id="prompt-pulse-rings">\n <div class="prompt-pulse-ring" style="background-color: '.concat(e,'33;"></div>\n <div class="prompt-pulse-ring" style="background-color: ').concat(e,'1a;"></div>\n </div>\n ')}generateCSS(A,e,t){var n,o,i,r,s,a=this.config.button,c=this.config.icon,l=this.config.panel,d=this.config.header,u=(this.config.messages,this.config.animation),g=(null===(n=this.config.behavior)||void 0===n?void 0:n.mode)||"unified",p="unified"===g,h="unified"===g||"voice-only"===g,B="unified"===g||"text-only"===g,m=!1===this.config.useShadowDOM?" !important":"";return'\n /* MOBILE FIRST - Default styles for all devices */\n #text-chat-widget {\n position: fixed !important;\n z-index: 10000;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n /* Mobile defaults */\n right: 10px;\n bottom: 10px;\n left: auto;\n top: auto;\n }\n \n /* Desktop positioning (only on larger screens) */\n @media (min-width: 769px) {\n #text-chat-widget {\n '.concat(A,"\n right: ").concat("right"===this.config.position.horizontal?"20px":"auto",";\n left: ").concat("left"===this.config.position.horizontal?"20px":"auto",";\n bottom: ").concat("bottom"===this.config.position.vertical?"20px":"auto",";\n top: ").concat("top"===this.config.position.vertical?"20px":"auto",";\n }\n }\n \n /* Mobile override (force mobile positioning) */\n @media (max-width: 768px) {\n #text-chat-widget {\n right: 10px !important;\n bottom: 10px !important;\n left: auto !important;\n top: auto !important;\n transform: none !important;\n }\n }\n \n @media (max-width: 480px) {\n #text-chat-widget {\n right: 8px !important;\n bottom: 8px !important;\n left: auto !important;\n top: auto !important;\n }\n }\n \n #text-chat-button {\n position: relative;\n width: ").concat(e,"px;\n height: ").concat(e,"px;\n margin: 0;\n flex-shrink: 0;\n border-radius: ").concat("circle"===a.shape?"50%":"square"===a.shape?"0":"12px",";\n background: ").concat(a.backgroundColor||c.backgroundColor||"#7C3AED",";\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all ").concat(u.duration,"s ease;\n box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);\n touch-action: manipulation;\n -webkit-tap-highlight-color: transparent;\n -webkit-touch-callout: none;\n user-select: none;\n min-width: 44px;\n min-height: 44px;\n z-index: 1;\n }\n \n @media (max-width: 768px) {\n #text-chat-widget {\n right: 10px !important;\n bottom: 10px !important;\n left: auto !important;\n top: auto !important;\n transform: none !important;\n }\n \n #text-chat-button-container {\n width: 56px !important;\n height: 56px !important;\n }\n \n #text-chat-button {\n width: 56px !important;\n height: 56px !important;\n min-width: 56px !important;\n min-height: 56px !important;\n max-width: 56px !important;\n max-height: 56px !important;\n }\n \n #text-chat-panel {\n position: fixed !important;\n left: 10px !important;\n right: 10px !important;\n bottom: 92px !important; /* 56px button + 20px gap + 16px footer */\n top: 60px !important; /* Add top spacing */\n width: auto !important;\n max-width: none !important;\n height: auto !important; /* Change from max-height to auto */\n max-height: none !important; /* Remove max-height */\n transform: none !important;\n margin: 0 !important;\n }\n \n #text-chat-panel .widget-header {\n padding: 10px 14px;\n min-height: 56px;\n }\n \n #text-chat-panel .header-title {\n font-size: 15px;\n }\n \n #text-chat-panel .header-icon {\n width: 40px;\n height: 40px;\n min-width: 40px;\n min-height: 40px;\n }\n \n #text-chat-input {\n font-size: 16px !important; /* Prevents iOS zoom on focus */\n padding: 12px 16px !important;\n min-height: 48px !important;\n }\n \n #text-chat-send {\n min-width: 48px !important;\n min-height: 48px !important;\n width: 48px !important;\n height: 48px !important;\n }\n \n .landing-screen {\n padding: 16px;\n }\n \n .landing-logo {\n font-size: 40px;\n }\n \n .landing-title {\n font-size: 18px;\n margin-bottom: 16px;\n }\n \n .mode-selection {\n flex-direction: column;\n gap: 12px;\n align-items: center;\n }\n \n .mode-card {\n max-width: 100%;\n width: 100%;\n padding: 16px;\n }\n \n .mode-card-icon {\n width: 50px;\n height: 50px;\n font-size: 28px;\n }\n \n .mode-card-title {\n font-size: 14px;\n }\n }\n \n @media (max-width: 480px) {\n #text-chat-widget {\n right: 8px !important;\n bottom: 8px !important;\n left: auto !important;\n top: auto !important;\n }\n \n #text-chat-button-container {\n width: 54px !important;\n height: 54px !important;\n }\n \n #text-chat-button {\n width: 54px !important;\n height: 54px !important;\n min-width: 54px !important;\n min-height: 54px !important;\n }\n \n #text-chat-panel {\n left: 8px !important;\n right: 8px !important;\n bottom: 86px !important; /* 54px button + 20px gap + 12px footer */\n top: 50px !important; /* Add top spacing for very small screens */\n height: auto !important;\n max-height: none !important;\n }\n \n #text-chat-panel .widget-header {\n padding: 8px 12px;\n min-height: 52px;\n }\n \n #text-chat-panel .header-title {\n font-size: 14px;\n }\n \n .landing-logo {\n font-size: 36px;\n }\n \n .landing-title {\n font-size: 16px;\n }\n }\n \n ").concat(u.enableHover?"\n #text-chat-button:hover {\n ".concat(a.hoverColor?"background: ".concat(a.hoverColor,";"):"","\n transform: scale(1.05);\n box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);\n }\n "):"","\n \n /* Prompt Animation Keyframes */\n @keyframes widget-shimmer {\n 0% { transform: translateX(-100%); }\n 100% { transform: translateX(200%); }\n }\n \n @keyframes widget-ripple {\n 0% { transform: scale(1); opacity: 0.6; }\n 100% { transform: scale(2.5); opacity: 0; }\n }\n \n @keyframes widget-float {\n 0%, 100% { transform: translateX(-50%) translateY(0); }\n 50% { transform: translateX(-50%) translateY(-8px); }\n }\n \n @keyframes widget-bounce {\n 0%, 100% { transform: translateX(-50%) translateY(0); }\n 50% { transform: translateX(-50%) translateY(-10px); }\n }\n \n @keyframes widget-pulse-ring {\n 0% { transform: scale(1); opacity: 0.4; }\n 100% { transform: scale(1.8); opacity: 0; }\n }\n \n /* Prompt Bubble Container */\n #text-chat-button-container {\n position: fixed;\n ").concat("bottom"===this.config.position.vertical?"bottom: ".concat((null===(o=this.config.position.offset)||void 0===o?void 0:o.y)||20,"px;"):"top: ".concat((null===(i=this.config.position.offset)||void 0===i?void 0:i.y)||20,"px;"),"\n ").concat("right"===this.config.position.horizontal?"right: ".concat((null===(r=this.config.position.offset)||void 0===r?void 0:r.x)||20,"px;"):"left: ".concat((null===(s=this.config.position.offset)||void 0===s?void 0:s.x)||20,"px;"),"\n width: ").concat(e,"px;\n height: ").concat(e,"px;\n z-index: 10001;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n \n @media (max-width: 768px) {\n #text-chat-button-container {\n right: 10px !important;\n bottom: 10px !important;\n left: auto !important;\n top: auto !important;\n }\n }\n \n @media (max-width: 480px) {\n #text-chat-button-container {\n right: 8px !important;\n bottom: 8px !important;\n left: auto !important;\n top: auto !important;\n }\n }\n \n /* Prompt Bubble Styles */\n .prompt-bubble {\n position: absolute;\n z-index: 10002;\n pointer-events: none;\n white-space: nowrap;\n }\n \n .prompt-bubble.top {\n bottom: calc(100% + 18px);\n left: 50%;\n transform: translateX(-50%);\n }\n \n .prompt-bubble.left {\n right: calc(100% + 12px);\n top: 50%;\n transform: translateY(-50%);\n }\n \n .prompt-bubble.right {\n left: calc(100% + 12px);\n top: 50%;\n transform: translateY(-50%);\n }\n \n /* Ensure animations preserve horizontal centering for top position */\n .prompt-bubble.top.animation-bounce {\n animation: widget-bounce 1s ease-in-out infinite;\n transform: translateX(-50%); /* Keep centering */\n }\n \n .prompt-bubble.top.animation-float {\n animation: widget-float 2s ease-in-out infinite;\n transform: translateX(-50%); /* Keep centering */\n }\n \n .prompt-bubble.top.animation-pulse {\n animation: pulse 2s ease-in-out infinite;\n transform: translateX(-50%); /* Keep centering */\n }\n \n .prompt-bubble-content {\n position: relative;\n padding: 8px 16px;\n border-radius: 20px;\n font-weight: 500;\n font-size: 14px;\n box-shadow: 0 4px 15px rgba(124, 58, 237, 0.3);\n overflow: hidden;\n }\n \n .prompt-bubble-shimmer {\n position: absolute;\n inset: 0;\n background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);\n animation: widget-shimmer 2s infinite;\n }\n \n .prompt-bubble.animation-bounce {\n animation: widget-bounce 1s ease-in-out infinite;\n }\n \n .prompt-bubble.animation-pulse {\n animation: pulse 2s ease-in-out infinite;\n }\n \n .prompt-bubble.animation-float {\n animation: widget-float 2s ease-in-out infinite;\n }\n \n /* Ensure top-positioned bubbles maintain horizontal centering during animations */\n .prompt-bubble.top.animation-bounce,\n .prompt-bubble.top.animation-float,\n .prompt-bubble.top.animation-pulse {\n /* Animation keyframes already include translateX(-50%) for centering */\n }\n \n /* Prompt Bubble Arrow */\n .prompt-bubble-arrow {\n position: absolute;\n width: 0;\n height: 0;\n border: 8px solid transparent;\n }\n \n .prompt-bubble.top .prompt-bubble-arrow {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n border-top-color: var(--prompt-bubble-bg-color, #7c3aed);\n border-bottom: none;\n margin-left: 0;\n }\n \n .prompt-bubble.left .prompt-bubble-arrow {\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n border-left-color: var(--prompt-bubble-bg-color, #7c3aed);\n border-right: none;\n }\n \n .prompt-bubble.right .prompt-bubble-arrow {\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n border-right-color: var(--prompt-bubble-bg-color, #7c3aed);\n border-left: none;\n }\n \n /* Pulse Rings */\n .prompt-pulse-rings {\n position: absolute;\n inset: 0;\n border-radius: 50%;\n pointer-events: none;\n }\n \n .prompt-pulse-ring {\n position: absolute;\n inset: 0;\n border-radius: 50%;\n animation: widget-pulse-ring 2s ease-out infinite;\n }\n \n .prompt-pulse-ring:nth-child(2) {\n animation-delay: 0.5s;\n }\n \n /* Mobile adjustments for prompt bubble */\n @media (max-width: 768px) {\n .prompt-bubble-content {\n font-size: 12px;\n padding: 6px 12px;\n }\n \n .prompt-bubble.top {\n bottom: calc(100% + 14px);\n }\n \n .prompt-bubble.left,\n .prompt-bubble.right {\n display: none; /* Hide side prompts on mobile */\n }\n }\n \n #text-chat-panel {\n display: none").concat(m,";\n position: fixed;\n bottom: calc(").concat(e,"px + 20px + 20px); /* Button + gap + reduced footer offset */\n ").concat("right"===this.config.position.horizontal?"right: 20px;":"left: 20px;","\n width: ").concat(l.width,"px;\n max-width: calc(100vw - 40px);\n height: ").concat(l.height,"px;\n max-height: calc(100vh - ").concat(e,"px - 40px - 20px); /* Account for footer height */\n background: transparent;\n border-radius: ").concat(l.borderRadius,"px;\n border: none;\n flex-direction: column;\n overflow: hidden;\n ").concat(l.backdropFilter?"backdrop-filter: ".concat(l.backdropFilter,";"):"","\n ").concat(u.enableSlide?"transition: all ".concat(u.duration,"s ease;"):"","\n box-sizing: border-box;\n }\n \n #text-chat-panel.open {\n display: flex").concat(m,";\n ").concat(u.enableSlide?"transform: translateY(0); opacity: 1;":"","\n }\n\n /* Shell for gradient border/background */\n .widget-shell { width: 100%; height: 100%; padding: 0; border-radius: ").concat(l.borderRadius,"px; background: transparent; box-shadow: 0 20px 60px rgba(0,0,0,0.15); overflow: hidden; display: flex; flex-direction: column; box-sizing: border-box; }\n .panel-inner { width: 100%; height: 100%; background: #ffffff; border-radius: ").concat(l.borderRadius,"px; border: ").concat(l.border,"; overflow: hidden; display:flex; flex-direction: column; padding: 0; box-sizing: border-box; max-width: 100%; }\n\n /* New structure styles matching provided design */\n #text-chat-panel .widget-container {\n width: 100%; height: 100%; background: #FFFFFF; overflow: visible; display: flex; flex-direction: column; border-radius: ").concat(l.borderRadius,"px;\n container-type: size;\n }\n \n /* Ensure content areas can scroll when height is constrained */\n #text-chat-panel .widget-container > .landing-screen,\n #text-chat-panel .widget-container > .voice-interface,\n #text-chat-panel .widget-container > .text-interface {\n flex: 1;\n overflow-y: auto;\n overflow-x: visible; /* Change from hidden to visible */\n }\n \n /* Header should not scroll */\n #text-chat-panel .widget-header {\n padding: 14px 16px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-top-left-radius: ").concat(l.borderRadius,"px;\n border-top-right-radius: ").concat(l.borderRadius,"px;\n flex-shrink: 0;\n box-sizing: border-box;\n position: relative;\n overflow: hidden;\n background: ").concat(d.backgroundColor||"#7C3AED").concat(m,";\n color: ").concat(d.textColor||"#FFFFFF").concat(m,";\n }\n \n #text-chat-panel .widget-header::before {\n content: '';\n position: absolute;\n top: -50%;\n right: -20%;\n width: 180px;\n height: 180px;\n background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);\n pointer-events: none;\n }\n \n #text-chat-panel .widget-header > div:first-child {\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 4px;\n position: relative;\n z-index: 1;\n }\n \n #text-chat-panel .header-title { font-size: 15px; font-weight: 600; margin: 0; }\n #text-chat-panel .header-status { display: flex; align-items: center; gap: 5px; font-size: 12px; margin: 0; }\n #text-chat-panel .status-dot { width: 6px; height: 6px; border-radius: 50%; animation: pulse 2s ease-in-out infinite; }\n /* Online indicator customization - inline styles take precedence */\n @keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.15); opacity: 0.8; } }\n /* Header icon buttons */\n .header-icon {\n background: rgba(255, 255, 255, 0.1);\n border: none;\n color: white;\n width: 34px;\n height: 34px;\n min-width: 34px;\n min-height: 34px;\n border-radius: 10px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background 0.2s;\n flex-shrink: 0;\n font-size: 16px;\n padding: 0;\n box-sizing: border-box;\n position: relative;\n z-index: 1;\n }\n \n .header-icon:hover {\n background: rgba(255, 255, 255, 0.2);\n }\n \n .header-icon svg {\n pointer-events: none;\n stroke: white;\n fill: none;\n }\n \n .back-btn.visible {\n display: flex !important;\n }\n\n ").concat(p&&this.landingScreen?this.landingScreen.generateCSS():"","\n\n ").concat(h?this.voiceInterface.generateCSS():"","\n ").concat(B?this.textInterface.generateCSS():"","\n \n /* Footer Branding */\n .widget-footer {\n box-sizing: border-box;\n }\n \n .footer-brand-link {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;\n }\n \n .footer-brand-link:hover {\n opacity: 0.9;\n }\n \n @media (max-width: 768px) {\n .widget-footer {\n height: 32px;\n }\n .widget-footer span {\n font-size: 10px;\n }\n .widget-footer span:last-child {\n font-size: 8px;\n }\n }\n \n #text-chat-send-hint {\n text-align: center;\n line-height: 1.4;\n }\n \n .agent-thinking {\n font-style: italic;\n color: #6B7280;\n }\n ")}setupWidgetEvents(){var A,e=this;if(this.shadowRoot){this.setupPromptAnimation();var t=this.shadowRoot.getElementById("text-chat-button");t&&(t.onclick=()=>{this.config.promptAnimation.hideAfterClick&&this.hidePrompt(),this.togglePanel()});var n=this.shadowRoot.getElementById("closeBtn");n&&(n.onclick=()=>{this._doTogglePanel()});var o,i=(null===(A=this.config.behavior)||void 0===A?void 0:A.mode)||"unified",r="unified"===i,s="unified"===i||"voice-only"===i,a="unified"===i||"text-only"===i,c=this.shadowRoot.getElementById("backBtn"),l=this.shadowRoot.getElementById("landingScreen"),d=this.shadowRoot.getElementById("textInterface"),u=this.shadowRoot.getElementById("voiceInterface");c&&(c.onclick=()=>{var A,e,t;if(null!==(A=this.voiceInterface)&&void 0!==A&&A.isShowingDomainError)return console.log("🔙 Back button clicked - clearing domain error and returning to landing"),this.voiceInterface.isShowingDomainError=!1,null!==(t=this.voiceInterface)&&void 0!==t&&t.resetConnectingState&&this.voiceInterface.resetConnectingState(),void this.showLanding();null!==(e=this.voiceInterface)&&void 0!==e&&e.isActive?this.showBackButtonWarning():this.showLanding()}),r&&this.landingScreen?(this.landingScreen.setupEventHandlers({onSelectVoice:(o=Qe(function*(){if(e.isStartingCall)console.log("⚠️ Call already starting, ignoring duplicate click");else{if("function"==typeof e.config.onVoiceCallButtonClick)try{e.config.onVoiceCallButtonClick({timestamp:Date.now(),widgetState:"start"})}catch(A){console.error("Error in onVoiceCallButtonClick callback:",A)}e.isStartingCall=!0;try{var A,t,n,o;if(e.showVoice(),null!==(A=e.voiceInterface)&&void 0!==A&&A.showConnectingState&&e.voiceInterface.showConnectingState(),null!==(t=e.voiceInterface)&&void 0!==t&&t.isMobile&&null!==(n=e.voiceInterface)&&void 0!==n&&n.createMobileMinimizedBar){var i,r=(null===(i=e.shadowRoot)||void 0===i?void 0:i.getElementById("text-chat-button"))||document.getElementById("text-chat-button");r&&(r.style.display="none"),e.voiceInterface.createMobileMinimizedBar(),e.voiceInterface.updateMobileStatus("connecting"),yield new Promise(A=>requestAnimationFrame(()=>requestAnimationFrame(A)))}if(yield e.startVoiceCall(),null!==(o=e.voiceInterface)&&void 0!==o&&o.isActive)console.log("✅ Voice call started successfully");else{var s,a,c;console.warn("⚠️ startVoiceCall() returned but call is not active");var l=null===(s=e.voiceInterface)||void 0===s||null===(s=s.shadowRoot)||void 0===s?void 0:s.getElementById("voiceIdleState"),d=!1;if(l&&"none"!==l.style.display){var u=l.querySelector(".voice-status-title");if(u){var g,p=u.textContent.trim(),h=null===(g=e.voiceInterface)||void 0===g?void 0:g.t("domainNotValidated");console.log("🔍 Checking for domain error - titleText:",p,"domainErrorTitle:",h),(p===h||p.includes("Domain not")||p.includes("not whitelisted"))&&(d=!0,console.log("🚫 Domain error detected - staying on voice interface, NOT returning to landing"))}}if(d)return e.currentView="voice",e.showVoice(),void console.log("✅ Staying on voice interface with domain error displayed");console.log("⚠️ Not a domain error - returning to landing screen"),null!==(a=e.voiceInterface)&&void 0!==a&&a.resetConnectingState&&e.voiceInterface.resetConnectingState(),"unified"===((null===(c=e.config.behavior)||void 0===c?void 0:c.mode)||"unified")&&e.showLanding()}}catch(A){var B,m,f,v;if(A.isServerRejection||"ServerRejected"===A.name)return void(null!==(v=e.voiceInterface)&&void 0!==v&&v.resetConnectingState&&e.voiceInterface.resetConnectingState());if(console.error("❌ Failed to start voice call:",A),null!==(B=e.voiceInterface)&&void 0!==B&&B.resetConnectingState&&e.voiceInterface.resetConnectingState(),null!==(m=e.voiceInterface)&&void 0!==m&&m.isMobile){var w,C;document.getElementById("mobile-voice-call-bar-container")&&null!==(w=e.voiceInterface)&&void 0!==w&&w.removeMobileMinimizedBar&&e.voiceInterface.removeMobileMinimizedBar();var y=(null===(C=e.shadowRoot)||void 0===C?void 0:C.getElementById("text-chat-button"))||document.getElementById("text-chat-button");y&&(y.style.display="")}"Call cancelled by user"!==A.message&&e.showErrorToast(A.message||"Failed to start voice call. Please try again.","error"),"unified"===((null===(f=e.config.behavior)||void 0===f?void 0:f.mode)||"unified")&&e.showLanding()}finally{e.isStartingCall=!1}}}),function(){return o.apply(this,arguments)}),onSelectText:()=>this.showText()}),"text"===this.currentView?(l&&l.classList.remove("active"),d&&d.classList.add("active"),u&&u.classList.remove("active"),c&&"unified"===i&&c.classList.add("visible"),g&&(g.style.display="")):"voice"===this.currentView?(l&&l.classList.remove("active"),d&&d.classList.remove("active"),u&&u.classList.add("active"),c&&"unified"===i&&c.classList.add("visible"),g&&(g.style.display="none")):(this.currentView="landing",l&&l.classList.add("active"),d&&d.classList.remove("active"),u&&u.classList.remove("active"),c&&"unified"===i&&c.classList.remove("visible"))):"voice-only"===i?(u&&u.classList.add("active"),d&&d.classList.remove("active"),l&&l.classList.remove("active")):"text-only"===i&&(d&&d.classList.add("active"),u&&u.classList.remove("active"),l&&l.classList.remove("active")),s&&(console.log("⚙️ Setting up voice interface event handlers"),this.voiceInterface.setupEventHandlers()),a&&(console.log("⚙️ Setting up text interface event handlers"),this.textInterface.setupEventHandlers());var g=this.shadowRoot.getElementById("newChatBtn");g&&(g.onclick=()=>this.textInterface.startNewChat(),r&&(g.style.display="none")),this.config.accessibility.keyboardNavigation&&this.setupKeyboardNavigation()}}startNewChat(){this.textInterface.startNewChat()}showLanding(){var A;if(this.shadowRoot){var e=null===(A=this.voiceInterface)||void 0===A||null===(A=A.shadowRoot)||void 0===A?void 0:A.getElementById("voiceIdleState");if(e&&"none"!==e.style.display){var t=e.querySelector(".voice-status-title");if(t){var n,o=t.textContent.trim();if(o===(null===(n=this.voiceInterface)||void 0===n?void 0:n.t("domainNotValidated"))||o.includes("Domain not")||o.includes("not whitelisted"))return void console.log("🚫 showLanding() called but domain error is displayed - preventing return to landing")}}if("unified"===(this.config.behavior.mode||"unified")){this.currentView="landing";var i=this.shadowRoot.getElementById("landingScreen"),r=this.shadowRoot.getElementById("textInterface"),s=this.shadowRoot.getElementById("voiceInterface"),a=this.shadowRoot.getElementById("backBtn"),c=this.shadowRoot.getElementById("newChatBtn");i&&i.classList.add("active"),r&&r.classList.remove("active"),s&&s.classList.remove("active"),a&&a.classList.remove("visible"),c&&(c.style.display="none")}}}showText(){if(this.shadowRoot){this.currentView="text";var A=this.shadowRoot.getElementById("landingScreen"),e=this.shadowRoot.getElementById("voiceInterface"),t=this.shadowRoot.getElementById("backBtn"),n=this.shadowRoot.getElementById("newChatBtn");A&&A.classList.remove("active"),e&&e.classList.remove("active"),this.textInterface.show();var o=this.config.behavior.mode||"unified";t&&"unified"===o&&t.classList.add("visible"),n&&(n.style.display="")}}showVoice(){if(this.shadowRoot){this.currentView="voice";var A=this.shadowRoot.getElementById("landingScreen"),e=this.shadowRoot.getElementById("textInterface"),t=this.shadowRoot.getElementById("voiceInterface"),n=this.shadowRoot.getElementById("backBtn"),o=this.shadowRoot.getElementById("newChatBtn");A&&A.classList.remove("active"),e&&e.classList.remove("active"),t&&t.classList.add("active");var i=this.config.behavior.mode||"unified";n&&"unified"===i&&n.classList.add("visible"),o&&(o.style.display="none")}}setupKeyboardNavigation(){document.addEventListener("keydown",A=>{"Escape"===A.key&&this.isOpen&&this.togglePanel()})}setupPromptAnimation(){var A=this;if(this.shadowRoot){var e=this.config.promptAnimation||{},t=!0===e.enabled;if(console.log("🎨 setupPromptAnimation called:",{hasPromptConfig:!!this.config.promptAnimation,promptConfig:e,enabled:e.enabled,isPromptEnabled:t,isOpen:this.isOpen}),!t)return console.log("❌ Prompt disabled, hiding"),void this.hidePrompt();if(this.isOpen?this.hidePrompt():this.showPrompt(),!this.isOpen&&null!==e.hideAfterSeconds&&e.hideAfterSeconds>0&&(this.promptAutoHideTimer=setTimeout(()=>{this.hidePrompt()},1e3*e.hideAfterSeconds)),this.voiceInterface&&this.voiceInterface.sdk){var n=this.config.onConversationStart;this.config.onConversationStart=function(){var e=A.shadowRoot.getElementById("prompt-pulse-rings");e&&(e.style.display="none"),n&&n(...arguments)},this.voiceInterface.sdk.voiceSDK&&this.voiceInterface.sdk.voiceSDK.on("recordingStarted",()=>{var A=this.shadowRoot.getElementById("prompt-pulse-rings");A&&(A.style.display="none")})}}}hidePrompt(){if(this.shadowRoot){this.promptAutoHideTimer&&(clearTimeout(this.promptAutoHideTimer),this.promptAutoHideTimer=null);var A=this.shadowRoot.getElementById("prompt-bubble");A||this.shadowRoot===document||(A=document.getElementById("prompt-bubble")),A&&(A.style.display="none",A.style.visibility="hidden");var e=this.shadowRoot.getElementById("prompt-pulse-rings");e||this.shadowRoot===document||(e=document.getElementById("prompt-pulse-rings")),e&&(e.style.display="none",e.style.visibility="hidden")}}showPrompt(){if(this.shadowRoot){var A=this.config.promptAnimation||{},e=!1!==A.enabled;if(console.log("👁️ showPrompt called:",{hasPromptConfig:!!this.config.promptAnimation,promptConfig:A,enabled:A.enabled,isPromptEnabled:e,shadowRoot:!!this.shadowRoot}),e){var t=()=>{var e=this.shadowRoot.getElementById("prompt-bubble");if(e||this.shadowRoot===document||(e=document.getElementById("prompt-bubble")),e?(e.style.display="block",e.style.visibility="visible",e.style.opacity="1",console.log("✅ Prompt bubble shown:",e)):console.warn("⚠️ Prompt bubble not found in shadowRoot or document"),!1!==A.showPulseRings){var t=this.shadowRoot.getElementById("prompt-pulse-rings");t||this.shadowRoot===document||(t=document.getElementById("prompt-pulse-rings")),t&&(t.style.display="block",t.style.visibility="visible",t.style.opacity="1")}};t();var n=this.shadowRoot.getElementById("prompt-bubble"),o=!1!==A.showPulseRings?this.shadowRoot.getElementById("prompt-pulse-rings"):null;n&&(!1===A.showPulseRings||o)||(setTimeout(()=>{t()},100),setTimeout(()=>{t()},500)),null!==A.hideAfterSeconds&&A.hideAfterSeconds>0&&(this.promptAutoHideTimer&&clearTimeout(this.promptAutoHideTimer),this.promptAutoHideTimer=setTimeout(()=>{this.hidePrompt()},1e3*A.hideAfterSeconds))}else console.log("❌ Prompt not enabled, skipping show")}}togglePanel(){this.shadowRoot&&this._doTogglePanel()}_doTogglePanel(){if(this.shadowRoot){this.isOpen=!this.isOpen;var A=this.shadowRoot.getElementById("text-chat-panel");A&&A.classList.toggle("open"),this.isOpen?(this.hidePrompt(),setTimeout(()=>{var A=this.shadowRoot.getElementById("messageInput");A&&A.focus()},100)):(this.showPrompt(),setTimeout(()=>{var A,e=this.shadowRoot.getElementById("prompt-bubble");e&&"none"===e.style.display&&(e.style.display="block");var t=this.shadowRoot.getElementById("prompt-pulse-rings");t&&!1!==(null===(A=this.config.promptAnimation)||void 0===A?void 0:A.showPulseRings)&&"none"===t.style.display&&(t.style.display="block")},100)),this.isOpen&&!this.isActive&&this.config.behavior.autoConnect&&this.startChat()}}showErrorToast(A){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"error",t=document.createElement("div");t.className="widget-toast widget-toast-".concat(e),t.textContent=A;var n="error"===e?"#ef4444":"warning"===e?"#f59e0b":"#3b82f6";if(Object.assign(t.style,{position:"fixed",bottom:"20px",left:"50%",transform:"translateX(-50%)",backgroundColor:n,color:"white",padding:"12px 24px",borderRadius:"8px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",zIndex:"10000",fontSize:"14px",fontWeight:"500",maxWidth:"90%",textAlign:"center",animation:"slideUp 0.3s ease-out",fontFamily:"inherit"}),!document.getElementById("widget-toast-styles")){var o=document.createElement("style");o.id="widget-toast-styles",o.textContent="\n @keyframes slideUp {\n from {\n opacity: 0;\n transform: translateX(-50%) translateY(20px);\n }\n to {\n opacity: 1;\n transform: translateX(-50%) translateY(0);\n }\n }\n @keyframes slideDown {\n from {\n opacity: 1;\n transform: translateX(-50%) translateY(0);\n }\n to {\n opacity: 0;\n transform: translateX(-50%) translateY(20px);\n }\n }\n ",document.head.appendChild(o)}(this.shadowRoot||document.body).appendChild(t),setTimeout(()=>{t.style.animation="slideDown 0.3s ease-out",setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t)},300)},4e3)}showConfirmModal(A){var{title:e="Confirm",message:t="Are you sure?",confirmText:n="Confirm",cancelText:o="Cancel",confirmButtonClass:i="primary",onConfirm:r,onCancel:s}=A,a=document.createElement("div");a.className="widget-modal-overlay",a.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n background: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 10000;\n ";var c=document.createElement("div");c.className="widget-confirm-modal",c.style.cssText="\n background: white;\n border-radius: 12px;\n padding: 24px;\n max-width: 400px;\n width: 90%;\n box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);\n ";var l="danger"===i?"widget-modal-btn--danger":"widget-modal-btn--primary";c.innerHTML='\n <h3 style="margin: 0 0 12px 0; font-size: 18px; font-weight: 600; color: #1e293b;">'.concat(e,'</h3>\n <p style="margin: 0 0 24px 0; color: #64748b; font-size: 14px; line-height: 1.5;">').concat(t,'</p>\n <div style="display: flex; gap: 12px; justify-content: flex-end;">\n <button class="widget-modal-btn widget-modal-btn--cancel" data-action="cancel" style="\n padding: 10px 20px;\n border: 1px solid #e2e8f0;\n background: white;\n color: #64748b;\n border-radius: 8px;\n cursor: pointer;\n font-size: 14px;\n font-weight: 500;\n ">\n ').concat(o,'\n </button>\n <button class="widget-modal-btn ').concat(l,'" data-action="confirm" style="\n padding: 10px 20px;\n border: none;\n background: ').concat("danger"===i?"#ef4444":"#7c3aed",';\n color: white;\n border-radius: 8px;\n cursor: pointer;\n font-size: 14px;\n font-weight: 500;\n ">\n ').concat(n,"\n </button>\n </div>\n "),a.appendChild(c),(this.shadowRoot||document.body).appendChild(a),c.querySelector('[data-action="confirm"]').onclick=()=>{a.remove(),null==r||r()},c.querySelector('[data-action="cancel"]').onclick=()=>{a.remove(),null==s||s()},a.onclick=A=>{A.target===a&&(a.remove(),null==s||s())}}startChat(){var A=this;return Qe(function*(){A.isActive=!0,A.textInterface.setActive(!0)})()}sendMessage(){var A=this;return Qe(function*(){yield A.textInterface.sendMessage()})()}updateSendButtonState(){this.textInterface.updateSendButtonState()}showBackButtonWarning(){var A,e;null!==(A=this.voiceInterface)&&void 0!==A&&A.isActive&&null!==(e=this.voiceInterface.desktop)&&void 0!==e&&e.showBackButtonWarning&&this.voiceInterface.desktop.showBackButtonWarning()}getSignedUrl(){var A=this;return Qe(function*(){if(A.config.signedUrl)return A.config.signedUrl;if(!A.config.agentId)throw new Error("agentId is required when signedUrl is not provided");var e=A.config.websocketUrl||"wss://backend.talktopc.com/ws/conv",t=new URLSearchParams;t.append("agentId",A.config.agentId),A.config.appId&&t.append("appId",A.config.appId),!1!==A.config.demo&&t.append("demo","true");var n="".concat(e,"?").concat(t.toString());return"undefined"!=typeof __DEV__&&__DEV__&&console.log("[TTPAgentSDK] WebSocket URL:",n),n})()}addMessage(A,e){this.textInterface.addMessage(A,e)}beginStreaming(){this.textInterface.beginStreaming()}appendStreamingChunk(A){this.textInterface.appendStreamingChunk(A)}finalizeStreaming(A){this.textInterface.finalizeStreaming(A)}stopStreamingState(){this.textInterface.stopStreamingState()}showError(A){this.textInterface.showError(A)}updateStatus(A){}updateConfig(A){var e,t,n,o,i,r,s,a,c,l,d=Ue({},this.config);A.panel&&(d.panel=Ue(Ue({},this.config.panel),A.panel)),A.voice&&(d.voice=Ue(Ue({},this.config.voice),A.voice),A.voice.micButtonHint&&(d.voice.micButtonHint=Ue(Ue({},null===(c=this.config.voice)||void 0===c?void 0:c.micButtonHint),A.voice.micButtonHint))),A.text&&(d.text=Ue(Ue({},this.config.text),A.text),A.text.sendButtonHint&&(d.text.sendButtonHint=Ue(Ue({},null===(l=this.config.text)||void 0===l?void 0:l.sendButtonHint),A.text.sendButtonHint))),void 0!==A.language&&(d.language=A.language),void 0!==A.language&&(["he","ar"].includes(A.language)?d.direction="rtl":void 0===A.direction&&(d.direction="ltr")),A.translations&&(d.translations=A.translations,this.translations=A.translations),A.button&&(d.button=Ue(Ue({},this.config.button),A.button)),A.header&&(d.header=Ue(Ue({},this.config.header),A.header)),A.icon&&(d.icon=Ue(Ue({},this.config.icon),A.icon)),A.messages&&(d.messages=Ue(Ue({},this.config.messages),A.messages)),A.animation&&(d.animation=Ue(Ue({},this.config.animation),A.animation)),A.behavior&&(d.behavior=Ue(Ue({},this.config.behavior),A.behavior)),A.accessibility&&(d.accessibility=Ue(Ue({},this.config.accessibility),A.accessibility)),A.tooltips&&(d.tooltips=Ue(Ue({},this.config.tooltips),A.tooltips)),A.landing&&(d.landing=Ue(Ue({},this.config.landing),A.landing)),A.footer&&(d.footer=Ue(Ue({},this.config.footer),A.footer)),void 0!==A.direction&&void 0===d.direction&&(d.direction=A.direction),void 0!==A.primaryColor&&(d.primaryColor=A.primaryColor),d.onConversationStart=void 0!==A.onConversationStart?A.onConversationStart:this.config.onConversationStart,d.onConversationEnd=void 0!==A.onConversationEnd?A.onConversationEnd:this.config.onConversationEnd,d.onBargeIn=void 0!==A.onBargeIn?A.onBargeIn:this.config.onBargeIn,d.onAudioStartPlaying=void 0!==A.onAudioStartPlaying?A.onAudioStartPlaying:this.config.onAudioStartPlaying,d.onAudioStoppedPlaying=void 0!==A.onAudioStoppedPlaying?A.onAudioStoppedPlaying:this.config.onAudioStoppedPlaying,d.onSubtitleDisplay=void 0!==A.onSubtitleDisplay?A.onSubtitleDisplay:this.config.onSubtitleDisplay,d.onVoiceCallButtonClick=void 0!==A.onVoiceCallButtonClick?A.onVoiceCallButtonClick:this.config.onVoiceCallButtonClick,void 0!==A.useShadowDOM&&(d.useShadowDOM=A.useShadowDOM),Object.keys(A).forEach(e=>{["panel","button","header","footer","icon","messages","direction","voice","text","animation","behavior","accessibility","language","tooltips","landing","primaryColor","useShadowDOM","onConversationStart","onConversationEnd","onBargeIn","onAudioStartPlaying","onAudioStoppedPlaying","onSubtitleDisplay","onVoiceCallButtonClick"].includes(e)||(d[e]=A[e])}),null===(e=this.config)||void 0===e||e.language;var u=!1!==(null===(t=this.config)||void 0===t?void 0:t.useShadowDOM);if(this.config=this.mergeWithDefaults(d),!1!==this.config.useShadowDOM===u&&this.container){var g=document.getElementById("ttp-widget-shadow-host");g&&!this.config.useShadowDOM&&g.remove();var p=document.getElementById("ttp-widget-container");if(p&&this.config.useShadowDOM&&p.remove(),this.config.useShadowDOM)if(this.shadowRoot)this.container=this.shadowRoot;else{var h=document.getElementById("ttp-widget-shadow-host");h?(this.shadowRoot=h.shadowRoot,this.container=this.shadowRoot):(this.createShadowHost(),this.container=this.shadowRoot)}else{if(this.regularContainer)this.container=this.regularContainer;else{var B=document.getElementById("ttp-widget-container");B?(this.regularContainer=B,this.container=B):(this.createRegularContainer(),this.container=this.regularContainer)}this.shadowRoot=document}}else{var m=document.getElementById("ttp-widget-shadow-host");m&&m.remove();var f=document.getElementById("ttp-widget-container");if(f&&f.remove(),!1===u){var v=document.getElementById("ttp-widget-styles");v&&v.remove()}this.config.useShadowDOM?(this.createShadowHost(),this.container=this.shadowRoot):(this.createRegularContainer(),this.container=this.regularContainer,this.shadowRoot=document)}var w=this.config.language||"en",C=Ue(Ue(Ue({},this.config),this.config.voice),{},{language:w,translations:this.translations,shadowRoot:this.shadowRoot,signedUrl:this.config.signedUrl,agentSettingsOverride:this.config.agentSettingsOverride,visualAssistant:this.config.visualAssistant,outputContainer:(null===(n=this.config.voice)||void 0===n?void 0:n.outputContainer)||"raw",outputEncoding:(null===(o=this.config.voice)||void 0===o?void 0:o.outputEncoding)||"pcm",outputSampleRate:(null===(i=this.config.voice)||void 0===i?void 0:i.outputSampleRate)||44100,outputChannels:(null===(r=this.config.voice)||void 0===r?void 0:r.outputChannels)||1,outputBitDepth:(null===(s=this.config.voice)||void 0===s?void 0:s.outputBitDepth)||16,onConversationStart:this.config.onConversationStart,onConversationEnd:this.config.onConversationEnd,onBargeIn:this.config.onBargeIn,onAudioStartPlaying:this.config.onAudioStartPlaying,onAudioStoppedPlaying:this.config.onAudioStoppedPlaying,onSubtitleDisplay:this.config.onSubtitleDisplay});this.voiceInterface=new fe(C);var y=Ue(Ue(Ue({},this.config),this.config.text),{},{language:w,translations:this.translations,shadowRoot:this.shadowRoot});if(this.textInterface=new Ce(y,this.sdk),"unified"===((null===(a=this.config.behavior)||void 0===a?void 0:a.mode)||"unified")){var b=Ue(Ue({},this.config),{},{translations:this.translations,shadowRoot:this.shadowRoot});this.landingScreen=new ye(b)}else this.landingScreen=null;this.createWidget(),this.textInterface&&this.textInterface.updateInputAttributes&&this.textInterface.updateInputAttributes()}destroy(){this.promptAutoHideTimer&&(clearTimeout(this.promptAutoHideTimer),this.promptAutoHideTimer=null);var A=document.getElementById("ttp-widget-shadow-host");A&&A.remove();var e=document.getElementById("ttp-widget-container");e&&e.remove();var t=document.getElementById("ttp-widget-styles");t&&t.remove(),this.sdk&&this.sdk.destroy(),this.voiceInterface&&this.voiceInterface.destroy()}startVoiceCall(){var A=this;return Qe(function*(){yield A.voiceInterface.startVoiceCall(),A._flushPendingClientTools()})()}endVoiceCall(){this.voiceInterface.endVoiceCall()}toggleMute(){this.voiceInterface.toggleMute()}toggleSpeaker(){this.voiceInterface.toggleSpeaker()}injectData(A){var e=arguments,t=this;return Qe(function*(){var n,o=e.length>1&&void 0!==e[1]?e[1]:{};if(!A||!A.trim())throw console.warn("TTPChatWidget: Cannot inject empty data"),new Error("Cannot inject empty data");if(!t.voiceInterface||!t.voiceInterface.isActive)throw console.warn("TTPChatWidget: Cannot inject data - voice call is not active"),new Error("Voice call is not active");var i=null===(n=t.voiceInterface)||void 0===n?void 0:n.getVoiceSDK();if(!i)throw console.warn("TTPChatWidget: VoiceSDK not available"),new Error("VoiceSDK not available");try{return yield i.injectData(A,Ue(Ue({},o),{},{source:o.source||"widget_programmatic"}))}catch(A){throw A}})()}registerToolHandler(A,e){var t;return null!==(t=this.voiceInterface)&&void 0!==t&&t.sdk?this.voiceInterface.sdk.registerToolHandler(A,e):(this._pendingClientTools=this._pendingClientTools||[],this._pendingClientTools.push({name:A,handler:e}),console.warn("TTPChatWidget: Tool handler queued - voice interface SDK not ready yet"),this._flushPendingClientTools(),this)}unregisterToolHandler(A){var e;return null!==(e=this.voiceInterface)&&void 0!==e&&e.sdk?this.voiceInterface.sdk.unregisterToolHandler(A):(this._pendingClientTools&&(this._pendingClientTools=this._pendingClientTools.filter(e=>e.name!==A)),this)}hasToolHandler(A){var e;return!(null===(e=this.voiceInterface)||void 0===e||!e.sdk)&&this.voiceInterface.sdk.hasToolHandler(A)}getRegisteredTools(){var A;return null!==(A=this.voiceInterface)&&void 0!==A&&A.sdk?this.voiceInterface.sdk.getRegisteredTools():this._pendingClientTools?this._pendingClientTools.map(A=>A.name):[]}_flushPendingClientTools(){var A;this._pendingClientTools&&null!==(A=this.voiceInterface)&&void 0!==A&&A.sdk&&(this._pendingClientTools.forEach(A=>{var{name:e,handler:t}=A;this.voiceInterface.sdk.registerToolHandler(e,t)}),this._pendingClientTools=null,console.log("TTPChatWidget: Flushed pending client tools"))}registerClientTool(A,e){return this.registerToolHandler(A,e)}unregisterClientTool(A){return this.unregisterToolHandler(A)}hasClientTool(A){return this.hasToolHandler(A)}getRegisteredClientTools(){return this.getRegisteredTools()}}console.log("[TTP SDK] ✅ Sandbox Deployment Test - v2.33.9-SANDBOX (with NEW conversation panel: collapsed/expanded states & compact design)");var Ee="2.18.0";const ke={VoiceSDK_v2:FA,TextChatSDK:kA,WebSocketManager:KA,AudioRecorder:C,AudioPlayer:RA,EventEmitter:h,VoiceButton:GA,VanillaVoiceButton:JA,AgentSDK:ZA,TTPChatWidget:Ie,VERSION:Ee};export{ZA as AgentSDK,RA as AudioPlayer,C as AudioRecorder,h as EventEmitter,s as MicPermissionModals,r as MicPermissionUtils,Ie as TTPChatWidget,kA as TextChatSDK,Ee as VERSION,JA as VanillaVoiceButton,GA as VoiceButton,FA as VoiceSDK_v2,KA as WebSocketManager,ke as default};
3
3
  //# sourceMappingURL=agent-widget.esm.js.map