ttp-agent-sdk 2.29.1 → 2.29.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/agent-widget.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/*! For license information please see agent-widget.js.LICENSE.txt */
|
|
2
|
-
!function(A,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.TTPAgentSDK=e():A.TTPAgentSDK=e()}(window,()=>(()=>{var A={354:function(A){A.exports=function(){"use strict";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,r){function i(A){try{s(n.next(A))}catch(A){r(A)}}function a(A){try{s(n.throw(A))}catch(A){r(A)}}function s(A){var e;A.done?o(A.value):(e=A.value,e instanceof t?e:new t(function(A){A(e)})).then(i,a)}s((n=n.apply(A,e||[])).next())})}function o(A,e){var t,n,o,r,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(t)throw new TypeError("Generator is already executing.");for(;i;)try{if(t=1,n&&(o=2&r[0]?n.return:r[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,r[1])).done)return o;switch(n=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return i.label++,{value:r[1],done:!1};case 5:i.label++,n=r[1],r=[0];continue;case 7:r=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){i=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){i.label=r[1];break}if(6===r[0]&&i.label<o[1]){i.label=o[1],o=r;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(r);break}o[2]&&i.ops.pop(),i.trys.pop();continue}r=e.call(A,i)}catch(A){r=[6,A],n=0}finally{t=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function r(A,e,t){if(t||2===arguments.length)for(var n,o=0,r=e.length;o<r;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 i=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}(),a=function(A,e){return i.fromClientRect(A,e.getBoundingClientRect())},s=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 r=A.charCodeAt(t++);56320==(64512&r)?e.push(((1023&o)<<10)+(1023&r)+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,r="";++o<t;){var i=A[o];i<=65535?n.push(i):(i-=65536,n.push(55296+(i>>10),i%1024+56320)),(o+1===t||n.length>16384)&&(r+=String.fromCharCode.apply(String,n),n.length=0)}return r},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u="undefined"==typeof Uint8Array?[]:new Uint8Array(256),d=0;d<64;d++)u[l.charCodeAt(d)]=d;for(var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h="undefined"==typeof Uint8Array?[]:new Uint8Array(256),p=0;p<64;p++)h[g.charCodeAt(p)]=p;for(var f=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},B=function(){function A(A,e,t,n,o,r){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=n,this.index=o,this.data=r}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}(),w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",v="undefined"==typeof Uint8Array?[]:new Uint8Array(256),m=0;m<64;m++)v[w.charCodeAt(m)]=m;var y=10,C=13,Q=15,b=17,F=18,U=19,E=20,S=21,x=22,I=24,H=25,k=26,T=27,D=28,K=30,O=32,P=33,L=34,R=35,M=37,V=38,_=39,G=40,N=42,j=[9001,65288],W="×",J="÷",X=function(A){var e,t,n,o=function(A){var e,t,n,o,r,i=.75*A.length,a=A.length,s=0;"="===A[A.length-1]&&(i--,"="===A[A.length-2]&&i--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(i):new Array(i),l=Array.isArray(c)?c:new Uint8Array(c);for(e=0;e<a;e+=4)t=h[A.charCodeAt(e)],n=h[A.charCodeAt(e+1)],o=h[A.charCodeAt(e+2)],r=h[A.charCodeAt(e+3)],l[s++]=t<<2|n>>4,l[s++]=(15&n)<<4|o>>2,l[s++]=(3&o)<<6|63&r;return c}(A),r=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),i=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),a=f(i,12,r[4]/2),s=2===r[5]?f(i,(24+r[4])/2):(e=r,t=Math.ceil((24+r[4])/4),e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,t,n)));return new B(r[0],r[1],r[2],r[3],a,s)}("KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3g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LAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLA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AwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcAB9cPKwkyCToJMAB1AHUAdQBCCUoJTQl1AFUJXAljCWcJawkwADAAMAAwAHMJdQB2CX4JdQCECYoJjgmWCXUAngkwAGAAYABxAHUApgn3A64JtAl1ALkJdQDACTAAMAAwADAAdQB1AHUAdQB1AHUAdQB1AHUAowYNBMUIMAAwADAAMADICcsJ0wnZCRUE4QkwAOkJ8An4CTAAMAB1AAAKvwh1AAgKDwoXCh8KdQAwACcKLgp1ADYKqAmICT4KRgowADAAdQB1AE4KMAB1AFYKdQBeCnUAZQowADAAMAAwADAAMAAwADAAMAAVBHUAbQowADAAdQC5CXUKMAAwAHwBxAijBogEMgF9CoQKiASMCpQKmgqIBKIKqgquCogEDQG2Cr4KxgrLCjAAMADTCtsKCgHjCusK8Qr5CgELMAAwADAAMAB1AIsECQsRC3UANAEZCzAAMAAwADAAMAB1ACELKQswAHUANAExCzkLdQBBC0kLMABRC1kLMAAwADAAMAAwADAAdQBhCzAAMAAwAGAAYABpC3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AcsBywHLAcsBywHLAcsBywHPA/SBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gbSBtIG0gYUD0QPlQCVAJUAMAAwADAAMACVAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAG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AEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAe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B4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAFAAUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAEAAQABAAeAB4AKwArACsAKwArABMADQANAA0AUAATAA0AUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUAANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVw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QABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQADQAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAVABVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBUAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVAFUAVQBVACsAKwArACsAKwArACsAKwArACsAKwArAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAKwArACsAKwBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAKwArACsAKwAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYABgAGAAYAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAKwArACsAKwArAFYABABWAFYAVgBWAFYAVgBWAFYAVgBWAB4AVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgArAFYAVgBWAFYAVgArAFYAKwBWAFYAKwBWAFYAKwBWAFYAVgBWAFYAVgBWAFYAVgBWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4A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AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeACsAKwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAgACUAJQAgACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAgACAAIAAgACAAIAAgACAAIAAgACUAJQAgACAAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACAAIAAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAgACAAIAAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAlACUAJQAlACUAJQAlACUAJQAlACUAVwBXACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA=="),Y=[K,36],z=[1,2,3,5],Z=[y,8],q=[T,k],$=z.concat(Z),AA=[V,_,G,L,R],eA=[Q,C],tA=function(A,e,t,n){var o=n[t];if(Array.isArray(A)?-1!==A.indexOf(o):A===o)for(var r=t;r<=n.length;){if((s=n[++r])===e)return!0;if(s!==y)break}if(o===y)for(r=t;r>0;){var i=n[--r];if(Array.isArray(A)?-1!==A.indexOf(i):A===i)for(var a=t;a<=n.length;){var s;if((s=n[++a])===e)return!0;if(s!==y)break}if(i!==y)break}return!1},nA=function(A,e){for(var t=A;t>=0;){var n=e[t];if(n!==y)return n;t--}return 0},oA=function(A,e,t,n,o){if(0===t[n])return W;var r=n-1;if(Array.isArray(o)&&!0===o[r])return W;var i=r-1,a=r+1,s=e[r],c=i>=0?e[i]:0,l=e[a];if(2===s&&3===l)return W;if(-1!==z.indexOf(s))return"!";if(-1!==z.indexOf(l))return W;if(-1!==Z.indexOf(l))return W;if(8===nA(r,e))return J;if(11===X.get(A[r]))return W;if((s===O||s===P)&&11===X.get(A[a]))return W;if(7===s||7===l)return W;if(9===s)return W;if(-1===[y,C,Q].indexOf(s)&&9===l)return W;if(-1!==[b,F,U,I,D].indexOf(l))return W;if(nA(r,e)===x)return W;if(tA(23,x,r,e))return W;if(tA([b,F],S,r,e))return W;if(tA(12,12,r,e))return W;if(s===y)return J;if(23===s||23===l)return W;if(16===l||16===s)return J;if(-1!==[C,Q,S].indexOf(l)||14===s)return W;if(36===c&&-1!==eA.indexOf(s))return W;if(s===D&&36===l)return W;if(l===E)return W;if(-1!==Y.indexOf(l)&&s===H||-1!==Y.indexOf(s)&&l===H)return W;if(s===T&&-1!==[M,O,P].indexOf(l)||-1!==[M,O,P].indexOf(s)&&l===k)return W;if(-1!==Y.indexOf(s)&&-1!==q.indexOf(l)||-1!==q.indexOf(s)&&-1!==Y.indexOf(l))return W;if(-1!==[T,k].indexOf(s)&&(l===H||-1!==[x,Q].indexOf(l)&&e[a+1]===H)||-1!==[x,Q].indexOf(s)&&l===H||s===H&&-1!==[H,D,I].indexOf(l))return W;if(-1!==[H,D,I,b,F].indexOf(l))for(var u=r;u>=0;){if((d=e[u])===H)return W;if(-1===[D,I].indexOf(d))break;u--}if(-1!==[T,k].indexOf(l))for(u=-1!==[b,F].indexOf(s)?i:r;u>=0;){var d;if((d=e[u])===H)return W;if(-1===[D,I].indexOf(d))break;u--}if(V===s&&-1!==[V,_,L,R].indexOf(l)||-1!==[_,L].indexOf(s)&&-1!==[_,G].indexOf(l)||-1!==[G,R].indexOf(s)&&l===G)return W;if(-1!==AA.indexOf(s)&&-1!==[E,k].indexOf(l)||-1!==AA.indexOf(l)&&s===T)return W;if(-1!==Y.indexOf(s)&&-1!==Y.indexOf(l))return W;if(s===I&&-1!==Y.indexOf(l))return W;if(-1!==Y.concat(H).indexOf(s)&&l===x&&-1===j.indexOf(A[a])||-1!==Y.concat(H).indexOf(l)&&s===F)return W;if(41===s&&41===l){for(var g=t[r],h=1;g>0&&41===e[--g];)h++;if(h%2!=0)return W}return s===O&&l===P?W:J},rA=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,r){var i=X.get(A);if(i>50?(o.push(!0),i-=50):o.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(A))return n.push(r),t.push(16);if(4===i||11===i){if(0===r)return n.push(r),t.push(K);var a=t[r-1];return-1===$.indexOf(a)?(n.push(n[r-1]),t.push(a)):(n.push(r),t.push(K))}return n.push(r),31===i?t.push("strict"===e?S:M):i===N||29===i?t.push(K):43===i?A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(M):t.push(K):void t.push(i)}),[n,t,o]}(A,e.lineBreak),n=t[0],o=t[1],r=t[2];"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(o=o.map(function(A){return-1!==[H,K,N].indexOf(A)?M:A}));var i="keep-all"===e.wordBreak?r.map(function(e,t){return e&&A[t]>=19968&&A[t]<=40959}):void 0;return[n,o,i]},iA=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}(),aA=45,sA=43,cA=-1,lA=function(A){return A>=48&&A<=57},uA=function(A){return lA(A)||A>=65&&A<=70||A>=97&&A<=102},dA=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},hA=function(A){return gA(A)||lA(A)||A===aA},pA=function(A){return A>=0&&A<=8||11===A||A>=14&&A<=31||127===A},fA=function(A,e){return 92===A&&10!==e},BA=function(A,e,t){return A===aA?gA(e)||fA(e,t):!!gA(A)||!(92!==A||!fA(A,e))},wA=function(A,e,t){return A===sA||A===aA?!!lA(e)||46===e&&lA(t):lA(46===A?e:A)},vA=function(A){var e=0,t=1;A[e]!==sA&&A[e]!==aA||(A[e]===aA&&(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 r=[];lA(A[e]);)r.push(A[e++]);var i=r.length,a=i?parseInt(c.apply(void 0,r),10):0;69!==A[e]&&101!==A[e]||e++;var s=1;A[e]!==sA&&A[e]!==aA||(A[e]===aA&&(s=-1),e++);for(var l=[];lA(A[e]);)l.push(A[e++]);var u=l.length?parseInt(c.apply(void 0,l),10):0;return t*(o+a*Math.pow(10,-i))*Math.pow(10,s*u)},mA={type:2},yA={type:3},CA={type:4},QA={type:13},bA={type:8},FA={type:21},UA={type:9},EA={type:10},SA={type:11},xA={type:12},IA={type:14},HA={type:23},kA={type:1},TA={type:25},DA={type:24},KA={type:26},OA={type:27},PA={type:28},LA={type:29},RA={type:31},MA={type:32},VA=function(){function A(){this._value=[]}return A.prototype.write=function(A){this._value=this._value.concat(s(A))},A.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==MA;)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(hA(e)||fA(t,n)){var o=BA(e,t,n)?2:1;return{type:5,value:this.consumeName(),flags:o}}break;case 36:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),QA;break;case 39:return this.consumeStringToken(39);case 40:return mA;case 41:return yA;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),IA;break;case sA:if(wA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 44:return CA;case aA:var r=A,i=this.peekCodePoint(0),a=this.peekCodePoint(1);if(wA(r,i,a))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(BA(r,i,a))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(i===aA&&62===a)return this.consumeCodePoint(),this.consumeCodePoint(),DA;break;case 46:if(wA(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 s=this.consumeCodePoint();if(42===s&&47===(s=this.consumeCodePoint()))return this.consumeToken();if(s===cA)return this.consumeToken()}break;case 58:return KA;case 59:return OA;case 60:if(33===this.peekCodePoint(0)&&this.peekCodePoint(1)===aA&&this.peekCodePoint(2)===aA)return this.consumeCodePoint(),this.consumeCodePoint(),TA;break;case 64:var l=this.peekCodePoint(0),u=this.peekCodePoint(1),d=this.peekCodePoint(2);if(BA(l,u,d))return{type:7,value:this.consumeName()};break;case 91:return PA;case 92:if(fA(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case 93:return LA;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),bA;break;case 123:return SA;case 125:return xA;case 117:case 85:var g=this.peekCodePoint(0),h=this.peekCodePoint(1);return g!==sA||!uA(h)&&63!==h||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),UA;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),FA;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),EA;break;case cA:return MA}return dA(A)?(this.consumeWhiteSpace(),RA):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();uA(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)===aA&&uA(this.peekCodePoint(1))){this.consumeCodePoint(),e=this.consumeCodePoint();for(var o=[];uA(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(),HA)}for(;;){var n=this.consumeCodePoint();if(n===cA||41===n)return{type:22,value:c.apply(void 0,A)};if(dA(n))return this.consumeWhiteSpace(),this.peekCodePoint(0)===cA||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:c.apply(void 0,A)}):(this.consumeBadUrlRemnants(),HA);if(34===n||39===n||40===n||pA(n))return this.consumeBadUrlRemnants(),HA;if(92===n){if(!fA(n,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),HA;A.push(this.consumeEscapedCodePoint())}else A.push(n)}},A.prototype.consumeWhiteSpace=function(){for(;dA(this.peekCodePoint(0));)this.consumeCodePoint()},A.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(41===A||A===cA)return;fA(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),kA;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()):fA(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!==sA&&t!==aA||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===sA||n===aA)&&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),r=this.peekCodePoint(2);return BA(n,o,r)?{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(uA(A)){for(var e=c(A);uA(this.peekCodePoint(0))&&e.length<6;)e+=c(this.consumeCodePoint());dA(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(hA(e))A+=c(e);else{if(!fA(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||ZA(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?MA:A},A.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},A}(),GA=function(A){return 15===A.type},NA=function(A){return 17===A.type},jA=function(A){return 20===A.type},WA=function(A){return 0===A.type},JA=function(A,e){return jA(A)&&A.value===e},XA=function(A){return 31!==A.type},YA=function(A){return 31!==A.type&&4!==A.type},zA=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},ZA=function(A,e){return 11===e&&12===A.type||28===e&&29===A.type||2===e&&3===A.type},qA=function(A){return 17===A.type||15===A.type},$A=function(A){return 16===A.type||qA(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[re(n,e),re(void 0!==o?o:n,t)]},re=function(A,e){if(16===A.type)return A.number/100*e;if(GA(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},ie="grad",ae="turn",se=function(A,e){if(15===e.type)switch(e.unit){case"deg":return Math.PI*e.number/180;case ie:return Math.PI/200*e.number;case"rad":return e.number;case ae:return 2*Math.PI*e.number}throw new Error("Unsupported angle type")},ce=function(A){return 15===A.type&&("deg"===A.unit||A.unit===ie||"rad"===A.unit||A.unit===ae)},le=function(A){switch(A.filter(jA).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 ue(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[ee,ne];case"to right":case"left":return ue(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[ne,ne];case"to bottom":case"top":return ue(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[ne,ee];case"to left":case"right":return ue(270)}return 0},ue=function(A){return Math.PI*A/180},de=function(A,e){if(18===e.type){var t=me[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),r=e.value.substring(2,3);return pe(parseInt(n+n,16),parseInt(o+o,16),parseInt(r+r,16),1)}if(4===e.value.length){n=e.value.substring(0,1),o=e.value.substring(1,2),r=e.value.substring(2,3);var i=e.value.substring(3,4);return pe(parseInt(n+n,16),parseInt(o+o,16),parseInt(r+r,16),parseInt(i+i,16)/255)}if(6===e.value.length)return n=e.value.substring(0,2),o=e.value.substring(2,4),r=e.value.substring(4,6),pe(parseInt(n,16),parseInt(o,16),parseInt(r,16),1);if(8===e.value.length)return n=e.value.substring(0,2),o=e.value.substring(2,4),r=e.value.substring(4,6),i=e.value.substring(6,8),pe(parseInt(n,16),parseInt(o,16),parseInt(r,16),parseInt(i,16)/255)}if(20===e.type){var a=Ce[e.value.toUpperCase()];if(void 0!==a)return a}return Ce.TRANSPARENT},ge=function(A){return!(255&A)},he=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+")"},pe=function(A,e,t,n){return(A<<24|e<<16|t<<8|Math.round(255*n))>>>0},fe=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},Be=function(A,e){var t=e.filter(YA);if(3===t.length){var n=t.map(fe),o=n[0],r=n[1],i=n[2];return pe(o,r,i,1)}if(4===t.length){var a=t.map(fe),s=(o=a[0],r=a[1],i=a[2],a[3]);return pe(o,r,i,s)}return 0};function we(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(YA),n=t[0],o=t[1],r=t[2],i=t[3],a=(17===n.type?ue(n.number):se(A,n))/(2*Math.PI),s=$A(o)?o.number/100:0,c=$A(r)?r.number/100:0,l=void 0!==i&&$A(i)?re(i,1):1;if(0===s)return pe(255*c,255*c,255*c,1);var u=c<=.5?c*(s+1):c+s-c*s,d=2*c-u,g=we(d,u,a+1/3),h=we(d,u,a),p=we(d,u,a-1/3);return pe(255*g,255*h,255*p,l)},me={hsl:ve,hsla:ve,rgb:Be,rgba:Be},ye=function(A,e){return de(A,_A.create(e).parseComponentValue())},Ce={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},Qe={name:"background-clip",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map(function(A){if(jA(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},be={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Fe=function(A,e){var t=de(A,e[0]),n=e[1];return n&&$A(n)?{color:t,stop:n}:{color:t,stop:null}},Ue=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=[],r=0,i=0;i<A.length;i++){var a=A[i].stop;if(null!==a){var s=re(a,e);s>r?o.push(s):o.push(r),r=s}else o.push(null)}var c=null;for(i=0;i<o.length;i++){var l=o[i];if(null===l)null===c&&(c=i);else if(null!==c){for(var u=i-c,d=(l-o[c-1])/(u+1),g=1;g<=u;g++)o[c+g-1]=d*g;c=null}}return A.map(function(A,t){return{color:A.color,stop:Math.max(Math.min(1,o[t]/e),0)}})},Ee=function(A,e,t){var n="number"==typeof A?A:function(A,e,t){var n=e/2,o=t/2,r=re(A[0],e)-n,i=o-re(A[1],t);return(Math.atan2(i,r)+2*Math.PI)%(2*Math.PI)}(A,e,t),o=Math.abs(e*Math.sin(n))+Math.abs(t*Math.cos(n)),r=e/2,i=t/2,a=o/2,s=Math.sin(n-Math.PI/2)*a,c=Math.cos(n-Math.PI/2)*a;return[o,r-c,r+c,i-s,i+s]},Se=function(A,e){return Math.sqrt(A*A+e*e)},xe=function(A,e,t,n,o){return[[0,0],[0,e],[A,0],[A,e]].reduce(function(A,e){var r=e[0],i=e[1],a=Se(t-r,n-i);return(o?a<A.optimumDistance:a>A.optimumDistance)?{optimumCorner:e,optimumDistance:a}:A},{optimumDistance:o?1/0:-1/0,optimumCorner:null}).optimumCorner},Ie=function(A,e){var t=ue(180),n=[];return zA(e).forEach(function(e,o){if(0===o){var r=e[0];if(20===r.type&&-1!==["top","left","right","bottom"].indexOf(r.value))return void(t=le(e));if(ce(r))return void(t=(se(A,r)+ue(270))%ue(360))}var i=Fe(A,e);n.push(i)}),{angle:t,stops:n,type:1}},He="closest-side",ke="farthest-side",Te="closest-corner",De="farthest-corner",Ke="circle",Oe="ellipse",Pe="cover",Le="contain",Re=function(A,e){var t=0,n=3,o=[],r=[];return zA(e).forEach(function(e,i){var a=!0;if(0===i?a=e.reduce(function(A,e){if(jA(e))switch(e.value){case"center":return r.push(te),!1;case"top":case"left":return r.push(ee),!1;case"right":case"bottom":return r.push(ne),!1}else if($A(e)||qA(e))return r.push(e),!1;return A},a):1===i&&(a=e.reduce(function(A,e){if(jA(e))switch(e.value){case Ke:return t=0,!1;case Oe:return t=1,!1;case Le:case He:return n=0,!1;case ke:return n=1,!1;case Te:return n=2,!1;case Pe:case De:return n=3,!1}else if(qA(e)||$A(e))return Array.isArray(n)||(n=[]),n.push(e),!1;return A},a)),a){var s=Fe(A,e);o.push(s)}}),{size:n,shape:t,stops:o,position:r,type:2}},Me=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=ue(180),n=[];return zA(e).forEach(function(e,o){if(0===o){var r=e[0];if(20===r.type&&"to"===r.value)return void(t=le(e));if(ce(r))return void(t=se(A,r))}var i=Fe(A,e);n.push(i)}),{angle:t,stops:n,type:1}},"-moz-linear-gradient":Ie,"-ms-linear-gradient":Ie,"-o-linear-gradient":Ie,"-webkit-linear-gradient":Ie,"radial-gradient":function(A,e){var t=0,n=3,o=[],r=[];return zA(e).forEach(function(e,i){var a=!0;if(0===i){var s=!1;a=e.reduce(function(A,e){if(s)if(jA(e))switch(e.value){case"center":return r.push(te),A;case"top":case"left":return r.push(ee),A;case"right":case"bottom":return r.push(ne),A}else($A(e)||qA(e))&&r.push(e);else if(jA(e))switch(e.value){case Ke:return t=0,!1;case Oe:return t=1,!1;case"at":return s=!0,!1;case He:return n=0,!1;case Pe:case ke:return n=1,!1;case Le:case Te:return n=2,!1;case De:return n=3,!1}else if(qA(e)||$A(e))return Array.isArray(n)||(n=[]),n.push(e),!1;return A},a)}if(a){var c=Fe(A,e);o.push(c)}}),{size:n,shape:t,stops:o,position:r,type:2}},"-moz-radial-gradient":Re,"-ms-radial-gradient":Re,"-o-radial-gradient":Re,"-webkit-radial-gradient":Re,"-webkit-gradient":function(A,e){var t=ue(180),n=[],o=1;return zA(e).forEach(function(e,t){var r=e[0];if(0===t){if(jA(r)&&"linear"===r.value)return void(o=1);if(jA(r)&&"radial"===r.value)return void(o=2)}if(18===r.type)if("from"===r.name){var i=de(A,r.values[0]);n.push({stop:ee,color:i})}else if("to"===r.name)i=de(A,r.values[0]),n.push({stop:ne,color:i});else if("color-stop"===r.name){var a=r.values.filter(YA);if(2===a.length){i=de(A,a[1]);var s=a[0];NA(s)&&n.push({stop:{type:16,number:100*s.number,flags:s.flags},color:i})}}}),1===o?{angle:(t+ue(180))%ue(360),stops:n,type:o}:{size:3,shape:0,stops:n,position:[],type:o}}},Ge={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 YA(A)&&function(A){return!(20===A.type&&"none"===A.value||18===A.type&&!_e[A.name])}(A)}).map(function(e){return Me(A,e)})}},Ne={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map(function(A){if(jA(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},je={name:"background-position",initialValue:"0% 0%",type:1,prefix:!1,parse:function(A,e){return zA(e).map(function(A){return A.filter($A)}).map(Ae)}},We={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(A,e){return zA(e).map(function(A){return A.filter(jA).map(function(A){return A.value}).join(" ")}).map(Je)}},Je=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,Ye={name:"background-size",initialValue:"0",prefix:!1,type:1,parse:function(A,e){return zA(e).map(function(A){return A.filter(ze)})}},ze=function(A){return jA(A)||$A(A)},Ze=function(A){return{name:"border-"+A+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},qe=Ze("top"),$e=Ze("right"),At=Ze("bottom"),et=Ze("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"),rt=tt("bottom-right"),it=tt("bottom-left"),at=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}}},st=at("top"),ct=at("right"),lt=at("bottom"),ut=at("left"),dt=function(A){return{name:"border-"+A+"-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return GA(e)?e.number:0}}},gt=dt("top"),ht=dt("right"),pt=dt("bottom"),ft=dt("left"),Bt={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},wt={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(jA).reduce(function(A,e){return A|mt(e.value)},0)}},mt=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},yt={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}},Ct={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 Qt,bt={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"strict"===e?Xe.STRICT:Xe.NORMAL}},Ft={name:"line-height",initialValue:"normal",prefix:!1,type:4},Ut=function(A,e){return jA(A)&&"normal"===A.value?1.2*e:17===A.type?e*A.number:$A(A)?re(A,e):e},Et={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(A,e){return 20===e.type&&"none"===e.value?null:Me(A,e)}},St={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(A,e){return"inside"===e?0:1}},xt={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}}},It=function(A){return{name:"margin-"+A,initialValue:"0",prefix:!1,type:4}},Ht=It("top"),kt=It("right"),Tt=It("bottom"),Dt=It("left"),Kt={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(A,e){return e.filter(jA).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}})}},Ot={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"break-word"===e?"break-word":"normal"}},Pt=function(A){return{name:"padding-"+A,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Lt=Pt("top"),Rt=Pt("right"),Mt=Pt("bottom"),Vt=Pt("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}}},Gt={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}},Nt={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&JA(e[0],"none")?[]:zA(e).map(function(e){for(var t={color:Ce.TRANSPARENT,offsetX:ee,offsetY:ee,blur:ee},n=0,o=0;o<e.length;o++){var r=e[o];qA(r)?(0===n?t.offsetX=r:1===n?t.offsetY=r:t.blur=r,n++):t.color=de(A,r)}return t})}},jt={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}},Wt={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=Jt[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported transform function "'+e.name+'"');return t(e.values)}return null}},Jt={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],r=e[5];e[6],e[7],e[8],e[9],e[10],e[11];var i=e[12],a=e[13];return e[14],e[15],16===e.length?[t,n,o,r,i,a]:null}},Xt={type:16,number:50,flags:4},Yt=[Xt,Xt],zt={name:"transform-origin",initialValue:"50% 50%",prefix:!0,type:1,parse:function(A,e){var t=e.filter($A);return 2!==t.length?Yt:[t[0],t[1]]}},Zt={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"}(Qt||(Qt={}));for(var qt={name:"word-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){switch(e){case"break-all":return Qt.BREAK_ALL;case"keep-all":return Qt.KEEP_ALL;default:return Qt.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(NA(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 NA(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(jA).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"},an={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(A,e){return NA(e)?e.number:jA(e)&&"bold"===e.value?700:400}},sn={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return e.filter(jA).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)},un={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}},dn={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),r=0;r<o.length;r++){var i=o[r],a=o[r+1];if(20===i.type){var s=a&&NA(a)?a.number:1;n.push({counter:i.value,increment:s})}}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 r=n[o],i=n[o+1];if(jA(r)&&"none"!==r.value){var a=i&&NA(i)?i.number:0;t.push({counter:r.value,reset:a})}}return t}},hn={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(A,e){return e.filter(GA).map(function(e){return An.parse(A,e)})}},pn={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(WA);if(o.length%2!=0)return null;for(var r=0;r<o.length;r+=2){var i=o[r].value,a=o[r+1].value;n.push({open:i,close:a})}return n}},fn=function(A,e,t){if(!A)return"";var n=A[Math.min(e,A.length-1)];return n?t?n.open:n.close:""},Bn={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&JA(e[0],"none")?[]:zA(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 r=e[o];JA(r,"inset")?t.inset=!0:qA(r)?(0===n?t.offsetX=r:1===n?t.offsetY=r:2===n?t.blur=r:t.spread=r,n++):t.color=de(A,r)}return t})}},wn={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(A,e){var t=[];return e.filter(jA).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"},mn={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return GA(e)?e.number:0}},yn=function(){function A(A,e){var t,n;this.animationDuration=bn(A,hn,e.animationDuration),this.backgroundClip=bn(A,Qe,e.backgroundClip),this.backgroundColor=bn(A,be,e.backgroundColor),this.backgroundImage=bn(A,Ge,e.backgroundImage),this.backgroundOrigin=bn(A,Ne,e.backgroundOrigin),this.backgroundPosition=bn(A,je,e.backgroundPosition),this.backgroundRepeat=bn(A,We,e.backgroundRepeat),this.backgroundSize=bn(A,Ye,e.backgroundSize),this.borderTopColor=bn(A,qe,e.borderTopColor),this.borderRightColor=bn(A,$e,e.borderRightColor),this.borderBottomColor=bn(A,At,e.borderBottomColor),this.borderLeftColor=bn(A,et,e.borderLeftColor),this.borderTopLeftRadius=bn(A,nt,e.borderTopLeftRadius),this.borderTopRightRadius=bn(A,ot,e.borderTopRightRadius),this.borderBottomRightRadius=bn(A,rt,e.borderBottomRightRadius),this.borderBottomLeftRadius=bn(A,it,e.borderBottomLeftRadius),this.borderTopStyle=bn(A,st,e.borderTopStyle),this.borderRightStyle=bn(A,ct,e.borderRightStyle),this.borderBottomStyle=bn(A,lt,e.borderBottomStyle),this.borderLeftStyle=bn(A,ut,e.borderLeftStyle),this.borderTopWidth=bn(A,gt,e.borderTopWidth),this.borderRightWidth=bn(A,ht,e.borderRightWidth),this.borderBottomWidth=bn(A,pt,e.borderBottomWidth),this.borderLeftWidth=bn(A,ft,e.borderLeftWidth),this.boxShadow=bn(A,Bn,e.boxShadow),this.color=bn(A,Bt,e.color),this.direction=bn(A,wt,e.direction),this.display=bn(A,vt,e.display),this.float=bn(A,yt,e.cssFloat),this.fontFamily=bn(A,on,e.fontFamily),this.fontSize=bn(A,rn,e.fontSize),this.fontStyle=bn(A,cn,e.fontStyle),this.fontVariant=bn(A,sn,e.fontVariant),this.fontWeight=bn(A,an,e.fontWeight),this.letterSpacing=bn(A,Ct,e.letterSpacing),this.lineBreak=bn(A,bt,e.lineBreak),this.lineHeight=bn(A,Ft,e.lineHeight),this.listStyleImage=bn(A,Et,e.listStyleImage),this.listStylePosition=bn(A,St,e.listStylePosition),this.listStyleType=bn(A,xt,e.listStyleType),this.marginTop=bn(A,Ht,e.marginTop),this.marginRight=bn(A,kt,e.marginRight),this.marginBottom=bn(A,Tt,e.marginBottom),this.marginLeft=bn(A,Dt,e.marginLeft),this.opacity=bn(A,en,e.opacity);var o=bn(A,Kt,e.overflow);this.overflowX=o[0],this.overflowY=o[o.length>1?1:0],this.overflowWrap=bn(A,Ot,e.overflowWrap),this.paddingTop=bn(A,Lt,e.paddingTop),this.paddingRight=bn(A,Rt,e.paddingRight),this.paddingBottom=bn(A,Mt,e.paddingBottom),this.paddingLeft=bn(A,Vt,e.paddingLeft),this.paintOrder=bn(A,wn,e.paintOrder),this.position=bn(A,Gt,e.position),this.textAlign=bn(A,_t,e.textAlign),this.textDecorationColor=bn(A,tn,null!==(t=e.textDecorationColor)&&void 0!==t?t:e.color),this.textDecorationLine=bn(A,nn,null!==(n=e.textDecorationLine)&&void 0!==n?n:e.textDecoration),this.textShadow=bn(A,Nt,e.textShadow),this.textTransform=bn(A,jt,e.textTransform),this.transform=bn(A,Wt,e.transform),this.transformOrigin=bn(A,zt,e.transformOrigin),this.visibility=bn(A,Zt,e.visibility),this.webkitTextStrokeColor=bn(A,vn,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=bn(A,mn,e.webkitTextStrokeWidth),this.wordBreak=bn(A,qt,e.wordBreak),this.zIndex=bn(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}(),Cn=function(A,e){this.content=bn(A,un,e.content),this.quotes=bn(A,pn,e.quotes)},Qn=function(A,e){this.counterIncrement=bn(A,dn,e.counterIncrement),this.counterReset=bn(A,gn,e.counterReset)},bn=function(A,e,t){var n=new VA,o=null!=t?t.toString():e.initialValue;n.write(o);var r=new _A(n.read());switch(e.type){case 2:var i=r.parseComponentValue();return e.parse(A,jA(i)?i.value:e.initialValue);case 0:return e.parse(A,r.parseComponentValue());case 1:return e.parse(A,r.parseComponentValues());case 4:return r.parseComponentValue();case 3:switch(e.format){case"angle":return se(A,r.parseComponentValue());case"color":return de(A,r.parseComponentValue());case"image":return Me(A,r.parseComponentValue());case"length":var a=r.parseComponentValue();return qA(a)?a:ee;case"length-percentage":var s=r.parseComponentValue();return $A(s)?s:ee;case"time":return An.parse(A,r.parseComponentValue())}}},Fn=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},Un=function(A,e){this.context=A,this.textNodes=[],this.elements=[],this.flags=0,Fn(e,3),this.styles=new yn(A,window.getComputedStyle(e,null)),Ho(e)&&(this.styles.animationDuration.some(function(A){return A>0})&&(e.style.animationDuration="0s"),null!==this.styles.transform&&(e.style.transform="none")),this.bounds=a(this.context,e),Fn(e,4)&&(this.flags|=16)},En="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Sn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),xn=0;xn<64;xn++)Sn[En.charCodeAt(xn)]=xn;for(var In=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},Hn=function(){function A(A,e,t,n,o,r){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=n,this.index=o,this.data=r}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}(),kn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Tn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Dn=0;Dn<64;Dn++)Tn[kn.charCodeAt(Dn)]=Dn;var Kn,On=8,Pn=9,Ln=11,Rn=12,Mn=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,r="";++o<t;){var i=A[o];i<=65535?n.push(i):(i-=65536,n.push(55296+(i>>10),i%1024+56320)),(o+1===t||n.length>16384)&&(r+=String.fromCharCode.apply(String,n),n.length=0)}return r},Vn=function(A){var e,t,n,o=function(A){var e,t,n,o,r,i=.75*A.length,a=A.length,s=0;"="===A[A.length-1]&&(i--,"="===A[A.length-2]&&i--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(i):new Array(i),l=Array.isArray(c)?c:new Uint8Array(c);for(e=0;e<a;e+=4)t=Sn[A.charCodeAt(e)],n=Sn[A.charCodeAt(e+1)],o=Sn[A.charCodeAt(e+2)],r=Sn[A.charCodeAt(e+3)],l[s++]=t<<2|n>>4,l[s++]=(15&n)<<4|o>>2,l[s++]=(3&o)<<6|63&r;return c}(A),r=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),i=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),a=In(i,12,r[4]/2),s=2===r[5]?In(i,(24+r[4])/2):(e=r,t=Math.ceil((24+r[4])/4),e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,t,n)));return new Hn(r[0],r[1],r[2],r[3],a,s)}("AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1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AAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABtAwgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABMAEwACAAIAAgACAAIABgACAAIAAgACAC/AAgACAAyAQgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACAAIAAwAAgACAAIAAgACAAIAAgACAAIAAAARABIAAgACAAIABQASAAIAAgAIABwAEAAjgCIABsAqAC2AL0AigDQAtwC+IJIQqVAZUBWQqVAZUBlQGVAZUBlQGrC5UBlQGVAZUBlQGVAZUBlQGVAXsKlQGVAbAK6wsrDGUMpQzlDJUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZUBlQGVAZU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gACAAIAAgACAA4BAgACABABEYECAAIAAgATAQYAQgAVAQIAAgACAAIAAgACAAIAAgACAAIAFoECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAOQEIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAxwQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAGYECAAIAAgAzgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBd0FXwUIAOIF6gXxBYoF3gT5BQAGCAaKBYoFigWKBYoFigWKBYoFigWKBYoFigXWBIoFigWKBYoFigWKBYoFigWKBYsFEAaKBYoFigWKBYoFigWKBRQGCACKBYoFigWKBQgACAAIANEECAAIABgGigUgBggAJgYIAC4GMwaKBYoF0wQ3Bj4GigWKBYoFigWKBYoFigWKBYoFigWKBYoFigUIAAgACAAIAAgACAAIAAgAigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWKBYoFigWLBf///////wQABAAEAAQABAAEAAQABAAEAAQAAwAEAAQAAgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4AAAAAAA4ADgAOAA4ADgAOAA4ADgAOAAAADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA="),_n="×",Gn=function(A){return Vn.get(A)},Nn=function(A,e,t){var n=t-2,o=e[n],r=e[t-1],i=e[t];if(2===r&&3===i)return _n;if(2===r||3===r||4===r)return"÷";if(2===i||3===i||4===i)return"÷";if(r===On&&-1!==[On,Pn,Ln,Rn].indexOf(i))return _n;if(!(r!==Ln&&r!==Pn||i!==Pn&&10!==i))return _n;if((r===Rn||10===r)&&10===i)return _n;if(13===i||5===i)return _n;if(7===i)return _n;if(1===r)return _n;if(13===r&&14===i){for(;5===o;)o=e[--n];if(14===o)return _n}if(15===r&&15===i){for(var a=0;15===o;)a++,o=e[--n];if(a%2==0)return _n}return"÷"},jn=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 r=A.charCodeAt(t++);56320==(64512&r)?e.push(((1023&o)<<10)+(1023&r)+65536):(e.push(o),t--)}else e.push(o)}return e}(A),t=e.length,n=0,o=0,r=e.map(Gn);return{next:function(){if(n>=t)return{done:!0,value:null};for(var A=_n;n<t&&(A=Nn(0,r,++n))===_n;);if(A!==_n||n===t){var i=Mn.apply(null,e.slice(o,n));return o=n,{value:i,done:!1}}return{done:!0,value:null}}}},Wn=function(A){return 0===A[0]&&255===A[1]&&0===A[2]&&255===A[3]},Jn=function(A,e,t,n,o){var r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return i.setAttributeNS(null,"width",A.toString()),i.setAttributeNS(null,"height",e.toString()),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.setAttributeNS(null,"x",t.toString()),a.setAttributeNS(null,"y",n.toString()),a.setAttributeNS(null,"externalResourcesRequired","true"),i.appendChild(a),a.appendChild(o),i},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))})},Yn={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(Yn,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_WORD_BREAKING(){var A=Yn.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?"👨".repeat(10):"";var n=e.firstChild,o=s(n.data).map(function(A){return c(A)}),r=0,i={},a=o.every(function(A,e){t.setStart(n,r),t.setEnd(n,r+A.length);var o=t.getBoundingClientRect();r+=A.length;var a=o.x>i.x||o.y>i.y;return i=o,0===e||a});return A.body.removeChild(e),a}(document);return Object.defineProperty(Yn,"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(Yn,"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,r=e.toDataURL();o.src=r;var i=Jn(t,t,0,0,o);return n.fillStyle="red",n.fillRect(0,0,t,t),Xn(i).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 i=A.createElement("div");return i.style.backgroundImage="url("+r+")",i.style.height=t+"px",Wn(o)?Xn(Jn(t,t,0,0,i)):Promise.reject(!1)}).then(function(A){return n.drawImage(A,0,0),Wn(n.getImageData(0,0,t,t).data)}).catch(function(){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(Yn,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(Yn,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(Yn,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(Yn,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var A=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(Yn,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:A}),A}},zn=function(A,e){this.text=A,this.bounds=e},Zn=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 r=a(A,n);return n.firstChild&&o.replaceChild(n.firstChild,n),r}}return i.EMPTY},qn=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(Yn.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=jn(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(Yn.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=s(A),n=rA(t,e),o=n[0],r=n[1],i=n[2],a=t.length,c=0,l=0;return{next:function(){if(l>=a)return{done:!0,value:null};for(var A=W;l<a&&(A=oA(t,r,o,++l,i))===W;);if(A!==W||l===a){var e=new iA(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=[],r=function(){if(t.value){var A=t.value.slice(),e=s(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;)r();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),r=[],a=0;return o.forEach(function(e){if(t.textDecorationLine.length||e.trim().length>0)if(Yn.SUPPORT_RANGE_BOUNDS){var o=qn(n,a,e.length).getClientRects();if(o.length>1){var s=$n(e),c=0;s.forEach(function(e){r.push(new zn(e,i.fromDOMRectList(A,qn(n,c+a,e.length).getClientRects()))),c+=e.length})}else r.push(new zn(e,i.fromDOMRectList(A,o)))}else{var l=n.splitText(e.length);r.push(new zn(e,Zn(A,n))),n=l}else Yn.SUPPORT_RANGE_BOUNDS||(n=n.splitText(e.length));a+=e.length}),r}(A,this.text,t,e)},oo=function(A,e){switch(e){case 1:return A.toLowerCase();case 3:return A.replace(ro,io);case 2:return A.toUpperCase();default:return A}},ro=/(^|\s|:|-|\(|\))([a-z])/g,io=function(A,e,t){return A.length>0?e+t.toUpperCase():A},ao=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}(Un),so=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}(Un),co=function(A){function t(e,t){var n=A.call(this,e,t)||this,o=new XMLSerializer,r=a(e,t);return t.setAttribute("width",r.width+"px"),t.setAttribute("height",r.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}(Un),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}(Un),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}(Un),go=[{type:15,flags:0,unit:"px",number:3}],ho=[{type:16,flags:0,number:50}],po="checkbox",fo="radio",Bo="password",wo=707406591,vo=function(A){function t(e,t){var n,o,r,a=A.call(this,e,t)||this;switch(a.type=t.type.toLowerCase(),a.checked=t.checked,a.value=0===(r=(o=t).type===Bo?new Array(o.value.length+1).join("•"):o.value).length?o.placeholder||"":r,a.type!==po&&a.type!==fo||(a.styles.backgroundColor=3739148031,a.styles.borderTopColor=a.styles.borderRightColor=a.styles.borderBottomColor=a.styles.borderLeftColor=2779096575,a.styles.borderTopWidth=a.styles.borderRightWidth=a.styles.borderBottomWidth=a.styles.borderLeftWidth=1,a.styles.borderTopStyle=a.styles.borderRightStyle=a.styles.borderBottomStyle=a.styles.borderLeftStyle=1,a.styles.backgroundClip=[0],a.styles.backgroundOrigin=[0],a.bounds=(n=a.bounds).width>n.height?new i(n.left+(n.width-n.height)/2,n.top,n.height,n.height):n.width<n.height?new i(n.left,n.top+(n.height-n.width)/2,n.width,n.width):n),a.type){case po:a.styles.borderTopRightRadius=a.styles.borderTopLeftRadius=a.styles.borderBottomRightRadius=a.styles.borderBottomLeftRadius=go;break;case fo:a.styles.borderTopRightRadius=a.styles.borderTopLeftRadius=a.styles.borderBottomRightRadius=a.styles.borderBottomLeftRadius=ho}return a}return e(t,A),t}(Un),mo=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}(Un),yo=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}(Un),Co=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=Uo(e,t.contentWindow.document.documentElement);var o=t.contentWindow.document.documentElement?ye(e,getComputedStyle(t.contentWindow.document.documentElement).backgroundColor):Ce.TRANSPARENT,r=t.contentWindow.document.body?ye(e,getComputedStyle(t.contentWindow.document.body).backgroundColor):Ce.TRANSPARENT;n.backgroundColor=ge(o)?ge(r)?n.styles.backgroundColor:r:o}}catch(A){}return n}return e(t,A),t}(Un),Qo=["OL","UL","MENU"],bo=function(A,e,t,n){for(var o=e.firstChild,r=void 0;o;o=r)if(r=o.nextSibling,xo(o)&&o.data.trim().length>0)t.textNodes.push(new no(A,o,t.styles));else if(Io(o))if(jo(o)&&o.assignedNodes)o.assignedNodes().forEach(function(e){return bo(A,e,t,n)});else{var i=Fo(A,o);i.styles.isVisible()&&(Eo(o,i,n)?i.flags|=4:So(i.styles)&&(i.flags|=2),-1!==Qo.indexOf(o.tagName)&&(i.flags|=8),t.elements.push(i),o.slot,o.shadowRoot?bo(A,o.shadowRoot,i,n):Go(o)||Oo(o)||No(o)||bo(A,o,i,n))}},Fo=function(A,e){return Mo(e)?new ao(A,e):Lo(e)?new so(A,e):Oo(e)?new co(A,e):To(e)?new lo(A,e):Do(e)?new uo(A,e):Ko(e)?new vo(A,e):No(e)?new mo(A,e):Go(e)?new yo(A,e):Vo(e)?new Co(A,e):new Un(A,e)},Uo=function(A,e){var t=Fo(A,e);return t.flags|=4,bo(A,e,t,t),t},Eo=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||Po(A)&&t.styles.isTransparent()},So=function(A){return A.isPositioned()||A.isFloating()},xo=function(A){return A.nodeType===Node.TEXT_NODE},Io=function(A){return A.nodeType===Node.ELEMENT_NODE},Ho=function(A){return Io(A)&&void 0!==A.style&&!ko(A)},ko=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},Oo=function(A){return"svg"===A.tagName},Po=function(A){return"BODY"===A.tagName},Lo=function(A){return"CANVAS"===A.tagName},Ro=function(A){return"VIDEO"===A.tagName},Mo=function(A){return"IMG"===A.tagName},Vo=function(A){return"IFRAME"===A.tagName},_o=function(A){return"STYLE"===A.tagName},Go=function(A){return"TEXTAREA"===A.tagName},No=function(A){return"SELECT"===A.tagName},jo=function(A){return"SLOT"===A.tagName},Wo=function(A){return A.tagName.indexOf("-")>0},Jo=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 r=[];return o&&n.forEach(function(A){var t=e.counters[A.counter];r.push(A.counter),t||(t=e.counters[A.counter]=[]),t.push(A.reset)}),r},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"]},Yo={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:["Ք","Փ","Ւ","Ց","Ր","Տ","Վ","Ս","Ռ","Ջ","Պ","Չ","Ո","Շ","Ն","Յ","Մ","Ճ","Ղ","Ձ","Հ","Կ","Ծ","Խ","Լ","Ի","Ժ","Թ","Ը","Է","Զ","Ե","Դ","Գ","Բ","Ա"]},zo={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:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Zo={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:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},qo=function(A,e,t,n,o,r){return A<e||A>t?ar(A,o,r.length>0):n.integers.reduce(function(e,t,o){for(;A>=t;)A-=t,e+=n.values[o];return e},"")+r},$o=function(A,e,t,n){var o="";do{t||A--,o=n(A)+o,A/=e}while(A*e>=e);return o},Ar=function(A,e,t,n,o){var r=t-e+1;return(A<0?"-":"")+($o(Math.abs(A),r,n,function(A){return c(Math.floor(A%r)+e)})+o)},er=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},tr=function(A,e,t,n,o,r){if(A<-9999||A>9999)return ar(A,4,o.length>0);var i=Math.abs(A),a=o;if(0===i)return e[0]+a;for(var s=0;i>0&&s<=4;s++){var c=i%10;0===c&&ln(r,1)&&""!==a?a=e[c]+a:c>1||1===c&&0===s||1===c&&1===s&&ln(r,2)||1===c&&1===s&&ln(r,4)&&A>100||1===c&&s>1&&ln(r,8)?a=e[c]+(s>0?t[s-1]:"")+a:1===c&&s>0&&(a=t[s-1]+a),i=Math.floor(i/10)}return(A<0?n:"")+a},nr="十百千萬",or="拾佰仟萬",rr="マイナス",ir="마이너스",ar=function(A,e,t){var n=t?". ":"",o=t?"、":"",r=t?", ":"",i=t?" ":"";switch(e){case 0:return"•"+i;case 1:return"◦"+i;case 2:return"◾"+i;case 5:var a=Ar(A,48,57,!0,n);return a.length<4?"0"+a:a;case 4:return er(A,"〇一二三四五六七八九",o);case 6:return qo(A,1,3999,Xo,3,n).toLowerCase();case 7:return qo(A,1,3999,Xo,3,n);case 8:return Ar(A,945,969,!1,n);case 9:return Ar(A,97,122,!1,n);case 10:return Ar(A,65,90,!1,n);case 11:return Ar(A,1632,1641,!0,n);case 12:case 49:return qo(A,1,9999,Yo,3,n);case 35:return qo(A,1,9999,Yo,3,n).toLowerCase();case 13:return Ar(A,2534,2543,!0,n);case 14:case 30:return Ar(A,6112,6121,!0,n);case 15:return er(A,"子丑寅卯辰巳午未申酉戌亥",o);case 16:return er(A,"甲乙丙丁戊己庚辛壬癸",o);case 17:case 48:return tr(A,"零一二三四五六七八九",nr,"負",o,14);case 47:return tr(A,"零壹貳參肆伍陸柒捌玖",or,"負",o,15);case 42:return tr(A,"零一二三四五六七八九",nr,"负",o,14);case 41:return tr(A,"零壹贰叁肆伍陆柒捌玖",or,"负",o,15);case 26:return tr(A,"〇一二三四五六七八九","十百千万",rr,o,0);case 25:return tr(A,"零壱弐参四伍六七八九","拾百千万",rr,o,7);case 31:return tr(A,"영일이삼사오육칠팔구","십백천만",ir,r,7);case 33:return tr(A,"零一二三四五六七八九","十百千萬",ir,r,0);case 32:return tr(A,"零壹貳參四五六七八九","拾百千",ir,r,7);case 18:return Ar(A,2406,2415,!0,n);case 20:return qo(A,1,19999,Zo,3,n);case 21:return Ar(A,2790,2799,!0,n);case 22:return Ar(A,2662,2671,!0,n);case 22:return qo(A,1,10999,zo,3,n);case 23:return er(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return er(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return Ar(A,3302,3311,!0,n);case 28:return er(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",o);case 29:return er(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",o);case 34:return Ar(A,3792,3801,!0,n);case 37:return Ar(A,6160,6169,!0,n);case 38:return Ar(A,4160,4169,!0,n);case 39:return Ar(A,2918,2927,!0,n);case 40:return Ar(A,1776,1785,!0,n);case 43:return Ar(A,3046,3055,!0,n);case 44:return Ar(A,3174,3183,!0,n);case 45:return Ar(A,3664,3673,!0,n);case 46:return Ar(A,3872,3881,!0,n);default:return Ar(A,48,57,!0,n)}},sr="data-html2canvas-ignore",cr=function(){function A(A,e,t){if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new Jo,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,r=ur(A,e);if(!r.contentWindow)return Promise.reject("Unable to find iframe window");var i=A.defaultView.pageXOffset,a=A.defaultView.pageYOffset,s=r.contentWindow,c=s.document,l=hr(r).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(vr),s&&(s.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===e.top&&s.scrollX===e.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(s.scrollX-e.left,s.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,gr(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 r})]:[2,r]}})})});return c.open(),c.write(Br(document.doctype)+"<html></html>"),wr(this.referenceElement.ownerDocument,i,a),c.replaceChild(c.adoptNode(this.documentElement),c.documentElement),c.close(),l},A.prototype.createElementClone=function(A){if(Fn(A,2),Lo(A))return this.createCanvasClone(A);if(Ro(A))return this.createVideoClone(A);if(_o(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return Mo(e)&&(Mo(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),"lazy"===e.loading&&(e.loading="eager")),Wo(e)?this.createCustomElementClone(e):e},A.prototype.createCustomElementClone=function(A){var e=document.createElement("html2canvascustomelement");return fr(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"),r=n.getContext("2d");if(r)if(!this.options.allowTaint&&o)r.putImageData(o.getImageData(0,0,A.width,A.height),0,0);else{var i=null!==(e=A.getContext("webgl2"))&&void 0!==e?e:A.getContext("webgl");if(i){var a=i.getContextAttributes();!1===(null==a?void 0:a.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",A)}r.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){Io(e)&&("SCRIPT"===e.tagName||e.hasAttribute(sr)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(e))||this.options.copyStyles&&Io(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(Io(o)&&jo(o)&&"function"==typeof o.assignedNodes){var r=o.assignedNodes();r.length&&r.forEach(function(A){return n.appendChildNode(e,A,t)})}else this.appendChildNode(e,o,t)},A.prototype.cloneNode=function(A,e){if(xo(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var t=A.ownerDocument.defaultView;if(t&&Io(A)&&(Ho(A)||ko(A))){var n=this.createElementClone(A);n.style.transitionProperty="none";var o=t.getComputedStyle(A),r=t.getComputedStyle(A,":before"),i=t.getComputedStyle(A,":after");this.referenceElement===A&&Ho(n)&&(this.clonedReferenceElement=n),Po(n)&&Qr(n);var a=this.counters.parse(new Qn(this.context,o)),s=this.resolvePseudoContent(A,n,r,Kn.BEFORE);Wo(A)&&(e=!0),Ro(A)||this.cloneChildNodes(A,n,e),s&&n.insertBefore(s,n.firstChild);var c=this.resolvePseudoContent(A,n,i,Kn.AFTER);return c&&n.appendChild(c),this.counters.pop(a),(o&&(this.options.copyStyles||ko(A))&&!Vo(A)||e)&&fr(o,n),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([n,A.scrollLeft,A.scrollTop]),(Go(A)||No(A))&&(Go(n)||No(n))&&(n.value=A.value),n}return A.cloneNode(!1)},A.prototype.resolvePseudoContent=function(A,e,t,n){var o=this;if(t){var r=t.content,i=e.ownerDocument;if(i&&r&&"none"!==r&&"-moz-alt-content"!==r&&"none"!==t.display){this.counters.parse(new Qn(this.context,t));var a=new Cn(this.context,t),s=i.createElement("html2canvaspseudoelement");fr(t,s),a.content.forEach(function(e){if(0===e.type)s.appendChild(i.createTextNode(e.value));else if(22===e.type){var t=i.createElement("img");t.src=e.value,t.style.opacity="1",s.appendChild(t)}else if(18===e.type){if("attr"===e.name){var n=e.values.filter(jA);n.length&&s.appendChild(i.createTextNode(A.getAttribute(n[0].value)||""))}else if("counter"===e.name){var r=e.values.filter(YA),c=r[0],l=r[1];if(c&&jA(c)){var u=o.counters.getCounterValue(c.value),d=l&&jA(l)?xt.parse(o.context,l.value):3;s.appendChild(i.createTextNode(ar(u,d,!1)))}}else if("counters"===e.name){var g=e.values.filter(YA),h=(c=g[0],g[1]);if(l=g[2],c&&jA(c)){var p=o.counters.getCounterValues(c.value),f=l&&jA(l)?xt.parse(o.context,l.value):3,B=h&&0===h.type?h.value:"",w=p.map(function(A){return ar(A,f,!1)}).join(B);s.appendChild(i.createTextNode(w))}}}else if(20===e.type)switch(e.value){case"open-quote":s.appendChild(i.createTextNode(fn(a.quotes,o.quoteDepth++,!0)));break;case"close-quote":s.appendChild(i.createTextNode(fn(a.quotes,--o.quoteDepth,!1)));break;default:s.appendChild(i.createTextNode(e.value))}}),s.className=mr+" "+yr;var c=n===Kn.BEFORE?" "+mr:" "+yr;return ko(e)?e.className.baseValue+=c:e.className+=c,s}}},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 lr,ur=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(sr,"true"),A.body.appendChild(t),t},dr=function(A){return new Promise(function(e){A.complete?e():A.src?(A.onload=e,A.onerror=e):e()})},gr=function(A){return Promise.all([].slice.call(A.images,0).map(dr))},hr=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)}})},pr=["all","d","content"],fr=function(A,e){for(var t=A.length-1;t>=0;t--){var n=A.item(t);-1===pr.indexOf(n)&&e.style.setProperty(n,A.getPropertyValue(n))}return e},Br=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},wr=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},vr=function(A){var e=A[0],t=A[1],n=A[2];e.scrollLeft=t,e.scrollTop=n},mr="___html2canvas___pseudoelement_before",yr="___html2canvas___pseudoelement_after",Cr='{\n content: "" !important;\n display: none !important;\n}',Qr=function(A){br(A,"."+mr+":before"+Cr+"\n ."+yr+":after"+Cr)},br=function(A,e){var t=A.ownerDocument;if(t){var n=t.createElement("style");n.textContent=e,A.appendChild(n)}},Fr=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}(),Ur=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:Tr(A)||Ir(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,r,i=this;return o(this,function(o){switch(o.label){case 0:return e=Fr.isSameOrigin(A),t=!Hr(A)&&!0===this._options.useCORS&&Yn.SUPPORT_CORS_IMAGES&&!e,n=!Hr(A)&&!e&&!Tr(A)&&"string"==typeof this._options.proxy&&Yn.SUPPORT_CORS_XHR&&!t,e||!1!==this._options.allowTaint||Hr(A)||Tr(A)||n||t?(r=A,n?[4,this.proxy(r)]:[3,2]):[2];case 1:r=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,(kr(r)||t)&&(n.crossOrigin="anonymous"),n.src=r,!0===n.complete&&setTimeout(function(){return A(n)},500),i._options.imageTimeout>0&&setTimeout(function(){return e("Timed out ("+i._options.imageTimeout+"ms) loading image")},i._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,r){var i=Yn.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(200===a.status)if("text"===i)o(a.response);else{var A=new FileReader;A.addEventListener("load",function(){return o(A.result)},!1),A.addEventListener("error",function(A){return r(A)},!1),A.readAsDataURL(a.response)}else r("Failed to proxy resource "+n+" with status code "+a.status)},a.onerror=r;var s=t.indexOf("?")>-1?"&":"?";if(a.open("GET",""+t+s+"url="+encodeURIComponent(A)+"&responseType="+i),"text"!==i&&a instanceof XMLHttpRequest&&(a.responseType=i),e._options.imageTimeout){var c=e._options.imageTimeout;a.timeout=c,a.ontimeout=function(){return r("Timed out ("+c+"ms) proxying "+n)}}a.send()})},A}(),Er=/^data:image\/svg\+xml/i,Sr=/^data:image\/.*;base64,/i,xr=/^data:image\/.*/i,Ir=function(A){return Yn.SUPPORT_SVG_DRAWING||!Dr(A)},Hr=function(A){return xr.test(A)},kr=function(A){return Sr.test(A)},Tr=function(A){return"blob"===A.substr(0,4)},Dr=function(A){return"svg"===A.substr(-3).toLowerCase()||Er.test(A)},Kr=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}(),Or=function(A,e,t){return new Kr(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)},Pr=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=Or(this.start,this.startControl,e),o=Or(this.startControl,this.endControl,e),r=Or(this.endControl,this.end,e),i=Or(n,o,e),a=Or(o,r,e),s=Or(i,a,e);return t?new A(this.start,n,i,s):new A(s,a,r,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}(),Lr=function(A){return 1===A.type},Rr=function(A){var e=A.styles,t=A.bounds,n=oe(e.borderTopLeftRadius,t.width,t.height),o=n[0],r=n[1],i=oe(e.borderTopRightRadius,t.width,t.height),a=i[0],s=i[1],c=oe(e.borderBottomRightRadius,t.width,t.height),l=c[0],u=c[1],d=oe(e.borderBottomLeftRadius,t.width,t.height),g=d[0],h=d[1],p=[];p.push((o+a)/t.width),p.push((g+l)/t.width),p.push((r+h)/t.height),p.push((s+u)/t.height);var f=Math.max.apply(Math,p);f>1&&(o/=f,r/=f,a/=f,s/=f,l/=f,u/=f,g/=f,h/=f);var B=t.width-a,w=t.height-u,v=t.width-l,m=t.height-h,y=e.borderTopWidth,C=e.borderRightWidth,Q=e.borderBottomWidth,b=e.borderLeftWidth,F=re(e.paddingTop,A.bounds.width),U=re(e.paddingRight,A.bounds.width),E=re(e.paddingBottom,A.bounds.width),S=re(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=o>0||r>0?Mr(t.left+b/3,t.top+y/3,o-b/3,r-y/3,lr.TOP_LEFT):new Kr(t.left+b/3,t.top+y/3),this.topRightBorderDoubleOuterBox=o>0||r>0?Mr(t.left+B,t.top+y/3,a-C/3,s-y/3,lr.TOP_RIGHT):new Kr(t.left+t.width-C/3,t.top+y/3),this.bottomRightBorderDoubleOuterBox=l>0||u>0?Mr(t.left+v,t.top+w,l-C/3,u-Q/3,lr.BOTTOM_RIGHT):new Kr(t.left+t.width-C/3,t.top+t.height-Q/3),this.bottomLeftBorderDoubleOuterBox=g>0||h>0?Mr(t.left+b/3,t.top+m,g-b/3,h-Q/3,lr.BOTTOM_LEFT):new Kr(t.left+b/3,t.top+t.height-Q/3),this.topLeftBorderDoubleInnerBox=o>0||r>0?Mr(t.left+2*b/3,t.top+2*y/3,o-2*b/3,r-2*y/3,lr.TOP_LEFT):new Kr(t.left+2*b/3,t.top+2*y/3),this.topRightBorderDoubleInnerBox=o>0||r>0?Mr(t.left+B,t.top+2*y/3,a-2*C/3,s-2*y/3,lr.TOP_RIGHT):new Kr(t.left+t.width-2*C/3,t.top+2*y/3),this.bottomRightBorderDoubleInnerBox=l>0||u>0?Mr(t.left+v,t.top+w,l-2*C/3,u-2*Q/3,lr.BOTTOM_RIGHT):new Kr(t.left+t.width-2*C/3,t.top+t.height-2*Q/3),this.bottomLeftBorderDoubleInnerBox=g>0||h>0?Mr(t.left+2*b/3,t.top+m,g-2*b/3,h-2*Q/3,lr.BOTTOM_LEFT):new Kr(t.left+2*b/3,t.top+t.height-2*Q/3),this.topLeftBorderStroke=o>0||r>0?Mr(t.left+b/2,t.top+y/2,o-b/2,r-y/2,lr.TOP_LEFT):new Kr(t.left+b/2,t.top+y/2),this.topRightBorderStroke=o>0||r>0?Mr(t.left+B,t.top+y/2,a-C/2,s-y/2,lr.TOP_RIGHT):new Kr(t.left+t.width-C/2,t.top+y/2),this.bottomRightBorderStroke=l>0||u>0?Mr(t.left+v,t.top+w,l-C/2,u-Q/2,lr.BOTTOM_RIGHT):new Kr(t.left+t.width-C/2,t.top+t.height-Q/2),this.bottomLeftBorderStroke=g>0||h>0?Mr(t.left+b/2,t.top+m,g-b/2,h-Q/2,lr.BOTTOM_LEFT):new Kr(t.left+b/2,t.top+t.height-Q/2),this.topLeftBorderBox=o>0||r>0?Mr(t.left,t.top,o,r,lr.TOP_LEFT):new Kr(t.left,t.top),this.topRightBorderBox=a>0||s>0?Mr(t.left+B,t.top,a,s,lr.TOP_RIGHT):new Kr(t.left+t.width,t.top),this.bottomRightBorderBox=l>0||u>0?Mr(t.left+v,t.top+w,l,u,lr.BOTTOM_RIGHT):new Kr(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=g>0||h>0?Mr(t.left,t.top+m,g,h,lr.BOTTOM_LEFT):new Kr(t.left,t.top+t.height),this.topLeftPaddingBox=o>0||r>0?Mr(t.left+b,t.top+y,Math.max(0,o-b),Math.max(0,r-y),lr.TOP_LEFT):new Kr(t.left+b,t.top+y),this.topRightPaddingBox=a>0||s>0?Mr(t.left+Math.min(B,t.width-C),t.top+y,B>t.width+C?0:Math.max(0,a-C),Math.max(0,s-y),lr.TOP_RIGHT):new Kr(t.left+t.width-C,t.top+y),this.bottomRightPaddingBox=l>0||u>0?Mr(t.left+Math.min(v,t.width-b),t.top+Math.min(w,t.height-Q),Math.max(0,l-C),Math.max(0,u-Q),lr.BOTTOM_RIGHT):new Kr(t.left+t.width-C,t.top+t.height-Q),this.bottomLeftPaddingBox=g>0||h>0?Mr(t.left+b,t.top+Math.min(m,t.height-Q),Math.max(0,g-b),Math.max(0,h-Q),lr.BOTTOM_LEFT):new Kr(t.left+b,t.top+t.height-Q),this.topLeftContentBox=o>0||r>0?Mr(t.left+b+S,t.top+y+F,Math.max(0,o-(b+S)),Math.max(0,r-(y+F)),lr.TOP_LEFT):new Kr(t.left+b+S,t.top+y+F),this.topRightContentBox=a>0||s>0?Mr(t.left+Math.min(B,t.width+b+S),t.top+y+F,B>t.width+b+S?0:a-b+S,s-(y+F),lr.TOP_RIGHT):new Kr(t.left+t.width-(C+U),t.top+y+F),this.bottomRightContentBox=l>0||u>0?Mr(t.left+Math.min(v,t.width-(b+S)),t.top+Math.min(w,t.height+y+F),Math.max(0,l-(C+U)),u-(Q+E),lr.BOTTOM_RIGHT):new Kr(t.left+t.width-(C+U),t.top+t.height-(Q+E)),this.bottomLeftContentBox=g>0||h>0?Mr(t.left+b+S,t.top+m,Math.max(0,g-(b+S)),h-(Q+E),lr.BOTTOM_LEFT):new Kr(t.left+b+S,t.top+t.height-(Q+E))};!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"}(lr||(lr={}));var Mr=function(A,e,t,n,o){var r=(Math.sqrt(2)-1)/3*4,i=t*r,a=n*r,s=A+t,c=e+n;switch(o){case lr.TOP_LEFT:return new Pr(new Kr(A,c),new Kr(A,c-a),new Kr(s-i,e),new Kr(s,e));case lr.TOP_RIGHT:return new Pr(new Kr(A,e),new Kr(A+i,e),new Kr(s,c-a),new Kr(s,c));case lr.BOTTOM_RIGHT:return new Pr(new Kr(s,e),new Kr(s,e+a),new Kr(A+i,c),new Kr(A,c));case lr.BOTTOM_LEFT:default:return new Pr(new Kr(s,c),new Kr(s-i,c),new Kr(A,e+a),new Kr(A,e))}},Vr=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},_r=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},Gr=function(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6},Nr=function(A,e){this.path=A,this.target=e,this.type=1},jr=function(A){this.opacity=A,this.type=2,this.target=6},Wr=function(A){return 1===A.type},Jr=function(A,e){return A.length===e.length&&A.some(function(A,t){return A===e[t]})},Xr=function(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},Yr=function(){function A(A,e){if(this.container=A,this.parent=e,this.effects=[],this.curves=new Rr(this.container),this.container.styles.opacity<1&&this.effects.push(new jr(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 Gr(t,n,o))}if(0!==this.container.styles.overflowX){var r=Vr(this.curves),i=_r(this.curves);Jr(r,i)?this.effects.push(new Nr(r,6)):(this.effects.push(new Nr(r,2)),this.effects.push(new Nr(i,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!Wr(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 r=Vr(t.curves),i=_r(t.curves);Jr(r,i)||n.unshift(new Nr(i,6))}}else n.unshift.apply(n,o);t=t.parent}return n.filter(function(e){return ln(e.target,A)})},A}(),zr=function(A,e,t,n){A.container.elements.forEach(function(o){var r=ln(o.flags,4),i=ln(o.flags,2),a=new Yr(o,A);ln(o.styles.display,2048)&&n.push(a);var s=ln(o.flags,8)?[]:n;if(r||i){var c=r||o.styles.isPositioned()?t:e,l=new Xr(a);if(o.styles.isPositioned()||o.styles.opacity<1||o.styles.isTransformed()){var u=o.styles.zIndex.order;if(u<0){var d=0;c.negativeZIndex.some(function(A,e){return u>A.element.container.styles.zIndex.order?(d=e,!1):d>0}),c.negativeZIndex.splice(d,0,l)}else if(u>0){var g=0;c.positiveZIndex.some(function(A,e){return u>=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);zr(a,l,r?l:t,s)}else o.styles.isInlineLevel()?e.inlineLevel.push(a):e.nonInlineLevel.push(a),zr(a,e,t,s);ln(o.flags,8)&&Zr(o,s)})},Zr=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 r=e[o];r.container instanceof lo&&"number"==typeof r.container.value&&0!==r.container.value&&(t=r.container.value),r.listValue=ar(t,r.container.styles.listStyleType,!0),t+=n?-1:1}},qr=function(A,e){switch(e){case 0:return Ai(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return Ai(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return Ai(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return Ai(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},$r=function(A,e){var t=[];return Lr(A)?t.push(A.subdivide(.5,!1)):t.push(A),Lr(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},Ai=function(A,e,t,n){var o=[];return Lr(A)?o.push(A.subdivide(.5,!1)):o.push(A),Lr(t)?o.push(t.subdivide(.5,!0)):o.push(t),Lr(n)?o.push(n.subdivide(.5,!0).reverse()):o.push(n),Lr(e)?o.push(e.subdivide(.5,!1).reverse()):o.push(e),o},ei=function(A){var e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},ti=function(A){var e=A.styles,t=A.bounds,n=re(e.paddingLeft,t.width),o=re(e.paddingRight,t.width),r=re(e.paddingTop,t.width),i=re(e.paddingBottom,t.width);return t.add(n+e.borderLeftWidth,r+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+n+o),-(e.borderTopWidth+e.borderBottomWidth+r+i))},ni=function(A,e,t){var n=function(A,e){return 0===A?e.bounds:2===A?ti(e):ei(e)}(ai(A.styles.backgroundOrigin,e),A),o=function(A,e){return 0===A?e.bounds:2===A?ti(e):ei(e)}(ai(A.styles.backgroundClip,e),A),r=ii(ai(A.styles.backgroundSize,e),t,n),i=r[0],a=r[1],s=oe(ai(A.styles.backgroundPosition,e),n.width-i,n.height-a);return[si(ai(A.styles.backgroundRepeat,e),s,r,n,o),Math.round(n.left+s[0]),Math.round(n.top+s[1]),i,a]},oi=function(A){return jA(A)&&A.value===Ve.AUTO},ri=function(A){return"number"==typeof A},ii=function(A,e,t){var n=e[0],o=e[1],r=e[2],i=A[0],a=A[1];if(!i)return[0,0];if($A(i)&&a&&$A(a))return[re(i,t.width),re(a,t.height)];var s=ri(r);if(jA(i)&&(i.value===Ve.CONTAIN||i.value===Ve.COVER))return ri(r)?t.width/t.height<r!=(i.value===Ve.COVER)?[t.width,t.width/r]:[t.height*r,t.height]:[t.width,t.height];var c=ri(n),l=ri(o),u=c||l;if(oi(i)&&(!a||oi(a)))return c&&l?[n,o]:s||u?u&&s?[c?n:o*r,l?o:n/r]:[c?n:t.width,l?o:t.height]:[t.width,t.height];if(s){var d=0,g=0;return $A(i)?d=re(i,t.width):$A(a)&&(g=re(a,t.height)),oi(i)?d=g*r:a&&!oi(a)||(g=d/r),[d,g]}var h=null,p=null;if($A(i)?h=re(i,t.width):a&&$A(a)&&(p=re(a,t.height)),null===h||a&&!oi(a)||(p=c&&l?h/n*o:t.height),null!==p&&oi(i)&&(h=c&&l?p/o*n:t.width),null!==h&&null!==p)return[h,p];throw new Error("Unable to calculate background-size for element")},ai=function(A,e){var t=A[e];return void 0===t?A[0]:t},si=function(A,e,t,n,o){var r=e[0],i=e[1],a=t[0],s=t[1];switch(A){case 2:return[new Kr(Math.round(n.left),Math.round(n.top+i)),new Kr(Math.round(n.left+n.width),Math.round(n.top+i)),new Kr(Math.round(n.left+n.width),Math.round(s+n.top+i)),new Kr(Math.round(n.left),Math.round(s+n.top+i))];case 3:return[new Kr(Math.round(n.left+r),Math.round(n.top)),new Kr(Math.round(n.left+r+a),Math.round(n.top)),new Kr(Math.round(n.left+r+a),Math.round(n.height+n.top)),new Kr(Math.round(n.left+r),Math.round(n.height+n.top))];case 1:return[new Kr(Math.round(n.left+r),Math.round(n.top+i)),new Kr(Math.round(n.left+r+a),Math.round(n.top+i)),new Kr(Math.round(n.left+r+a),Math.round(n.top+i+s)),new Kr(Math.round(n.left+r),Math.round(n.top+i+s))];default:return[new Kr(Math.round(o.left),Math.round(o.top)),new Kr(Math.round(o.left+o.width),Math.round(o.top)),new Kr(Math.round(o.left+o.width),Math.round(o.height+o.top)),new Kr(Math.round(o.left),Math.round(o.height+o.top))]}},ci="Hidden Text",li=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"),r=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",r.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(ci)),t.appendChild(o),t.appendChild(n);var i=n.offsetTop-o.offsetTop+2;t.removeChild(o),t.appendChild(this._document.createTextNode(ci)),t.style.lineHeight="normal",n.style.verticalAlign="super";var a=n.offsetTop-t.offsetTop+2;return r.removeChild(t),{baseline:i,middle:a}},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}(),ui=function(A,e){this.context=A,this.options=e},di=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 li(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)),Wr(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=Bi(A.fontFamily).join(", "),n=GA(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,r,i,a,s,c,l,u=this;return o(this,function(o){return t=this.createFontStyle(e),n=t[0],r=t[1],i=t[2],this.ctx.font=n,this.ctx.direction=1===e.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(r,i),s=a.baseline,c=a.middle,l=e.paintOrder,A.textBounds.forEach(function(A){l.forEach(function(t){switch(t){case 0:u.ctx.fillStyle=he(e.color),u.renderTextWithLetterSpacing(A,e.letterSpacing,s);var n=e.textShadow;n.length&&A.text.trim().length&&(n.slice(0).reverse().forEach(function(t){u.ctx.shadowColor=he(t.color),u.ctx.shadowOffsetX=t.offsetX.number*u.options.scale,u.ctx.shadowOffsetY=t.offsetY.number*u.options.scale,u.ctx.shadowBlur=t.blur.number,u.renderTextWithLetterSpacing(A,e.letterSpacing,s)}),u.ctx.shadowColor="",u.ctx.shadowOffsetX=0,u.ctx.shadowOffsetY=0,u.ctx.shadowBlur=0),e.textDecorationLine.length&&(u.ctx.fillStyle=he(e.textDecorationColor||e.color),e.textDecorationLine.forEach(function(e){switch(e){case 1:u.ctx.fillRect(A.bounds.left,Math.round(A.bounds.top+s),A.bounds.width,1);break;case 2:u.ctx.fillRect(A.bounds.left,Math.round(A.bounds.top),A.bounds.width,1);break;case 3:u.ctx.fillRect(A.bounds.left,Math.ceil(A.bounds.top+c),A.bounds.width,1)}}));break;case 1:e.webkitTextStrokeWidth&&A.text.trim().length&&(u.ctx.strokeStyle=he(e.webkitTextStrokeColor),u.ctx.lineWidth=e.webkitTextStrokeWidth,u.ctx.lineJoin=window.chrome?"miter":"round",u.ctx.strokeText(A.text,A.bounds.left,A.bounds.top+s)),u.ctx.strokeStyle="",u.ctx.lineWidth=0,u.ctx.lineJoin="miter"}})}),[2]})})},t.prototype.renderReplacedElement=function(A,e,t){if(t&&A.intrinsicWidth>0&&A.intrinsicHeight>0){var n=ti(A),o=_r(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,r,a,s,c,l,u,d,g,h,p,f,B,w,v,m,y;return o(this,function(o){switch(o.label){case 0:this.applyEffects(A.getEffects(4)),e=A.container,n=A.curves,r=e.styles,a=0,s=e.textNodes,o.label=1;case 1:return a<s.length?(c=s[a],[4,this.renderTextNode(c,r)]):[3,4];case 2:o.sent(),o.label=3;case 3:return a++,[3,1];case 4:if(!(e instanceof ao))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 w=o.sent(),this.renderReplacedElement(e,n,w),[3,8];case 7:return o.sent(),this.context.logger.error("Error loading image "+e.src),[3,8];case 8:if(e instanceof so&&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 w=o.sent(),this.renderReplacedElement(e,n,w),[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 Co&&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&&(u=Math.min(e.bounds.width,e.bounds.height),e.type===po?e.checked&&(this.ctx.save(),this.path([new Kr(e.bounds.left+.39363*u,e.bounds.top+.79*u),new Kr(e.bounds.left+.16*u,e.bounds.top+.5549*u),new Kr(e.bounds.left+.27347*u,e.bounds.top+.44071*u),new Kr(e.bounds.left+.39694*u,e.bounds.top+.5649*u),new Kr(e.bounds.left+.72983*u,e.bounds.top+.23*u),new Kr(e.bounds.left+.84*u,e.bounds.top+.34085*u),new Kr(e.bounds.left+.39363*u,e.bounds.top+.79*u)]),this.ctx.fillStyle=he(wo),this.ctx.fill(),this.ctx.restore()):e.type===fo&&e.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(e.bounds.left+u/2,e.bounds.top+u/2,u/4,0,2*Math.PI,!0),this.ctx.fillStyle=he(wo),this.ctx.fill(),this.ctx.restore())),gi(e)&&e.value.length){switch(d=this.createFontStyle(r),m=d[0],g=d[1],h=this.fontMetrics.getMetrics(m,g).baseline,this.ctx.font=m,this.ctx.fillStyle=he(r.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=pi(e.styles.textAlign),y=ti(e),p=0,e.styles.textAlign){case 1:p+=y.width/2;break;case 2:p+=y.width}f=y.add(p,0,0,-y.height/2+1),this.ctx.save(),this.path([new Kr(y.left,y.top),new Kr(y.left+y.width,y.top),new Kr(y.left+y.width,y.top+y.height),new Kr(y.left,y.top+y.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new zn(e.value,f),r.letterSpacing,h),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!==(B=e.styles.listStyleImage).type)return[3,18];w=void 0,v=B.url,o.label=15;case 15:return o.trys.push([15,17,,18]),[4,this.context.cache.match(v)];case 16:return w=o.sent(),this.ctx.drawImage(w,e.bounds.left-(w.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&&(m=this.createFontStyle(r)[0],this.ctx.font=m,this.ctx.fillStyle=he(r.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",y=new i(e.bounds.left,e.bounds.top+re(e.styles.paddingTop,e.bounds.width),e.bounds.width,Ut(r.lineHeight,r.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new zn(A.listValue,y),r.letterSpacing,Ut(r.lineHeight,r.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,r,i,a,s,c,l,u,d,g,h,p,f;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?(f=t[e],[4,this.renderStack(f)]):[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,r=A.nonInlineLevel,o.label=7;case 7:return n<r.length?(f=r[n],[4,this.renderNode(f)]):[3,10];case 8:o.sent(),o.label=9;case 9:return n++,[3,7];case 10:i=0,a=A.nonPositionedFloats,o.label=11;case 11:return i<a.length?(f=a[i],[4,this.renderStack(f)]):[3,14];case 12:o.sent(),o.label=13;case 13:return i++,[3,11];case 14:s=0,c=A.nonPositionedInlineLevel,o.label=15;case 15:return s<c.length?(f=c[s],[4,this.renderStack(f)]):[3,18];case 16:o.sent(),o.label=17;case 17:return s++,[3,15];case 18:l=0,u=A.inlineLevel,o.label=19;case 19:return l<u.length?(f=u[l],[4,this.renderNode(f)]):[3,22];case 20:o.sent(),o.label=21;case 21:return l++,[3,19];case 22:d=0,g=A.zeroOrAutoZIndexOrTransformedOrOpacity,o.label=23;case 23:return d<g.length?(f=g[d],[4,this.renderStack(f)]):[3,26];case 24:o.sent(),o.label=25;case 25:return d++,[3,23];case 26:h=0,p=A.positiveZIndex,o.label=27;case 27:return h<p.length?(f=p[h],[4,this.renderStack(f)]):[3,30];case 28:o.sent(),o.label=29;case 29:return h++,[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=Lr(A)?A.start:A;0===t?e.ctx.moveTo(n.x,n.y):e.ctx.lineTo(n.x,n.y),Lr(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,r,i,a;return o(this,function(s){switch(s.label){case 0:e=A.styles.backgroundImage.length-1,t=function(t){var r,i,a,s,c,l,u,d,g,h,p,f,B,w,v,m,y,C,Q,b,F,U,E,S,x,I,H,k,T,D,K;return o(this,function(o){switch(o.label){case 0:if(0!==t.type)return[3,5];r=void 0,i=t.url,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n.context.cache.match(i)];case 2:return r=o.sent(),[3,4];case 3:return o.sent(),n.context.logger.error("Error loading background-image "+i),[3,4];case 4:return r&&(a=ni(A,e,[r.width,r.height,r.width/r.height]),m=a[0],U=a[1],E=a[2],Q=a[3],b=a[4],w=n.ctx.createPattern(n.resizeImage(r,Q,b),"repeat"),n.renderRepeat(m,w,U,E)),[3,6];case 5:1===t.type?(s=ni(A,e,[null,null,null]),m=s[0],U=s[1],E=s[2],Q=s[3],b=s[4],c=Ee(t.angle,Q,b),l=c[0],u=c[1],d=c[2],g=c[3],h=c[4],(p=document.createElement("canvas")).width=Q,p.height=b,f=p.getContext("2d"),B=f.createLinearGradient(u,g,d,h),Ue(t.stops,l).forEach(function(A){return B.addColorStop(A.stop,he(A.color))}),f.fillStyle=B,f.fillRect(0,0,Q,b),Q>0&&b>0&&(w=n.ctx.createPattern(p,"repeat"),n.renderRepeat(m,w,U,E))):function(A){return 2===A.type}(t)&&(v=ni(A,e,[null,null,null]),m=v[0],y=v[1],C=v[2],Q=v[3],b=v[4],F=0===t.position.length?[te]:t.position,U=re(F[0],Q),E=re(F[F.length-1],b),S=function(A,e,t,n,o){var r=0,i=0;switch(A.size){case 0:0===A.shape?r=i=Math.min(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-o)):1===A.shape&&(r=Math.min(Math.abs(e),Math.abs(e-n)),i=Math.min(Math.abs(t),Math.abs(t-o)));break;case 2:if(0===A.shape)r=i=Math.min(Se(e,t),Se(e,t-o),Se(e-n,t),Se(e-n,t-o));else if(1===A.shape){var a=Math.min(Math.abs(t),Math.abs(t-o))/Math.min(Math.abs(e),Math.abs(e-n)),s=xe(n,o,e,t,!0),c=s[0],l=s[1];i=a*(r=Se(c-e,(l-t)/a))}break;case 1:0===A.shape?r=i=Math.max(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-o)):1===A.shape&&(r=Math.max(Math.abs(e),Math.abs(e-n)),i=Math.max(Math.abs(t),Math.abs(t-o)));break;case 3:if(0===A.shape)r=i=Math.max(Se(e,t),Se(e,t-o),Se(e-n,t),Se(e-n,t-o));else if(1===A.shape){a=Math.max(Math.abs(t),Math.abs(t-o))/Math.max(Math.abs(e),Math.abs(e-n));var u=xe(n,o,e,t,!1);c=u[0],l=u[1],i=a*(r=Se(c-e,(l-t)/a))}}return Array.isArray(A.size)&&(r=re(A.size[0],n),i=2===A.size.length?re(A.size[1],o):r),[r,i]}(t,U,E,Q,b),x=S[0],I=S[1],x>0&&I>0&&(H=n.ctx.createRadialGradient(y+U,C+E,0,y+U,C+E,x),Ue(t.stops,2*x).forEach(function(A){return H.addColorStop(A.stop,he(A.color))}),n.path(m),n.ctx.fillStyle=H,x!==I?(k=A.bounds.left+.5*A.bounds.width,T=A.bounds.top+.5*A.bounds.height,K=1/(D=I/x),n.ctx.save(),n.ctx.translate(k,T),n.ctx.transform(1,0,0,D,0,0),n.ctx.translate(-k,-T),n.ctx.fillRect(y,K*(C-T)+T,Q,b*K),n.ctx.restore()):n.ctx.fill())),o.label=6;case 6:return e--,[2]}})},n=this,r=0,i=A.styles.backgroundImage.slice(0).reverse(),s.label=1;case 1:return r<i.length?(a=i[r],[5,t(a)]):[3,4];case 2:s.sent(),s.label=3;case 3:return r++,[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(qr(t,e)),this.ctx.fillStyle=he(A),this.ctx.fill(),[2]})})},t.prototype.renderDoubleBorder=function(A,e,t,r){return n(this,void 0,void 0,function(){var n,i;return o(this,function(o){switch(o.label){case 0:return e<3?[4,this.renderSolidBorder(A,t,r)]:[3,2];case 1:return o.sent(),[2];case 2:return n=function(A,e){switch(e){case 0:return Ai(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return Ai(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return Ai(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return Ai(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}}(r,t),this.path(n),this.ctx.fillStyle=he(A),this.ctx.fill(),i=function(A,e){switch(e){case 0:return Ai(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return Ai(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return Ai(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return Ai(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}}(r,t),this.path(i),this.ctx.fill(),[2]}})})},t.prototype.renderNodeBackgroundAndBorders=function(A){return n(this,void 0,void 0,function(){var e,t,n,r,i,a,s,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}],r=hi(ai(e.backgroundClip,0),A.curves),t||e.boxShadow.length?(this.ctx.save(),this.path(r),this.ctx.clip(),ge(e.backgroundColor)||(this.ctx.fillStyle=he(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,r,i,a=Vr(A.curves),s=e.inset?0:1e4,c=(t=a,n=-s+(e.inset?1:-1)*e.spread.number,o=(e.inset?1:-1)*e.spread.number,r=e.spread.number*(e.inset?-2:2),i=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+r,o);case 2:return A.add(n+r,o+i);case 3:return A.add(n,o+i)}return A}));e.inset?(l.path(a),l.ctx.clip(),l.mask(c)):(l.mask(a),l.ctx.clip(),l.path(c)),l.ctx.shadowOffsetX=e.offsetX.number+s,l.ctx.shadowOffsetY=e.offsetY.number,l.ctx.shadowColor=he(e.color),l.ctx.shadowBlur=e.blur.number,l.ctx.fillStyle=e.inset?he(e.color):"rgba(0,0,0,1)",l.ctx.fill(),l.ctx.restore()}),o.label=2;case 2:i=0,a=0,s=n,o.label=3;case 3:return a<s.length?0!==(c=s[a]).style&&!ge(c.color)&&c.width>0?2!==c.style?[3,5]:[4,this.renderDashedDottedBorder(c.color,c.width,i,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,i,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,i,A.curves)];case 8:return o.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,i,A.curves)];case 10:o.sent(),o.label=11;case 11:i++,o.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},t.prototype.renderDashedDottedBorder=function(A,e,t,r,i){return n(this,void 0,void 0,function(){var n,a,s,c,l,u,d,g,h,p,f,B,w,v,m,y;return o(this,function(o){return this.ctx.save(),n=function(A,e){switch(e){case 0:return $r(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return $r(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return $r(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return $r(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}}(r,t),a=qr(r,t),2===i&&(this.path(a),this.ctx.clip()),Lr(a[0])?(s=a[0].start.x,c=a[0].start.y):(s=a[0].x,c=a[0].y),Lr(a[1])?(l=a[1].end.x,u=a[1].end.y):(l=a[1].x,u=a[1].y),d=0===t||2===t?Math.abs(s-l):Math.abs(c-u),this.ctx.beginPath(),3===i?this.formatPath(n):this.formatPath(a.slice(0,2)),g=e<3?3*e:2*e,h=e<3?2*e:e,3===i&&(g=e,h=e),p=!0,d<=2*g?p=!1:d<=2*g+h?(g*=f=d/(2*g+h),h*=f):(B=Math.floor((d+h)/(g+h)),w=(d-B*g)/(B-1),h=(v=(d-(B+1)*g)/B)<=0||Math.abs(h-w)<Math.abs(h-v)?w:v),p&&(3===i?this.ctx.setLineDash([0,g+h]):this.ctx.setLineDash([g,h])),3===i?(this.ctx.lineCap="round",this.ctx.lineWidth=e):this.ctx.lineWidth=2*e+1.1,this.ctx.strokeStyle=he(A),this.ctx.stroke(),this.ctx.setLineDash([]),2===i&&(Lr(a[0])&&(m=a[3],y=a[0],this.ctx.beginPath(),this.formatPath([new Kr(m.end.x,m.end.y),new Kr(y.start.x,y.start.y)]),this.ctx.stroke()),Lr(a[1])&&(m=a[1],y=a[2],this.ctx.beginPath(),this.formatPath([new Kr(m.end.x,m.end.y),new Kr(y.start.x,y.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=he(this.options.backgroundColor),this.ctx.fillRect(this.options.x,this.options.y,this.options.width,this.options.height)),n=new Yr(A,null),o=new Xr(n),zr(n,o,o,r=[]),Zr(n.container,r),e=o,[4,this.renderStack(e)];case 1:return t.sent(),this.applyEffects([]),[2,this.canvas]}var n,o,r})})},t}(ui),gi=function(A){return A instanceof yo||A instanceof mo||A instanceof vo&&A.type!==fo&&A.type!==po},hi=function(A,e){switch(A){case 0:return Vr(e);case 2:return function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]}(e);default:return _r(e)}},pi=function(A){switch(A){case 1:return"center";case 2:return"right";default:return"left"}},fi=["-apple-system","system-ui"],Bi=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter(function(A){return-1===fi.indexOf(A)}):A},wi=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=Jn(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,A),[4,vi(e)];case 1:return t=n.sent(),this.options.backgroundColor&&(this.ctx.fillStyle=he(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}(ui),vi=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))})},mi=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,r([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,r([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,r([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,r([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},A.instances={},A}(),yi=function(){function A(e,t){var n;this.windowBounds=t,this.instanceName="#"+A.instanceCount++,this.logger=new mi({id:this.instanceName,enabled:e.logging}),this.cache=null!==(n=e.cache)&&void 0!==n?n:new Ur(this,e)}return A.instanceCount=1,A}();"undefined"!=typeof window&&Fr.setContext(window);var Ci=function(A,e){return n(void 0,void 0,void 0,function(){var n,r,s,c,l,u,d,g,h,p,f,B,w,v,m,y,C,Q,b,F,U,E,S,x,I,H,k,T,D,K,O,P,L,R,M,V,_,G;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(!(r=n.defaultView))throw new Error("Document is not attached to a Window");return s={allowTaint:null!==(E=e.allowTaint)&&void 0!==E&&E,imageTimeout:null!==(S=e.imageTimeout)&&void 0!==S?S:15e3,proxy:e.proxy,useCORS:null!==(x=e.useCORS)&&void 0!==x&&x},c=t({logging:null===(I=e.logging)||void 0===I||I,cache:e.cache},s),l={windowWidth:null!==(H=e.windowWidth)&&void 0!==H?H:r.innerWidth,windowHeight:null!==(k=e.windowHeight)&&void 0!==k?k:r.innerHeight,scrollX:null!==(T=e.scrollX)&&void 0!==T?T:r.pageXOffset,scrollY:null!==(D=e.scrollY)&&void 0!==D?D:r.pageYOffset},u=new i(l.scrollX,l.scrollY,l.windowWidth,l.windowHeight),d=new yi(c,u),g=null!==(K=e.foreignObjectRendering)&&void 0!==K&&K,h={allowTaint:null!==(O=e.allowTaint)&&void 0!==O&&O,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:g,copyStyles:g},d.logger.debug("Starting document clone with size "+u.width+"x"+u.height+" scrolled to "+-u.left+","+-u.top),p=new cr(d,A,h),(f=p.clonedReferenceElement)?[4,p.toIFrame(n,u)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return B=o.sent(),w=Po(f)||"HTML"===f.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 i(0,0,n,o)}(f.ownerDocument):a(d,f),v=w.width,m=w.height,y=w.left,C=w.top,Q=Qi(d,f,e.backgroundColor),b={canvas:e.canvas,backgroundColor:Q,scale:null!==(L=null!==(P=e.scale)&&void 0!==P?P:r.devicePixelRatio)&&void 0!==L?L:1,x:(null!==(R=e.x)&&void 0!==R?R:0)+y,y:(null!==(M=e.y)&&void 0!==M?M:0)+C,width:null!==(V=e.width)&&void 0!==V?V:Math.ceil(v),height:null!==(_=e.height)&&void 0!==_?_:Math.ceil(m)},g?(d.logger.debug("Document cloned, using foreign object rendering"),[4,new wi(d,b).render(f)]):[3,3];case 2:return F=o.sent(),[3,5];case 3:return d.logger.debug("Document cloned, element located at "+y+","+C+" with size "+v+"x"+m+" using computed rendering"),d.logger.debug("Starting DOM parsing"),U=Uo(d,f),Q===U.styles.backgroundColor&&(U.styles.backgroundColor=Ce.TRANSPARENT),d.logger.debug("Starting renderer for element at "+b.x+","+b.y+" with size "+b.width+"x"+b.height),[4,new di(d,b).render(U)];case 4:F=o.sent(),o.label=5;case 5:return(null===(G=e.removeContainer)||void 0===G||G)&&(cr.destroy(B)||d.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),d.logger.debug("Finished rendering"),[2,F]}})})},Qi=function(A,e,t){var n=e.ownerDocument,o=n.documentElement?ye(A,getComputedStyle(n.documentElement).backgroundColor):Ce.TRANSPARENT,r=n.body?ye(A,getComputedStyle(n.body).backgroundColor):Ce.TRANSPARENT,i="string"==typeof t?ye(A,t):null===t?Ce.TRANSPARENT:4294967295;return e===n.documentElement?ge(o)?ge(r)?i:r:o:i};return function(A,e){return void 0===e&&(e={}),Ci(A,e)}}()},540:(A,e,t)=>{"use strict";A.exports=t(869)},698:(A,e)=>{"use strict";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 r in n={},e)"key"!==r&&(n[r]=e[r]);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)=>{"use strict";A.exports=t(698)},869:(A,e)=>{"use strict";Symbol.for("react.transitional.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.consumer"),Symbol.for("react.context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.activity"),Symbol.iterator;var t={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},n=Object.assign,o={};function r(A,e,n){this.props=A,this.context=e,this.refs=o,this.updater=n||t}function i(){}function a(A,e,n){this.props=A,this.context=e,this.refs=o,this.updater=n||t}r.prototype.isReactComponent={},r.prototype.setState=function(A,e){if("object"!=typeof A&&"function"!=typeof A&&null!=A)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,e,"setState")},r.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")},i.prototype=r.prototype;var s=a.prototype=new i;s.constructor=a,n(s,r.prototype),s.isPureReactComponent=!0;Array.isArray;var c={H:null,A:null,T:null,S:null};Object.prototype.hasOwnProperty;"function"==typeof reportError&&reportError;e.useEffect=function(A,e){return c.H.useEffect(A,e)},e.useRef=function(A){return c.H.useRef(A)},e.useState=function(A){return c.H.useState(A)}}},e={};function t(n){var o=e[n];if(void 0!==o)return o.exports;var r=e[n]={exports:{}};return A[n].call(r.exports,r,r.exports,t),r.exports}t.n=A=>{var e=A&&A.__esModule?()=>A.default:()=>A;return t.d(e,{a:e}),e},t.d=(A,e)=>{for(var n in e)t.o(e,n)&&!t.o(A,n)&&Object.defineProperty(A,n,{enumerable:!0,get:e[n]})},t.o=(A,e)=>Object.prototype.hasOwnProperty.call(A,e),t.r=A=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})};var n={};return(()=>{"use strict";t.r(n),t.d(n,{AgentSDK:()=>Yt,AudioPlayer:()=>pt,AudioRecorder:()=>ot,EventEmitter:()=>ce,MicPermissionModals:()=>e,MicPermissionUtils:()=>A,TTPChatWidget:()=>Vn,TextChatSDK:()=>Ce,VERSION:()=>_n,VanillaVoiceButton:()=>Pt,VoiceButton:()=>Et,VoiceSDK_v2:()=>re,WebSocketManager:()=>We,default:()=>Gn});var A={};t.r(A),t.d(A,{checkPermissionState:()=>An,getDeviceInfo:()=>$t,getPermissionInstructions:()=>tn,openSettings:()=>nn});var e={};function o(A){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},o(A)}function r(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,i(n.key),n)}}function i(A){var e=function(A){if("object"!=o(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=o(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==o(e)?e:e+""}t.r(e),t.d(e,{showBlockedModal:()=>dn,showNoMicrophoneModal:()=>gn,showPrePromptModal:()=>un});const a=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.events={}},e=[{key:"on",value:function(A,e){return this.events[A]||(this.events[A]=[]),this.events[A].push(e),this}},{key:"off",value:function(A,e){return this.events[A]?(this.events[A]=this.events[A].filter(function(A){return A!==e}),this):this}},{key:"emit",value:function(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(function(A){A.apply(void 0,t)}),!0)}},{key:"once",value:function(A,e){var t=this,n=function(){e.apply(void 0,arguments),t.off(A,n)};return this.on(A,n)}},{key:"removeAllListeners",value:function(A){return A?delete this.events[A]:this.events={},this}}],e&&r(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function s(A){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},s(A)}function c(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,l(n.key),n)}}function l(A){var e=function(A){if("object"!=s(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=s(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==s(e)?e:e+""}const u=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.name="PCM"},(e=[{key:"decode",value:function(A){if(A instanceof ArrayBuffer)return A;if(A instanceof Uint8Array)return A.buffer;throw new Error("Invalid PCM data type")}},{key:"encode",value:function(A){return A}}])&&c(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function d(A){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},d(A)}function g(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,h(n.key),n)}}function h(A){var e=function(A){if("object"!=d(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=d(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==d(e)?e:e+""}const p=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.name="PCMU"},(e=[{key:"decode",value:function(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}},{key:"encode",value:function(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}},{key:"mulawToLinear",value:function(A){var e=1<<3+(A>>4&7);return(128&A?-1:1)*(132+(15&A)*e+(e>>1)-4)}},{key:"linearToMulaw",value:function(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)}}])&&g(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function f(A){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},f(A)}function B(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,w(n.key),n)}}function w(A){var e=function(A){if("object"!=f(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=f(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==f(e)?e:e+""}const v=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.name="PCMA"},(e=[{key:"decode",value:function(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}},{key:"encode",value:function(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}},{key:"alawToLinear",value:function(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)}},{key:"linearToAlaw",value:function(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)}}])&&B(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function m(A){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},m(A)}function y(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=function(A,e){if(A){if("string"==typeof A)return C(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?C(A,e):void 0}}(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,o=function(){};return{s:o,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){a=!0,r=A},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function C(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}function Q(A){if(null!=A){var e=A["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],t=0;if(e)return e.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length))return{next:function(){return A&&t>=A.length&&(A=void 0),{value:A&&A[t++],done:!A}}}}throw new TypeError(m(A)+" is not iterable")}function b(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return F(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,h=r[2];t>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<h&&(o=t<3||r[0]>n||n>h)&&(r[4]=t,r[5]=n,d.n=h,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,h),a=l,s=h;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(F(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,F(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,F(u,"constructor",c),F(c,"constructor",s),s.displayName="GeneratorFunction",F(c,o,"GeneratorFunction"),F(u),F(u,o,"Generator"),F(u,n,function(){return this}),F(u,"toString",function(){return"[object Generator]"}),(b=function(){return{w:r,m:d}})()}function F(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}F=function(A,e,t,n){function r(e,t){F(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},F(A,e,t,n)}function U(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function E(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){U(r,n,o,i,a,"next",A)}function a(A){U(r,n,o,i,a,"throw",A)}i(void 0)})}}function S(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,x(n.key),n)}}function x(A){var e=function(A){if("object"!=m(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=m(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==m(e)?e:e+""}function I(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(I=function(){return!!A})()}function H(A){return H=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},H(A)}function k(A,e){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},k(A,e)}const T=function(A){function e(){var A,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(A=function(A,e,t){return e=H(e),function(A,e){if(e&&("object"==m(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,I()?Reflect.construct(e,t||[],H(A).constructor):e.apply(A,t))}(this,e)).config=t,A.audioContext=null,A.audioQueue=[],A.isPlaying=!1,A.isProcessingQueue=!1,A.currentSource=null,A.outputFormat=null,A.nextStartTime=0,A.scheduledBuffers=0,A.scheduledSources=new Set,A.pcmChunkQueue=[],A.preparedBuffer=[],A.isProcessingPcmQueue=!1,A.isSchedulingFrames=!1,A.MAX_LOOKAHEAD_SECONDS=.02,A.pendingSentenceText=null,A.sentenceTimings=[],A.isCheckingTranscripts=!1,A.codecs={pcm:new u,pcmu:new p,pcma:new v},A.SUPPORTED_CONTAINERS=["wav","raw"],A.SUPPORTED_ENCODINGS=["pcm","pcmu","pcma"],A.SUPPORTED_SAMPLE_RATES=[8e3,16e3,22050,24e3,44100,48e3],A.SUPPORTED_BIT_DEPTHS=[8,16,24],A.SUPPORTED_CHANNELS=[1],console.log("🎵 AudioPlayer v2 initialized"),A}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&k(A,e)}(e,A),t=e,n=[{key:"setOutputFormat",value:function(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(),"closed"!==this.audioContext.state&&this.audioContext.close(),this.audioContext=null,console.log("ℹ️ AudioContext will be recreated on next audio chunk with correct sample rate")),this.audioContext||(this.initializeAudioContext(),this.audioContext&&"suspended"===this.audioContext.state&&this.audioContext.resume().then(function(){console.log("✅ AudioPlayer v2: AudioContext resumed and ready")}).catch(function(A){console.warn("⚠️ AudioPlayer v2: Could not resume AudioContext:",A)}))}},{key:"validateFormat",value:function(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))}},{key:"getDefaultFormat",value:function(){return{container:"raw",encoding:"pcm",sampleRate:16e3,channels:1,bitDepth:16}}},{key:"playAudio",value:function(A){var e=this;try{var t=this.createAudioBlob(A);this.audioQueue.push(t),this.isPlaying||this.isProcessingQueue||this.currentSource||setTimeout(function(){return e.processQueue()},50)}catch(A){console.error("❌ AudioPlayer v2: Playback error:",A),this.emit("playbackError",A)}}},{key:"playChunk",value:(s=E(b().m(function A(e){var t,n,o=this;return b().w(function(A){for(;;)switch(A.n){case 0:(t=this.prepareChunk(e))?(this.preparedBuffer.push(t),this.isSchedulingFrames?setTimeout(function(){o.preparedBuffer.length>0&&!o.isSchedulingFrames&&o.schedulePreparedFrames()},5):this.schedulePreparedFrames(),this.pcmChunkQueue.length>0&&!this.isProcessingPcmQueue&&this.processPcmQueue()):(console.error("❌ AudioPlayer: playChunk failed - prepareChunk returned null"),console.error(" pcmData length:",(null==e?void 0:e.byteLength)||"undefined"),console.error(" outputFormat:",this.outputFormat),console.error(" audioContext:",this.audioContext?"initialized":"not initialized"),console.error(" audioContext state:",(null===(n=this.audioContext)||void 0===n?void 0:n.state)||"N/A"),this.emit("playbackError",new Error("Failed to prepare PCM chunk for playback")));case 1:return A.a(2)}},A,this)})),function(A){return s.apply(this,arguments)})},{key:"prepareChunk",value:function(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),r=new Float32Array(o.length),i=1/32768,a=o.length,s=0;s<a;s++)r[s]=o[s]*i;var c=(null===(e=this.outputFormat)||void 0===e?void 0:e.sampleRate)||this.audioContext.sampleRate,l=this.audioContext.sampleRate,u=this.audioContext.createBuffer(1,r.length,c);u.getChannelData(0).set(r);var d=u.duration,g=r.length,h=d;return l!==c&&(h=g/l),{buffer:u,duration:h,sampleRate:c,contextSampleRate:l}}catch(A){return console.error("❌ AudioPlayer: Error preparing chunk:",A),null}}},{key:"applyFadeOut",value:function(A){return A}},{key:"schedulePreparedFrames",value:(a=E(b().m(function A(){var e,t,n,o,r,i,a=this;return b().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!this.isSchedulingFrames){A.n=1;break}return A.a(2);case 1:if(this.isSchedulingFrames=!0,e=this.preparedBuffer.length,0===(t=Math.min(e,5))&&e>0&&(t=1),A.p=2,this.audioContext||this.initializeAudioContext(),n=0===this.scheduledBuffers&&!this.isPlaying,"suspended"!==this.audioContext.state){A.n=4;break}return A.n=3,this.audioContext.resume();case 3:if(!n){A.n=4;break}return A.n=4,new Promise(function(A){return setTimeout(A,50)});case 4:if("running"===this.audioContext.state){A.n=8;break}if(console.warn("AudioPlayer v2: AudioContext not in running state:",this.audioContext.state),"suspended"!==this.audioContext.state){A.n=8;break}return A.n=5,this.audioContext.resume();case 5:if(!n){A.n=7;break}return A.n=6,new Promise(function(A){return setTimeout(A,50)});case 6:A.n=8;break;case 7:return A.n=8,new Promise(function(A){return setTimeout(A,10)});case 8:o=0,r=b().m(function A(){var e,t,n,r,i;return b().w(function(A){for(;;)switch(A.n){case 0:if(e=a.preparedBuffer.shift()){A.n=1;break}return A.a(2,1);case 1:(t=a.audioContext.createBufferSource()).buffer=e.buffer,t.connect(a.audioContext.destination),a.scheduledSources.add(t),n=a.audioContext.currentTime,0===a.scheduledBuffers?(a.nextStartTime<n&&(a.nextStartTime=n+a.MAX_LOOKAHEAD_SECONDS),console.log("🎵 Starting playback with minimal delay:",a.nextStartTime)):(r=n+a.MAX_LOOKAHEAD_SECONDS,a.nextStartTime<r&&(a.nextStartTime=r,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,i=a.nextStartTime-e.duration,a.scheduledBuffers<5&&(console.log("🎵 AudioPlayer: Scheduled frame ".concat(a.scheduledBuffers+1," at ").concat(i.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++,o++,t.onended=function(){if(a.scheduledSources.delete(t),a.scheduledBuffers--,0===a.scheduledBuffers&&0===a.preparedBuffer.length&&0===a.pcmChunkQueue.length)a.isPlaying=!1,a.isSchedulingFrames=!1,console.log("🛑 AudioPlayer: Emitting playbackStopped event (all buffers finished)"),a.emit("playbackStopped");else if(a.preparedBuffer.length>0)setTimeout(function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.schedulePreparedFrames()},0);else if(a.scheduledBuffers>0){var A=function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.scheduledBuffers>0?a.schedulePreparedFrames():a.scheduledBuffers>0&&setTimeout(A,10)};setTimeout(A,10)}},a.isPlaying||(a.isPlaying=!0,console.log("🎵 AudioPlayer: Emitting playbackStarted event"),a.emit("playbackStarted"));case 2:return A.a(2)}},A)});case 9:if(!(this.preparedBuffer.length>0&&o<t)){A.n=12;break}return A.d(Q(r()),10);case 10:if(!A.v){A.n=11;break}return A.a(3,12);case 11:A.n=9;break;case 12:this.isSchedulingFrames=!1,this.preparedBuffer.length>0&&requestAnimationFrame(function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.schedulePreparedFrames()}),this.scheduledBuffers>0&&setTimeout(function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.scheduledBuffers>0?a.schedulePreparedFrames():a.scheduledBuffers>0&&setTimeout(function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.scheduledBuffers>0&&a.schedulePreparedFrames()},10)},10),A.n=14;break;case 13:A.p=13,i=A.v,console.error("❌ AudioPlayer v2: Error scheduling frames:",i),this.emit("playbackError",i),this.isSchedulingFrames=!1;case 14:return A.a(2)}},A,this,[[2,13]])})),function(){return a.apply(this,arguments)})},{key:"processPcmQueue",value:(i=E(b().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,g,h,p,f,B,w,v,m,y,C=this;return b().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!this.isProcessingPcmQueue){A.n=1;break}return A.a(2);case 1:if(this.isProcessingPcmQueue=!0,A.p=2,this.audioContext||this.initializeAudioContext(),e=0===this.scheduledBuffers&&!this.isPlaying,"suspended"!==this.audioContext.state){A.n=4;break}return A.n=3,this.audioContext.resume();case 3:if(!e){A.n=4;break}return A.n=4,new Promise(function(A){return setTimeout(A,50)});case 4:if("running"===this.audioContext.state){A.n=8;break}if(console.warn("AudioPlayer v2: AudioContext not in running state:",this.audioContext.state),"suspended"!==this.audioContext.state){A.n=8;break}return A.n=5,this.audioContext.resume();case 5:if(!e){A.n=7;break}return A.n=6,new Promise(function(A){return setTimeout(A,50)});case 6:A.n=8;break;case 7:return A.n=8,new Promise(function(A){return setTimeout(A,10)});case 8:if(!(this.pcmChunkQueue.length>0)){A.n=10;break}if(o=this.pcmChunkQueue.shift()){A.n=9;break}return A.a(3,8);case 9:for(r=o,o.byteLength%2!=0&&(console.warn("⚠️ Odd PCM chunk size, padding:",o.byteLength),(i=new Uint8Array(o.byteLength+1)).set(new Uint8Array(o),0),i[o.byteLength]=0,r=i.buffer),a=new Int16Array(r),s=new Float32Array(a.length),c=1/32768,l=a.length,u=0;u<l;u++)s[u]=a[u]*c;d=(null===(t=this.outputFormat)||void 0===t?void 0:t.sampleRate)||this.audioContext.sampleRate,g=this.audioContext.sampleRate,null!==(n=this.outputFormat)&&void 0!==n&&n.sampleRate?this.scheduledBuffers<3&&console.log("🎵 AudioPlayer: Creating buffer at ".concat(d,"Hz (AudioContext: ").concat(g,"Hz)")):console.warn("⚠️ AudioPlayer: outputFormat.sampleRate not set! Using AudioContext sample rate:",g),(h=this.audioContext.createBuffer(1,s.length,d)).getChannelData(0).set(s),(p=this.audioContext.createBufferSource()).buffer=h,p.connect(this.audioContext.destination),f=this.audioContext.currentTime,this.nextStartTime<f&&(this.nextStartTime=f,0===this.scheduledBuffers&&console.log("🎵 Starting playback at current time:",f)),B=h.duration,w=s.length,v=B,g!==d&&(v=w/g,this.scheduledBuffers<3&&(console.log("🔄 Resampling detected: ".concat(d,"Hz → ").concat(g,"Hz")),console.log(" Buffer duration: ".concat(B.toFixed(4),"s, Calculated: ").concat(v.toFixed(4),"s")))),p.start(this.nextStartTime),this.nextStartTime+=v,this.nextStartTime=Math.round(1e6*this.nextStartTime)/1e6,this.scheduledBuffers<3&&(m=this.nextStartTime-v,console.log("🎵 AudioPlayer: Scheduled chunk ".concat(this.scheduledBuffers+1," at ").concat(m.toFixed(4),"s, next at ").concat(this.nextStartTime.toFixed(4),"s")),console.log(" Duration: ".concat(v.toFixed(4),"s (").concat((1e3*v).toFixed(2),"ms)"))),this.scheduledBuffers++,p.onended=function(){C.scheduledBuffers--,0===C.scheduledBuffers&&0===C.pcmChunkQueue.length&&(C.isPlaying=!1,C.isProcessingPcmQueue=!1,C.emit("playbackStopped"))},this.isPlaying||(this.isPlaying=!0,this.emit("playbackStarted")),A.n=8;break;case 10:this.isProcessingPcmQueue=!1,A.n=12;break;case 11:A.p=11,y=A.v,console.error("❌ AudioPlayer v2: Error playing chunk:",y),this.emit("playbackError",y),this.isProcessingPcmQueue=!1;case 12:return A.a(2)}},A,this,[[2,11]])})),function(){return i.apply(this,arguments)})},{key:"createAudioBlob",value:function(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)}},{key:"isWavFile",value:function(A){return A.length>=44&&82===A[0]&&73===A[1]&&70===A[2]&&70===A[3]}},{key:"handleWavFile",value:function(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),r=this.createWavHeader(o.byteLength,e.sampleRate,e.channels,16);return new Blob([r,o],{type:"audio/wav"})}},{key:"handleRawData",value:function(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 r=this.outputFormat.bitDepth||16;A.length,24===r?(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===r?(console.log("🔄 AudioPlayer: Converting 8-bit PCM to 16-bit PCM"),e=this.convert8BitTo16Bit(A),t=16):(e=A.buffer,t=r,console.log("✅ AudioPlayer: Using native ".concat(r,"-bit PCM (no conversion needed)")))}else e=o.decode(A),t=16,console.log("🔄 AudioPlayer: Decoded ".concat(n.toUpperCase()," to 16-bit PCM"));var i=this.createWavHeader(e.byteLength,this.outputFormat.sampleRate,this.outputFormat.channels,t);return new Blob([i,e],{type:"audio/wav"})}},{key:"convert24BitTo16Bit",value:function(A){for(var e=Math.floor(A.length/3),t=new Int16Array(e),n=0;n<e;n++){var o=A[3*n],r=A[3*n+1],i=A[3*n+2],a=o|r<<8|(255&i)<<16;128&i&&(a|=4278190080),t[n]=Math.max(-32768,Math.min(32767,Math.round(a/256)))}return t.buffer}},{key:"convert8BitTo16Bit",value:function(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}},{key:"getCodec",value:function(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]}},{key:"getCodecForWavFormat",value:function(A){switch(A){case 1:return this.codecs.pcm;case 6:return this.codecs.pcma;case 7:return this.codecs.pcmu;default:return null}}},{key:"getEncodingName",value:function(A){switch(A){case 1:return"PCM";case 6:return"A-law";case 7:return"μ-law";default:return"Unknown (".concat(A,")")}}},{key:"parseWavHeader",value:function(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)}}},{key:"createWavHeader",value:function(A,e,t,n){var o=new ArrayBuffer(44),r=new DataView(o);return r.setUint32(0,1380533830,!1),r.setUint32(4,36+A,!0),r.setUint32(8,1463899717,!1),r.setUint32(12,1718449184,!1),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,t,!0),r.setUint32(24,e,!0),r.setUint32(28,e*t*n/8,!0),r.setUint16(32,t*n/8,!0),r.setUint16(34,n,!0),r.setUint32(36,1684108385,!1),r.setUint32(40,A,!0),o}},{key:"initializeAudioContext",value:function(){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(),"closed"!==this.audioContext.state&&this.audioContext.close(),this.audioContext=null}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."))}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"))}}},{key:"processQueue",value:(r=E(b().m(function A(){var e,t,n,o,r,i,a,s,c=this;return b().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!this.isProcessingQueue&&0!==this.audioQueue.length){A.n=1;break}return A.a(2);case 1:if(this.isProcessingQueue=!0,e=this.audioQueue.shift()){A.n=2;break}return this.isProcessingQueue=!1,A.a(2);case 2:if(A.p=2,t=!this.isPlaying&&null===this.currentSource,this.audioContext||this.initializeAudioContext(),"suspended"!==(n=this.audioContext).state){A.n=4;break}return A.n=3,n.resume();case 3:if(!t){A.n=4;break}return A.n=4,new Promise(function(A){return setTimeout(A,50)});case 4:if("running"===n.state){A.n=8;break}if(console.warn("AudioPlayer v2: AudioContext not in running state:",n.state),"suspended"!==n.state){A.n=8;break}return A.n=5,n.resume();case 5:if(!t){A.n=7;break}return A.n=6,new Promise(function(A){return setTimeout(A,50)});case 6:A.n=8;break;case 7:return A.n=8,new Promise(function(A){return setTimeout(A,10)});case 8:return A.n=9,e.arrayBuffer();case 9:return o=A.v,A.n=10,n.decodeAudioData(o);case 10:r=A.v,i=t&&!this.isPlaying&&null===this.currentSource,(a=n.createBufferSource()).buffer=r,a.connect(n.destination),this.currentSource=a,this.isPlaying=!0,i&&this.emit("playbackStarted"),a.onended=function(){c.currentSource=null,c.isProcessingQueue=!1,c.audioQueue.length>0?setTimeout(function(){return c.processQueue()},50):setTimeout(function(){0!==c.audioQueue.length||c.currentSource||(c.isPlaying=!1,c.emit("playbackStopped"))},100)},a.start(),A.n=12;break;case 11:A.p=11,s=A.v,console.error("❌ AudioPlayer v2: Error processing queue:",s),this.currentSource=null,this.emit("playbackError",s),this.audioQueue.length>0?(this.isProcessingQueue=!1,setTimeout(function(){return c.processQueue()},100)):(this.isPlaying=!1,this.isProcessingQueue=!1,this.emit("playbackStopped"));case 12:return A.a(2)}},A,this,[[2,11]])})),function(){return r.apply(this,arguments)})},{key:"stop",value:function(){this.stopImmediate()}},{key:"reset",value:function(){this.stop(),this.audioQueue=[],this.pcmChunkQueue=[]}},{key:"stopImmediate",value:function(){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.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,t=0,n=y(this.scheduledSources);try{for(n.s();!(e=n.n()).done;){var o=e.value;try{o.stop(),t++}catch(A){console.log(" Source already stopped or not started:",A.message)}}}catch(A){n.e(A)}finally{n.f()}console.log(" Stopped ".concat(t," sources")),this.scheduledSources.clear()}this.isPlaying=!1,this.isProcessingQueue=!1,this.audioQueue=[],this.pcmChunkQueue=[],this.preparedBuffer=[],this.isProcessingPcmQueue=!1,this.isSchedulingFrames=!1,this.nextStartTime=0,this.scheduledBuffers=0,this.clearTranscriptState(),A&&(console.log("🛑 AudioPlayer: Emitting playbackStopped event (stopImmediate called)"),this.emit("playbackStopped"))}},{key:"markNewSentence",value:function(A){this.pendingSentenceText=A,console.log('📝 AudioPlayer: New sentence marked: "'.concat(A.substring(0,40),'..."'))}},{key:"startTranscriptChecker",value:function(){var A=this;if(!this.isCheckingTranscripts){this.isCheckingTranscripts=!0,console.log("📝 AudioPlayer: Transcript checker started");var e=function(){if(A.isCheckingTranscripts&&A.audioContext){var t,n=A.audioContext.currentTime,o=y(A.sentenceTimings);try{for(o.s();!(t=o.n()).done;){var r=t.value;!r.displayed&&n>=r.startTime&&(r.displayed=!0,console.log("📝 AudioPlayer: Display transcript at ".concat(n.toFixed(3),'s: "').concat(r.text.substring(0,40),'..."')),A.emit("transcriptDisplay",{text:r.text}))}}catch(A){o.e(A)}finally{o.f()}A.isPlaying||A.scheduledBuffers>0?requestAnimationFrame(e):(A.isCheckingTranscripts=!1,console.log("📝 AudioPlayer: Transcript checker stopped"))}};requestAnimationFrame(e)}}},{key:"clearTranscriptState",value:function(){this.pendingSentenceText=null,this.sentenceTimings=[],this.isCheckingTranscripts=!1,console.log("📝 AudioPlayer: Transcript state cleared")}},{key:"resumeAudioContext",value:(o=E(b().m(function A(){var e;return b().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.audioContext&&"closed"!==this.audioContext.state){A.n=2;break}return A.n=1,this.initializeAudioContext();case 1:return A.a(2);case 2:if("suspended"!==this.audioContext.state){A.n=6;break}return A.p=3,A.n=4,this.audioContext.resume();case 4:console.log("✅ AudioPlayer v2: AudioContext resumed after mic permission"),A.n=6;break;case 5:A.p=5,e=A.v,console.warn("⚠️ AudioPlayer v2: Failed to resume AudioContext:",e);case 6:return A.a(2)}},A,this,[[3,5]])})),function(){return o.apply(this,arguments)})},{key:"getStatus",value:function(){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}}},{key:"destroy",value:function(){this.stop(),this.audioContext&&"closed"!==this.audioContext.state&&(this.audioContext.close(),this.audioContext=null),this.removeAllListeners()}}],n&&S(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i,a,s}(a);function D(A){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},D(A)}function K(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return O(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,h=r[2];t>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<h&&(o=t<3||r[0]>n||n>h)&&(r[4]=t,r[5]=n,d.n=h,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,h),a=l,s=h;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(O(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,O(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,O(u,"constructor",c),O(c,"constructor",s),s.displayName="GeneratorFunction",O(c,o,"GeneratorFunction"),O(u),O(u,o,"Generator"),O(u,n,function(){return this}),O(u,"toString",function(){return"[object Generator]"}),(K=function(){return{w:r,m:d}})()}function O(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}O=function(A,e,t,n){function r(e,t){O(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},O(A,e,t,n)}function P(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function L(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){P(r,n,o,i,a,"next",A)}function a(A){P(r,n,o,i,a,"throw",A)}i(void 0)})}}function R(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}function M(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,V(n.key),n)}}function V(A){var e=function(A){if("object"!=D(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=D(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==D(e)?e:e+""}function _(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(_=function(){return!!A})()}function G(A){return G=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},G(A)}function N(A,e){return N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},N(A,e)}var j=function(A){function e(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(A,e,t){return e=G(e),function(A,e){if(e&&("object"==D(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,_()?Reflect.construct(e,t||[],G(A).constructor):e.apply(A,t))}(this,e)).config=A,t.audioContext=null,t.audioWorkletNode=null,t.mediaStream=null,t.isRecording=!1,t}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&N(A,e)}(e,A),t=e,n=[{key:"getAudioProcessorPath",value:function(){if(this.config.audioProcessorPath)return this.config.audioProcessorPath;var A,e=function(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=function(A,e){if(A){if("string"==typeof A)return R(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?R(A,e):void 0}}(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,o=function(){};return{s:o,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){a=!0,r=A},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}(document.getElementsByTagName("script"));try{for(e.s();!(A=e.n()).done;){var t=A.value.src;if(t&&(t.includes("agent-widget.js")||t.includes("ttp-agent-sdk")))try{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")}}}catch(A){e.e(A)}finally{e.f()}return"https://cdn.talktopc.com/audio-processor.js"}},{key:"start",value:(r=L(K().m(function A(){var e,t,n,o,r,i,a=this;return K().w(function(A){for(;;)switch(A.p=A.n){case 0:if(A.p=0,"https:"===location.protocol||"localhost"===location.hostname||"127.0.0.1"===location.hostname){A.n=1;break}throw e=new Error("Microphone access requires HTTPS. Please use https:// or test on localhost."),console.error("❌ AudioRecorder:",e.message),this.emit("error",e),e;case 1:if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia){A.n=2;break}throw t=new Error("getUserMedia is not supported in this browser. Please use a modern browser."),console.error("❌ AudioRecorder:",t.message),this.emit("error",t),t;case 2:return console.log("🎤 AudioRecorder: Requesting microphone access..."),A.n=3,navigator.mediaDevices.getUserMedia({audio:{sampleRate:this.config.sampleRate,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});case 3:if(this.mediaStream=A.v,console.log("✅ AudioRecorder: Microphone access granted"),this.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:this.config.sampleRate}),"suspended"!==this.audioContext.state){A.n=4;break}return A.n=4,this.audioContext.resume();case 4:return n=this.getAudioProcessorPath(),A.n=5,this.audioContext.audioWorklet.addModule(n);case 5:this.audioWorkletNode=new AudioWorkletNode(this.audioContext,"audio-processor"),this.audioContext.createMediaStreamSource(this.mediaStream).connect(this.audioWorkletNode),this.audioWorkletNode.port.onmessage=function(A){var e=A.data,t=e.type,n=e.data;"pcm_audio_data"===t&&a.emit("audioData",n)},this.audioWorkletNode.port.postMessage({type:"setForceContinuous",data:{enabled:!0}}),this.isRecording=!0,this.emit("recordingStarted"),A.n=7;break;case 6:throw A.p=6,i=A.v,o=i.message,"NotAllowedError"===i.name||"PermissionDeniedError"===i.name?(o="Microphone permission denied. Please allow microphone access in your browser settings and try again.",console.error("❌ AudioRecorder: Permission denied. User needs to grant microphone access.")):"NotFoundError"===i.name||"DevicesNotFoundError"===i.name?(o="No microphone found. Please connect a microphone and try again.",console.error("❌ AudioRecorder: No microphone device found.")):"NotReadableError"===i.name||"TrackStartError"===i.name?(o="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.")):i.message&&i.message.includes("not allowed by the user agent")&&(o="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.")),(r=new Error(o)).name=i.name,r.originalError=i,console.error("❌ AudioRecorder: Failed to start recording:",r),this.emit("error",r),r;case 7:return A.a(2)}},A,this,[[0,6]])})),function(){return r.apply(this,arguments)})},{key:"stop",value:(o=L(K().m(function A(){var e;return K().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.isRecording){A.n=1;break}return A.a(2);case 1:if(A.p=1,!this.audioWorkletNode){A.n=2;break}return this.audioWorkletNode.port.postMessage({type:"flush"}),A.n=2,new Promise(function(A){return setTimeout(A,100)});case 2:if(this.mediaStream&&(this.mediaStream.getTracks().forEach(function(A){return A.stop()}),this.mediaStream=null),!this.audioContext||"closed"===this.audioContext.state){A.n=4;break}return A.n=3,this.audioContext.close();case 3:this.audioContext=null;case 4:this.audioWorkletNode=null,this.isRecording=!1,this.emit("recordingStopped"),A.n=6;break;case 5:throw A.p=5,e=A.v,this.emit("error",e),e;case 6:return A.a(2)}},A,this,[[1,5]])})),function(){return o.apply(this,arguments)})},{key:"getStatus",value:function(){return{isRecording:this.isRecording,audioContextState:this.audioContext?this.audioContext.state:"closed"}}},{key:"destroy",value:function(){this.stop()}}],n&&M(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r}(a);function W(A){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},W(A)}function J(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,X(n.key),n)}}function X(A){var e=function(A){if("object"!=W(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=W(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==W(e)?e:e+""}const Y=function(){function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A)}return e=A,t=[{key:"extractPcmFromWav",value:function(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,r=-1,i=12;i<e.length-8;i+=4){if("data"===String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3])){r=i;break}i+=4+(e[i+4]|e[i+5]<<8|e[i+6]<<16|e[i+7]<<24)}if(-1===r)throw new Error("No data chunk found in WAV");var a=e[r+4]|e[r+5]<<8|e[r+6]<<16|e[r+7]<<24,s=r+8,c=Math.min(a,e.length-s);return{pcmData:e.slice(s,s+c).buffer,format:{sampleRate:n,channels:t,bitDepth:o}}}},{key:"isWavFile",value:function(A){return A.length>=44&&82===A[0]&&73===A[1]&&70===A[2]&&70===A[3]}},{key:"createWavHeader",value:function(A,e,t,n){var o=new ArrayBuffer(44),r=new DataView(o);return r.setUint32(0,1380533830,!1),r.setUint32(4,36+A,!0),r.setUint32(8,1463899717,!1),r.setUint32(12,1718449184,!1),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,t,!0),r.setUint32(24,e,!0),r.setUint32(28,e*t*n/8,!0),r.setUint16(32,t*n/8,!0),r.setUint16(34,n,!0),r.setUint32(36,1684108385,!1),r.setUint32(40,A,!0),o}},{key:"wrapPcmInWav",value:function(e,t){var n=A.createWavHeader(e.byteLength,t.sampleRate,t.channels||1,t.bitDepth||16),o=new Uint8Array(n.byteLength+e.byteLength);return o.set(new Uint8Array(n),0),o.set(new Uint8Array(e),n.byteLength),o.buffer}}],null&&J(e.prototype,null),t&&J(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function z(A){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},z(A)}function Z(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,q(n.key),n)}}function q(A){var e=function(A){if("object"!=z(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=z(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==z(e)?e:e+""}const $=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.codecs={pcm:new u,pcmu:new p,pcma:new v}},(e=[{key:"decodeToPcm",value:function(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)}},{key:"encodeFromPcm",value:function(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}},{key:"getCodec",value:function(A){var e=null==A?void 0:A.toLowerCase();return this.codecs[e]||null}}])&&Z(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function AA(A){return AA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},AA(A)}function eA(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,tA(n.key),n)}}function tA(A){var e=function(A){if("object"!=AA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=AA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==AA(e)?e:e+""}const nA=function(){function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A)}return e=A,t=[{key:"convert",value:function(e,t,n){if(t===n)return e;if(8===t)throw new Error("Source bit depth cannot be 8-bit (only 16-bit or 24-bit supported)");var o=t/8,r=n/8,i=e.byteLength/o;if(new ArrayBuffer(i*r),16===t&&16===n)return e;if(24===t&&16===n)return A.convert24To16(e);if(16===t&&24===n)return A.convert16To24(e);if(16===t&&8===n)return A.convert16To8(e);if(24===t&&8===n)return A.convert24To8(e);throw new Error("Unsupported bit depth conversion: ".concat(t,"-bit → ").concat(n,"-bit"))}},{key:"convert24To16",value:function(A){for(var e=new Uint8Array(A),t=Math.floor(e.length/3),n=new Int16Array(t),o=0;o<t;o++){var r=e[3*o],i=e[3*o+1],a=e[3*o+2],s=r|i<<8|(255&a)<<16;128&a&&(s|=4278190080),n[o]=Math.max(-32768,Math.min(32767,Math.round(s/256)))}return n.buffer}},{key:"convert16To24",value:function(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}},{key:"convert16To8",value:function(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}},{key:"convert24To8",value:function(e){var t=A.convert24To16(e);return A.convert16To8(t)}}],null&&eA(e.prototype,null),t&&eA(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function oA(A){return oA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},oA(A)}function rA(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return iA(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,h=r[2];t>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<h&&(o=t<3||r[0]>n||n>h)&&(r[4]=t,r[5]=n,d.n=h,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,h),a=l,s=h;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(iA(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,iA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,iA(u,"constructor",c),iA(c,"constructor",s),s.displayName="GeneratorFunction",iA(c,o,"GeneratorFunction"),iA(u),iA(u,o,"Generator"),iA(u,n,function(){return this}),iA(u,"toString",function(){return"[object Generator]"}),(rA=function(){return{w:r,m:d}})()}function iA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}iA=function(A,e,t,n){function r(e,t){iA(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},iA(A,e,t,n)}function aA(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function sA(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,cA(n.key),n)}}function cA(A){var e=function(A){if("object"!=oA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=oA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==oA(e)?e:e+""}const lA=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A)},e=[{key:"resample",value:(t=rA().m(function A(e,t,n){var o,r,i,a,s,c,l,u,d,g,h,p,f;return rA().w(function(A){for(;;)switch(A.n){case 0:if(t!==n){A.n=1;break}return A.a(2,e);case 1:for(o=new Int16Array(e),r=new Float32Array(o.length),i=1/32768,a=0;a<o.length;a++)r[a]=o[a]*i;return s=Math.ceil(r.length*n/t),c=new OfflineAudioContext(1,s,n),(l=c.createBuffer(1,r.length,t)).getChannelData(0).set(r),(u=c.createBufferSource()).buffer=l,u.connect(c.destination),u.start(),A.n=2,c.startRendering();case 2:for(d=A.v,g=d.getChannelData(0),h=new Int16Array(g.length),p=0;p<g.length;p++)f=Math.max(-1,Math.min(1,g[p])),h[p]=Math.round(32767*f);return A.a(2,h.buffer)}},A)}),n=function(){var A=this,e=arguments;return new Promise(function(n,o){var r=t.apply(A,e);function i(A){aA(r,n,o,i,a,"next",A)}function a(A){aA(r,n,o,i,a,"throw",A)}i(void 0)})},function(A,e,t){return n.apply(this,arguments)})}],e&&sA(A,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function uA(A){return uA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},uA(A)}function dA(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,gA(n.key),n)}}function gA(A){var e=function(A){if("object"!=uA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=uA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==uA(e)?e:e+""}const hA=function(){function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A)}return e=A,t=[{key:"convert",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:16;if(t===n)return e;if(1===t&&1===n)return e;if(1===t&&2===n)return A.monoToStereo(e,o);if(2===t&&1===n)return A.stereoToMono(e,o);throw new Error("Unsupported channel conversion: ".concat(t," → ").concat(n))}},{key:"monoToStereo",value:function(A,e){for(var t=e/8,n=A.byteLength/t,o=new ArrayBuffer(n*t*2),r=new Uint8Array(A),i=new Uint8Array(o),a=0;a<n;a++)for(var s=a*t,c=a*t*2,l=0;l<t;l++)i[c+l]=r[s+l],i[c+t+l]=r[s+l];return o}},{key:"stereoToMono",value:function(A,e){var t=e/8,n=A.byteLength/(2*t),o=new ArrayBuffer(n*t),r=new Uint8Array(A),i=new Uint8Array(o);if(16===e)for(var a=0;a<n;a++){var s=a*t*2,c=s+t,l=(r[s]|r[s+1]<<8)<<16>>16,u=(r[c]|r[c+1]<<8)<<16>>16,d=Math.round((l+u)/2),g=a*t;i[g]=255&d,i[g+1]=d>>8&255}else for(var h=0;h<n;h++)for(var p=h*t*2,f=h*t,B=0;B<t;B++)i[f+B]=r[p+B];return o}}],null&&dA(e.prototype,null),t&&dA(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function pA(A){return pA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},pA(A)}function fA(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return BA(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,h=r[2];t>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<h&&(o=t<3||r[0]>n||n>h)&&(r[4]=t,r[5]=n,d.n=h,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,h),a=l,s=h;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(BA(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,BA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,BA(u,"constructor",c),BA(c,"constructor",s),s.displayName="GeneratorFunction",BA(c,o,"GeneratorFunction"),BA(u),BA(u,o,"Generator"),BA(u,n,function(){return this}),BA(u,"toString",function(){return"[object Generator]"}),(fA=function(){return{w:r,m:d}})()}function BA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}BA=function(A,e,t,n){function r(e,t){BA(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},BA(A,e,t,n)}function wA(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?wA(Object(t),!0).forEach(function(e){mA(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):wA(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function mA(A,e,t){return(e=QA(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function yA(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function CA(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,QA(n.key),n)}}function QA(A){var e=function(A){if("object"!=pA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=pA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==pA(e)?e:e+""}const bA=function(){return A=function A(e,t){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.requestedFormat=e,this.actualFormat=t,this.encodingConverter=new $,this.conversionSteps=[],this._analyzeConversions()},e=[{key:"_analyzeConversions",value:function(){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")}},{key:"needsConversion",value:function(){return this.conversionSteps.length>0}},{key:"getConversionSteps",value:function(){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}},{key:"convert",value:(t=fA().m(function A(e){var t,n,o,r;return fA().w(function(A){for(;;)switch(A.n){case 0:if(this.needsConversion()){A.n=1;break}return A.a(2,e instanceof ArrayBuffer?e:e.buffer);case 1:if(t=e instanceof ArrayBuffer?e:e.buffer,n=vA({},this.actualFormat),this.conversionSteps.includes("extract_wav")&&(o=Y.extractPcmFromWav(t),t=o.pcmData,n=vA(vA({},n),{},{container:"raw",sampleRate:o.format.sampleRate,channels:o.format.channels,bitDepth:o.format.bitDepth}),console.log("🔄 AudioFormatConverter: Extracted PCM from WAV",o.format)),this.conversionSteps.includes("decode_encoding")&&(t=this.encodingConverter.decodeToPcm(t,n.encoding),n.encoding="pcm",n.bitDepth=16,console.log("🔄 AudioFormatConverter: Decoded ".concat(this.actualFormat.encoding.toUpperCase()," → PCM"))),24===n.bitDepth&&n.bitDepth!==this.requestedFormat.bitDepth&&(this.conversionSteps.includes("resample")||this.conversionSteps.includes("convert_channels")||24!==this.requestedFormat.bitDepth)&&(t=nA.convert(t,24,16),n.bitDepth=16,console.log("🔄 AudioFormatConverter: Normalized 24-bit → 16-bit PCM")),!this.conversionSteps.includes("resample")){A.n=3;break}return A.n=2,lA.resample(t,n.sampleRate,this.requestedFormat.sampleRate);case 2:t=A.v,n.sampleRate=this.requestedFormat.sampleRate,console.log("🔄 AudioFormatConverter: Resampled ".concat(this.actualFormat.sampleRate,"Hz → ").concat(this.requestedFormat.sampleRate,"Hz"));case 3:return this.conversionSteps.includes("convert_channels")&&(t=hA.convert(t,n.channels,this.requestedFormat.channels,n.bitDepth),n.channels=this.requestedFormat.channels,console.log("🔄 AudioFormatConverter: Converted channels ".concat(this.actualFormat.channels," → ").concat(this.requestedFormat.channels))),this.conversionSteps.includes("convert_bitdepth")&&(t=nA.convert(t,n.bitDepth,this.requestedFormat.bitDepth),n.bitDepth=this.requestedFormat.bitDepth,console.log("🔄 AudioFormatConverter: Converted bit depth ".concat(this.actualFormat.bitDepth,"-bit → ").concat(this.requestedFormat.bitDepth,"-bit"))),this.conversionSteps.includes("encode_encoding")&&(r=this.encodingConverter.encodeFromPcm(t,this.requestedFormat.encoding),t=r instanceof ArrayBuffer?r:r.buffer,n.encoding=this.requestedFormat.encoding,console.log("🔄 AudioFormatConverter: Encoded PCM → ".concat(this.requestedFormat.encoding.toUpperCase()))),this.conversionSteps.includes("wrap_wav")&&(t=Y.wrapPcmInWav(t,n),n.container="wav",console.log("🔄 AudioFormatConverter: Wrapped in WAV container")),console.log("✅ AudioFormatConverter: Conversion complete"),A.a(2,t)}},A,this)}),n=function(){var A=this,e=arguments;return new Promise(function(n,o){var r=t.apply(A,e);function i(A){yA(r,n,o,i,a,"next",A)}function a(A){yA(r,n,o,i,a,"throw",A)}i(void 0)})},function(A){return n.apply(this,arguments)})}],e&&CA(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function FA(A){return FA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},FA(A)}function UA(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return EA(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,h=r[2];t>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<h&&(o=t<3||r[0]>n||n>h)&&(r[4]=t,r[5]=n,d.n=h,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,h),a=l,s=h;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(EA(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,EA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,EA(u,"constructor",c),EA(c,"constructor",s),s.displayName="GeneratorFunction",EA(c,o,"GeneratorFunction"),EA(u),EA(u,o,"Generator"),EA(u,n,function(){return this}),EA(u,"toString",function(){return"[object Generator]"}),(UA=function(){return{w:r,m:d}})()}function EA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}EA=function(A,e,t,n){function r(e,t){EA(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},EA(A,e,t,n)}function SA(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function xA(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,IA(n.key),n)}}function IA(A){var e=function(A){if("object"!=FA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=FA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==FA(e)?e:e+""}const HA=function(){return A=function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return null};!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.handlers=new Map,this.sendMessage=e,this.getConversationId=t},e=[{key:"registerHandler",value:function(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,"'"))}},{key:"unregisterHandler",value:function(A){this.handlers.delete(A),console.log("🔧 ClientTools: Unregistered handler for '".concat(A,"'"))}},{key:"hasHandler",value:function(A){return this.handlers.has(A)}},{key:"getRegisteredTools",value:function(){return Array.from(this.handlers.keys())}},{key:"handleToolCall",value:(t=UA().m(function A(e){var t,n,o,r,i,a,s,c,l,u,d,g,h;return UA().w(function(A){for(;;)switch(A.p=A.n){case 0:if(t=e.toolCallId,n=e.toolName,o=e.parameters,r=Date.now(),i=(new Date).toISOString(),console.log("🔧 ClientTools: [".concat(i,"] Received tool call '").concat(n,"' (id: ").concat(t,")")),console.log(" 📋 Full message received:",JSON.stringify(e,null,2)),console.log(" ⏱️ Start time: ".concat(r,"ms (").concat(new Date(r).toISOString(),")")),a=this.handlers.get(n)){A.n=1;break}return console.warn("🔧 ClientTools: No handler registered for '".concat(n,"'")),this.sendError(t,n,"No handler registered for tool '".concat(n,"'"),"NO_HANDLER",r),A.a(2);case 1:return A.p=1,A.n=2,a(o);case 2:s=A.v,c=Date.now()-r,console.log("🔧 ClientTools: Tool '".concat(n,"' completed in ").concat(c,"ms")),this.sendResult(t,n,s,c),A.n=4;break;case 3:A.p=3,h=A.v,d=Date.now()-r,console.error("🔧 ClientTools: Tool '".concat(n,"' failed:"),h),g="EXECUTION_ERROR","NotAllowedError"===h.name||null!==(l=h.message)&&void 0!==l&&l.includes("permission")?g="PERMISSION_DENIED":("NotSupportedError"===h.name||null!==(u=h.message)&&void 0!==u&&u.includes("not supported"))&&(g="API_UNAVAILABLE"),this.sendError(t,n,h.message||"Unknown error",g,d);case 4:return A.a(2)}},A,this,[[1,3]])}),n=function(){var A=this,e=arguments;return new Promise(function(n,o){var r=t.apply(A,e);function i(A){SA(r,n,o,i,a,"next",A)}function a(A){SA(r,n,o,i,a,"throw",A)}i(void 0)})},function(A){return n.apply(this,arguments)})},{key:"sendResult",value:function(A,e,t,n){var o=this.getConversationId(),r=(new Date).toISOString(),i={t:"client_tool_result",toolCallId:A,toolName:e,conversationId:o,result:t,executionTimeMs:n};console.log("🔧 ClientTools: [".concat(r,"] 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(i,null,2)),this.sendMessage(i),console.log("✅ ClientTools: Result message sent at ".concat(r))}},{key:"sendError",value:function(A,e,t,n,o){var r="number"==typeof o?Date.now()-o:o,i=(new Date).toISOString(),a=this.getConversationId(),s={t:"client_tool_error",toolCallId:A,toolName:e,conversationId:a,error:t,errorCode:n,executionTimeMs:r};console.log("🔧 ClientTools: [".concat(i,"] Sending error for tool '").concat(e,"'")),console.log(" 📋 toolCallId: ".concat(A)),console.log(" 📋 conversationId: ".concat(a||"null")),console.log(" 📋 toolName: ".concat(e)),console.log(" 📋 error: ".concat(t,", errorCode: ").concat(n)),console.log(" 📋 Full message:",JSON.stringify(s,null,2)),this.sendMessage(s),console.log("✅ ClientTools: Error message sent at ".concat(i))}},{key:"setSendMessage",value:function(A){this.sendMessage=A}}],e&&xA(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();var kA=t(354),TA=t.n(kA);function DA(A){return DA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},DA(A)}function KA(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return OA(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,h=r[2];t>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<h&&(o=t<3||r[0]>n||n>h)&&(r[4]=t,r[5]=n,d.n=h,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,h),a=l,s=h;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(OA(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,OA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,OA(u,"constructor",c),OA(c,"constructor",s),s.displayName="GeneratorFunction",OA(c,o,"GeneratorFunction"),OA(u),OA(u,o,"Generator"),OA(u,n,function(){return this}),OA(u,"toString",function(){return"[object Generator]"}),(KA=function(){return{w:r,m:d}})()}function OA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}OA=function(A,e,t,n){function r(e,t){OA(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},OA(A,e,t,n)}function PA(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 LA(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?PA(Object(t),!0).forEach(function(e){RA(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):PA(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function RA(A,e,t){return(e=function(A){var e=function(A){if("object"!=DA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=DA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==DA(e)?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function MA(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}var VA={useCORS:!0,allowTaint:!1,backgroundColor:"#ffffff",scale:1,logging:!1,imageTimeout:15e3};function _A(){return GA.apply(this,arguments)}function GA(){var A;return A=KA().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,g,h,p,f,B,w,v,m,y,C,Q,b,F,U,E=arguments;return KA().w(function(A){for(;;)switch(A.p=A.n){case 0:if(t=(e=E.length>0&&void 0!==E[0]?E[0]:{}).selector,n=void 0===t?null:t,o=e.format,r=void 0===o?"jpeg":o,i=e.quality,a=void 0===i?.85:i,s=e.scale,c=void 0===s?1:s,l=e.maxWidth,u=void 0===l?1280:l,d=e.maxHeight,g=void 0===d?1280:d,h=e.fullPage,p=void 0!==h&&h,console.log("📸 SDK Screenshot: Starting capture with options:",e),f=Date.now(),A.p=1,B=document.body,!n){A.n=3;break}if(w=document.querySelector(n)){A.n=2;break}throw new Error("Element not found: ".concat(n));case 2:B=w,console.log("📸 SDK Screenshot: Capturing element: ".concat(n)),A.n=4;break;case 3:console.log("📸 SDK Screenshot: Capturing entire page");case 4:return v=LA(LA({},VA),{},{scale:c}),p&&!n&&(v.windowHeight=document.documentElement.scrollHeight,v.height=document.documentElement.scrollHeight,v.y=0),A.n=5,TA()(B,v);case 5:return m=A.v,console.log("📸 SDK Screenshot: Canvas created (".concat(m.width,"x").concat(m.height,")")),y=m,(u||g)&&(y=NA(m,u,g))!==m&&console.log("📸 SDK Screenshot: Resized to ".concat(y.width,"x").concat(y.height)),C="jpeg"===r?"image/jpeg":"image/png",Q=y.toDataURL(C,"jpeg"===r?a:void 0),b=Q.split(",")[1],F=Date.now()-f,console.log("📸 SDK Screenshot: Capture completed in ".concat(F,"ms")),console.log("📸 SDK Screenshot: Size: ".concat(Math.round(b.length/1024),"KB")),A.a(2,{image:b,mimeType:C,width:y.width,height:y.height,captureTimeMs:F,selector:n||"body"});case 6:throw A.p=6,U=A.v,console.error("📸 SDK Screenshot: Capture failed:",U),new Error("Screenshot capture failed: ".concat(U.message));case 7:return A.a(2)}},A,null,[[1,6]])}),GA=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){MA(r,n,o,i,a,"next",A)}function a(A){MA(r,n,o,i,a,"throw",A)}i(void 0)})},GA.apply(this,arguments)}function NA(A,e,t){var n=A.width,o=A.height,r=1;if(e&&n>e&&(r=Math.min(r,e/n)),t&&o>t&&(r=Math.min(r,t/o)),1===r)return A;var i=Math.round(n*r),a=Math.round(o*r),s=document.createElement("canvas");return s.width=i,s.height=a,s.getContext("2d").drawImage(A,0,0,i,a),s}function jA(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 WA(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?jA(Object(t),!0).forEach(function(e){te(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):jA(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function JA(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return XA(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,h=r[2];t>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<h&&(o=t<3||r[0]>n||n>h)&&(r[4]=t,r[5]=n,d.n=h,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,h),a=l,s=h;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(XA(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,XA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,XA(u,"constructor",c),XA(c,"constructor",s),s.displayName="GeneratorFunction",XA(c,o,"GeneratorFunction"),XA(u),XA(u,o,"Generator"),XA(u,n,function(){return this}),XA(u,"toString",function(){return"[object Generator]"}),(JA=function(){return{w:r,m:d}})()}function XA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}XA=function(A,e,t,n){function r(e,t){XA(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},XA(A,e,t,n)}function YA(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function zA(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){YA(r,n,o,i,a,"next",A)}function a(A){YA(r,n,o,i,a,"throw",A)}i(void 0)})}}function ZA(A){return ZA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},ZA(A)}function qA(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,ne(n.key),n)}}function $A(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return($A=function(){return!!A})()}function Ae(A){return Ae=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},Ae(A)}function ee(A,e){return ee=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},ee(A,e)}function te(A,e,t){return(e=ne(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function ne(A){var e=function(A){if("object"!=ZA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=ZA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==ZA(e)?e:e+""}var oe=function(A){function e(){var A,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(A=function(A,e,t){return e=Ae(e),function(A,e){if(e&&("object"==ZA(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,$A()?Reflect.construct(e,t||[],Ae(A).constructor):e.apply(A,t))}(this,e)).version="2.0.0",A.config={signedUrl:t.signedUrl||t.websocketUrl||"wss://speech.talktopc.com/ws/conv",websocketUrl:t.signedUrl||t.websocketUrl||"wss://speech.talktopc.com/ws/conv",agentId:t.agentId,appId:t.appId,sampleRate:t.sampleRate||16e3,channels:t.channels||1,bitDepth:t.bitDepth||16,audioProcessorPath:t.audioProcessorPath,outputContainer:t.outputContainer||A.getDefaultContainer(t),outputEncoding:t.outputEncoding||t.outputCodec||"pcm",outputSampleRate:t.outputSampleRate||16e3,outputChannels:t.outputChannels||1,outputBitDepth:t.outputBitDepth||16,outputFrameDurationMs:t.outputFrameDurationMs||600,outputCodec:t.outputCodec,agentSettingsOverride:t.agentSettingsOverride||null,variables:t.variables||null,autoReconnect:!1!==t.autoReconnect,protocolVersion:t.protocolVersion||2},A.isConnected=!1,A.hasEverConnected=!1,A.isRecording=!1,A.isPlaying=!1,A.isDestroyed=!1,A.outputAudioFormat=null,A.requestedOutputFormat=null,A.formatConverter=null,A.websocket=null,A.conversationId=null,A.transcriptQueue=[],A.currentPlayingSentenceId=null,A.audioFrameCount=0,A.audioPlayer=new T(A.config),A.audioRecorder=new j(A.config),A.setupAudioPlayerEvents(),A.setupAudioRecorderEvents(),A.clientToolsRegistry=new HA(function(e){return A.sendMessage(e)},function(){return A.conversationId}),A._registerBuiltInTools(),A.validateConfig(),A._setupPageUnloadHandler(),console.log("🎵 VoiceSDK v2 initialized:",{version:A.version,outputContainer:A.config.outputContainer,outputEncoding:A.config.outputEncoding,outputSampleRate:A.config.outputSampleRate}),A}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&ee(A,e)}(e,A),t=e,n=[{key:"_registerBuiltInTools",value:function(){var A=this;console.log("📸 VoiceSDK: _registerBuiltInTools() called"),console.log("📸 VoiceSDK: captureScreenshot available?",void 0!==_A);try{if(void 0===_A)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:",ZA(_A)),this.clientToolsRegistry.registerHandler("capture_screen",zA(JA().m(function e(){var t,n,o,r,i,a,s,c,l,u,d,g,h,p,f,B,w,v=arguments;return JA().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=v.length>0&&void 0!==v[0]?v[0]:{},console.log("📸 VoiceSDK: capture_screen tool called with params:",t),n=t.selector,o=void 0===n?null:n,r=t.format,i=void 0===r?"jpeg":r,a=t.quality,s=void 0===a?.85:a,c=t.scale,l=void 0===c?1:c,u=t.fullPage,d=void 0!==u&&u,g=t.maxWidth,h=void 0===g?1280:g,p=t.maxHeight,f=void 0===p?1280:p,e.p=1,e.n=2,_A({selector:o,format:i,quality:s,scale:l,fullPage:d,maxWidth:h,maxHeight:f});case 2:return B=e.v,console.log("📸 VoiceSDK: Screenshot captured: ".concat(B.width,"x").concat(B.height,", ").concat(Math.round(B.image.length/1024),"KB")),A.emit("screenshotCaptured",{width:B.width,height:B.height,sizeKB:Math.round(B.image.length/1024),selector:B.selector}),e.a(2,B);case 3:throw e.p=3,w=e.v,console.error("📸 VoiceSDK: Screenshot capture failed:",w),A.emit("screenshotError",{error:w.message}),w;case 4:return e.a(2)}},e,null,[[1,3]])}))),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)}}},{key:"getStoredConversationId",value:function(){try{if("undefined"==typeof sessionStorage)return console.warn("⚠️ VoiceSDK v2: sessionStorage not available (private mode?)"),null;var A=sessionStorage.getItem(e.RESUME_STORAGE_KEY);if(A){var t=JSON.parse(A);if(t&&t.conversationId)return console.log("📦 VoiceSDK v2: Found stored conversationId:",t.conversationId),t.conversationId}return null}catch(A){return console.warn("⚠️ VoiceSDK v2: Error reading sessionStorage:",A),null}}},{key:"storeConversationId",value:function(A){if(A)try{if("undefined"==typeof sessionStorage)return void console.warn("⚠️ VoiceSDK v2: sessionStorage not available (private mode?)");var t={},n=sessionStorage.getItem(e.RESUME_STORAGE_KEY);if(n)try{t=JSON.parse(n)}catch(A){}t.conversationId=A,t.timestamp=Date.now(),t.fromPage=t.fromPage||window.location.pathname+window.location.search,sessionStorage.setItem(e.RESUME_STORAGE_KEY,JSON.stringify(t)),console.log("💾 VoiceSDK v2: Stored conversationId:",A)}catch(A){console.warn("⚠️ VoiceSDK v2: Error writing to sessionStorage:",A)}}},{key:"clearStoredConversationId",value:function(){try{if("undefined"==typeof sessionStorage)return;sessionStorage.removeItem(e.RESUME_STORAGE_KEY),console.log("🗑️ VoiceSDK v2: Cleared stored conversationId")}catch(A){console.warn("⚠️ VoiceSDK v2: Error clearing sessionStorage:",A)}}},{key:"_getResumeState",value:function(){try{if("undefined"==typeof sessionStorage)return null;var A=sessionStorage.getItem(e.RESUME_STORAGE_KEY);if(!A)return null;var t=JSON.parse(A),n=Date.now()-t.timestamp;return n>e.RESUME_TTL_MS?(console.log("[VoiceSDK] Resume state expired:",n,"ms"),this._clearResumeState(),null):(console.log("[VoiceSDK] Found valid resume state:",t,"age:",n,"ms"),t)}catch(A){return console.warn("[VoiceSDK] Failed to get resume state:",A),null}}},{key:"_clearResumeState",value:function(){try{if("undefined"==typeof sessionStorage)return;sessionStorage.removeItem(e.RESUME_STORAGE_KEY)}catch(A){}}},{key:"_setupPageUnloadHandler",value:function(){var A=this;window.addEventListener("beforeunload",function(){A.conversationId&&A.websocket&&A.websocket.readyState===WebSocket.OPEN&&A.storeConversationId(A.conversationId)}),document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&A.conversationId&&A.websocket&&A.websocket.readyState===WebSocket.OPEN&&A.storeConversationId(A.conversationId)})}},{key:"checkAndResume",value:function(){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}}},{key:"getDefaultContainer",value:function(A){return"wav"===A.outputCodec?"wav":"raw"}},{key:"validateInputFormat",value:function(A){var t;if(!A)return"Input format is required";var n=null===(t=A.encoding)||void 0===t?void 0:t.toLowerCase();return n&&e.SUPPORTED_INPUT_ENCODINGS.includes(n)?A.sampleRate&&e.SUPPORTED_INPUT_SAMPLE_RATES.includes(A.sampleRate)?A.bitDepth&&e.SUPPORTED_INPUT_BIT_DEPTHS.includes(A.bitDepth)?A.channels&&e.SUPPORTED_INPUT_CHANNELS.includes(A.channels)?null:"Unsupported input channels: ".concat(A.channels,". Supported: ").concat(e.SUPPORTED_INPUT_CHANNELS.join(", ")):"Unsupported input bit depth: ".concat(A.bitDepth,". Supported: ").concat(e.SUPPORTED_INPUT_BIT_DEPTHS.join(", ")):"Unsupported input sample rate: ".concat(A.sampleRate,". Supported: ").concat(e.SUPPORTED_INPUT_SAMPLE_RATES.join(", ")):"Unsupported input encoding: ".concat(A.encoding,". Supported: ").concat(e.SUPPORTED_INPUT_ENCODINGS.join(", "))}},{key:"validateOutputFormat",value:function(A){var t,n;if(!A)return"Output format is required";var o=null===(t=A.encoding)||void 0===t?void 0:t.toLowerCase();if(!o||!e.SUPPORTED_OUTPUT_ENCODINGS.includes(o))return"Unsupported output encoding: ".concat(A.encoding,". Supported: ").concat(e.SUPPORTED_OUTPUT_ENCODINGS.join(", "));if(!A.sampleRate||!e.SUPPORTED_OUTPUT_SAMPLE_RATES.includes(A.sampleRate))return"Unsupported output sample rate: ".concat(A.sampleRate,". Supported: ").concat(e.SUPPORTED_OUTPUT_SAMPLE_RATES.join(", "));if(!A.bitDepth||!e.SUPPORTED_OUTPUT_BIT_DEPTHS.includes(A.bitDepth))return"Unsupported output bit depth: ".concat(A.bitDepth,". Supported: ").concat(e.SUPPORTED_OUTPUT_BIT_DEPTHS.join(", "));if(!A.channels||!e.SUPPORTED_OUTPUT_CHANNELS.includes(A.channels))return"Unsupported output channels: ".concat(A.channels,". Supported: ").concat(e.SUPPORTED_OUTPUT_CHANNELS.join(", "));var r=null===(n=A.container)||void 0===n?void 0:n.toLowerCase();return r&&e.SUPPORTED_OUTPUT_CONTAINERS.includes(r)?null:"Unsupported output container: ".concat(A.container,". Supported: ").concat(e.SUPPORTED_OUTPUT_CONTAINERS.join(", "))}},{key:"validateConfig",value:function(){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")}},{key:"setupAudioPlayerEvents",value:function(){var A=this;this.audioPlayer.on("playbackStarted",function(){A.isPlaying=!0,A.emit("playbackStarted"),A.isConnected?(console.log("📤 VoiceSDK v2: Sending audio_started_playing message to server"),A.sendMessage({t:"audio_started_playing"})):console.warn("⚠️ VoiceSDK v2: Cannot send audio_started_playing - not connected")}),this.audioPlayer.on("transcriptDisplay",function(e){var t=A.currentPlayingSentenceId?A.currentPlayingSentenceId+1:1;A.currentPlayingSentenceId=t;var n={text:e.text,role:"assistant",sentenceId:t,final:!0,timestamp:Date.now()};console.log("📝 VoiceSDK v2: Emitting synced transcriptDisplay from AudioPlayer:",n),A.emit("transcriptDisplay",n),A.emit("transcript",n)}),this.audioPlayer.on("playbackStopped",function(){A.isPlaying=!1,A.emit("playbackStopped"),A.isConnected?(console.log("📤 VoiceSDK v2: Sending audio_stopped_playing message to server"),A.sendMessage({t:"audio_stopped_playing"})):console.warn("⚠️ VoiceSDK v2: Cannot send audio_stopped_playing - not connected")}),this.audioPlayer.on("playbackError",function(e){A.emit("playbackError",e),A.emit("error",e)})}},{key:"setupAudioRecorderEvents",value:function(){var A=this;this.audioRecorder.on("recordingStarted",function(){A.isRecording=!0,A.emit("recordingStarted")}),this.audioRecorder.on("recordingStopped",function(){A.isRecording&&(A.isRecording=!1,A.emit("recordingStopped"),console.log("🛑 VoiceSDK v2: Recording stopped (from audioRecorder event)"))}),this.audioRecorder.on("audioData",function(e){A.isConnected&&A.sendBinary(e)}),this.audioRecorder.on("error",function(e){console.error("❌ AudioRecorder error:",e),A.emit("error",e)})}},{key:"buildWebSocketUrl",value:function(){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 r=t.toString();return r?"".concat(e.origin).concat(e.pathname,"?").concat(r):"".concat(e.origin).concat(e.pathname)}},{key:"connect",value:(c=zA(JA().m(function A(){var e,t,n=this;return JA().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!this.isDestroyed){A.n=1;break}return console.warn("VoiceSDK v2: Cannot connect - SDK is destroyed"),A.a(2,!1);case 1:if(!this.isConnected){A.n=2;break}return console.warn("VoiceSDK v2: Already connected"),A.a(2,!0);case 2:return A.p=2,e=this.buildWebSocketUrl(),console.log("🔌 VoiceSDK v2: Connecting to",e),A.n=3,new Promise(function(A,t){n.websocket=new WebSocket(e),n.websocket.onopen=function(){console.log("✅ VoiceSDK v2: WebSocket connected"),n.isConnected=!0,n.hasEverConnected=!0,n.clientToolsRegistry&&n.clientToolsRegistry.setSendMessage(function(A){return n.sendMessage(A)}),n.sendHelloMessage(),n.emit("connected"),A(!0)},n.websocket.onerror=function(A){console.error("❌ VoiceSDK v2: WebSocket error:",A),t(A)},n.websocket.onclose=function(A){console.log("🔌 VoiceSDK v2: WebSocket closed:",A.code,A.reason),n.isConnected=!1,n.isRecording&&n.stopRecording().catch(function(A){return console.error("Error stopping recording:",A)}),n.emit("disconnected",A),n.config.autoReconnect&&!n.isDestroyed&&n.hasEverConnected?(console.log("🔄 VoiceSDK v2: Auto-reconnecting in 3s..."),setTimeout(function(){n.isDestroyed||n.isConnected||n.connect()},3e3)):n.config.autoReconnect&&!n.hasEverConnected&&console.log("⚠️ VoiceSDK v2: Initial connection failed. Auto-reconnect disabled to prevent retry loop.")},n.websocket.onmessage=function(A){n.handleMessage(A)}});case 3:return A.a(2,A.v);case 4:return A.p=4,t=A.v,console.error("🔌 VoiceSDK v2: Connection failed:",t),this.emit("error",t),A.a(2,!1)}},A,this,[[2,4]])})),function(){return c.apply(this,arguments)})},{key:"sendHelloMessage",value:function(){if(this.isConnected){var A={encoding:"pcm",sampleRate:this.config.sampleRate,channels:this.config.channels,bitDepth:this.config.bitDepth},e={encoding:this.config.outputEncoding,sampleRate:this.config.outputSampleRate,channels:this.config.outputChannels,bitDepth:this.config.outputBitDepth,container:this.config.outputContainer},t=this.validateInputFormat(A);if(t)return console.error("❌ VoiceSDK v2: Cannot send hello - invalid input format:",t),void this.emit("error",new Error("Invalid input format: ".concat(t)));var n=this.validateOutputFormat(e);if(n)return console.error("❌ VoiceSDK v2: Cannot send hello - invalid output format:",n),void this.emit("error",new Error("Invalid output format: ".concat(n)));var o={t:"hello",v:this.config.protocolVersion,inputFormat:A,requestedOutputFormat:e,outputFrameDurationMs:this.config.outputFrameDurationMs};this.config.agentSettingsOverride&&(o.agentSettingsOverride=this.config.agentSettingsOverride),console.log("🔍 VoiceSDK v2: Checking variables:",{hasVariables:!!this.config.variables,variables:this.config.variables,keys:this.config.variables?Object.keys(this.config.variables):[]}),this.config.variables&&Object.keys(this.config.variables).length>0?(o.variables=this.config.variables,console.log("📝 VoiceSDK v2: Including variables in hello:",Object.keys(this.config.variables))):console.log("⚠️ VoiceSDK v2: Variables NOT included - condition failed"),console.log("📤 VoiceSDK v2: Sending hello:",{version:o.v,requestedFormat:o.requestedOutputFormat,variables:o.variables?Object.keys(o.variables):void 0}),console.log("📤 VoiceSDK v2: Requested output format:",{container:o.requestedOutputFormat.container,encoding:o.requestedOutputFormat.encoding,sampleRate:o.requestedOutputFormat.sampleRate,bitDepth:o.requestedOutputFormat.bitDepth}),console.log("📤 VoiceSDK v2: Full hello message being sent:",JSON.stringify(o,null,2));try{this.sendMessage(o)}catch(A){console.error("VoiceSDK v2: Failed to send hello:",A),this.emit("error",A)}}else console.warn("VoiceSDK v2: Cannot send hello - not connected")}},{key:"handleMessage",value:function(A){if(A.data instanceof ArrayBuffer||A.data instanceof Blob)this.handleBinaryMessage(A.data);else try{var e=JSON.parse(A.data);switch("audio"!==e.t&&console.log("📥 VoiceSDK v2: Received message type:",e.t,"Full message:",JSON.stringify(e).substring(0,200)),!this.conversationId&&e.conversationId&&(this.conversationId=e.conversationId,console.log("🔍 VoiceSDK v2: Captured conversationId from message:",this.conversationId),this.emit("conversationIdChanged",this.conversationId)),"audio"!==e.t&&console.log("📨 VoiceSDK v2: Received message type:",e.t,e),e.t){case"hello_ack":this.handleHelloAck(e);break;case"transcript":console.log("📝 VoiceSDK v2: Processing transcript message:",e),this.handleTranscript(e);break;case"user_transcript":console.log("📝 VoiceSDK v2: Received user_transcript:",e),this.emit("message",e);break;case"agent_response":if(console.log("📝 VoiceSDK v2: Received agent_response:",e),(e.text||e.transcript)&&(console.log("📝 VoiceSDK v2: agent_response contains transcript data:",e.text||e.transcript),e.sentenceId&&(e.text||e.transcript))){var t={t:"transcript",sentenceId:e.sentenceId,text:e.text||e.transcript,role:e.role||"assistant",final:!1!==e.final,timestamp:e.timestamp||Date.now()};console.log("📝 VoiceSDK v2: Converting agent_response to transcript:",t),this.handleTranscript(t)}this.emit("message",e);break;case"error":this.emit("message",e);break;case"barge_in":this.emit("bargeIn",e),this.stopAudioPlayback();break;case"stop_playing":this.emit("stopPlaying",e),this.stopAudioPlayback();break;case"audio_start":console.log("📝 VoiceSDK v2: Received audio_start with text:",e.text),e.text&&this.audioPlayer&&this.audioPlayer.markNewSentence(e.text),this.emit("message",e);break;case"client_tool_call":this.clientToolsRegistry.handleToolCall(e);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;default:if(console.log("VoiceSDK v2: Unknown message type:",e.t,"Full message:",JSON.stringify(e).substring(0,300)),(e.text||e.transcript||e.transcription)&&(console.log("📝 VoiceSDK v2: Unknown message contains transcript-like data:",{text:e.text,transcript:e.transcript,transcription:e.transcription,sentenceId:e.sentenceId,role:e.role}),e.sentenceId&&(e.text||e.transcript||e.transcription))){var n={t:"transcript",sentenceId:e.sentenceId,text:e.text||e.transcript||e.transcription,role:e.role||"assistant",final:!1!==e.final,timestamp:e.timestamp||Date.now()};console.log("📝 VoiceSDK v2: Attempting to process unknown message as transcript:",n),this.handleTranscript(n)}this.emit("message",e)}}catch(A){console.error("VoiceSDK v2: Error parsing message:",A)}}},{key:"handleHelloAck",value:function(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 bA(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...")):console.log("✅ VoiceSDK v2: Connected (v1 legacy mode)");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}}},{key:"handleTranscript",value:function(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)}},{key:"handleBinaryMessage",value:(s=zA(JA().m(function A(e){var t,n,o,r,i,a,s,c,l;return JA().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!(e instanceof Blob)){A.n=2;break}return A.n=1,e.arrayBuffer();case 1:t=A.v,A.n=3;break;case 2:t=e;case 3:if(n=t,!this.formatConverter||!this.formatConverter.needsConversion()){A.n=7;break}return A.p=4,A.n=5,this.formatConverter.convert(t);case 5:n=A.v,console.log("✅ VoiceSDK v2: Audio converted to requested format"),A.n=7;break;case 6:A.p=6,l=A.v,console.error("❌ VoiceSDK v2: Format conversion failed:",l),console.warn(" Using backend format without conversion"),n=t;case 7:o=this.formatConverter&&this.formatConverter.needsConversion()?this.requestedOutputFormat:this.outputAudioFormat||{container:this.config.outputContainer||"raw",encoding:this.config.outputEncoding||"pcm",sampleRate:this.config.outputSampleRate||16e3,bitDepth:this.config.outputBitDepth||16,channels:this.config.outputChannels||1},r=o.container||"raw",i=(o.encoding||"pcm").toLowerCase(),"raw"===r?(a=n,"pcm"!==i&&((s=this.audioPlayer.getCodec(i))?(c=s.decode(new Uint8Array(n)),a=c.buffer,console.log("🔄 VoiceSDK v2: Decoded ".concat(i.toUpperCase()," to PCM (").concat(c.byteLength," bytes)"))):console.warn("⚠️ VoiceSDK v2: No codec for ".concat(i,", treating as PCM"))),this.audioPlayer.outputFormat||(console.warn("⚠️ VoiceSDK v2: outputFormat not set on AudioPlayer, setting from playbackFormat"),this.audioPlayer.setOutputFormat(o)),this.audioFrameCount++,this.audioPlayer.playChunk(a)):(this.audioFrameCount++,this.audioPlayer.playAudio(n));case 8:return A.a(2)}},A,this,[[4,6]])})),function(A){return s.apply(this,arguments)})},{key:"sendMessage",value:function(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}}},{key:"sendBinary",value:function(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}}},{key:"hangup",value:function(){var A=this;if(this.websocket&&this.websocket.readyState===WebSocket.OPEN){console.log("📞 VoiceSDK v2: Hanging up call..."),this.clearStoredConversationId(),this.stopRecording(),this.audioPlayer&&this.stopAudioPlayback();try{this.sendMessage({t:"hangup"}),setTimeout(function(){A.websocket&&A.websocket.readyState===WebSocket.OPEN&&(A.websocket.close(1e3,"User hangup"),A.websocket=null),A.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}}else console.warn("🔌 VoiceSDK v2: Cannot hangup - WebSocket not open")}},{key:"startRecording",value:(a=zA(JA().m(function A(){var e,t,n;return JA().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.isConnected){A.n=1;break}throw e=new Error("Not connected to voice server"),this.emit("error",e),e;case 1:if(!this.isRecording){A.n=2;break}return console.warn("VoiceSDK v2: Already recording"),A.a(2,!0);case 2:return console.log("🎤 VoiceSDK v2: Starting recording..."),A.p=3,console.log("🎤 VoiceSDK v2: Requesting microphone permission (mobile-friendly)..."),A.n=4,this.audioRecorder.start();case 4:return A.n=5,this.audioPlayer.resumeAudioContext();case 5:return this.sendMessage({t:"start_continuous_mode",ttpId:this.generateTtpId()}),A.a(2,!0);case 6:return A.p=6,n=A.v,console.error("❌ VoiceSDK v2: Failed to start recording:",n),"NotAllowedError"===n.name||"PermissionDeniedError"===n.name?((t=new Error("Microphone permission denied. Please allow microphone access in your browser settings and try again.")).name=n.name,t.originalError=n,this.emit("error",t)):this.emit("error",n),A.a(2,!1)}},A,this,[[3,6]])})),function(){return a.apply(this,arguments)})},{key:"stopRecording",value:(i=zA(JA().m(function A(){var e;return JA().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.isRecording){A.n=1;break}return console.warn("VoiceSDK v2: Not recording"),A.a(2,!0);case 1:return console.log("🛑 VoiceSDK v2: Stopping recording..."),A.p=2,this.sendMessage({t:"stop_continuous_mode",ttpId:this.generateTtpId()}),this.isRecording=!1,this.emit("recordingStopped"),console.log("🛑 VoiceSDK v2: Recording stopped (emitted before audioRecorder.stop())"),A.n=3,this.audioRecorder.stop();case 3:return this.stopAudioPlayback(),A.a(2,!0);case 4:return A.p=4,e=A.v,console.error("VoiceSDK v2: Error stopping recording:",e),this.emit("error",e),A.a(2,!1)}},A,this,[[2,4]])})),function(){return i.apply(this,arguments)})},{key:"toggleRecording",value:(r=zA(JA().m(function A(){return JA().w(function(A){for(;;)switch(A.n){case 0:if(!this.isRecording){A.n=2;break}return A.n=1,this.stopRecording();case 1:case 3:return A.a(2,A.v);case 2:return A.n=3,this.startRecording();case 4:return A.a(2)}},A,this)})),function(){return r.apply(this,arguments)})},{key:"clearTranscriptState",value:function(){this.currentPlayingSentenceId=null,console.log("📝 VoiceSDK v2: Cleared transcript state")}},{key:"stopAudioPlayback",value:function(){this.audioPlayer.stopImmediate(),this.clearTranscriptState()}},{key:"handleBargeIn",value:(o=zA(JA().m(function A(){return JA().w(function(A){for(;;)switch(A.n){case 0:if(this.stopAudioPlayback(),this.isRecording){A.n=1;break}return A.n=1,this.startRecording();case 1:return A.a(2)}},A,this)})),function(){return o.apply(this,arguments)})},{key:"getStatus",value:function(){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()}}},{key:"updateConfig",value:function(A){this.config=WA(WA({},this.config),A)}},{key:"generateTtpId",value:function(){return"sdk_"+Math.random().toString(36).substr(2,9)+"_"+Date.now()}},{key:"registerToolHandler",value:function(A,e){return this.clientToolsRegistry.registerHandler(A,e)}},{key:"unregisterToolHandler",value:function(A){return this.clientToolsRegistry.unregisterHandler(A)}},{key:"hasToolHandler",value:function(A){return this.clientToolsRegistry.hasHandler(A)}},{key:"getRegisteredTools",value:function(){return this.clientToolsRegistry.getRegisteredTools()}},{key:"destroy",value:function(){var A=this;this.isDestroyed||(console.log("🗑️ VoiceSDK v2: Destroying..."),this.isDestroyed=!0,this.isRecording&&this.stopRecording(),this.audioPlayer&&this.stopAudioPlayback(),this.websocket&&(this.websocket.close(),this.websocket=null),this.isConnected=!1,this.audioPlayer&&this.audioPlayer.destroy(),this.audioRecorder&&this.audioRecorder.destroy(),this.clientToolsRegistry&&this.clientToolsRegistry.getRegisteredTools().forEach(function(e){return A.clientToolsRegistry.unregisterHandler(e)}),this.removeAllListeners())}}],n&&qA(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i,a,s,c}(a);te(oe,"RESUME_STORAGE_KEY","voice_resume_state"),te(oe,"RESUME_TTL_MS",1e4),te(oe,"SUPPORTED_INPUT_ENCODINGS",["pcm","pcmu","pcma"]),te(oe,"SUPPORTED_INPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),te(oe,"SUPPORTED_INPUT_BIT_DEPTHS",[8,16,24]),te(oe,"SUPPORTED_INPUT_CHANNELS",[1]),te(oe,"SUPPORTED_OUTPUT_ENCODINGS",["pcm","pcmu","pcma"]),te(oe,"SUPPORTED_OUTPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),te(oe,"SUPPORTED_OUTPUT_BIT_DEPTHS",[8,16,24]),te(oe,"SUPPORTED_OUTPUT_CHANNELS",[1]),te(oe,"SUPPORTED_OUTPUT_CONTAINERS",["raw","wav"]);const re=oe;function ie(A){return ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},ie(A)}function ae(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,se(n.key),n)}}function se(A){var e=function(A){if("object"!=ie(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=ie(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==ie(e)?e:e+""}var ce=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.events={}},e=[{key:"on",value:function(A,e){this.events[A]||(this.events[A]=[]),this.events[A].push(e)}},{key:"off",value:function(A,e){this.events[A]&&(this.events[A]=this.events[A].filter(function(A){return A!==e}))}},{key:"emit",value:function(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(function(e){try{e.apply(void 0,t)}catch(e){console.error("Error in event listener for ".concat(A,":"),e)}})}},{key:"removeAllListeners",value:function(A){A?delete this.events[A]:this.events={}}}],e&&ae(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function le(A){return le="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},le(A)}function ue(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return de(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,h=r[2];t>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<h&&(o=t<3||r[0]>n||n>h)&&(r[4]=t,r[5]=n,d.n=h,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,h),a=l,s=h;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(de(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,de(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,de(u,"constructor",c),de(c,"constructor",s),s.displayName="GeneratorFunction",de(c,o,"GeneratorFunction"),de(u),de(u,o,"Generator"),de(u,n,function(){return this}),de(u,"toString",function(){return"[object Generator]"}),(ue=function(){return{w:r,m:d}})()}function de(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}de=function(A,e,t,n){function r(e,t){de(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},de(A,e,t,n)}function ge(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function he(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 pe(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?he(Object(t),!0).forEach(function(e){fe(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):he(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function fe(A,e,t){return(e=we(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function Be(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,we(n.key),n)}}function we(A){var e=function(A){if("object"!=le(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=le(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==le(e)?e:e+""}function ve(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(ve=function(){return!!A})()}function me(A){return me=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},me(A)}function ye(A,e){return ye=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},ye(A,e)}var Ce=function(A){function e(){var A,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=(A=function(A,e,t){return e=me(e),function(A,e){if(e&&("object"==le(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,ve()?Reflect.construct(e,t||[],me(A).constructor):e.apply(A,t))}(this,e)).readScriptTagConfig();return A.config=pe({baseWsUrl:"wss://backend.talktopc.com/chat/websocket",appId:t.appId||n.appId,agentId:t.agentId||n.agentId,conversationId:void 0!==t.conversationId?t.conversationId:A.getPersistedConversationId(),forceConversationId:t.forceConversationId,queue:[],inFlight:!1},t),A.fullResponseBuffer="",A}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&ye(A,e)}(e,A),t=e,n=[{key:"readScriptTagConfig",value:function(){try{var A=Array.from(document.getElementsByTagName("script")).reverse().find(function(A){return 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{}}}},{key:"buildWebSocketUrl",value:function(){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())}},{key:"sendMessage",value:(o=ue().m(function A(e){var t=this;return ue().w(function(A){for(;;)if(0===A.n)return A.a(2,new Promise(function(A,n){if(e&&e.trim())if(t.config.appId&&t.config.agentId){var o={text:e,resolve:A,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"))}))},A)}),r=function(){var A=this,e=arguments;return new Promise(function(t,n){var r=o.apply(A,e);function i(A){ge(r,t,n,i,a,"next",A)}function a(A){ge(r,t,n,i,a,"throw",A)}i(void 0)})},function(A){return r.apply(this,arguments)})},{key:"executeTask",value:function(A){var e=this;if(this.config.inFlight=!0,this.fullResponseBuffer="",!this.config.conversationId){var t=this.getPersistedConversationId();t&&(this.config.conversationId=t,console.log("🔍 TextChatSDK hydrated conversationId from storage:",t))}var n,o=this.buildWebSocketUrl(this.config.baseWsUrl),r=this.config.baseWsUrl.endsWith("/websocket")?this.config.baseWsUrl.replace(/\/websocket$/,""):"".concat(this.config.baseWsUrl,"/websocket"),i=this.buildWebSocketUrl(r),a=!1,s=!1,c=null,l=function(t){if(!s)try{var n={message:A.text},o=e.config.forceConversationId||e.config.conversationId;o&&(n.conversationId=o,e.config.forceConversationId&&!e.config.conversationId&&(e.config.conversationId=o,e.persistConversationId(o))),console.log("🔍 TextChatSDK sending payload:",n,"conversationId in config:",e.config.conversationId),t.send(JSON.stringify(n)),s=!0}catch(n){A.reject(n),e.emit("error",n);try{t.close()}catch(A){}}},u=function(A){return function(){e.config.conversationId?l(A):c=setTimeout(function(){return l(A)},200)}},d=function(t){return function(n){try{try{console.log("🔎 [TextChatSDK] WS <= raw:",n.data)}catch(A){}var o=JSON.parse(n.data);try{console.log("🔎 [TextChatSDK] WS <= parsed:",o)}catch(A){}if("hello"===o.type&&o.conversationId){if(console.log("🔍 TextChatSDK received conversationId:",o.conversationId),e.config.conversationId=o.conversationId,e.persistConversationId(o.conversationId),e.emit&&e.emit("conversationIdChanged",o.conversationId),!s&&t&&1===t.readyState){if(c)try{clearTimeout(c)}catch(A){}l(t)}return}if(!e.config.conversationId&&o.conversationId&&(console.log("🔍 TextChatSDK captured conversationId from message:",o.conversationId),e.config.conversationId=o.conversationId,e.persistConversationId(o.conversationId)),"chunk"===o.type&&"string"==typeof o.content)e.fullResponseBuffer+=o.content,e.emit("chunk",o.content);else if("done"===o.type){try{var r=o.text||o.content||o.answer||o.message||"";r&&!e.fullResponseBuffer&&(e.fullResponseBuffer=r)}catch(A){}!e.config.conversationId&&o.conversationId&&(console.log("🔍 TextChatSDK captured conversationId from done:",o.conversationId),e.config.conversationId=o.conversationId),e.persistConversationId(e.config.conversationId),e.emit("done",{text:e.fullResponseBuffer}),A.resolve({conversationId:e.config.conversationId,fullText:e.fullResponseBuffer});try{t.close()}catch(A){}}else if("error"===o.type){var i=new Error(o.message||"Server error");e.emit("error",i),A.reject(i);try{t.close()}catch(A){}}}catch(A){}}},g=function(t){if(1008===t.code&&t.reason&&(t.reason.includes("Domain not whitelisted")||t.reason.includes("domain")||t.reason.includes("whitelist"))){var n=new Error("DOMAIN_NOT_WHITELISTED");return n.reason=t.reason,n.code=t.code,e.emit("domainError",n),A.reject(n),e.config.inFlight=!1,void e.drainQueue()}e.config.inFlight=!1,e.drainQueue()},h=new WebSocket(o);h.onopen=u(h),h.onmessage=d(h),h.onerror=(n=h,function(t){if(!a){a=!0;try{n.close()}catch(A){}var o=new WebSocket(i);return o.onopen=u(o),o.onmessage=d(o),o.onerror=function(t){e.emit("error",t),A.reject(t)},void(o.onclose=g)}e.emit("error",t),A.reject(t)}),h.onclose=g}},{key:"drainQueue",value:function(){if(0!==this.config.queue.length&&!this.config.inFlight){var A=this.config.queue.shift();this.executeTask(A)}}},{key:"persistConversationId",value:function(A){try{A&&localStorage.setItem("ttp_text_chat_conversation_id",A)}catch(A){}}},{key:"getPersistedConversationId",value:function(){try{return localStorage.getItem("ttp_text_chat_conversation_id")||null}catch(A){return null}}},{key:"updateConfig",value:function(A){this.config=pe(pe({},this.config),A)}},{key:"destroy",value:function(){this.config.queue=[],this.config.inFlight=!1,this.removeAllListeners()}}],n&&Be(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r}(ce);function Qe(A){return Qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Qe(A)}function be(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=t){var n,o,r,i,a=[],s=!0,c=!1;try{if(r=(t=t.call(A)).next,0===e){if(Object(t)!==t)return;s=!1}else for(;!(s=(n=r.call(t)).done)&&(a.push(n.value),a.length!==e);s=!0);}catch(A){c=!0,o=A}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(A,e)||Ue(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Fe(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=Ue(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,o=function(){};return{s:o,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){a=!0,r=A},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function Ue(A,e){if(A){if("string"==typeof A)return Ee(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ee(A,e):void 0}}function Ee(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}function Se(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return xe(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,h=r[2];t>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<h&&(o=t<3||r[0]>n||n>h)&&(r[4]=t,r[5]=n,d.n=h,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,h),a=l,s=h;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(xe(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,xe(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,xe(u,"constructor",c),xe(c,"constructor",s),s.displayName="GeneratorFunction",xe(c,o,"GeneratorFunction"),xe(u),xe(u,o,"Generator"),xe(u,n,function(){return this}),xe(u,"toString",function(){return"[object Generator]"}),(Se=function(){return{w:r,m:d}})()}function xe(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}xe=function(A,e,t,n){function r(e,t){xe(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},xe(A,e,t,n)}function Ie(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function He(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,ke(n.key),n)}}function ke(A){var e=function(A){if("object"!=Qe(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Qe(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Qe(e)?e:e+""}function Te(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(Te=function(){return!!A})()}function De(A){return De=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},De(A)}function Ke(A,e){return Ke=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},Ke(A,e)}const Oe=new(function(A){function e(){var A;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(A=function(A,e,t){return e=De(e),function(A,e){if(e&&("object"==Qe(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,Te()?Reflect.construct(e,t||[],De(A).constructor):e.apply(A,t))}(this,e)).connections=new Map,A.connectionCounts=new Map,A.creatingConnections=new Set,A}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&Ke(A,e)}(e,A),t=e,n=[{key:"getConnection",value:(o=Se().m(function A(e){var t,n,o=this;return Se().w(function(A){for(;;)switch(A.n){case 0:if(!this.connections.has(e)){A.n=1;break}return t=this.connections.get(e),this.connectionCounts.set(e,(this.connectionCounts.get(e)||0)+1),A.a(2,t);case 1:if(!this.creatingConnections||!this.creatingConnections.has(e)){A.n=2;break}return A.a(2,new Promise(function(A){var t=function(){if(o.connections.has(e)){var n=o.connections.get(e);o.connectionCounts.set(e,(o.connectionCounts.get(e)||0)+1),A(n)}else setTimeout(t,50)};t()}));case 2:return this.creatingConnections.add(e),n=new WebSocket(e),this.connections.set(e,n),this.connectionCounts.set(e,1),n.addEventListener("open",function(A){o.creatingConnections.delete(e),o.emit("open",A,e)}),n.addEventListener("close",function(A){o.creatingConnections.delete(e),o.connections.delete(e),o.connectionCounts.delete(e),o.emit("close",A,e)}),n.addEventListener("error",function(A){o.creatingConnections.delete(e),o.emit("error",A,e)}),n.addEventListener("message",function(A){o.emit("message",A,e)}),A.a(2,n)}},A,this)}),r=function(){var A=this,e=arguments;return new Promise(function(t,n){var r=o.apply(A,e);function i(A){Ie(r,t,n,i,a,"next",A)}function a(A){Ie(r,t,n,i,a,"throw",A)}i(void 0)})},function(A){return r.apply(this,arguments)})},{key:"releaseConnection",value:function(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)}}}},{key:"forceClose",value:function(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)}}},{key:"getConnectionStatus",value:function(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}}},{key:"getAllConnections",value:function(){var A,e={},t=Fe(this.connections.entries());try{for(t.s();!(A=t.n()).done;){var n=be(A.value,2),o=n[0],r=n[1];e[o]={readyState:r.readyState,subscribers:this.connectionCounts.get(o)||0}}}catch(A){t.e(A)}finally{t.f()}return e}},{key:"clearAll",value:function(){var A,e=Fe(this.connections.entries());try{for(e.s();!(A=e.n()).done;){var t=be(A.value,2),n=(t[0],t[1]);n&&n.readyState===WebSocket.OPEN&&n.close(1e3,"Clear all")}}catch(A){e.e(A)}finally{e.f()}this.connections.clear(),this.connectionCounts.clear(),this.creatingConnections.clear()}}],n&&He(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r}(ce));function Pe(A){return Pe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Pe(A)}function Le(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Re(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,h=r[2];t>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<h&&(o=t<3||r[0]>n||n>h)&&(r[4]=t,r[5]=n,d.n=h,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,h),a=l,s=h;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Re(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,Re(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Re(u,"constructor",c),Re(c,"constructor",s),s.displayName="GeneratorFunction",Re(c,o,"GeneratorFunction"),Re(u),Re(u,o,"Generator"),Re(u,n,function(){return this}),Re(u,"toString",function(){return"[object Generator]"}),(Le=function(){return{w:r,m:d}})()}function Re(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Re=function(A,e,t,n){function r(e,t){Re(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},Re(A,e,t,n)}function Me(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Ve(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,_e(n.key),n)}}function _e(A){var e=function(A){if("object"!=Pe(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Pe(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Pe(e)?e:e+""}function Ge(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(Ge=function(){return!!A})()}function Ne(A){return Ne=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},Ne(A)}function je(A,e){return je=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},je(A,e)}var We=function(A){function e(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(A,e,t){return e=Ne(e),function(A,e){if(e&&("object"==Pe(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,Ge()?Reflect.construct(e,t||[],Ne(A).constructor):e.apply(A,t))}(this,e)).config=A,t.ws=null,t.isConnected=!1,t.connectionId=null,t}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&je(A,e)}(e,A),t=e,n=[{key:"connect",value:(r=Le().m(function A(){var e=this;return Le().w(function(A){for(;;)if(0===A.n)return A.a(2,new Promise(function(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;Oe.getConnection(n,e.config).then(function(t){e.ws=t,e.setupEventListeners(),t.readyState===WebSocket.OPEN&&(e.isConnected=!0,e.emit("connected"),A(),e.connectResolve=null,e.connectReject=null)}).catch(function(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}}))},A)}),i=function(){var A=this,e=arguments;return new Promise(function(t,n){var o=r.apply(A,e);function i(A){Me(o,t,n,i,a,"next",A)}function a(A){Me(o,t,n,i,a,"throw",A)}i(void 0)})},function(){return i.apply(this,arguments)})},{key:"setupEventListeners",value:function(){var A=this;if(this.ws){var e=function(e,t){t===(A.config.signedUrl||A.config.websocketUrl)&&(A.isConnected=!0,A.emit("connected"),A.connectResolve&&(A.connectResolve(),A.connectResolve=null,A.connectReject=null))},t=function(e,t){t===(A.config.signedUrl||A.config.websocketUrl)&&(A.isConnected=!1,A.emit("disconnected",e))},n=function(e,t){t===(A.config.signedUrl||A.config.websocketUrl)&&(A.emit("error",e),A.connectReject&&(A.connectReject(e),A.connectResolve=null,A.connectReject=null))},o=function(e,t){t===(A.config.signedUrl||A.config.websocketUrl)&&A.handleMessage(e)};Oe.on("open",e),Oe.on("close",t),Oe.on("error",n),Oe.on("message",o),this.eventHandlers={open:e,close:t,error:n,message:o}}}},{key:"disconnect",value:function(){this.eventHandlers&&(Oe.off("open",this.eventHandlers.open),Oe.off("close",this.eventHandlers.close),Oe.off("error",this.eventHandlers.error),Oe.off("message",this.eventHandlers.message));var A=this.config.signedUrl||this.config.websocketUrl;A&&Oe.releaseConnection(A),this.ws=null,this.isConnected=!1}},{key:"sendMessage",value:function(A){if(this.isConnected&&this.ws)try{this.ws.send(JSON.stringify(A))}catch(A){console.warn("🔌 WebSocketManager: Failed to send message:",A.message)}}},{key:"sendBinary",value:function(A){if(this.isConnected&&this.ws)try{this.ws.send(A)}catch(A){console.warn("🔌 WebSocketManager: Failed to send binary data:",A.message)}}},{key:"handleMessage",value:function(A){var e=this;if(A.data instanceof ArrayBuffer)this.emit("binaryAudio",A.data);else if(A.data instanceof Blob)A.data.arrayBuffer().then(function(A){e.emit("binaryAudio",A)}).catch(function(A){console.error("🔌 WebSocketManager: Error converting Blob to ArrayBuffer:",A)});else try{var t=JSON.parse(A.data);"barge_in_ack"!==t.t&&"stop_sending"!==t.t||this.emit("bargeIn",t),"stop_playing"===t.t&&this.emit("stopPlaying",t),this.emit("message",t)}catch(A){this.emit("error",A)}}},{key:"getStatus",value:function(){return{isConnected:this.isConnected,readyState:this.ws?this.ws.readyState:null,connectionId:this.connectionId}}}],o=[{key:"getSingletonStatus",value:function(){return Oe.getAllConnections()}},{key:"clearAllConnections",value:function(){Oe.clearAll()}}],n&&Ve(t.prototype,n),o&&Ve(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(ce);function Je(A){return Je="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Je(A)}function Xe(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Ye(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,h=r[2];t>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<h&&(o=t<3||r[0]>n||n>h)&&(r[4]=t,r[5]=n,d.n=h,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,h),a=l,s=h;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Ye(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,Ye(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Ye(u,"constructor",c),Ye(c,"constructor",s),s.displayName="GeneratorFunction",Ye(c,o,"GeneratorFunction"),Ye(u),Ye(u,o,"Generator"),Ye(u,n,function(){return this}),Ye(u,"toString",function(){return"[object Generator]"}),(Xe=function(){return{w:r,m:d}})()}function Ye(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Ye=function(A,e,t,n){function r(e,t){Ye(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},Ye(A,e,t,n)}function ze(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Ze(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){ze(r,n,o,i,a,"next",A)}function a(A){ze(r,n,o,i,a,"throw",A)}i(void 0)})}}function qe(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}function $e(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,At(n.key),n)}}function At(A){var e=function(A){if("object"!=Je(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Je(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Je(e)?e:e+""}function et(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(et=function(){return!!A})()}function tt(A){return tt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},tt(A)}function nt(A,e){return nt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},nt(A,e)}var ot=function(A){function e(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(A,e,t){return e=tt(e),function(A,e){if(e&&("object"==Je(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,et()?Reflect.construct(e,t||[],tt(A).constructor):e.apply(A,t))}(this,e)).config=A,t.audioContext=null,t.audioWorkletNode=null,t.mediaStream=null,t.isRecording=!1,t}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&nt(A,e)}(e,A),t=e,n=[{key:"getAudioProcessorPath",value:function(){if(this.config.audioProcessorPath)return this.config.audioProcessorPath;var A,e=function(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=function(A,e){if(A){if("string"==typeof A)return qe(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?qe(A,e):void 0}}(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,o=function(){};return{s:o,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){a=!0,r=A},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}(document.getElementsByTagName("script"));try{for(e.s();!(A=e.n()).done;){var t=A.value.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")}}}catch(A){e.e(A)}finally{e.f()}return"https://cdn.talktopc.com/audio-processor.js"}},{key:"checkPermissionState",value:function(){var A=Ze(Xe().m(function A(){var e;return Xe().w(function(A){for(;;)switch(A.p=A.n){case 0:if(A.p=0,!navigator.permissions||!navigator.permissions.query){A.n=2;break}return A.n=1,navigator.permissions.query({name:"microphone"});case 1:return e=A.v,A.a(2,e.state);case 2:A.n=4;break;case 3:A.p=3,A.v,console.log("⚠️ AudioRecorder: Permissions API not available or not supported for microphone");case 4:return A.a(2,null)}},A,null,[[0,3]])}));return function(){return A.apply(this,arguments)}}()},{key:"requestPermission",value:(i=Ze(Xe().m(function A(){var e,t;return Xe().w(function(A){for(;;)switch(A.p=A.n){case 0:return A.p=0,A.n=1,this.checkPermissionState();case 1:if("granted"!==A.v){A.n=2;break}return console.log("✅ AudioRecorder: Microphone permission already granted"),A.a(2,!0);case 2:return console.log("🎤 AudioRecorder: Requesting microphone permission..."),e=this.config.sampleRate||this.config.outputSampleRate||44100,A.n=3,navigator.mediaDevices.getUserMedia({audio:{sampleRate:e,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});case 3:return A.v.getTracks().forEach(function(A){return A.stop()}),console.log("✅ AudioRecorder: Microphone permission granted"),A.a(2,!0);case 4:return A.p=4,t=A.v,console.error("❌ AudioRecorder: Failed to get microphone permission:",t),A.a(2,!1)}},A,this,[[0,4]])})),function(){return i.apply(this,arguments)})},{key:"start",value:(r=Ze(Xe().m(function A(){var e,t,n,o,r,i,a,s=this;return Xe().w(function(A){for(;;)switch(A.p=A.n){case 0:return A.p=0,console.log("🎤 AudioRecorder: Requesting microphone access..."),A.n=1,this.checkPermissionState();case 1:return(e=A.v)&&(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.')),t=this.config.sampleRate||this.config.outputSampleRate||44100,A.n=2,navigator.mediaDevices.getUserMedia({audio:{sampleRate:t,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});case 2:if(this.mediaStream=A.v,this.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:t}),"suspended"!==this.audioContext.state){A.n=3;break}return A.n=3,this.audioContext.resume();case 3:return n=this.getAudioProcessorPath(),A.n=4,this.audioContext.audioWorklet.addModule(n);case 4:this.audioWorkletNode=new AudioWorkletNode(this.audioContext,"audio-processor",{processorOptions:{sampleRate:t,outputSampleRate:this.config.outputSampleRate}}),this.audioContext.createMediaStreamSource(this.mediaStream).connect(this.audioWorkletNode),this.audioWorkletNode.port.onmessage=function(A){var e=A.data,t=e.type,n=e.data;"pcm_audio_data"===t&&s.emit("audioData",n)},this.audioWorkletNode.port.postMessage({type:"setForceContinuous",data:{enabled:!0}}),console.log("✅ AudioRecorder: Microphone access granted"),this.isRecording=!0,this.emit("recordingStarted"),A.n=9;break;case 5:if(A.p=5,a=A.v,o=a.message,"NotAllowedError"!==a.name&&"PermissionDeniedError"!==a.name){A.n=7;break}return A.n=6,this.checkPermissionState();case 6:"denied"===(r=A.v)?(o='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"===r?(o='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.')):(o="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.")),A.n=8;break;case 7:"NotFoundError"===a.name||"DevicesNotFoundError"===a.name?(o="No microphone found. Please connect a microphone and try again.",console.error("❌ AudioRecorder: No microphone device found.")):"NotReadableError"===a.name||"TrackStartError"===a.name?(o="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"!==a.name&&"PermissionDeniedError"!==a.name||(o="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."));case 8:throw(i=new Error(o)).name=a.name,i.originalError=a,this.emit("error",i),i;case 9:return A.a(2)}},A,this,[[0,5]])})),function(){return r.apply(this,arguments)})},{key:"stop",value:(o=Ze(Xe().m(function A(){var e;return Xe().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.isRecording){A.n=1;break}return A.a(2);case 1:if(A.p=1,!this.audioWorkletNode){A.n=2;break}return this.audioWorkletNode.port.postMessage({type:"flush"}),A.n=2,new Promise(function(A){return setTimeout(A,100)});case 2:if(this.mediaStream&&(this.mediaStream.getTracks().forEach(function(A){return A.stop()}),this.mediaStream=null),!this.audioContext||"closed"===this.audioContext.state){A.n=4;break}return A.n=3,this.audioContext.close();case 3:this.audioContext=null;case 4:this.audioWorkletNode=null,this.isRecording=!1,this.emit("recordingStopped"),A.n=6;break;case 5:throw A.p=5,e=A.v,this.emit("error",e),e;case 6:return A.a(2)}},A,this,[[1,5]])})),function(){return o.apply(this,arguments)})},{key:"getStatus",value:function(){return{isRecording:this.isRecording,audioContextState:this.audioContext?this.audioContext.state:"closed"}}},{key:"destroy",value:function(){this.stop()}}],n&&$e(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(ce);function rt(A){return rt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},rt(A)}function it(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return at(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,h=r[2];t>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<h&&(o=t<3||r[0]>n||n>h)&&(r[4]=t,r[5]=n,d.n=h,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,h),a=l,s=h;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(at(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,at(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,at(u,"constructor",c),at(c,"constructor",s),s.displayName="GeneratorFunction",at(c,o,"GeneratorFunction"),at(u),at(u,o,"Generator"),at(u,n,function(){return this}),at(u,"toString",function(){return"[object Generator]"}),(it=function(){return{w:r,m:d}})()}function at(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}at=function(A,e,t,n){function r(e,t){at(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},at(A,e,t,n)}function st(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function ct(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){st(r,n,o,i,a,"next",A)}function a(A){st(r,n,o,i,a,"throw",A)}i(void 0)})}}function lt(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,ut(n.key),n)}}function ut(A){var e=function(A){if("object"!=rt(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=rt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==rt(e)?e:e+""}function dt(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(dt=function(){return!!A})()}function gt(A){return gt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},gt(A)}function ht(A,e){return ht=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},ht(A,e)}var pt=function(A){function e(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(A,e,t){return e=gt(e),function(A,e){if(e&&("object"==rt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,dt()?Reflect.construct(e,t||[],gt(A).constructor):e.apply(A,t))}(this,e)).config=A,t.audioContext=null,t.audioQueue=[],t.isPlaying=!1,t.isProcessingQueue=!1,t.currentSource=null,t.audioContextReady=!1,t.initializeAudioContext().catch(function(){}),t}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&ht(A,e)}(e,A),t=e,n=[{key:"initializeAudioContext",value:(i=ct(it().m(function A(){var e,t,n,o,r,i;return it().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!this.audioContext||"closed"===this.audioContext.state){A.n=1;break}return A.a(2);case 1:if(A.p=1,e=this.config.sampleRate||this.config.outputSampleRate||44100,t={sampleRate:e},this.audioContext=new(window.AudioContext||window.webkitAudioContext)(t),"suspended"!==this.audioContext.state){A.n=2;break}return A.n=2,this.audioContext.resume();case 2:if("running"===this.audioContext.state)try{n=this.audioContext.sampleRate,o=this.audioContext.createBuffer(1,.01*n,n),(r=this.audioContext.createBufferSource()).buffer=o,r.connect(this.audioContext.destination),r.start(0),r.stop(this.audioContext.currentTime+.01)}catch(A){console.debug("AudioPlayer: AudioContext warmup skipped:",A)}this.audioContextReady=!0,A.n=4;break;case 3:A.p=3,i=A.v,console.warn("AudioPlayer: Failed to pre-initialize AudioContext:",i),this.audioContextReady=!1;case 4:return A.a(2)}},A,this,[[1,3]])})),function(){return i.apply(this,arguments)})},{key:"playAudio",value:function(A){var e=this;try{var t=this.createAudioBlob(A);if(this.audioQueue.push(t),!this.isPlaying&&!this.isProcessingQueue&&!this.currentSource){var n=this.audioContextReady?0:50;setTimeout(function(){return e.processQueue()},n)}}catch(A){this.emit("playbackError",A)}}},{key:"createAudioBlob",value:function(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"})}},{key:"processQueue",value:(r=ct(it().m(function A(){var e,t,n,o,r,i,a,s,c=this;return it().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!this.isProcessingQueue&&0!==this.audioQueue.length){A.n=1;break}return A.a(2);case 1:if(this.isProcessingQueue=!0,e=this.audioQueue.shift()){A.n=2;break}return this.isProcessingQueue=!1,A.a(2);case 2:if(A.p=2,t=!this.isPlaying&&null===this.currentSource,this.audioContext&&"closed"!==this.audioContext.state){A.n=3;break}return A.n=3,this.initializeAudioContext();case 3:if("suspended"!==(n=this.audioContext).state){A.n=5;break}return A.n=4,n.resume();case 4:if(!t){A.n=5;break}return A.n=5,new Promise(function(A){return setTimeout(A,10)});case 5:if("running"===n.state){A.n=7;break}if(console.warn("AudioPlayer: AudioContext not in running state:",n.state),"suspended"!==n.state){A.n=7;break}return A.n=6,n.resume();case 6:return A.n=7,new Promise(function(A){return setTimeout(A,10)});case 7:return A.n=8,e.arrayBuffer();case 8:return o=A.v,A.n=9,n.decodeAudioData(o);case 9:r=A.v,i=t&&!this.isPlaying&&null===this.currentSource,(a=n.createBufferSource()).buffer=r,a.connect(n.destination),this.currentSource=a,this.isPlaying=!0,i&&this.emit("playbackStarted"),a.onended=function(){c.currentSource=null,c.isProcessingQueue=!1,c.audioQueue.length>0?setTimeout(function(){return c.processQueue()},0):setTimeout(function(){0!==c.audioQueue.length||c.currentSource||(c.isPlaying=!1,c.emit("playbackStopped"))},100)},a.start(),A.n=11;break;case 10:A.p=10,s=A.v,this.currentSource=null,this.emit("playbackError",s),this.audioQueue.length>0?(this.isProcessingQueue=!1,setTimeout(function(){return c.processQueue()},100)):(this.isPlaying=!1,this.isProcessingQueue=!1,this.emit("playbackStopped"));case 11:return A.a(2)}},A,this,[[2,10]])})),function(){return r.apply(this,arguments)})},{key:"stop",value:function(){this.stopImmediate()}},{key:"stopImmediate",value:function(){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")}},{key:"resumeAudioContext",value:(o=ct(it().m(function A(){var e;return it().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.audioContext&&"closed"!==this.audioContext.state){A.n=2;break}return A.n=1,this.initializeAudioContext();case 1:return A.a(2);case 2:if("suspended"!==this.audioContext.state){A.n=6;break}return A.p=3,A.n=4,this.audioContext.resume();case 4:console.log("✅ AudioPlayer: AudioContext resumed after mic permission"),A.n=6;break;case 5:A.p=5,e=A.v,console.warn("⚠️ AudioPlayer: Failed to resume AudioContext:",e);case 6:return A.a(2)}},A,this,[[3,5]])})),function(){return o.apply(this,arguments)})},{key:"getStatus",value:function(){return{isPlaying:this.isPlaying,isProcessingQueue:this.isProcessingQueue,queueLength:this.audioQueue.length,audioContextState:this.audioContext?this.audioContext.state:"closed"}}},{key:"destroy",value:function(){this.stop(),this.audioContext&&"closed"!==this.audioContext.state&&(this.audioContext.close(),this.audioContext=null),this.audioContextReady=!1}}],n&<(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(ce),ft=t(540),Bt=t(848);function wt(A){return wt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},wt(A)}function vt(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 mt(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?vt(Object(t),!0).forEach(function(e){yt(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):vt(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function yt(A,e,t){return(e=function(A){var e=function(A){if("object"!=wt(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=wt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==wt(e)?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function Ct(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Qt(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,h=r[2];t>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<h&&(o=t<3||r[0]>n||n>h)&&(r[4]=t,r[5]=n,d.n=h,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,h),a=l,s=h;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Qt(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,Qt(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Qt(u,"constructor",c),Qt(c,"constructor",s),s.displayName="GeneratorFunction",Qt(c,o,"GeneratorFunction"),Qt(u),Qt(u,o,"Generator"),Qt(u,n,function(){return this}),Qt(u,"toString",function(){return"[object Generator]"}),(Ct=function(){return{w:r,m:d}})()}function Qt(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Qt=function(A,e,t,n){function r(e,t){Qt(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},Qt(A,e,t,n)}function bt(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Ft(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=t){var n,o,r,i,a=[],s=!0,c=!1;try{if(r=(t=t.call(A)).next,0===e){if(Object(t)!==t)return;s=!1}else for(;!(s=(n=r.call(t)).done)&&(a.push(n.value),a.length!==e);s=!0);}catch(A){c=!0,o=A}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(A,e)||function(A,e){if(A){if("string"==typeof A)return Ut(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ut(A,e):void 0}}(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ut(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}const Et=function(A){var e=A.signedUrl,t=A.websocketUrl,n=A.agentId,o=A.appId,r=A.voice,i=void 0===r?"default":r,a=A.language,s=void 0===a?"en":a,c=A.autoReconnect,l=void 0===c||c,u=A.agentSettingsOverride,d=void 0===u?null:u,g=A.onConnected,h=A.onDisconnected,p=A.onRecordingStarted,f=A.onRecordingStopped,B=A.onPlaybackStarted,w=A.onPlaybackStopped,v=A.onError,m=A.onMessage,y=A.onBargeIn,C=A.onStopPlaying,Q=A.onStartConversation,b=A.onEndConversation,F=A.className,U=void 0===F?"":F,E=A.style,S=void 0===E?{}:E,x=A.children,I=Ft((0,ft.useState)(!1),2),H=I[0],k=I[1],T=Ft((0,ft.useState)(!1),2),D=T[0],K=T[1],O=Ft((0,ft.useState)(!1),2),P=(O[0],O[1]),L=Ft((0,ft.useState)("Disconnected"),2),R=(L[0],L[1]),M=(0,ft.useRef)(null);(0,ft.useEffect)(function(){console.log("🎙️ VoiceButton: Creating VoiceSDK_v2 instance for ".concat(t||e)),M.current&&(console.log("🎙️ VoiceButton: Destroying existing VoiceSDK_v2 instance"),M.current.destroy(),M.current=null);var A=new re({signedUrl:t||e,websocketUrl:t||e,agentId:n,appId:o,voice:i,language:s,autoReconnect:l,agentSettingsOverride:d,onStartConversation:Q,onEndConversation:b});return A.on("connected",function(){k(!0),R("Connected"),null==g||g()}),A.on("disconnected",function(){k(!1),R("Disconnected"),null==h||h()}),A.on("recordingStarted",function(){K(!0),null==p||p()}),A.on("recordingStopped",function(){K(!1),null==f||f()}),A.on("playbackStarted",function(){P(!0),null==B||B()}),A.on("playbackStopped",function(){P(!1),null==w||w()}),A.on("error",function(A){null==v||v(A)}),A.on("message",function(A){null==m||m(A)}),A.on("bargeIn",function(A){null==y||y(A)}),A.on("stopPlaying",function(A){null==C||C(A)}),M.current=A,A.connect(),function(){var A=e||t;console.log("🎙️ VoiceButton: Cleaning up VoiceSDK instance for ".concat(A)),M.current&&(M.current.destroy(),M.current=null)}},[e,t,n,o,i,s,d]);var V=function(){var A,e=(A=Ct().m(function A(){var e;return Ct().w(function(A){for(;;)switch(A.p=A.n){case 0:if(M.current){A.n=1;break}return A.a(2);case 1:return A.p=1,A.n=2,M.current.toggleRecording();case 2:A.n=4;break;case 3:A.p=3,e=A.v,console.error("Error toggling recording:",e);case 4:return A.a(2)}},A,null,[[1,3]])}),function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){bt(r,n,o,i,a,"next",A)}function a(A){bt(r,n,o,i,a,"throw",A)}i(void 0)})});return function(){return e.apply(this,arguments)}}(),_=(0,Bt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,Bt.jsx)("div",{style:{fontSize:"20px"},children:D?"🔴":"🎤"}),(0,Bt.jsx)("div",{children:D?"Stop Listening":"Start Listening"})]});return(0,Bt.jsx)("button",{className:"voice-button ".concat(D?"recording":""," ").concat(U),style:mt({padding:"12px 24px",border:"none",borderRadius:"8px",backgroundColor:D?"#dc3545":"#007bff",color:"white",cursor:"pointer",fontSize:"16px",fontWeight:"500",transition:"all 0.2s ease"},S),onClick:V,disabled:!H,children:x||_})};function St(A){return St="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},St(A)}function xt(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return It(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,h=r[2];t>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<h&&(o=t<3||r[0]>n||n>h)&&(r[4]=t,r[5]=n,d.n=h,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,h),a=l,s=h;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(It(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,It(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,It(u,"constructor",c),It(c,"constructor",s),s.displayName="GeneratorFunction",It(c,o,"GeneratorFunction"),It(u),It(u,o,"Generator"),It(u,n,function(){return this}),It(u,"toString",function(){return"[object Generator]"}),(xt=function(){return{w:r,m:d}})()}function It(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}It=function(A,e,t,n){function r(e,t){It(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},It(A,e,t,n)}function Ht(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function kt(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Ht(r,n,o,i,a,"next",A)}function a(A){Ht(r,n,o,i,a,"throw",A)}i(void 0)})}}function Tt(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 Dt(A,e,t){return(e=Ot(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function Kt(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,Ot(n.key),n)}}function Ot(A){var e=function(A){if("object"!=St(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=St(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==St(e)?e:e+""}var Pt=function(){return A=function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.options=function(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?Tt(Object(t),!0).forEach(function(e){Dt(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):Tt(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}({websocketUrl:e.websocketUrl||"wss://speech.talktopc.com/ws/conv",agentId:e.agentId,voice:e.voice||"default",language:e.language||"en",container:e.container||document.body,buttonText:e.buttonText||"Start Listening",buttonClass:e.buttonClass||"voice-button"},e),this.isConnected=!1,this.isRecording=!1,this.isPlaying=!1,this.voiceSDK=new re({signedUrl:this.options.websocketUrl||this.options.signedUrl,websocketUrl:this.options.websocketUrl||this.options.signedUrl,agentId:this.options.agentId,appId:this.options.appId,voice:this.options.voice,language:this.options.language}),this.setupEventListeners(),this.createButton(),this.connect()},e=[{key:"setupEventListeners",value:function(){var A=this;this.voiceSDK.on("connected",function(){var e,t;A.isConnected=!0,A.updateButton(),null===(e=(t=A.options).onConnected)||void 0===e||e.call(t)}),this.voiceSDK.on("disconnected",function(){var e,t;A.isConnected=!1,A.updateButton(),null===(e=(t=A.options).onDisconnected)||void 0===e||e.call(t)}),this.voiceSDK.on("recordingStarted",function(){var e,t;A.isRecording=!0,A.updateButton(),null===(e=(t=A.options).onRecordingStarted)||void 0===e||e.call(t)}),this.voiceSDK.on("recordingStopped",function(){var e,t;A.isRecording=!1,A.updateButton(),null===(e=(t=A.options).onRecordingStopped)||void 0===e||e.call(t)}),this.voiceSDK.on("playbackStarted",function(){var e,t;A.isPlaying=!0,null===(e=(t=A.options).onPlaybackStarted)||void 0===e||e.call(t)}),this.voiceSDK.on("playbackStopped",function(){var e,t;A.isPlaying=!1,null===(e=(t=A.options).onPlaybackStopped)||void 0===e||e.call(t)}),this.voiceSDK.on("error",function(e){var t,n;null===(t=(n=A.options).onError)||void 0===t||t.call(n,e)}),this.voiceSDK.on("message",function(e){var t,n;null===(t=(n=A.options).onMessage)||void 0===t||t.call(n,e)}),this.voiceSDK.on("bargeIn",function(e){var t,n;null===(t=(n=A.options).onBargeIn)||void 0===t||t.call(n,e)}),this.voiceSDK.on("stopPlaying",function(e){var t,n;null===(t=(n=A.options).onStopPlaying)||void 0===t||t.call(n,e)})}},{key:"createButton",value:function(){var A=this;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",function(){return A.toggleRecording()}),this.options.container.appendChild(this.button),this.updateButton()}},{key:"updateButton",value:function(){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"}}},{key:"connect",value:(n=kt(xt().m(function A(){var e;return xt().w(function(A){for(;;)switch(A.p=A.n){case 0:return A.p=0,A.n=1,this.voiceSDK.connect();case 1:A.n=3;break;case 2:A.p=2,e=A.v,console.error("Failed to connect:",e);case 3:return A.a(2)}},A,this,[[0,2]])})),function(){return n.apply(this,arguments)})},{key:"toggleRecording",value:(t=kt(xt().m(function A(){var e;return xt().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.voiceSDK){A.n=1;break}return A.a(2);case 1:return A.p=1,A.n=2,this.voiceSDK.toggleRecording();case 2:A.n=4;break;case 3:A.p=3,e=A.v,console.error("Error toggling recording:",e);case 4:return A.a(2)}},A,this,[[1,3]])})),function(){return t.apply(this,arguments)})},{key:"getStatus",value:function(){return{isConnected:this.isConnected,isRecording:this.isRecording,isPlaying:this.isPlaying}}},{key:"updateConfig",value:function(A){this.voiceSDK.updateConfig(A)}},{key:"destroy",value:function(){this.button&&this.button.parentNode&&this.button.parentNode.removeChild(this.button),this.voiceSDK&&this.voiceSDK.destroy()}}],e&&Kt(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function Lt(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Rt(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,h=r[2];t>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<h&&(o=t<3||r[0]>n||n>h)&&(r[4]=t,r[5]=n,d.n=h,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,h),a=l,s=h;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Rt(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,Rt(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Rt(u,"constructor",c),Rt(c,"constructor",s),s.displayName="GeneratorFunction",Rt(c,o,"GeneratorFunction"),Rt(u),Rt(u,o,"Generator"),Rt(u,n,function(){return this}),Rt(u,"toString",function(){return"[object Generator]"}),(Lt=function(){return{w:r,m:d}})()}function Rt(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Rt=function(A,e,t,n){function r(e,t){Rt(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},Rt(A,e,t,n)}function Mt(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=t){var n,o,r,i,a=[],s=!0,c=!1;try{if(r=(t=t.call(A)).next,0===e){if(Object(t)!==t)return;s=!1}else for(;!(s=(n=r.call(t)).done)&&(a.push(n.value),a.length!==e);s=!0);}catch(A){c=!0,o=A}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(A,e)||_t(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Vt(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=_t(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,o=function(){};return{s:o,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){a=!0,r=A},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function _t(A,e){if(A){if("string"==typeof A)return Gt(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Gt(A,e):void 0}}function Gt(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}function Nt(A){return Nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Nt(A)}function jt(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Wt(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){jt(r,n,o,i,a,"next",A)}function a(A){jt(r,n,o,i,a,"throw",A)}i(void 0)})}}function Jt(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,Xt(n.key),n)}}function Xt(A){var e=function(A){if("object"!=Nt(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Nt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Nt(e)?e:e+""}var Yt=function(){return A=function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),console.log("🚀 AgentSDK v2.1.8 initialized with config:",e),this.config=e,this.voiceSDK=null,this.isConnected=!1,this.isListening=!1,this.wasListening=!1,this._resumeInfo=null,this.onConnected=function(){},this.onDisconnected=function(){},this.onError=function(A){return console.error("SDK Error:",A)},this.onTranscript=function(A){},this.onAgentSpeaking=function(A){},this.onConversationStart=e.onConversationStart||function(){},this.onConversationEnd=e.onConversationEnd||function(){},this.onBargeIn=e.onBargeIn||function(){},this.onAudioStartPlaying=e.onAudioStartPlaying||function(){},this.onAudioStoppedPlaying=e.onAudioStoppedPlaying||function(){},this.onSubtitleDisplay=e.onSubtitleDisplay||function(){}},e=[{key:"checkResumeBeforeConnect",value:function(){try{var A=new re({signedUrl:"wss://placeholder",autoReconnect:!1,agentId:this.config.agentId,appId:this.config.appId,language:this.config.language||"en",protocolVersion:2}).checkAndResume();return A?(console.log("🔄 [AGENT SDK] Found resume state before connect:",A),this._resumeInfo=A,A):null}catch(A){return console.warn("⚠️ [AGENT SDK] Error checking resume:",A),null}}},{key:"connect",value:(n=Wt(Lt().m(function A(e){var t,n,o,r,i,a,s=this;return Lt().w(function(A){for(;;)switch(A.p=A.n){case 0:if(A.p=0,e){A.n=1;break}throw new Error("signedUrl is required");case 1:if(this.voiceSDK&&(console.log("🔌 AgentSDK: Cleaning up existing connection"),this.voiceSDK.destroy(),this.voiceSDK=null),this.voiceSDK=new re({signedUrl:e,autoReconnect:!1,agentId:this.config.agentId,appId:this.config.appId,language:this.config.language||"en",agentSettingsOverride:this.config.agentSettingsOverride,protocolVersion:2,outputContainer:this.config.outputContainer||"raw",outputEncoding:this.config.outputEncoding||"pcm",outputSampleRate:this.config.outputSampleRate||44100,outputChannels:this.config.outputChannels||1,outputBitDepth:this.config.outputBitDepth||16}),this._resumeInfo&&(console.log("🔄 [AGENT SDK] Using stored resume info:",this._resumeInfo),console.log(" From:",this._resumeInfo.fromPage,"→ To:",this._resumeInfo.toPage)),this.voiceSDK.on("connected",function(){s.isConnected=!0,s.onConnected()}),setTimeout(function(){s.voiceSDK&&s.voiceSDK.isConnected&&!s.isConnected&&(s.isConnected=!0,s.onConnected())},10),this.voiceSDK.on("disconnected",function(A){if(s.isConnected=!1,A&&1008===A.code&&A.reason&&(A.reason.includes("Domain not whitelisted")||A.reason.includes("domain")||A.reason.includes("whitelist"))){var e=new Error("DOMAIN_NOT_WHITELISTED");e.reason=A.reason,e.code=A.code,s.onError(e)}if((s.isListening||s.wasListening)&&(console.log("🎤 [AGENT SDK] disconnected event - calling onConversationEnd hook (isListening:",s.isListening,", wasListening:",s.wasListening,")"),s.onConversationEnd&&"function"==typeof s.onConversationEnd))try{s.onConversationEnd(),console.log("🎤 [AGENT SDK] ✅ onConversationEnd hook called from disconnected event"),s.wasListening=!1}catch(A){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationEnd from disconnected:",A)}s.onDisconnected()}),this.voiceSDK.on("domainError",function(A){s.onError(A)}),this.voiceSDK.on("error",function(A){s.onError(A)}),this.voiceSDK.on("message",function(A){s.handleWebSocketMessage(A)}),this.voiceSDK.on("recordingStarted",function(){if(s.isListening=!0,s.wasListening=!0,s.onConversationStart&&"function"==typeof s.onConversationStart)try{s.onConversationStart()}catch(A){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationStart:",A)}}),this.voiceSDK.on("recordingStopped",function(){console.log("🎤 [AGENT SDK] recordingStopped event received");var A=s.isListening;if(s.isListening=!1,A&&s.onConversationEnd&&"function"==typeof s.onConversationEnd)try{console.log("🎤 [AGENT SDK] ✅ Calling onConversationEnd hook from recordingStopped"),s.onConversationEnd(),console.log("🎤 [AGENT SDK] ✅ onConversationEnd hook called successfully"),s.wasListening=!1}catch(A){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationEnd:",A)}}),this.voiceSDK.on("playbackStarted",function(){s.onAgentSpeaking(!0),s.onAudioStartPlaying()}),this.voiceSDK.on("playbackStopped",function(){s.onAgentSpeaking(!1),s.onAudioStoppedPlaying()}),this.voiceSDK.on("bargeIn",function(A){s.onBargeIn(A)}),this.voiceSDK.on("transcriptDisplay",function(A){console.log("📝 [AGENT SDK] transcriptDisplay event received:",A),A&&A.text&&(console.log("📝 [AGENT SDK] Calling onTranscript with text:",A.text),s.onTranscript&&"function"==typeof s.onTranscript?s.onTranscript(A.text):console.warn("📝 [AGENT SDK] ⚠️ onTranscript is not a function!",Nt(s.onTranscript))),s.onSubtitleDisplay(A)}),this._pendingToolHandlers&&this._pendingToolHandlers.size>0){console.log("🔧 AgentSDK: Registering ".concat(this._pendingToolHandlers.size," pending tool handlers")),t=Vt(this._pendingToolHandlers);try{for(t.s();!(n=t.n()).done;)o=Mt(n.value,2),r=o[0],i=o[1],this.voiceSDK.registerToolHandler(r,i)}catch(A){t.e(A)}finally{t.f()}}return A.n=2,this.voiceSDK.connect();case 2:A.n=4;break;case 3:throw A.p=3,a=A.v,this.onError(a),a;case 4:return A.a(2)}},A,this,[[0,3]])})),function(A){return n.apply(this,arguments)})},{key:"handleWebSocketMessage",value:function(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"))}}},{key:"startListening",value:(t=Wt(Lt().m(function A(){var e;return Lt().w(function(A){for(;;)switch(A.p=A.n){case 0:if(console.log("🎤 AgentSDK: startListening() called"),!this.voiceSDK){A.n=5;break}return A.p=1,console.log("🎤 AgentSDK: Starting recording..."),A.n=2,this.voiceSDK.startRecording();case 2:console.log("✅ AgentSDK: Recording started successfully"),A.n=4;break;case 3:throw A.p=3,e=A.v,console.error("❌ AgentSDK: Failed to start recording:",e),e;case 4:A.n=6;break;case 5:throw console.error("❌ AgentSDK: No voiceSDK instance available"),new Error("No voiceSDK instance available");case 6:return A.a(2)}},A,this,[[1,3]])})),function(){return t.apply(this,arguments)})},{key:"stopListening",value:function(){this.voiceSDK&&this.voiceSDK.stopRecording()}},{key:"hangup",value:function(){this.voiceSDK&&this.voiceSDK.hangup()}},{key:"updateVariables",value:function(A){this.voiceSDK&&this.isConnected&&this.voiceSDK.sendMessage({t:"update_variables",variables:A})}},{key:"disconnect",value:function(){this.voiceSDK&&(this.voiceSDK.destroy(),this.voiceSDK=null),this.isConnected=!1,this.isListening=!1}},{key:"registerToolHandler",value:function(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"))}},{key:"unregisterToolHandler",value:function(A){if(this.voiceSDK)return this.voiceSDK.unregisterToolHandler(A);this._pendingToolHandlers&&this._pendingToolHandlers.delete(A)}},{key:"hasToolHandler",value:function(A){var e;return this.voiceSDK?this.voiceSDK.hasToolHandler(A):(null===(e=this._pendingToolHandlers)||void 0===e?void 0:e.has(A))||!1}},{key:"getRegisteredTools",value:function(){return this.voiceSDK?this.voiceSDK.getRegisteredTools():this._pendingToolHandlers?Array.from(this._pendingToolHandlers.keys()):[]}}],e&&Jt(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function zt(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Zt(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,h=r[2];t>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<h&&(o=t<3||r[0]>n||n>h)&&(r[4]=t,r[5]=n,d.n=h,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,h),a=l,s=h;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Zt(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,Zt(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Zt(u,"constructor",c),Zt(c,"constructor",s),s.displayName="GeneratorFunction",Zt(c,o,"GeneratorFunction"),Zt(u),Zt(u,o,"Generator"),Zt(u,n,function(){return this}),Zt(u,"toString",function(){return"[object Generator]"}),(zt=function(){return{w:r,m:d}})()}function Zt(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Zt=function(A,e,t,n){function r(e,t){Zt(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},Zt(A,e,t,n)}function qt(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function $t(){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),r=/Chrome/.test(A)&&!/Edg|OPR/.test(A),i=/Safari/.test(A)&&!/Chrome/.test(A),a=/Firefox/.test(A),s=/Edg/.test(A),c=/SamsungBrowser/.test(A),l="unknown";e?l="safari":c?l="samsung":r?l="chrome":i?l="safari":a?l="firefox":s&&(l="edge");var u="unknown";return e?u="ios":t?u="android":n?u="mac":o&&(u="windows"),{platform:u,browser:l,isIOS:e,isAndroid:t,isMac:n,isWindows:o,isMobile:e||t,isDesktop:!e&&!t}}function An(){return en.apply(this,arguments)}function en(){var A;return A=zt().m(function A(){var e;return zt().w(function(A){for(;;)switch(A.p=A.n){case 0:if(A.p=0,!navigator.permissions||!navigator.permissions.query){A.n=2;break}return A.n=1,navigator.permissions.query({name:"microphone"});case 1:return e=A.v,A.a(2,e.state);case 2:A.n=4;break;case 3:A.p=3,A.v,console.log("⚠️ MicPermissionUtils: Permissions API not available or not supported for microphone");case 4:return A.a(2,"unknown")}},A,null,[[0,3]])}),en=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){qt(r,n,o,i,a,"next",A)}function a(A){qt(r,n,o,i,a,"throw",A)}i(void 0)})},en.apply(this,arguments)}function tn(A){var e=A.platform,t=A.browser,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 nn(A){var e=A.isIOS,t=A.isAndroid,n=A.browser;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}function on(A){return on="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},on(A)}function rn(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,an(n.key),n)}}function an(A){var e=function(A){if("object"!=on(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=on(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==on(e)?e:e+""}function sn(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=function(A,e){if(A){if("string"==typeof A)return cn(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?cn(A,e):void 0}}(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,o=function(){};return{s:o,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){a=!0,r=A},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function cn(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}var ln=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.overlay=null,this.modal=null},(e=[{key:"createOverlay",value:function(){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}},{key:"injectStyles",value:function(){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)}}},{key:"close",value:function(){this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.overlay=null,this.modal=null}},{key:"show",value:function(){this.overlay&&this.modal&&document.body.appendChild(this.overlay)}}])&&rn(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function un(A,e){var t=new ln,n=t.createOverlay(),o=$t(),r=document.createElement("div");return r.className="mic-permission-modal",r.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(r),t.overlay=n,t.modal=r,r.querySelector('[data-action="accept"]').addEventListener("click",function(){t.close(),A()}),r.querySelector('[data-action="cancel"]').addEventListener("click",function(){t.close(),e()}),n.addEventListener("click",function(A){A.target===n&&(t.close(),e())}),t.show(),t}function dn(A,e){var t,n,o,r=new ln,i=r.createOverlay(),a=$t(),s=tn(a),c=document.createElement("div");c.className="mic-permission-modal";var l="";s.altSteps&&s.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(s.altTitle||"Alternative method",'\n </button>\n <ol style="margin: 0; padding-left: 20px; display: none;">\n ').concat(s.altSteps.map(function(A){return'<li style="padding: 8px 0; font-size: 14px; color: #6b7280;">'.concat(A,"</li>")}).join(""),"\n </ol>\n </div>\n "));var u=function(A){var e,t=A.platform,n=A.browser,o=document.getElementsByTagName("script"),r="",i=sn(o);try{for(i.s();!(e=i.n()).done;){var a=e.value.src;if(a&&(a.includes("agent-widget.js")||a.includes("ttp-agent-sdk")||a.includes("ttp-sdk-front")))try{new URL(a),r=a.substring(0,a.lastIndexOf("/"));break}catch(A){var s=a.match(/^(.*\/)[^\/]+$/);if(s){r=s[1];break}}}}catch(A){i.e(A)}finally{i.f()}var c;if(c="ios"===t?"ios-settings.svg":"android"===t?"android-chrome.svg":"chrome"===n?"desktop-chrome.svg":"safari"===n?"desktop-safari.svg":"firefox"===n?"desktop-firefox.svg":"edge"===n?"desktop-edge.svg":"desktop-chrome.svg",!r||""===r||r.startsWith("/")){var l,u=sn(o);try{for(u.s();!(l=u.n()).done;){var d=l.value.src;if(d&&(d.includes("cdn.talktopc.com")||d.includes("talktopc.com"))){if(d.includes("/ttp-agent-sdk/")||d.includes("/ttp-sdk-front/")){var g=d.match(/(https?:\/\/[^\/]+(?:\/[^\/]+)*)/);if(g){r=g[1].replace(/\/[^\/]+\.js$/,"");break}}if(!r&&(d.includes("cdn.talktopc.com")||d.includes("talktopc.com"))){r="https://cdn.talktopc.com/ttp-agent-sdk";break}}}}catch(A){u.e(A)}finally{u.f()}if(!r||""===r)if(window.location.hostname.includes("cdn.talktopc.com")||window.location.hostname.includes("talktopc.com"))r="https://cdn.talktopc.com/ttp-agent-sdk";else{var h=window.location.pathname.split("/");h.pop(),(r=window.location.origin+h.join("/"))&&r!==window.location.origin||(r=window.location.origin)}}r=r.replace(/\/$/,"");var p="".concat(r,"/shared/mic-permission-assets/").concat(c);return"undefined"!=typeof console&&console.log&&console.log("[MicPermission] Visual guide path:",p,"Base path:",r,"Platform:",t,"Browser:",n),p}(a);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(s.icon,'</span>\n <h2 class="mic-permission-modal__title" style="text-align: left; margin: 0;">').concat(s.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(s.note?'\n <div class="mic-permission-modal__note">\n <span>ℹ️</span>\n <span>'.concat(s.note,"</span>\n </div>\n "):"",'\n <div class="mic-permission-modal__visual-guide-container">\n <img src="').concat(u,'" 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(s.steps.map(function(A){return"<li>".concat(A,"</li>")}).join(""),"\n </ol>\n </div>\n ").concat(l,'\n <div class="mic-permission-modal__actions">\n ').concat(s.canOpenSettings?'\n <button class="mic-permission-modal__btn mic-permission-modal__btn--primary" data-action="open-settings">\n '.concat(s.settingsButtonText||"Open Settings","\n </button>\n "):"","\n ").concat(s.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 '),i.appendChild(c),r.overlay=i,r.modal=c,null===(t=c.querySelector('[data-action="close"]'))||void 0===t||t.addEventListener("click",function(){r.close(),A()}),null===(n=c.querySelector('[data-action="open-settings"]'))||void 0===n||n.addEventListener("click",function(){nn(a)}),null===(o=c.querySelector('[data-action="refresh"]'))||void 0===o||o.addEventListener("click",function(){window.location.reload()});var d=c.querySelector('[data-action="show-hint"]');d&&d.addEventListener("click",function(){r.close(),A(),function(){var A=document.getElementById("mic-address-bar-hint");A&&A.remove(),$t();var e,t=document.getElementsByTagName("script"),n="",o=sn(t);try{for(o.s();!(e=o.n()).done;){var r=e.value.src;if(r&&(r.includes("agent-widget.js")||r.includes("ttp-agent-sdk")||r.includes("ttp-sdk-front")))try{new URL(r),n=r.substring(0,r.lastIndexOf("/"));break}catch(A){var i=r.match(/^(.*\/)[^\/]+$/);if(i){n=i[1];break}}}}catch(A){o.e(A)}finally{o.f()}if(!n||""===n||n.startsWith("/")){var a,s=sn(t);try{for(s.s();!(a=s.n()).done;){var c=a.value.src;if(c&&(c.includes("cdn.talktopc.com")||c.includes("talktopc.com"))){if(c.includes("/ttp-agent-sdk/")||c.includes("/ttp-sdk-front/")){var l=c.match(/(https?:\/\/[^\/]+(?:\/[^\/]+)*)/);if(l){n=l[1].replace(/\/[^\/]+\.js$/,"");break}}if(!n&&(c.includes("cdn.talktopc.com")||c.includes("talktopc.com"))){n="https://cdn.talktopc.com/ttp-agent-sdk";break}}}}catch(A){s.e(A)}finally{s.f()}if(!n||""===n)if(window.location.hostname.includes("cdn.talktopc.com")||window.location.hostname.includes("talktopc.com"))n="https://cdn.talktopc.com/ttp-agent-sdk";else{var u=window.location.pathname.split("/");u.pop(),(n=window.location.origin+u.join("/"))&&n!==window.location.origin||(n=window.location.origin)}}n=n.replace(/\/$/,"");var d="".concat(n,"/shared/mic-permission-assets/address-bar-hint.svg"),g=document.createElement("div");g.id="mic-address-bar-hint",g.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 h=document.createElement("div");h.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 p=document.createElement("div");p.style.cssText="\n flex-shrink: 0;\n ";var f=document.createElement("img");f.src=d,f.alt="Address bar hint",f.style.cssText="\n width: auto;\n height: 80px;\n display: block;\n ",f.onerror=function(){p.style.display="none"},p.appendChild(f);var B=document.createElement("div");B.style.cssText="\n display: flex;\n flex-direction: column;\n gap: 4px;\n flex: 1;\n ";var w=document.createElement("div");w.style.cssText="\n font-size: 15px;\n font-weight: 500;\n ",w.innerHTML="Click the <strong>lock icon 🔒</strong>, <strong>information icon ℹ️</strong>, or <strong>settings icon ⋮</strong> in the address bar to enable microphone";var v=document.createElement("button");if(v.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 ",v.textContent="✕",v.addEventListener("click",function(){g.remove()}),v.addEventListener("mouseenter",function(){v.style.background="rgba(255, 255, 255, 0.3)"}),v.addEventListener("mouseleave",function(){v.style.background="rgba(255, 255, 255, 0.2)"}),!document.getElementById("mic-address-bar-hint-styles")){var m=document.createElement("style");m.id="mic-address-bar-hint-styles",m.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(m)}B.appendChild(w),h.appendChild(p),h.appendChild(B),h.appendChild(v),g.appendChild(h),document.body.appendChild(g),setTimeout(function(){g.parentNode&&(g.style.opacity="0",g.style.transition="opacity 0.3s ease-out",setTimeout(function(){g.parentNode&&g.remove()},300))},1e4)}()});var g=c.querySelector(".mic-permission-modal__alt-toggle");if(g&&s.altSteps){var h=g.nextElementSibling;h&&(h.style.display="none",g.addEventListener("click",function(){"none"===h.style.display?(h.style.display="block",g.innerHTML="▼ ".concat(s.altTitle||"Alternative method")):(h.style.display="none",g.innerHTML="▶ ".concat(s.altTitle||"Alternative method"))}))}return i.addEventListener("click",function(e){e.target===i&&(r.close(),A())}),r.show(),r}function gn(A){var e=new ln,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",function(){window.location.reload()}),n.querySelector('[data-action="close"]').addEventListener("click",function(){e.close(),A()}),t.addEventListener("click",function(n){n.target===t&&(e.close(),A())}),e.show(),e}function hn(A){return hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},hn(A)}function pn(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return fn(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,h=r[2];t>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<h&&(o=t<3||r[0]>n||n>h)&&(r[4]=t,r[5]=n,d.n=h,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,h),a=l,s=h;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(fn(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,fn(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,fn(u,"constructor",c),fn(c,"constructor",s),s.displayName="GeneratorFunction",fn(c,o,"GeneratorFunction"),fn(u),fn(u,o,"Generator"),fn(u,n,function(){return this}),fn(u,"toString",function(){return"[object Generator]"}),(pn=function(){return{w:r,m:d}})()}function fn(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}fn=function(A,e,t,n){function r(e,t){fn(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},fn(A,e,t,n)}function Bn(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function wn(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Bn(r,n,o,i,a,"next",A)}function a(A){Bn(r,n,o,i,a,"throw",A)}i(void 0)})}}function vn(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,mn(n.key),n)}}function mn(A){var e=function(A){if("object"!=hn(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=hn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==hn(e)?e:e+""}var yn=function(){return A=function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.config=e,this.audioStream=null,this.callStartTime=null,this.callTimerInterval=null,this.sdk=null,this.isActive=!1,this.shadowRoot=e.shadowRoot||document,this.sdk=new Yt({agentId:e.agentId,appId:e.appId,signedUrl:e.signedUrl,agentSettingsOverride:e.agentSettingsOverride,variables:e.variables||{},language:e.language||"en",outputContainer:e.outputContainer,outputEncoding:e.outputEncoding,outputSampleRate:e.outputSampleRate,outputChannels:e.outputChannels,outputBitDepth:e.outputBitDepth,onConversationStart:e.onConversationStart,onConversationEnd:e.onConversationEnd,onBargeIn:e.onBargeIn,onAudioStartPlaying:e.onAudioStartPlaying,onAudioStoppedPlaying:e.onAudioStoppedPlaying,onSubtitleDisplay:e.onSubtitleDisplay}),this.setupSDKEventHandlers(),this.checkAndHandleResume()},e=[{key:"checkAndHandleResume",value:function(){if(this._resumeInfo)return console.log("🔄 [VOICE INTERFACE] Returning cached resume info:",this._resumeInfo),this._resumeInfo;var A=this.sdk.checkResumeBeforeConnect();return A?(console.log("🔄 [WIDGET] Auto-resuming call:",A),console.log(" From:",A.fromPage,"→ To:",A.toPage),this._resumeInfo=A,this.config.onResume&&this.config.onResume(A),A):null}},{key:"setupSDKEventHandlers",value:function(){var A=this;this.sdk.onTranscript=function(e){console.log("📝 [VOICE INTERFACE] onTranscript called with text:",e),A.updateTranscript(e)},this.sdk.onAgentSpeaking=function(e){var t=A.shadowRoot.getElementById("voiceAvatarActive");t&&(e?t.classList.add("speaking"):t.classList.remove("speaking"))},this.sdk.onDisconnected=function(){console.log("🔌 WebSocket disconnected, hanging up call..."),A.isActive&&(A.isActive=!1,A.endVoiceCall())},this.sdk.onError=function(e){console.error("❌ Voice SDK Error:",e),e&&("DOMAIN_NOT_WHITELISTED"===e.message||e.message&&e.message.includes("Domain not whitelisted"))?A.showDomainError():A.showError(e.message||e)}}},{key:"t",value:function(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}},{key:"getText",value:function(A,e){return void 0!==this.config[A]&&null!==this.config[A]?this.config[A]:this.t(e)}},{key:"getTooltip",value:function(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]||""}},{key:"generateHTML",value:function(){return'<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 --\x3e\n <div id="voiceActiveState" style="display: none;">\n <div class="voice-avatar-active" id="voiceAvatarActive">\n <div class="voice-rings">\n <div class="voice-ring"></div>\n <div class="voice-ring"></div>\n <div class="voice-ring"></div>\n </div>\n 🤖\n </div>\n <div class="voice-status">\n <div class="voice-status-title" id="voiceStatusTitleActive">').concat(this.t("listening"),'</div>\n <div class="voice-status-subtitle" id="voiceStatusSubtitleActive">').concat(this.t("speakFreely"),'</div>\n </div>\n <div class="voice-transcript">\n <div class="transcript-label">').concat(this.t("liveTranscript"),'</div>\n <div class="transcript-text empty" id="transcriptText">\n ').concat(this.t("transcriptWillAppear"),'\n </div>\n </div>\n <div class="voice-controls">\n <button class="voice-control-btn secondary" id="muteBtn" title="').concat(this.getTooltip("mute"),'">\n <svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mute-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 <line x1="8" y1="23" x2="16" y2="23"/>\n <line x1="2" y1="2" x2="22" y2="22" class="mute-cross" style="display: none; stroke: #ef4444; stroke-width: 3.5;"/>\n </svg>\n </button>\n <button class="voice-control-btn primary active" id="endCallBtn" title="').concat(this.getTooltip("endCall"),'">\n <svg width="56" height="56" viewBox="0 0 24 24" fill="#ef4444">\n <rect x="6" y="6" width="12" height="12" rx="2"/>\n </svg>\n <div class="voice-timer" id="voiceTimer">00:00</div>\n </button>\n <button class="voice-control-btn secondary" id="speakerBtn" title="').concat(this.getTooltip("speaker"),'">\n <svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\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 0 1 0 14.14"/>\n <path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>\n </svg>\n </button>\n </div>\n </div>\n </div>')}},{key:"generateCSS",value:function(){var A=this.config.avatarBackgroundColor||"#667eea",e=this.config.avatarActiveBackgroundColor||this.config.avatarBackgroundColor||"#667eea",t=this.config.statusTitleColor||"#1e293b",n=this.config.statusSubtitleColor||"#64748b",o=this.config.startCallButtonColor||"#667eea",r=this.config.startCallButtonTextColor||"#FFFFFF",i=this.config.transcriptBackgroundColor||"#FFFFFF",a=this.config.transcriptTextColor||"#1e293b",s=this.config.transcriptLabelColor||"#94a3b8",c=this.config.controlButtonColor||"#FFFFFF",l=this.config.controlButtonSecondaryColor||"#64748b",u=(this.config.endCallButtonColor,!1===this.config.useShadowDOM?" !important":"");return"\n /* Voice Interface Styles - Ultra-compact for Wix iframes */\n .voice-interface { \n display: none".concat(u,"; \n flex: 1; \n flex-direction: column;\n align-items: center; \n justify-content: center; \n padding: 6px 10px 6px 10px; \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(u,'; }\n \n /* Voice States - Better scaling gaps */\n #voiceIdleState,\n #voiceActiveState {\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[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(A," 0%, ").concat(e," 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: 1;\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: 1;\n min-height: 0;\n }\n \n .voice-status-title {\n font-size: clamp(12px, 3vh, 20px);\n font-weight: 600;\n color: ").concat(t,";\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(n,";\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);\n height: clamp(48px, 8vh, 64px);\n border-radius: clamp(24px, 4vh, 32px);\n border: none;\n background: ").concat(o,";\n color: ").concat(r,";\n font-size: clamp(14px, 2.5vh, 18px);\n font-weight: 600;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\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 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 \n /* Voice Transcript - Scales with container */\n .voice-transcript {\n background: ").concat(i,";\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(100px, 18vh, 140px);\n max-height: clamp(120px, 22vh, 160px);\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(s,";\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(a,";\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 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: clamp(5px, 1.2vh, 10px);\n }\n \n .voice-control-btn {\n width: clamp(48px, 9vh, 72px);\n height: clamp(48px, 9vh, 72px);\n aspect-ratio: 1;\n border-radius: 50%;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s;\n position: relative;\n flex-shrink: 0;\n }\n \n .voice-control-btn svg {\n width: 48%;\n height: 48%;\n }\n \n .voice-control-btn.primary {\n width: clamp(54px, 10vh, 80px);\n height: clamp(54px, 10vh, 80px);\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\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: white;\n animation: recordingPulse 1.5s ease-in-out infinite;\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(c,";\n color: ").concat(l,";\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);\n }\n \n .voice-control-btn.secondary:hover {\n background: #f8fafc;\n transform: scale(1.05);\n }\n \n .voice-control-btn.secondary.muted {\n background: #f3f4f6;\n }\n \n .voice-control-btn.secondary.muted .mute-icon {\n stroke: #9ca3af !important;\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 /* 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 ")}},{key:"setupEventHandlers",value:function(A){var e=this,t=this.shadowRoot.getElementById("startCallBtn"),n=this.shadowRoot.getElementById("endCallBtn"),o=this.shadowRoot.getElementById("muteBtn"),r=this.shadowRoot.getElementById("speakerBtn");t&&(t.onclick=function(){return e.startVoiceCall()}),n&&(n.onclick=function(){return e.endVoiceCall()}),o&&(o.onclick=function(){return e.toggleMute()}),r&&(r.onclick=function(){return e.toggleSpeaker()});var i=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=e.shadowRoot.getElementById("voiceInterface");t&&t.classList.contains("active")&&t.clientHeight>100?(console.log("✅ Interface is active and has proper dimensions, adjusting sizes (attempt",A+1,")"),e.adjustSizesForContainer(),0===A&&setTimeout(function(){return e.adjustSizesForContainer()},500)):A<15?(console.log("⏳ Interface not ready yet (height:",null==t?void 0:t.clientHeight,"), retrying... (attempt",A+1,")"),setTimeout(function(){return i(A+1)},250)):(console.warn("⚠️ Interface never became fully ready, adjusting sizes anyway"),e.adjustSizesForContainer())};setTimeout(function(){return i()},200),window.addEventListener("resize",function(){console.log("🔄 Window resized, re-adjusting sizes"),e.adjustSizesForContainer()})}},{key:"getSignedUrl",value:(o=wn(pn().m(function A(){var e,t;return pn().w(function(A){for(;;)switch(A.n){case 0:if(!this.config.signedUrl){A.n=1;break}return A.a(2,this.config.signedUrl);case 1:if(this.config.agentId){A.n=2;break}throw new Error("agentId is required when signedUrl is not provided");case 2:return e=this.config.websocketUrl||"wss://speech.talktopc.com/ws/conv",(t=new URLSearchParams).append("agentId",this.config.agentId),this.config.appId&&t.append("appId",this.config.appId),!1!==this.config.demo&&t.append("demo","true"),A.a(2,"".concat(e,"?").concat(t.toString()))}},A,this)})),function(){return o.apply(this,arguments)})},{key:"adjustSizesForContainer",value:function(){var A=this.shadowRoot.getElementById("voiceInterface");if(A){var e=A.clientHeight,t=A.clientWidth;console.log("📏 Container size:",e,"x",t);var n,o,r,i,a,s,c,l,u,d=this.shadowRoot.getElementById("voiceIdleState"),g=this.shadowRoot.getElementById("voiceActiveState"),h=d&&"none"!==d.style.display,p=g&&"none"!==g.style.display;console.log("👁️ Visible state - Idle:",h,"Active:",p),e<=350?(u=5,n=70,o=35,r=11,i=9,a=32,s=100,c=42,l=48):e<=450?(u=7,n=110,o=55,r=15,i=11,a=38,s=110,c=52,l=58):e<=550?(u=8,n=140,o=70,r=16,i=12,a=42,s=120,c=56,l=64):e<=700?(u=10,n=130,o=65,r=18,i=13,a=46,s=130,c=60,l=70):(u=12,n=150,o=75,r=20,i=14,a=50,s=140,c=66,l=76),this.shadowRoot.querySelectorAll("#voiceIdleState, #voiceActiveState").forEach(function(A){A.style.gap="".concat(u,"px")});var f=this.shadowRoot.querySelectorAll(".voice-avatar, .voice-avatar-active");console.log("🤖 Found",f.length,"avatars, setting size to",n,"px"),f.forEach(function(A){A.style.width="".concat(n,"px"),A.style.height="".concat(n,"px"),A.style.fontSize="".concat(o,"px")}),this.shadowRoot.querySelectorAll(".voice-status-title").forEach(function(A){return A.style.fontSize="".concat(r,"px")}),this.shadowRoot.querySelectorAll(".voice-status-subtitle").forEach(function(A){return A.style.fontSize="".concat(i,"px")});var B=this.shadowRoot.querySelector(".voice-transcript");B&&(B.style.minHeight="".concat(s,"px"),B.style.maxHeight="".concat(s,"px"),B.style.height="".concat(s,"px"),B.style.width="min(360px, ".concat(t-40,"px)"),B.style.boxSizing="border-box");var w=this.shadowRoot.querySelector(".transcript-label");w&&(w.style.fontSize="".concat(Math.max(8,r-4),"px"));var v=this.shadowRoot.querySelector(".transcript-text");v&&(v.style.fontSize="".concat(Math.max(10,r-2),"px")),this.shadowRoot.querySelectorAll(".voice-control-btn.secondary").forEach(function(A){A.style.width="".concat(c,"px"),A.style.height="".concat(c,"px");var e=A.querySelector("svg");if(e){var t=.65*c;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 m=this.shadowRoot.querySelector(".voice-control-btn.primary");if(m){m.style.width="".concat(l,"px"),m.style.height="".concat(l,"px");var y=m.querySelector("svg");if(y){var C=.7*l;y.style.setProperty("width","".concat(C,"px"),"important"),y.style.setProperty("height","".concat(C,"px"),"important"),y.style.setProperty("min-width","".concat(C,"px"),"important"),y.style.setProperty("min-height","".concat(C,"px"),"important")}}var Q=this.shadowRoot.querySelector(".start-call-btn");if(Q){var b,F;e<=350?(b=48,F=14):e<=450?(b=52,F=15):e<=550?(b=58,F=17):e<=700?(b=62,F=18):(b=64,F=18),Q.style.height="".concat(b,"px"),Q.style.fontSize="".concat(F,"px");var U=Q.querySelector("svg");if(U){var E=Math.max(22,.5*b);U.style.width="".concat(E,"px"),U.style.height="".concat(E,"px")}}console.log("✅ Sizes adjusted - Avatar:",n,"Status:",a,"Transcript:",s,"Buttons:",c)}else console.warn("⚠️ voiceInterface not found, skipping size adjustment")}},{key:"startVoiceCall",value:(n=wn(pn().m(function A(){var e,t=this;return pn().w(function(A){for(;;)switch(A.n){case 0:if(!this.isActive){A.n=1;break}return console.log("⚠️ Voice call already active"),A.a(2);case 1:return console.log("🎤 Starting voice call..."),A.n=2,An();case 2:if(e=A.v,console.log("📋 Current permission state: ".concat(e)),"denied"!==e){A.n=3;break}return console.log("🚫 Permission is denied, showing blocked modal..."),$t(),dn(function(){console.log("Blocked modal closed")}),A.a(2);case 3:if("prompt"!==e&&"unknown"!==e){A.n=4;break}return console.log("📋 Permission is in prompt state, showing pre-prompt modal..."),A.a(2,new Promise(function(A){un(wn(pn().m(function e(){return pn().w(function(e){for(;;)switch(e.n){case 0:return console.log("✅ Pre-prompt accepted, proceeding with voice call..."),e.n=1,t.proceedWithVoiceCall();case 1:A();case 2:return e.a(2)}},e)})),function(){console.log("❌ Pre-prompt cancelled"),A()})}));case 4:return A.n=5,this.proceedWithVoiceCall();case 5:return A.a(2)}},A,this)})),function(){return n.apply(this,arguments)})},{key:"proceedWithVoiceCall",value:(t=wn(pn().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d=this;return pn().w(function(A){for(;;)switch(A.p=A.n){case 0:return A.p=0,e=this.shadowRoot.getElementById("voiceIdleState"),t=this.shadowRoot.getElementById("voiceActiveState"),n=this.shadowRoot.getElementById("voiceInterface"),e&&(e.style.display="none"),t&&(t.style.display="flex"),setTimeout(function(){return d.adjustSizesForContainer()},50),n&&(n.scrollTop=0),o=$t(),A.n=1,An();case 1:if(r=A.v,!o.isMobile||"granted"===r){A.n=5;break}return console.log("📱 Mobile device detected - requesting mic permission before connecting..."),console.log("📋 Current permission state: ".concat(r)),A.p=2,i=this.config.outputSampleRate||44100,A.n=3,navigator.mediaDevices.getUserMedia({audio:{sampleRate:i,channelCount:1,echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});case 3:A.v.getTracks().forEach(function(A){return A.stop()}),console.log("✅ Microphone permission granted on mobile - proceeding with connection"),A.n=5;break;case 4:return A.p=4,A.v,console.log("🚫 Permission denied on mobile, showing blocked modal..."),dn(function(){d.resetUIState()}),A.a(2);case 5:return A.n=6,this.getSignedUrl();case 6:if(a=A.v,console.log("🔗 Got signed URL:",a),!this.sdk||!this.sdk.isConnected){A.n=10;break}return console.log("🔄 SDK already connected, disconnecting for clean retry..."),A.p=7,this.sdk.disconnect(),A.n=8,new Promise(function(A){return setTimeout(A,100)});case 8:A.n=10;break;case 9:A.p=9,l=A.v,console.warn("Warning: Error disconnecting existing connection:",l);case 10:return A.n=11,this.sdk.connect(a);case 11:s=A.v,console.log("✅ Connected to WebSocket, connected:",s),c=0;case 12:if(!(c<50)){A.n=15;break}if(!this.sdk.isConnected){A.n=13;break}if(!(this.sdk.voiceSDK&&this.sdk.voiceSDK.isConnected&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN)){A.n=13;break}return A.a(3,15);case 13:return A.n=14,new Promise(function(A){return setTimeout(A,100)});case 14:c++,A.n=12;break;case 15:if(!(this.sdk.isConnected&&this.sdk.voiceSDK&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN)){A.n=17;break}return console.log("✅ WebSocket ready, starting listening..."),A.n=16,this.sdk.startListening();case 16:console.log("🎤 Started listening"),this.isActive=!0,this.callStartTime=Date.now(),this.callTimerInterval=setInterval(function(){var A=Date.now()-d.callStartTime,e=Math.floor(A/6e4),t=Math.floor(A%6e4/1e3),n=d.shadowRoot.getElementById("voiceTimer");n&&(n.textContent="".concat(e.toString().padStart(2,"0"),":").concat(t.toString().padStart(2,"0")))},1e3),A.n=19;break;case 17:return console.warn("⚠️ Connection not fully ready, but trying to start listening anyway..."),A.n=18,this.sdk.startListening();case 18:console.log("🎤 Started listening"),this.isActive=!0,this.callStartTime=Date.now(),this.callTimerInterval=setInterval(function(){var A=Date.now()-d.callStartTime,e=Math.floor(A/6e4),t=Math.floor(A%6e4/1e3),n=d.shadowRoot.getElementById("voiceTimer");n&&(n.textContent="".concat(e.toString().padStart(2,"0"),":").concat(t.toString().padStart(2,"0")))},1e3);case 19:console.log("✅ Voice call started successfully"),A.n=21;break;case 20:if(A.p=20,u=A.v,console.error("❌ Error starting voice call:",u),this.isActive=!1,this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null),this.sdk&&this.sdk.isConnected)try{this.sdk.disconnect()}catch(A){console.warn("Error disconnecting SDK on error:",A)}"NotAllowedError"===u.name||"PermissionDeniedError"===u.name?($t(),dn(function(){d.resetUIState()})):"NotFoundError"===u.name||"DevicesNotFoundError"===u.name?gn(function(){d.resetUIState()}):(this.showError(u.message||u),this.resetUIState());case 21:return A.a(2)}},A,this,[[7,9],[2,4],[0,20]])})),function(){return t.apply(this,arguments)})},{key:"resetUIState",value:function(){var A=this.shadowRoot.getElementById("voiceIdleState"),e=this.shadowRoot.getElementById("voiceActiveState");A&&(A.style.display="flex"),e&&(e.style.display="none")}},{key:"endVoiceCall",value:function(){var A=this;console.log("🔴 Ending voice call..."),this.sdk&&this.isActive&&(this.sdk.stopListening(),this.sdk.hangup(),this.isActive=!1),this.audioStream&&(this.audioStream.getTracks().forEach(function(A){return A.stop()}),this.audioStream=null),this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null);var e=this.shadowRoot.getElementById("voiceIdleState"),t=this.shadowRoot.getElementById("voiceActiveState");e&&(e.style.display="flex"),t&&(t.style.display="none"),setTimeout(function(){return A.adjustSizesForContainer()},50);var n=this.shadowRoot.getElementById("transcriptText");n&&(n.textContent=this.t("transcriptWillAppear"),n.classList.add("empty"));var o=this.shadowRoot.getElementById("voiceAvatarActive");o&&o.classList.remove("speaking"),console.log("✅ Voice call ended")}},{key:"updateTranscript",value:function(A){console.log("📝 [VOICE INTERFACE] updateTranscript called with text:",A);var e=this.shadowRoot.getElementById("transcriptText");e?(console.log("📝 [VOICE INTERFACE] Found transcript element, updating text"),e.textContent=A,e.classList.remove("empty")):console.warn("📝 [VOICE INTERFACE] ⚠️ transcriptText element not found!")}},{key:"showError",value:function(A){var e=this.shadowRoot.getElementById("transcriptText");e&&(e.textContent="".concat(this.t("error"),": ").concat(A),e.classList.remove("empty"))}},{key:"showDomainError",value:function(){var A=this.shadowRoot.getElementById("transcriptText");if(A){var e=this.t("domainNotValidated"),t=this.t("domainErrorMessage");A.innerHTML='<div style="font-weight: 600; font-size: 16px; margin-bottom: 8px; color: #991B1B;">'.concat(e,'</div><div style="font-size: 14px; color: #991B1B; line-height: 1.5;">').concat(t,"</div>"),A.classList.remove("empty")}}},{key:"toggleMute",value:function(){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;var e=this.shadowRoot.getElementById("muteBtn"),t=null==e?void 0:e.querySelector(".mute-icon"),n=null==e?void 0:e.querySelector(".mute-cross");e&&t&&n&&(A.enabled?(t.style.stroke="",n.style.display="none",e.classList.remove("muted")):(t.style.stroke="#9ca3af",n.style.display="block",e.classList.add("muted"))),console.log(A.enabled?"🔊 Unmuted":"🔇 Muted")}else console.warn("⚠️ No audio track available for mute toggle")}}},{key:"toggleSpeaker",value:function(){console.log("🔊 Speaker toggle")}},{key:"destroy",value:function(){this.isActive&&this.endVoiceCall(),this.audioStream&&(this.audioStream.getTracks().forEach(function(A){return A.stop()}),this.audioStream=null),this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null),this.sdk&&(this.sdk.disconnect(),this.sdk=null)}}],e&&vn(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n,o}();function Cn(A){return Cn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Cn(A)}function Qn(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return bn(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,h=r[2];t>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<h&&(o=t<3||r[0]>n||n>h)&&(r[4]=t,r[5]=n,d.n=h,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,h),a=l,s=h;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(bn(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,bn(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,bn(u,"constructor",c),bn(c,"constructor",s),s.displayName="GeneratorFunction",bn(c,o,"GeneratorFunction"),bn(u),bn(u,o,"Generator"),bn(u,n,function(){return this}),bn(u,"toString",function(){return"[object Generator]"}),(Qn=function(){return{w:r,m:d}})()}function bn(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}bn=function(A,e,t,n){function r(e,t){bn(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},bn(A,e,t,n)}function Fn(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Un(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Fn(r,n,o,i,a,"next",A)}function a(A){Fn(r,n,o,i,a,"throw",A)}i(void 0)})}}function En(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,Sn(n.key),n)}}function Sn(A){var e=function(A){if("object"!=Cn(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Cn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Cn(e)?e:e+""}var xn=function(){return A=function A(e,t){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.config=e,this.sdk=t,this.streamingEl=null,this.hasStartedStreaming=!1,this.isActive=!1,this.shadowRoot=e.shadowRoot||document,this.eventHandlers={autoResize:null,keydown:null},this.eventHandlersSetup=!1},e=[{key:"t",value:function(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}},{key:"generateHTML",value:function(){var A,e,t,n,o,r,i,a,s,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===(r=this.config.sendButtonHint)||void 0===r?void 0:r.fontSize)||(null===(i=this.config.panel)||void 0===i||null===(i=i.sendButtonHint)||void 0===i?void 0:i.fontSize)||"12px",'; text-align: center; margin-top: 4px;">\n ').concat((null===(a=this.config.sendButtonHint)||void 0===a?void 0:a.text)||(null===(s=this.config.panel)||void 0===s||null===(s=s.sendButtonHint)||void 0===s?void 0:s.text),"\n </div>\n "):"","\n </div>\n </div>")}},{key:"generateCSS",value:function(){var A,e,t,n,o,r,i,a,s,c,l,u,d,g=this.config.messages,h=(this.config.panel,this.config.animation,this.config.sendButtonColor||(null===(A=this.config.panel)||void 0===A?void 0:A.sendButtonColor)||"#7C3AED"),p=this.config.sendButtonHoverColor||(null===(e=this.config.panel)||void 0===e?void 0:e.sendButtonHoverColor)||"#6D28D9",f=this.config.sendButtonTextColor||(null===(t=this.config.panel)||void 0===t?void 0:t.sendButtonTextColor)||"#FFFFFF",B=(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"),w=this.config.inputFocusColor||(null===(r=this.config.panel)||void 0===r?void 0:r.inputFocusColor)||"#7C3AED",v=this.config.inputBackgroundColor||(null===(i=this.config.panel)||void 0===i?void 0:i.inputBackgroundColor)||"#FFFFFF",m=this.config.inputTextColor||(null===(a=this.config.panel)||void 0===a?void 0:a.inputTextColor)||"#1F2937",y=this.config.inputFontSize||(null===(s=this.config.panel)||void 0===s?void 0:s.inputFontSize)||"14px",C=this.config.inputBorderRadius||(null===(c=this.config.panel)||void 0===c?void 0:c.inputBorderRadius)||20,Q=this.config.inputPadding||(null===(l=this.config.panel)||void 0===l?void 0:l.inputPadding)||"6px 14px",b=!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(b,"; \n flex: 1; \n flex-direction: column; \n min-height: 0; \n overflow: hidden; \n }\n .text-interface.active { display: flex").concat(b,"; }\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; \n max-width: 80%; \n font-size: ").concat(g.fontSize,"; \n color: ").concat(g.textColor,"; \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 { \n background: ").concat(g.userBackgroundColor,"; \n align-self: ").concat("rtl"===this.config.direction?"flex-start":"flex-end","; \n }\n .message.agent { \n background: ").concat(g.agentBackgroundColor,"; \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(Q,";\n border: 1px solid ").concat(B,";\n border-radius: ").concat(C,"px;\n font-size: ").concat(y,";\n font-family: inherit;\n line-height: 1.3;\n resize: none;\n overflow-y: auto;\n background: ").concat(v,";\n color: ").concat(m,";\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(w,";\n background: ").concat("#FFFFFF"===v?"#FFFFFF":v,";\n box-shadow: 0 0 0 3px ").concat(w,"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(h,";\n color: ").concat(f,";\n font-size: ").concat(this.config.sendButtonFontSize||(null===(u=this.config.panel)||void 0===u?void 0:u.sendButtonFontSize)||"18px",";\n font-weight: ").concat(this.config.sendButtonFontWeight||(null===(d=this.config.panel)||void 0===d?void 0:d.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(p,";\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 ")}},{key:"setupEventHandlers",value:function(){var A=this,e=this.shadowRoot.getElementById("sendButton"),t=this.shadowRoot.getElementById("messageInput"),n=this.shadowRoot.getElementById("newChatBtn");if(e&&(e.onclick=function(){return A.sendMessage()}),n&&(n.onclick=function(){return A.startNewChat()}),this.updateInputAttributes(),t){t.style.height="32px",t.style.overflow="hidden";var o=function(){t.style.height="auto";var A=Math.min(t.scrollHeight,120);t.style.height=A+"px",t.style.overflowY=A>=120?"auto":"hidden",A>=120&&setTimeout(function(){t.scrollTop=t.scrollHeight},0)};t.addEventListener("input",o),t.addEventListener("keydown",function(e){"Enter"!==e.key||e.shiftKey?"Enter"===e.key&&e.shiftKey&&setTimeout(o,0):(e.preventDefault(),A.sendMessage())})}}},{key:"startNewChat",value:function(){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()}},{key:"updateInputAttributes",value:function(){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"}}},{key:"show",value:function(){var A=this,e=this.shadowRoot.getElementById("textInterface");e&&e.classList.add("active"),setTimeout(function(){var e=A.shadowRoot.getElementById("messageInput");e&&e.focus()},50)}},{key:"hide",value:function(){var A=this.shadowRoot.getElementById("textInterface");A&&A.classList.remove("active")}},{key:"startChat",value:(n=Un(Qn().m(function A(){return Qn().w(function(A){for(;;)switch(A.n){case 0:this.isActive=!0,this.updateSendButtonState();case 1:return A.a(2)}},A,this)})),function(){return n.apply(this,arguments)})},{key:"sendMessage",value:(t=Un(Qn().m(function A(){var e,t,n;return Qn().w(function(A){for(;;)switch(A.p=A.n){case 0:if(e=this.shadowRoot.getElementById("messageInput"),t=e.value.trim()){A.n=1;break}return A.a(2);case 1:if(this.isActive){A.n=2;break}return A.n=2,this.startChat();case 2:return this.addMessage("user",t),e.value="",e.style.height="32px",e.style.overflow="hidden",A.p=3,this.beginStreaming(),A.n=4,this.sdk.sendMessage(t);case 4:A.n=6;break;case 5:A.p=5,n=A.v,console.error("❌ Failed to send message:",n),n&&("DOMAIN_NOT_WHITELISTED"===n.message||n.message&&n.message.includes("Domain not whitelisted"))||this.showError(n),this.stopStreamingState();case 6:return A.a(2)}},A,this,[[3,5]])})),function(){return t.apply(this,arguments)})},{key:"updateSendButtonState",value:function(){var A=this.shadowRoot.getElementById("sendButton");A&&(A.disabled=!this.isActive)}},{key:"addMessage",value:function(A,e){var t=this.shadowRoot.getElementById("messagesContainer");if(t){var n=t.querySelector(".empty-state");n&&n.remove();var o=document.createElement("div"),r="rtl"===this.config.direction?"user"===A?"edge-left":"edge-right":"user"===A?"edge-right":"edge-left";o.className="message ".concat(A," ").concat(r);var i=document.createElement("div");i.className="message-avatar ".concat(A),i.textContent="user"===A?"👤":"🤖";var a=document.createElement("div");a.className="message-bubble",a.textContent=e,o.appendChild(i),o.appendChild(a),t.appendChild(o),t.scrollTop=t.scrollHeight}}},{key:"beginStreaming",value:function(){var A=this.shadowRoot.getElementById("messagesContainer");if(A){this.stopStreamingState();var e=document.createElement("div"),t="rtl"===this.config.direction?"edge-right":"edge-left";e.className="message agent ".concat(t),e.id="agent-streaming";var n=document.createElement("div");n.className="message-avatar agent",n.textContent="🤖";var o=document.createElement("div");o.className="message-bubble",o.innerHTML='<span class="typing-indicator"><span class="typing-dot"></span><span class="typing-dot"></span><span class="typing-dot"></span></span>',e.appendChild(n),e.appendChild(o),A.appendChild(e),this.streamingEl=o,this.hasStartedStreaming=!1,A.scrollTop=A.scrollHeight}}},{key:"appendStreamingChunk",value:function(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)}}},{key:"finalizeStreaming",value:function(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()}},{key:"stopStreamingState",value:function(){var A=this.shadowRoot.getElementById("agent-streaming");A&&A.remove(),this.streamingEl=null,this.hasStartedStreaming=!1}},{key:"showError",value:function(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 r=document.createElement("div");r.style.cssText="font-size: 14px; color: #991B1B; line-height: 1.5;",r.textContent=this.t("domainErrorMessage"),n.appendChild(o),n.appendChild(r),e.appendChild(n)}else{var i=document.createElement("div");i.className="error-message",i.textContent="string"==typeof A?A:(null==A?void 0:A.message)||A,e.appendChild(i)}e.scrollTop=e.scrollHeight}}},{key:"setActive",value:function(A){this.isActive=A,this.updateSendButtonState()}}],e&&En(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();const In={en:{landingTitle:"How would you like to communicate?",voiceCall:"Voice Call",textChat:"Text Chat",clickToStartCall:"Click to Start Call",realTimeVoice:"Real-time voice conversation",startCall:"Start Call",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:"איך תרצה לתקשר?",voiceCall:"שיחה קולית",textChat:"צ'אט טקסט",clickToStartCall:"לחץ להתחלת שיחה",realTimeVoice:"שיחה קולית בזמן אמת",startCall:"התחל שיחה",listening:"מקשיב...",speakFreely:"דבר בחופשיות",liveTranscript:"תמלול בזמן אמת",transcriptWillAppear:"התמלול יופיע כאן במהלך השיחה...",mute:"השתק",speaker:"רמקול",endCall:"סיים שיחה",hello:"שלום! איך אפשר לעזור?",sendMessage:"שלח הודעה או עבור למצב קולי לשיחה בזמן אמת",online:"מקוון",newChat:"צ'אט חדש",back:"חזור",close:"סגור",error:"שגיאה",typeMessage:"הקלד הודעה...",sendMessageAria:"שלח הודעה",domainNotValidated:"דומיין לא מאומת",domainErrorMessage:"דומיין זה לא ברשימת המורשים. אנא פנה למנהל המערכת כדי להוסיף את כתובת האתר שלך לרשימה."},ar:{landingTitle:"كيف تريد التواصل؟",voiceCall:"مكالمة صوتية",textChat:"دردشة نصية",clickToStartCall:"انقر لبدء المكالمة",realTimeVoice:"محادثة صوتية في الوقت الفعلي",startCall:"ابدأ المكالمة",listening:"الاستماع...",speakFreely:"تكلم بحرية",liveTranscript:"نص مباشر",transcriptWillAppear:"سيظهر النص هنا أثناء المكالمة...",mute:"كتم الصوت",speaker:"مكبر الصوت",endCall:"إنهاء المكالمة",hello:"مرحبا! كيف يمكنني المساعدة؟",sendMessage:"أرسل رسالة للبدء",online:"متصل",newChat:"محادثة جديدة",back:"رجوع",close:"إغلاق",error:"خطأ",typeMessage:"اكتب رسالة...",sendMessageAria:"إرسال رسالة",domainNotValidated:"النطاق غير معتمد",domainErrorMessage:"هذا النطاق غير مسموح به. يرجى الاتصال بالمسؤول لإضافة عنوان موقع الويب الخاص بك إلى القائمة."},ru:{landingTitle:"Как вы хотите общаться?",voiceCall:"Голосовой звонок",textChat:"Текстовый чат",clickToStartCall:"Нажмите, чтобы начать звонок",realTimeVoice:"Голосовой разговор в реальном времени",startCall:"Начать звонок",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?",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",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?",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",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?",voiceCall:"Sprachanruf",textChat:"Text-Chat",clickToStartCall:"Klicken Sie, um den Anruf zu starten",realTimeVoice:"Sprachanruf in Echtzeit",startCall:"Anruf starten",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 Hn(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return kn(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,h=r[2];t>3?(o=h===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<h&&(o=t<3||r[0]>n||n>h)&&(r[4]=t,r[5]=n,d.n=h,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,h){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,h),a=l,s=h;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(kn(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,kn(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,kn(u,"constructor",c),kn(c,"constructor",s),s.displayName="GeneratorFunction",kn(c,o,"GeneratorFunction"),kn(u),kn(u,o,"Generator"),kn(u,n,function(){return this}),kn(u,"toString",function(){return"[object Generator]"}),(Hn=function(){return{w:r,m:d}})()}function kn(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}kn=function(A,e,t,n){function r(e,t){kn(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},kn(A,e,t,n)}function Tn(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Dn(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Tn(r,n,o,i,a,"next",A)}function a(A){Tn(r,n,o,i,a,"throw",A)}i(void 0)})}}function Kn(A){return Kn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Kn(A)}function On(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 Pn(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?On(Object(t),!0).forEach(function(e){Ln(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):On(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function Ln(A,e,t){return(e=Mn(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function Rn(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,Mn(n.key),n)}}function Mn(A){var e=function(A){if("object"!=Kn(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Kn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Kn(e)?e:e+""}var Vn=function(){return A=function A(){var e,t,n,o,r,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.config=this.mergeWithDefaults(a),this.sdk=new Ce(this.config),this.isOpen=!1,this.isActive=!1,this.translations=In,this.currentView="landing",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 s=Pn(Pn(Pn({},this.config),this.config.voice),{},{language:(null===(e=this.config.voice)||void 0===e?void 0:e.language)||this.config.language||"en",signedUrl:this.config.signedUrl,agentSettingsOverride:this.config.agentSettingsOverride,translations:this.translations,shadowRoot:this.shadowRoot,outputContainer:(null===(t=this.config.voice)||void 0===t?void 0:t.outputContainer)||"raw",outputEncoding:(null===(n=this.config.voice)||void 0===n?void 0:n.outputEncoding)||"pcm",outputSampleRate:(null===(o=this.config.voice)||void 0===o?void 0:o.outputSampleRate)||44100,outputChannels:(null===(r=this.config.voice)||void 0===r?void 0:r.outputChannels)||1,outputBitDepth:(null===(i=this.config.voice)||void 0===i?void 0:i.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 yn(s);var c=Pn(Pn(Pn({},this.config),this.config.text),{},{translations:this.translations,shadowRoot:this.shadowRoot});if(this.textInterface=new xn(c,this.sdk),this.createWidget(),this.setupEventHandlers(),this.config.behavior.startOpen||this.config.behavior.autoOpen){var l,u=null===(l=this.shadowRoot)||void 0===l?void 0:l.getElementById("text-chat-panel");u&&(this.isOpen=!0,u.classList.add("open"))}this.checkAndHandleResume()},e=[{key:"checkAndHandleResume",value:function(){var A=this,e=this.voiceInterface.checkAndHandleResume();e&&(console.log("🔄 [WIDGET] Auto-resuming call from page navigation"),console.log(" From:",e.fromPage,"→ To:",e.toPage),this.open(),this.showVoice(),setTimeout(function(){A.startVoiceCall().then(function(){console.log("✅ [WIDGET] Auto-resumed call successfully")}).catch(function(A){console.error("❌ [WIDGET] Failed to auto-resume call:",A)})},100))}},{key:"open",value:function(){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"))}}},{key:"mergeWithDefaults",value:function(A){var e,t,n,o,r,i,a,s,c,l,u,d,g,h,p,f,B,w,v,m,y,C,Q,b,F,U,E,S,x,I,H,k,T,D,K,O,P,L,R,M,V,_,G,N,j,W,J,X,Y,z,Z,q,$,AA,eA,tA,nA,oA,rA,iA,aA,sA,cA,lA,uA,dA,gA,hA,pA,fA,BA,wA,vA,mA,yA,CA,QA,bA,FA,UA,EA,SA,xA,IA,HA,kA,TA,DA,KA,OA,PA,LA,RA,MA,VA,_A,GA,NA,jA,WA,JA,XA,YA,zA,ZA,qA,$A,Ae,ee,te,ne,oe,re,ie,ae,se,ce,le,ue,de,ge,he,pe,fe,Be,we,ve,me,ye,Ce,Qe,be,Fe,Ue,Ee,Se,xe,Ie,He,ke,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=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",Oe=(null===(n=A.header)||void 0===n?void 0:n.backgroundColor)||"#7C3AED";return Pn({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:Pn({type:(null===(o=A.icon)||void 0===o?void 0:o.type)||"custom",customImage:(null===(r=A.icon)||void 0===r?void 0:r.customImage)||"https://talktopc.com/logo192.png",emoji:(null===(i=A.icon)||void 0===i?void 0:i.emoji)||"🎤",text:(null===(a=A.icon)||void 0===a?void 0:a.text)||"AI",size:(null===(s=A.icon)||void 0===s?void 0:s.size)||"medium",backgroundColor:(null===(c=A.icon)||void 0===c?void 0:c.backgroundColor)||"#FFFFFF"},A.icon),position:Pn({vertical:Te.vertical||"bottom",horizontal:Te.horizontal||"right",offset:Te.offset||{x:20,y:20}},"object"===Kn(A.position)?A.position:{}),button:Pn({size:(null===(l=A.button)||void 0===l?void 0:l.size)||"medium",shape:(null===(u=A.button)||void 0===u?void 0:u.shape)||"circle",backgroundColor:(null===(d=A.button)||void 0===d?void 0:d.backgroundColor)||(null===(g=A.icon)||void 0===g?void 0:g.backgroundColor)||"#FFFFFF",hoverColor:(null===(h=A.button)||void 0===h?void 0:h.hoverColor)||"#D3D3D3",shadow:!1!==(null===(p=A.button)||void 0===p?void 0:p.shadow),shadowColor:(null===(f=A.button)||void 0===f?void 0:f.shadowColor)||"rgba(0,0,0,0.15)",primaryColor:(null===(B=A.button)||void 0===B?void 0:B.backgroundColor)||(null===(w=A.icon)||void 0===w?void 0:w.backgroundColor)||"#FFFFFF"},A.button),panel:Pn({width:(null===(v=A.panel)||void 0===v?void 0:v.width)||350,height:(null===(m=A.panel)||void 0===m?void 0:m.height)||500,borderRadius:(null===(y=A.panel)||void 0===y?void 0:y.borderRadius)||12,backgroundColor:(null===(C=A.panel)||void 0===C?void 0:C.backgroundColor)||"#FFFFFF",backdropFilter:(null===(Q=A.panel)||void 0===Q?void 0:Q.backdropFilter)||null,border:(null===(b=A.panel)||void 0===b?void 0:b.border)||"1px solid #E5E7EB"},A.panel),voice:Pn({micButtonColor:(null===(F=A.voice)||void 0===F?void 0:F.micButtonColor)||(null===(U=A.panel)||void 0===U?void 0:U.micButtonColor)||Ke,micButtonActiveColor:(null===(E=A.voice)||void 0===E?void 0:E.micButtonActiveColor)||(null===(S=A.panel)||void 0===S?void 0:S.micButtonActiveColor)||"#EF4444",micButtonHint:Pn(Pn({text:(null===(x=A.voice)||void 0===x||null===(x=x.micButtonHint)||void 0===x?void 0:x.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===(H=A.voice)||void 0===H||null===(H=H.micButtonHint)||void 0===H?void 0:H.color)||(null===(k=A.panel)||void 0===k||null===(k=k.micButtonHint)||void 0===k?void 0:k.color)||"#6B7280",fontSize:(null===(T=A.voice)||void 0===T||null===(T=T.micButtonHint)||void 0===T?void 0:T.fontSize)||(null===(D=A.panel)||void 0===D||null===(D=D.micButtonHint)||void 0===D?void 0:D.fontSize)||"12px"},null===(K=A.voice)||void 0===K?void 0:K.micButtonHint),null===(O=A.panel)||void 0===O?void 0:O.micButtonHint),avatarBackgroundColor:(null===(P=A.voice)||void 0===P?void 0:P.avatarBackgroundColor)||"#667eea",avatarActiveBackgroundColor:(null===(L=A.voice)||void 0===L?void 0:L.avatarActiveBackgroundColor)||"#667eea",statusTitleColor:(null===(R=A.voice)||void 0===R?void 0:R.statusTitleColor)||"#1e293b",statusSubtitleColor:(null===(M=A.voice)||void 0===M?void 0:M.statusSubtitleColor)||"#64748b",startCallButtonColor:(null===(V=A.voice)||void 0===V?void 0:V.startCallButtonColor)||"#667eea",startCallButtonTextColor:(null===(_=A.voice)||void 0===_?void 0:_.startCallButtonTextColor)||"#FFFFFF",startCallTitle:(null===(G=A.voice)||void 0===G?void 0:G.startCallTitle)||null,startCallSubtitle:(null===(N=A.voice)||void 0===N?void 0:N.startCallSubtitle)||null,startCallButtonText:(null===(j=A.voice)||void 0===j?void 0:j.startCallButtonText)||null,transcriptBackgroundColor:(null===(W=A.voice)||void 0===W?void 0:W.transcriptBackgroundColor)||"#FFFFFF",transcriptTextColor:(null===(J=A.voice)||void 0===J?void 0:J.transcriptTextColor)||"#1e293b",transcriptLabelColor:(null===(X=A.voice)||void 0===X?void 0:X.transcriptLabelColor)||"#94a3b8",controlButtonColor:(null===(Y=A.voice)||void 0===Y?void 0:Y.controlButtonColor)||"#FFFFFF",controlButtonSecondaryColor:(null===(z=A.voice)||void 0===z?void 0:z.controlButtonSecondaryColor)||"#64748b",endCallButtonColor:(null===(Z=A.voice)||void 0===Z?void 0:Z.endCallButtonColor)||"#ef4444",language:(null===(q=A.voice)||void 0===q?void 0:q.language)||A.language||"en"},A.voice),text:Pn({sendButtonColor:(null===($=A.text)||void 0===$?void 0:$.sendButtonColor)||(null===(AA=A.panel)||void 0===AA?void 0:AA.sendButtonColor)||"#7C3AED",sendButtonHoverColor:(null===(eA=A.text)||void 0===eA?void 0:eA.sendButtonHoverColor)||(null===(tA=A.panel)||void 0===tA?void 0:tA.sendButtonHoverColor)||"#6D28D9",sendButtonActiveColor:(null===(nA=A.text)||void 0===nA?void 0:nA.sendButtonActiveColor)||(null===(oA=A.panel)||void 0===oA?void 0:oA.sendButtonActiveColor)||"#6D28D9",sendButtonText:(null===(rA=A.text)||void 0===rA?void 0:rA.sendButtonText)||(null===(iA=A.panel)||void 0===iA?void 0:iA.sendButtonText)||"➤",sendButtonTextColor:(null===(aA=A.text)||void 0===aA?void 0:aA.sendButtonTextColor)||(null===(sA=A.panel)||void 0===sA?void 0:sA.sendButtonTextColor)||"#FFFFFF",sendButtonFontSize:(null===(cA=A.text)||void 0===cA?void 0:cA.sendButtonFontSize)||(null===(lA=A.panel)||void 0===lA?void 0:lA.sendButtonFontSize)||"18px",sendButtonFontWeight:(null===(uA=A.text)||void 0===uA?void 0:uA.sendButtonFontWeight)||(null===(dA=A.panel)||void 0===dA?void 0:dA.sendButtonFontWeight)||"500",sendButtonHint:Pn(Pn({text:(null===(gA=A.text)||void 0===gA||null===(gA=gA.sendButtonHint)||void 0===gA?void 0:gA.text)||(null===(hA=A.panel)||void 0===hA||null===(hA=hA.sendButtonHint)||void 0===hA?void 0:hA.text)||"",color:(null===(pA=A.text)||void 0===pA||null===(pA=pA.sendButtonHint)||void 0===pA?void 0:pA.color)||(null===(fA=A.panel)||void 0===fA||null===(fA=fA.sendButtonHint)||void 0===fA?void 0:fA.color)||"#6B7280",fontSize:(null===(BA=A.text)||void 0===BA||null===(BA=BA.sendButtonHint)||void 0===BA?void 0:BA.fontSize)||(null===(wA=A.panel)||void 0===wA||null===(wA=wA.sendButtonHint)||void 0===wA?void 0:wA.fontSize)||"12px"},null===(vA=A.text)||void 0===vA?void 0:vA.sendButtonHint),null===(mA=A.panel)||void 0===mA?void 0:mA.sendButtonHint),inputPlaceholder:(null===(yA=A.text)||void 0===yA?void 0:yA.inputPlaceholder)||(null===(CA=A.panel)||void 0===CA?void 0:CA.inputPlaceholder)||"Type your message...",inputBorderColor:(null===(QA=A.text)||void 0===QA?void 0:QA.inputBorderColor)||(null===(bA=A.panel)||void 0===bA?void 0:bA.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===(EA=A.text)||void 0===EA?void 0:EA.inputBackgroundColor)||(null===(SA=A.panel)||void 0===SA?void 0:SA.inputBackgroundColor)||"#FFFFFF",inputTextColor:(null===(xA=A.text)||void 0===xA?void 0:xA.inputTextColor)||(null===(IA=A.panel)||void 0===IA?void 0:IA.inputTextColor)||"#1F2937",inputFontSize:(null===(HA=A.text)||void 0===HA?void 0:HA.inputFontSize)||(null===(kA=A.panel)||void 0===kA?void 0:kA.inputFontSize)||"14px",inputBorderRadius:(null===(TA=A.text)||void 0===TA?void 0:TA.inputBorderRadius)||(null===(DA=A.panel)||void 0===DA?void 0:DA.inputBorderRadius)||20,inputPadding:(null===(KA=A.text)||void 0===KA?void 0:KA.inputPadding)||(null===(OA=A.panel)||void 0===OA?void 0:OA.inputPadding)||"6px 14px"},A.text),landing:Pn({backgroundColor:(null===(PA=A.landing)||void 0===PA?void 0:PA.backgroundColor)||"linear-gradient(180deg, #f8fafc 0%, #e0e7ff 100%)",logo:(null===(LA=A.landing)||void 0===LA?void 0:LA.logo)||"🤖",title:(null===(RA=A.landing)||void 0===RA?void 0:RA.title)||null,titleColor:(null===(MA=A.landing)||void 0===MA?void 0:MA.titleColor)||"#1e293b",modeCardBackgroundColor:(null===(VA=A.landing)||void 0===VA?void 0:VA.modeCardBackgroundColor)||"#FFFFFF",modeCardBorderColor:(null===(_A=A.landing)||void 0===_A?void 0:_A.modeCardBorderColor)||"#E2E8F0",modeCardHoverBorderColor:(null===(GA=A.landing)||void 0===GA?void 0:GA.modeCardHoverBorderColor)||Oe,modeCardIconBackgroundColor:(null===(NA=A.landing)||void 0===NA?void 0:NA.modeCardIconBackgroundColor)||Oe,modeCardTitleColor:(null===(jA=A.landing)||void 0===jA?void 0:jA.modeCardTitleColor)||"#111827",voiceCardIcon:(null===(WA=A.landing)||void 0===WA?void 0:WA.voiceCardIcon)||"🎤",textCardIcon:(null===(JA=A.landing)||void 0===JA?void 0:JA.textCardIcon)||"💬",voiceCardTitle:(null===(XA=A.landing)||void 0===XA?void 0:XA.voiceCardTitle)||null,textCardTitle:(null===(YA=A.landing)||void 0===YA?void 0:YA.textCardTitle)||null},A.landing),header:Pn({title:(null===(zA=A.header)||void 0===zA?void 0:zA.title)||"Chat Assistant",showTitle:!1!==(null===(ZA=A.header)||void 0===ZA?void 0:ZA.showTitle),backgroundColor:(null===(qA=A.header)||void 0===qA?void 0:qA.backgroundColor)||"#7C3AED",textColor:(null===($A=A.header)||void 0===$A?void 0:$A.textColor)||"#FFFFFF",showCloseButton:!1!==(null===(Ae=A.header)||void 0===Ae?void 0:Ae.showCloseButton)},A.header),footer:Pn({show:!1!==(null===(ee=A.footer)||void 0===ee?void 0:ee.show),backgroundColor:(null===(te=A.footer)||void 0===te?void 0:te.backgroundColor)||"#f9fafb",textColor:(null===(ne=A.footer)||void 0===ne?void 0:ne.textColor)||"#9ca3af",hoverColor:(null===(oe=A.footer)||void 0===oe?void 0:oe.hoverColor)||"#7C3AED"},A.footer),tooltips:Pn({newChat:(null===(re=A.tooltips)||void 0===re?void 0:re.newChat)||null,back:(null===(ie=A.tooltips)||void 0===ie?void 0:ie.back)||null,close:(null===(ae=A.tooltips)||void 0===ae?void 0:ae.close)||null,mute:(null===(se=A.tooltips)||void 0===se?void 0:se.mute)||null,speaker:(null===(ce=A.tooltips)||void 0===ce?void 0:ce.speaker)||null,endCall:(null===(le=A.tooltips)||void 0===le?void 0:le.endCall)||null},A.tooltips),messages:Pn({userBackgroundColor:(null===(ue=A.messages)||void 0===ue?void 0:ue.userBackgroundColor)||"#E5E7EB",agentBackgroundColor:(null===(de=A.messages)||void 0===de?void 0:de.agentBackgroundColor)||"#F3F4F6",systemBackgroundColor:(null===(ge=A.messages)||void 0===ge?void 0:ge.systemBackgroundColor)||"#DCFCE7",errorBackgroundColor:(null===(he=A.messages)||void 0===he?void 0:he.errorBackgroundColor)||"#FEE2E2",textColor:(null===(pe=A.messages)||void 0===pe?void 0:pe.textColor)||"#1F2937",fontSize:(null===(fe=A.messages)||void 0===fe?void 0:fe.fontSize)||"14px",borderRadius:(null===(Be=A.messages)||void 0===Be?void 0:Be.borderRadius)||8},A.messages),animation:Pn({enableHover:!1!==(null===(we=A.animation)||void 0===we?void 0:we.enableHover),enablePulse:!1!==(null===(ve=A.animation)||void 0===ve?void 0:ve.enablePulse),enableSlide:!1!==(null===(me=A.animation)||void 0===me?void 0:me.enableSlide),duration:(null===(ye=A.animation)||void 0===ye?void 0:ye.duration)||.3},A.animation),behavior:Pn({autoOpen:(null===(Ce=A.behavior)||void 0===Ce?void 0:Ce.autoOpen)||!1,startOpen:(null===(Qe=A.behavior)||void 0===Qe?void 0:Qe.startOpen)||!1,hidden:(null===(be=A.behavior)||void 0===be?void 0:be.hidden)||!1,autoConnect:(null===(Fe=A.behavior)||void 0===Fe?void 0:Fe.autoConnect)||!1,showWelcomeMessage:!1!==(null===(Ue=A.behavior)||void 0===Ue?void 0:Ue.showWelcomeMessage),welcomeMessage:(null===(Ee=A.behavior)||void 0===Ee?void 0:Ee.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===(xe=A.behavior)||void 0===xe?void 0:xe.mode)||"unified"},A.behavior),accessibility:Pn({ariaLabel:(null===(Ie=A.accessibility)||void 0===Ie?void 0:Ie.ariaLabel)||"Chat Assistant",ariaDescription:(null===(He=A.accessibility)||void 0===He?void 0:He.ariaDescription)||"Click to open chat assistant",keyboardNavigation:!1!==(null===(ke=A.accessibility)||void 0===ke?void 0:ke.keyboardNavigation)},A.accessibility),customStyles:A.customStyles||"",useShadowDOM:!1!==A.useShadowDOM,variables:A.variables||{},forceConversationId:A.forceConversationId,onConversationStart:A.onConversationStart,onConversationEnd:A.onConversationEnd,onBargeIn:A.onBargeIn,onAudioStartPlaying:A.onAudioStartPlaying,onAudioStoppedPlaying:A.onAudioStoppedPlaying,onSubtitleDisplay:A.onSubtitleDisplay,primaryColor:Ke},"string"==typeof A.position?{positionString:A.position}:{})}},{key:"setupEventHandlers",value:function(){var A=this;this.sdk.on("domainError",function(e){A.textInterface.showError(e),A.textInterface.stopStreamingState()}),this.sdk.on("error",function(e){e&&("DOMAIN_NOT_WHITELISTED"===e.message||e.message&&e.message.includes("Domain not whitelisted"))||(A.textInterface.showError(e.message||e),A.textInterface.stopStreamingState())}),this.sdk.on("chunk",function(e){A.textInterface.appendStreamingChunk(e)}),this.sdk.on("done",function(e){var t=e.text;A.textInterface.finalizeStreaming(t)})}},{key:"createShadowHost",value:function(){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)}},{key:"createRegularContainer",value:function(){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}},{key:"createWidget",value:function(){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"))}},{key:"injectStylesIntoHead",value:function(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,r={small:20,medium:28,large:36,xl:44}[null===(t=this.config.icon)||void 0===t?void 0:t.size]||28,i=this.generatePositionStyles(),a=this.generateCSS(i,o,r),s=document.createElement("style");s.id="ttp-widget-styles",s.textContent=A+"\n"+a,this.config.customStyles&&(s.textContent+="\n"+this.config.customStyles),document.head.appendChild(s)}},{key:"generateWidgetHTML",value:function(){var A,e,t,n,o=this,r=(this.config.position,this.config.button),i=this.config.icon,a=(this.config.panel,this.config.header),s=(this.config.animation,{small:50,medium:60,large:70,xl:80}[r.size]||60),c={small:20,medium:28,large:36,xl:44}[i.size]||28,l=this.generatePositionStyles(),u=this.generateIconHTML(c),d=this.config.behavior.mode||"unified",g="unified"===d,h="unified"===d||"voice-only"===d,p="unified"===d||"text-only"===d,f=function(A){var e=o.config.language||"en";return(o.translations[e]||o.translations.en)[A]||A},B=function(A){var e,t=null===(e=o.config.tooltips)||void 0===e?void 0:e[A];return null!=t?t:{newChat:f("newChat"),back:f("back"),close:f("close"),mute:f("mute"),speaker:f("speaker"),endCall:f("endCall")}[A]||""},w=this.config.useShadowDOM?"\n <style>\n ".concat(this.generateCSS(l,s,c),"\n ").concat(this.config.customStyles,"\n </style>\n "):"";return"\n ".concat(w,"\n \n ").concat(this.config.behavior.hidden?"":'\n <button id="text-chat-button" \n aria-label="'.concat(this.config.accessibility.ariaLabel,'"\n aria-description="').concat(this.config.accessibility.ariaDescription,'">\n ').concat(u,"\n </button>\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(a.backgroundColor,"; color: ").concat(a.textColor,';">\n <div>\n ').concat(a.showTitle?'<div class="header-title">'.concat(a.title,"</div>"):"",'\n <div class="header-status">\n <span class="status-dot"></span>\n <span>').concat(f("online"),'</span>\n </div>\n </div>\n \n <div style="display: flex; gap: 12px; align-items: center;">\n \x3c!-- New Chat Button (hide on landing screen, show otherwise) --\x3e\n <button class="header-icon new-chat-btn" id="newChatBtn" title="').concat(B("newChat"),'" style="').concat(g?"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"===d?'<button class="header-icon back-btn" id="backBtn" title="'.concat(B("back"),'" style="display: none;">\n <span style="font-size: 16px;">‹</span>\n </button>'):"","\n \n \x3c!-- Close Button --\x3e\n ").concat(a.showCloseButton?'<button class="header-icon close-btn" id="closeBtn" title="'+B("close")+'"><span style="font-size: 18px; font-weight: bold;">×</span></button>':"","\n </div>\n </div>\n\n ").concat(g?'\n <div class="landing-screen" id="landingScreen">\n <div class="landing-logo">'.concat((null===(A=this.config.landing)||void 0===A?void 0:A.logo)||"🤖",'</div>\n <div class="landing-title">').concat((null===(e=this.config.landing)||void 0===e?void 0:e.title)||f("landingTitle"),'</div>\n <div class="mode-selection">\n ').concat(h?'<div class="mode-card voice" id="mode-card-voice">\n <div class="mode-card-icon">🎤</div>\n <div class="mode-card-title">'.concat((null===(t=this.config.landing)||void 0===t?void 0:t.voiceCardTitle)||f("voiceCall"),"</div>\n </div>"):"","\n ").concat(p?'<div class="mode-card text" id="mode-card-text">\n <div class="mode-card-icon">💬</div>\n <div class="mode-card-title">'.concat((null===(n=this.config.landing)||void 0===n?void 0:n.textCardTitle)||f("textChat"),"</div>\n </div>"):"","\n </div>\n </div>"):"","\n\n ").concat(h?this.voiceInterface.generateHTML():"","\n ").concat(p?this.textInterface.generateHTML():"","\n ").concat(this.generateFooterHTML(),"\n </div>\n </div>\n </div>\n ")}},{key:"generateFooterHTML",value:function(){var A=this.config.footer;if(!A.show)return"";var e=encodeURIComponent(window.location.hostname||"widget"),t="https://talktopc.com?ref=widget&source=".concat(e);return'\n <div class="widget-footer" style="\n height: 36px;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background-color: '.concat(A.backgroundColor,';\n border-top: 1px solid #e5e7eb;\n flex-shrink: 0;\n ">\n <a \n href="').concat(t,'" \n target="_blank" \n rel="noopener noreferrer"\n aria-label="Visit TalkToPC website"\n class="footer-brand-link"\n style="\n display: flex;\n flex-direction: column;\n align-items: center;\n text-decoration: none;\n color: ').concat(A.textColor,';\n transition: color 0.2s ease;\n "\n onmouseover="this.style.color=\'').concat(A.hoverColor,"'\"\n onmouseout=\"this.style.color='").concat(A.textColor,'\'"\n >\n <span style="font-size: 11px; line-height: 1.3;">\n ⚡ Powered by <strong>TalkToPC</strong>\n </span>\n <span style="font-size: 9px; opacity: 0.7; line-height: 1.2;">\n https://talktopc.com\n </span>\n </a>\n </div>\n ')}},{key:"generatePositionStyles",value:function(){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}},{key:"generateIconHTML",value:function(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>')}}},{key:"generateCSS",value:function(A,e,t){var n,o,r,i,a,s,c,l,u,d,g,h=this.config.button,p=this.config.icon,f=this.config.panel,B=this.config.header,w=(this.config.messages,this.config.animation),v=this.config.behavior.mode||"unified",m="unified"===v||"voice-only"===v,y="unified"===v||"text-only"===v,C=!1===this.config.useShadowDOM?" !important":"",Q=B.backgroundColor;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: fixed;\n ").concat("bottom"===this.config.position.vertical?"bottom: ".concat((null===(n=this.config.position.offset)||void 0===n?void 0:n.y)||20,"px;"):"top: ".concat((null===(o=this.config.position.offset)||void 0===o?void 0:o.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===(i=this.config.position.offset)||void 0===i?void 0:i.x)||20,"px;"),"\n width: ").concat(e,"px;\n height: ").concat(e,"px;\n border-radius: ").concat("circle"===h.shape?"50%":"square"===h.shape?"0":"12px",";\n background: ").concat(h.backgroundColor||p.backgroundColor||"#7C3AED",";\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all ").concat(w.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: 10001;\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 {\n right: 10px !important;\n bottom: 10px !important;\n left: auto !important;\n top: auto !important;\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 {\n right: 8px !important;\n bottom: 8px !important;\n left: auto !important;\n top: auto !important;\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(w.enableHover?"\n #text-chat-button:hover {\n ".concat(h.hoverColor?"background: ".concat(h.hoverColor,";"):"","\n transform: scale(1.05);\n box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);\n }\n "):"","\n \n #text-chat-panel {\n display: none").concat(C,";\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(f.width,"px;\n max-width: calc(100vw - 40px);\n height: ").concat(f.height,"px;\n max-height: calc(100vh - ").concat(e,"px - 40px - 20px); /* Account for footer height */\n background: transparent;\n border-radius: ").concat(f.borderRadius,"px;\n border: none;\n flex-direction: column;\n overflow: hidden;\n ").concat(f.backdropFilter?"backdrop-filter: ".concat(f.backdropFilter,";"):"","\n ").concat(w.enableSlide?"transition: all ".concat(w.duration,"s ease;"):"","\n box-sizing: border-box;\n }\n \n #text-chat-panel.open {\n display: flex").concat(C,";\n ").concat(w.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(f.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(f.borderRadius,"px; border: ").concat(f.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%; min-height: 0; background: #FFFFFF; overflow: hidden; display: flex; flex-direction: column; border-radius: ").concat(f.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 min-height: 0;\n overflow-y: auto;\n overflow-x: hidden;\n }\n \n /* Header should not scroll */\n #text-chat-panel .widget-header {\n padding: 12px 16px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-top-left-radius: ").concat(f.borderRadius,"px;\n border-top-right-radius: ").concat(f.borderRadius,"px;\n flex-shrink: 0;\n min-height: 60px;\n box-sizing: border-box;\n }\n #text-chat-panel .header-title { font-size: 16px; font-weight: 600; }\n #text-chat-panel .header-status { display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: 0.9; }\n #text-chat-panel .status-dot { width: 8px; height: 8px; background: #4ade80; border-radius: 50%; animation: pulse 2s ease-in-out infinite; }\n @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }\n /* Header icon buttons */\n .header-icon {\n background: rgba(255, 255, 255, 0.2);\n border: none;\n color: white;\n width: 36px;\n height: 36px;\n min-width: 36px;\n min-height: 36px;\n border-radius: 50%;\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 }\n \n .header-icon:hover {\n background: rgba(255, 255, 255, 0.3);\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 /* Landing and mode selection (shown only if voice enabled) */\n .landing-screen { \n display: none").concat(C,"; \n flex: 1; \n padding: 20px; \n background: ").concat((null===(a=this.config.landing)||void 0===a?void 0:a.backgroundColor)||"linear-gradient(180deg, #f8fafc 0%, #e0e7ff 100%)","; \n align-items: center; \n justify-content: flex-start; \n flex-direction: column; \n gap: 16px; \n overflow-y: auto; \n min-height: 0; \n }\n .landing-screen.active { display: flex").concat(C,"; }\n .landing-logo { font-size: 48px; }\n .landing-title { \n font-size: 20px; \n color: ").concat((null===(s=this.config.landing)||void 0===s?void 0:s.titleColor)||"#1e293b","; \n font-weight: 700; \n margin-bottom: 20px; \n text-align: center;\n width: 100%;\n }\n .mode-selection { display: flex; gap: 16px; width: 100%; justify-content: center; }\n .mode-card { \n flex: 1; \n max-width: 180px; \n background: ").concat((null===(c=this.config.landing)||void 0===c?void 0:c.modeCardBackgroundColor)||"#FFFFFF","; \n border: 2px solid ").concat((null===(l=this.config.landing)||void 0===l?void 0:l.modeCardBorderColor)||"#E2E8F0","; \n border-radius: 20px; \n padding: 20px 12px; \n cursor: pointer; \n display: flex; \n flex-direction: column; \n align-items: center; \n gap: 8px; \n transition: transform ").concat(w.duration,"s ease, box-shadow ").concat(w.duration,"s ease, border-color ").concat(w.duration,"s ease; \n box-shadow: 0 4px 12px rgba(0,0,0,0.05); \n }\n .mode-card:hover { \n transform: translateY(-6px); \n box-shadow: 0 12px 24px rgba(102, 126, 234, 0.2); \n border-color: ").concat((null===(u=this.config.landing)||void 0===u?void 0:u.modeCardHoverBorderColor)||Q,"; \n }\n .mode-card-icon { \n width: 60px; \n height: 60px; \n display: flex; \n align-items: center; \n justify-content: center; \n border-radius: 50%; \n background: ").concat((null===(d=this.config.landing)||void 0===d?void 0:d.modeCardIconBackgroundColor)||Q,"; \n color: #fff; \n font-size: 32px; \n }\n .mode-card-title { \n color: ").concat((null===(g=this.config.landing)||void 0===g?void 0:g.modeCardTitleColor)||"#111827","; \n font-weight: 600; \n text-align: center;\n width: 100%;\n }\n\n ").concat(m?this.voiceInterface.generateCSS():"","\n ").concat(y?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 ")}},{key:"setupWidgetEvents",value:function(){var A=this;if(this.shadowRoot){var e=this.shadowRoot.getElementById("text-chat-button");e&&(e.onclick=function(){return A.togglePanel()});var t=this.shadowRoot.getElementById("closeBtn");t&&(t.onclick=function(){return A.togglePanel()});var n=this.config.behavior.mode||"unified",o="unified"===n,r="unified"===n||"voice-only"===n,i="unified"===n||"text-only"===n,a=this.shadowRoot.getElementById("backBtn"),s=this.shadowRoot.getElementById("landingScreen"),c=this.shadowRoot.getElementById("mode-card-voice"),l=this.shadowRoot.getElementById("mode-card-text"),u=this.shadowRoot.getElementById("textInterface"),d=this.shadowRoot.getElementById("voiceInterface");a&&(a.onclick=function(){return A.showLanding()}),o?(c&&(c.onclick=function(){return A.showVoice()}),l&&(l.onclick=function(){return A.showText()}),"text"===this.currentView?(s&&s.classList.remove("active"),u&&u.classList.add("active"),d&&d.classList.remove("active"),a&&"unified"===n&&a.classList.add("visible"),g&&(g.style.display="")):"voice"===this.currentView?(s&&s.classList.remove("active"),u&&u.classList.remove("active"),d&&d.classList.add("active"),a&&"unified"===n&&a.classList.add("visible"),g&&(g.style.display="none")):(this.currentView="landing",s&&s.classList.add("active"),u&&u.classList.remove("active"),d&&d.classList.remove("active"),a&&"unified"===n&&a.classList.remove("visible"))):"voice-only"===n?(d&&d.classList.add("active"),u&&u.classList.remove("active"),s&&s.classList.remove("active")):"text-only"===n&&(u&&u.classList.add("active"),d&&d.classList.remove("active"),s&&s.classList.remove("active")),r&&(console.log("⚙️ Setting up voice interface event handlers"),this.voiceInterface.setupEventHandlers()),i&&(console.log("⚙️ Setting up text interface event handlers"),this.textInterface.setupEventHandlers());var g=this.shadowRoot.getElementById("newChatBtn");g&&(g.onclick=function(){return A.textInterface.startNewChat()},o&&(g.style.display="none")),this.config.accessibility.keyboardNavigation&&this.setupKeyboardNavigation()}}},{key:"startNewChat",value:function(){this.textInterface.startNewChat()}},{key:"showLanding",value:function(){if(this.shadowRoot&&"unified"===(this.config.behavior.mode||"unified")){this.currentView="landing";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.add("active"),e&&e.classList.remove("active"),t&&t.classList.remove("active"),n&&n.classList.remove("visible"),o&&(o.style.display="none")}}},{key:"showText",value:function(){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="")}}},{key:"showVoice",value:function(){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 r=this.config.behavior.mode||"unified";n&&"unified"===r&&n.classList.add("visible"),o&&(o.style.display="none")}}},{key:"setupKeyboardNavigation",value:function(){var A=this;document.addEventListener("keydown",function(e){"Escape"===e.key&&A.isOpen&&A.togglePanel()})}},{key:"togglePanel",value:function(){var A=this;if(this.shadowRoot){this.isOpen=!this.isOpen;var e=this.shadowRoot.getElementById("text-chat-panel");e&&e.classList.toggle("open"),this.isOpen&&setTimeout(function(){var e=A.shadowRoot.getElementById("messageInput");e&&e.focus()},100),this.isOpen&&!this.isActive&&this.config.behavior.autoConnect&&this.startChat()}}},{key:"startChat",value:(r=Dn(Hn().m(function A(){return Hn().w(function(A){for(;;)switch(A.n){case 0:this.isActive=!0,this.textInterface.setActive(!0);case 1:return A.a(2)}},A,this)})),function(){return r.apply(this,arguments)})},{key:"sendMessage",value:(o=Dn(Hn().m(function A(){return Hn().w(function(A){for(;;)switch(A.n){case 0:return A.n=1,this.textInterface.sendMessage();case 1:return A.a(2)}},A,this)})),function(){return o.apply(this,arguments)})},{key:"updateSendButtonState",value:function(){this.textInterface.updateSendButtonState()}},{key:"getSignedUrl",value:(n=Dn(Hn().m(function A(){var e,t;return Hn().w(function(A){for(;;)switch(A.n){case 0:if(!this.config.signedUrl){A.n=1;break}return A.a(2,this.config.signedUrl);case 1:if(this.config.agentId){A.n=2;break}throw new Error("agentId is required when signedUrl is not provided");case 2:return e=this.config.websocketUrl||"wss://backend.talktopc.com/ws/conv",(t=new URLSearchParams).append("agentId",this.config.agentId),this.config.appId&&t.append("appId",this.config.appId),!1!==this.config.demo&&t.append("demo","true"),A.a(2,"".concat(e,"?").concat(t.toString()))}},A,this)})),function(){return n.apply(this,arguments)})},{key:"addMessage",value:function(A,e){this.textInterface.addMessage(A,e)}},{key:"beginStreaming",value:function(){this.textInterface.beginStreaming()}},{key:"appendStreamingChunk",value:function(A){this.textInterface.appendStreamingChunk(A)}},{key:"finalizeStreaming",value:function(A){this.textInterface.finalizeStreaming(A)}},{key:"stopStreamingState",value:function(){this.textInterface.stopStreamingState()}},{key:"showError",value:function(A){this.textInterface.showError(A)}},{key:"updateStatus",value:function(A){}},{key:"updateConfig",value:function(A){var e,t,n,o,r,i,a,s,c,l=Pn({},this.config);A.panel&&(l.panel=Pn(Pn({},this.config.panel),A.panel)),A.voice&&(l.voice=Pn(Pn({},this.config.voice),A.voice),A.voice.micButtonHint&&(l.voice.micButtonHint=Pn(Pn({},null===(s=this.config.voice)||void 0===s?void 0:s.micButtonHint),A.voice.micButtonHint))),A.text&&(l.text=Pn(Pn({},this.config.text),A.text),A.text.sendButtonHint&&(l.text.sendButtonHint=Pn(Pn({},null===(c=this.config.text)||void 0===c?void 0:c.sendButtonHint),A.text.sendButtonHint))),void 0!==A.language&&(l.language=A.language),void 0!==A.language&&(["he","ar"].includes(A.language)?l.direction="rtl":void 0===A.direction&&(l.direction="ltr")),A.translations&&(l.translations=A.translations,this.translations=A.translations),A.button&&(l.button=Pn(Pn({},this.config.button),A.button)),A.header&&(l.header=Pn(Pn({},this.config.header),A.header)),A.icon&&(l.icon=Pn(Pn({},this.config.icon),A.icon)),A.messages&&(l.messages=Pn(Pn({},this.config.messages),A.messages)),A.animation&&(l.animation=Pn(Pn({},this.config.animation),A.animation)),A.behavior&&(l.behavior=Pn(Pn({},this.config.behavior),A.behavior)),A.accessibility&&(l.accessibility=Pn(Pn({},this.config.accessibility),A.accessibility)),A.tooltips&&(l.tooltips=Pn(Pn({},this.config.tooltips),A.tooltips)),A.landing&&(l.landing=Pn(Pn({},this.config.landing),A.landing)),A.footer&&(l.footer=Pn(Pn({},this.config.footer),A.footer)),void 0!==A.direction&&void 0===l.direction&&(l.direction=A.direction),void 0!==A.primaryColor&&(l.primaryColor=A.primaryColor),l.onConversationStart=void 0!==A.onConversationStart?A.onConversationStart:this.config.onConversationStart,l.onConversationEnd=void 0!==A.onConversationEnd?A.onConversationEnd:this.config.onConversationEnd,l.onBargeIn=void 0!==A.onBargeIn?A.onBargeIn:this.config.onBargeIn,l.onAudioStartPlaying=void 0!==A.onAudioStartPlaying?A.onAudioStartPlaying:this.config.onAudioStartPlaying,l.onAudioStoppedPlaying=void 0!==A.onAudioStoppedPlaying?A.onAudioStoppedPlaying:this.config.onAudioStoppedPlaying,l.onSubtitleDisplay=void 0!==A.onSubtitleDisplay?A.onSubtitleDisplay:this.config.onSubtitleDisplay,void 0!==A.useShadowDOM&&(l.useShadowDOM=A.useShadowDOM),Object.keys(A).forEach(function(e){["panel","button","header","footer","icon","messages","direction","voice","text","animation","behavior","accessibility","language","tooltips","landing","primaryColor","useShadowDOM","onConversationStart","onConversationEnd","onBargeIn","onAudioStartPlaying","onAudioStoppedPlaying","onSubtitleDisplay"].includes(e)||(l[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(l),!1!==this.config.useShadowDOM===u&&this.container){var d=document.getElementById("ttp-widget-shadow-host");d&&!this.config.useShadowDOM&&d.remove();var g=document.getElementById("ttp-widget-container");if(g&&this.config.useShadowDOM&&g.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 p=document.getElementById("ttp-widget-container");p?(this.regularContainer=p,this.container=p):(this.createRegularContainer(),this.container=this.regularContainer)}this.shadowRoot=document}}else{var f=document.getElementById("ttp-widget-shadow-host");f&&f.remove();var B=document.getElementById("ttp-widget-container");if(B&&B.remove(),!1===u){var w=document.getElementById("ttp-widget-styles");w&&w.remove()}this.config.useShadowDOM?(this.createShadowHost(),this.container=this.shadowRoot):(this.createRegularContainer(),this.container=this.regularContainer,this.shadowRoot=document)}var v=this.config.language||"en",m=Pn(Pn(Pn({},this.config),this.config.voice),{},{language:v,translations:this.translations,shadowRoot:this.shadowRoot,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===(r=this.config.voice)||void 0===r?void 0:r.outputSampleRate)||44100,outputChannels:(null===(i=this.config.voice)||void 0===i?void 0:i.outputChannels)||1,outputBitDepth:(null===(a=this.config.voice)||void 0===a?void 0:a.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 yn(m);var y=Pn(Pn(Pn({},this.config),this.config.text),{},{language:v,translations:this.translations,shadowRoot:this.shadowRoot});this.textInterface=new xn(y,this.sdk),this.createWidget(),this.textInterface&&this.textInterface.updateInputAttributes&&this.textInterface.updateInputAttributes()}},{key:"destroy",value:function(){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()}},{key:"startVoiceCall",value:(t=Dn(Hn().m(function A(){return Hn().w(function(A){for(;;)switch(A.n){case 0:return A.n=1,this.voiceInterface.startVoiceCall();case 1:this._flushPendingClientTools();case 2:return A.a(2)}},A,this)})),function(){return t.apply(this,arguments)})},{key:"endVoiceCall",value:function(){this.voiceInterface.endVoiceCall()}},{key:"toggleMute",value:function(){this.voiceInterface.toggleMute()}},{key:"toggleSpeaker",value:function(){this.voiceInterface.toggleSpeaker()}},{key:"registerToolHandler",value:function(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)}},{key:"unregisterToolHandler",value:function(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(function(e){return e.name!==A})),this)}},{key:"hasToolHandler",value:function(A){var e;return!(null===(e=this.voiceInterface)||void 0===e||!e.sdk)&&this.voiceInterface.sdk.hasToolHandler(A)}},{key:"getRegisteredTools",value:function(){var A;return null!==(A=this.voiceInterface)&&void 0!==A&&A.sdk?this.voiceInterface.sdk.getRegisteredTools():this._pendingClientTools?this._pendingClientTools.map(function(A){return A.name}):[]}},{key:"_flushPendingClientTools",value:function(){var A,e=this;this._pendingClientTools&&null!==(A=this.voiceInterface)&&void 0!==A&&A.sdk&&(this._pendingClientTools.forEach(function(A){var t=A.name,n=A.handler;e.voiceInterface.sdk.registerToolHandler(t,n)}),this._pendingClientTools=null,console.log("TTPChatWidget: Flushed pending client tools"))}},{key:"registerClientTool",value:function(A,e){return this.registerToolHandler(A,e)}},{key:"unregisterClientTool",value:function(A){return this.unregisterToolHandler(A)}},{key:"hasClientTool",value:function(A){return this.hasToolHandler(A)}},{key:"getRegisteredClientTools",value:function(){return this.getRegisteredTools()}}],e&&Rn(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n,o,r}(),_n="2.18.0";const Gn={VoiceSDK_v2:re,TextChatSDK:Ce,WebSocketManager:We,AudioRecorder:ot,AudioPlayer:pt,EventEmitter:ce,VoiceButton:Et,VanillaVoiceButton:Pt,AgentSDK:Yt,TTPChatWidget:Vn,VERSION:_n}})(),n})());
|
|
2
|
+
!function(A,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.TTPAgentSDK=e():A.TTPAgentSDK=e()}(window,()=>(()=>{var A={354:function(A){A.exports=function(){"use strict";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,r){function i(A){try{s(n.next(A))}catch(A){r(A)}}function a(A){try{s(n.throw(A))}catch(A){r(A)}}function s(A){var e;A.done?o(A.value):(e=A.value,e instanceof t?e:new t(function(A){A(e)})).then(i,a)}s((n=n.apply(A,e||[])).next())})}function o(A,e){var t,n,o,r,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return r={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r;function a(r){return function(a){return function(r){if(t)throw new TypeError("Generator is already executing.");for(;i;)try{if(t=1,n&&(o=2&r[0]?n.return:r[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,r[1])).done)return o;switch(n=0,o&&(r=[2&r[0],o.value]),r[0]){case 0:case 1:o=r;break;case 4:return i.label++,{value:r[1],done:!1};case 5:i.label++,n=r[1],r=[0];continue;case 7:r=i.ops.pop(),i.trys.pop();continue;default:if(!((o=(o=i.trys).length>0&&o[o.length-1])||6!==r[0]&&2!==r[0])){i=0;continue}if(3===r[0]&&(!o||r[1]>o[0]&&r[1]<o[3])){i.label=r[1];break}if(6===r[0]&&i.label<o[1]){i.label=o[1],o=r;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(r);break}o[2]&&i.ops.pop(),i.trys.pop();continue}r=e.call(A,i)}catch(A){r=[6,A],n=0}finally{t=o=0}if(5&r[0])throw r[1];return{value:r[0]?r[1]:void 0,done:!0}}([r,a])}}}function r(A,e,t){if(t||2===arguments.length)for(var n,o=0,r=e.length;o<r;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 i=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}(),a=function(A,e){return i.fromClientRect(A,e.getBoundingClientRect())},s=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 r=A.charCodeAt(t++);56320==(64512&r)?e.push(((1023&o)<<10)+(1023&r)+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,r="";++o<t;){var i=A[o];i<=65535?n.push(i):(i-=65536,n.push(55296+(i>>10),i%1024+56320)),(o+1===t||n.length>16384)&&(r+=String.fromCharCode.apply(String,n),n.length=0)}return r},l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u="undefined"==typeof Uint8Array?[]:new Uint8Array(256),d=0;d<64;d++)u[l.charCodeAt(d)]=d;for(var g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",p="undefined"==typeof Uint8Array?[]:new Uint8Array(256),h=0;h<64;h++)p[g.charCodeAt(h)]=h;for(var f=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},B=function(){function A(A,e,t,n,o,r){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=n,this.index=o,this.data=r}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}(),w="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",m="undefined"==typeof Uint8Array?[]:new Uint8Array(256),v=0;v<64;v++)m[w.charCodeAt(v)]=v;var y=10,C=13,b=15,Q=17,F=18,U=19,x=20,E=21,S=22,I=24,H=25,k=26,T=27,D=28,O=30,K=32,P=33,L=34,M=35,R=37,V=38,_=39,G=40,j=42,N=[9001,65288],W="×",J="÷",X=function(A){var e,t,n,o=function(A){var e,t,n,o,r,i=.75*A.length,a=A.length,s=0;"="===A[A.length-1]&&(i--,"="===A[A.length-2]&&i--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(i):new Array(i),l=Array.isArray(c)?c:new Uint8Array(c);for(e=0;e<a;e+=4)t=p[A.charCodeAt(e)],n=p[A.charCodeAt(e+1)],o=p[A.charCodeAt(e+2)],r=p[A.charCodeAt(e+3)],l[s++]=t<<2|n>>4,l[s++]=(15&n)<<4|o>>2,l[s++]=(3&o)<<6|63&r;return c}(A),r=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),i=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),a=f(i,12,r[4]/2),s=2===r[5]?f(i,(24+r[4])/2):(e=r,t=Math.ceil((24+r[4])/4),e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,t,n)));return new B(r[0],r[1],r[2],r[3],a,s)}("KwAAAAAAAAAACA4AUD0AADAgAAACAAAAAAAIABAAGABAAEgAUABYAGAAaABgAGgAYgBqAF8AZwBgAGgAcQB5AHUAfQCFAI0AlQCdAKIAqgCyALoAYABoAGAAaABgAGgAwgDKAGAAaADGAM4A0wDbAOEA6QDxAPkAAQEJAQ8BFwF1AH0AHAEkASwBNAE6AUIBQQFJAVEBWQFhAWgBcAF4ATAAgAGGAY4BlQGXAZ8BpwGvAbUBvQHFAc0B0wHbAeMB6wHxAfkBAQIJAvEBEQIZAiECKQIxAjgCQAJGAk4CVgJeAmQCbAJ0AnwCgQKJApECmQKgAqgCsAK4ArwCxAIwAMwC0wLbAjAA4wLrAvMC+AIAAwcDDwMwABcDHQMlAy0DNQN1AD0DQQNJA0kDSQNRA1EDVwNZA1kDdQB1AGEDdQBpA20DdQN1AHsDdQCBA4kDkQN1AHUAmQOhA3UAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AHUAdQB1AKYDrgN1AHUAtgO+A8YDzgPWAxcD3gPjA+sD8wN1AHUA+wMDBAkEdQANBBUEHQQlBCoEFwMyBDgEYABABBcDSARQBFgEYARoBDAAcAQzAXgEgASIBJAEdQCXBHUAnwSnBK4EtgS6BMIEyAR1AHUAdQB1AHUAdQCVANAEYABgAGAAYABgAGAAYABgANgEYADcBOQEYADsBPQE/AQEBQwFFAUcBSQFLAU0BWQEPAVEBUsFUwVbBWAAYgVgAGoFcgV6BYIFigWRBWAAmQWfBaYFYABgAGAAYABgAKoFYACxBbAFuQW6BcEFwQXHBcEFwQXPBdMF2wXjBeoF8gX6BQIGCgYSBhoGIgYqBjIGOgZgAD4GRgZMBmAAUwZaBmAAYABgAGAAYABgAGAAYABgAGAAYABgAGIGYABpBnAGYABgAGAAYABgAGAAYABgAGAAYAB4Bn8GhQZgAGAAYAB1AHcDFQSLBmAAYABgAJMGdQA9A3UAmwajBqsGqwaVALMGuwbDBjAAywbSBtIG1QbSBtIG0gbSBtIG0gbdBuMG6wbzBvsGAwcLBxMHAwcbByMHJwcsBywHMQcsB9IGOAdAB0gHTgfSBkgHVgfSBtIG0gbSBtIG0gbSBtIG0gbSBiwHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAdgAGAALAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsBywHLAcsB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AAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAALAcsBywHLAcsBywHLAcsBywHLAcsB4oILAcsB44I0gaWCJ4Ipgh1AHUAqgiyCHUAdQB1AHUAdQB1AHUAdQB1AHUAtwh8AXUAvwh1AMUIyQjRCNkI4AjoCHUAdQB1AO4I9gj+CAYJDgkTCS0HGwkjCYIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiCCIIIggiAAIAAAAFAAYABgAGIAXwBgAHEAdQBFAJUAogCyAKAAYABgAEIA4ABGANMA4QDxAMEBDwE1AFwBLAE6AQEBUQF4QkhCmEKoQrhCgAHIQsAB0MLAAcABwAHAAeDC6ABoAHDCwMMAAcABwAHAAdDDGMMAAcAB6MM4wwjDWMNow3jDaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAGgAaABoAEjDqABWw6bDqABpg6gAaABoAHcDvwOPA+gAaABfA/8DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DvwO/A78DpcPAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABwAHAAcABw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VAJUAlQCVAJUAlQCVAEwPMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAA//8EAAQABAAEAAQABAAEAAQABAANAAMAAQABAAIABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQACgATABcAHgAbABoAHgAXABYAEgAeABsAGAAPABgAHABLAEsASwBLAEsASwBLAEsASwBLABgAGAAeAB4AHgATAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABYAGwASAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWAA0AEQAeAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAFAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAJABYAGgAbABsAGwAeAB0AHQAeAE8AFwAeAA0AHgAeABoAGwBPAE8ADgBQAB0AHQAdAE8ATwAXAE8ATwBPABYAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB0AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AH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AQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUAAeAB4AHgAeAB4AHgBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAYAA0AKwArAB4AHgAbACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAB4ABAAEAB4ABAAEABMABAArACsAKwArACsAKwArACsAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAVgBWAFYAKwArACsAKwBWAFYAVgBWAB4AHgArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AGgAaABoAGAAYAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQAEwAEACsAEwATAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABLAEsASwBLAEsASwBLAEsASwBLABoAGQAZAB4AUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQABMAUAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABABQAFAABAAEAB4ABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUAAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwAeAFAABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQAUABQAB4AHgAYABMAUAArACsABAAbABsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAFAABAAEAAQABAAEAFAABAAEAAQAUAAEAAQABAAEAAQAKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArACsAHgArAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAUAAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEAA0ADQBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUAArACsAKwBQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABABQACsAKwArACsAKwArACsAKwAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUAAaABoAUABQAFAAUABQAEwAHgAbAFAAHgAEACsAKwAEAAQABAArAFAAUABQAFAAUABQACsAKwArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQACsAUABQACsAKwAEACsABAAEAAQABAAEACsAKwArACsABAAEACsAKwAEAAQABAArACsAKwAEACsAKwArACsAKwArACsAUABQAFAAUAArAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLAAQABABQAFAAUAAEAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsAKwAEAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAArACsAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AGwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAKwArACsAKwArAAQABAAEACsAKwArACsAUABQACsAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAAQAUAArAFAAUABQAFAAUABQACsAKwArAFAAUABQACsAUABQAFAAUAArACsAKwBQAFAAKwBQACsAUABQACsAKwArAFAAUAArACsAKwBQAFAAUAArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArAAQABAAEAAQABAArACsAKwAEAAQABAArAAQABAAEAAQAKwArAFAAKwArACsAKwArACsABAArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAHgAeAB4AHgAeAB4AGwAeACsAKwArACsAKwAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAUABQAFAAKwArACsAKwArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwAOAFAAUABQAFAAUABQAFAAHgBQAAQABAAEAA4AUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAKwArAAQAUAAEAAQABAAEAAQABAAEACsABAAEAAQAKwAEAAQABAAEACsAKwArACsAKwArACsABAAEACsAKwArACsAKwArACsAUAArAFAAUAAEAAQAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAFAABAAEAAQABAAEAAQABAArAAQABAAEACsABAAEAAQABABQAB4AKwArACsAKwBQAFAAUAAEAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQABoAUABQAFAAUABQAFAAKwAEAAQABAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQACsAUAArACsAUABQAFAAUABQAFAAUAArACsAKwAEACsAKwArACsABAAEAAQABAAEAAQAKwAEACsABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArAAQABAAeACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAXAAqACoAKgAqACoAKgAqACsAKwArACsAGwBcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAeAEsASwBLAEsASwBLAEsASwBLAEsADQANACsAKwArACsAKwBcAFwAKwBcACsAXABcAFwAXABcACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAXAArAFwAXABcAFwAXABcAFwAXABcAFwAKgBcAFwAKgAqACoAKgAqACoAKgAqACoAXAArACsAXABcAFwAXABcACsAXAArACoAKgAqACoAKgAqACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwBcAFwAXABcAFAADgAOAA4ADgAeAA4ADgAJAA4ADgANAAkAEwATABMAEwATAAkAHgATAB4AHgAeAAQABAAeAB4AHgAeAB4AHgBLAEsASwBLAEsASwBLAEsASwBLAFAAUABQAFAAUABQAFAAUABQAFAADQAEAB4ABAAeAAQAFgARABYAEQAEAAQAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQADQAEAAQABAAEAAQADQAEAAQAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAA0ADQAeAB4AHgAeAB4AHgAEAB4AHgAeAB4AHgAeACsAHgAeAA4ADgANAA4AHgAeAB4AHgAeAAkACQArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgBcAEsASwBLAEsASwBLAEsASwBLAEsADQANAB4AHgAeAB4AXABcAFwAXABcAFwAKgAqACoAKgBcAFwAXABcACoAKgAqAFwAKgAqACoAXABcACoAKgAqACoAKgAqACoAXABcAFwAKgAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKgAqAFwAKgBLAEsASwBLAEsASwBLAEsASwBLACoAKgAqACoAKgAqAFAAUABQAFAAUABQACsAUAArACsAKwArACsAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgBQAFAAUABQAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWQBZAFkAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFoAWgBaAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAKwBQACsAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsABAAEAAQAHgANAB4AHgAeAB4AHgAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUAArACsADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAWABEAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQANAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAANAA0AKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUAArAAQABAArACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqAA0ADQAVAFwADQAeAA0AGwBcACoAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwAeAB4AEwATAA0ADQAOAB4AEwATAB4ABAAEAAQACQArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAHgArACsAKwATABMASwBLAEsASwBLAEsASwBLAEsASwBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAXABcAFwAXABcACsAKwArACsAKwArACsAKwArACsAKwBcAFwAXABcAFwAXABcAFwAXABcAFwAXAArACsAKwArAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAXAArACsAKwAqACoAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAArACsAHgAeAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcACoAKgAqACoAKgAqACoAKgAqACoAKwAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKwArAAQASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACoAKgAqACoAKgAqACoAXAAqACoAKgAqACoAKgArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABABQAFAAUABQAFAAUABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwANAA0AHgANAA0ADQANAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAEAAQABAAEAAQAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwAeAB4AHgAeAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArAA0ADQANAA0ADQBLAEsASwBLAEsASwBLAEsASwBLACsAKwArAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAA0ADQBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUAAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArAAQABAAEAB4ABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAAQAUABQAFAAUABQAFAABABQAFAABAAEAAQAUAArACsAKwArACsABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAKwBQACsAUAArAFAAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAFAAUABQACsAHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAUABQACsAKwAeAB4AHgAeAB4AHgArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AKwArAFAAUABQACsAHgAeAB4AHgAeAB4AHgAOAB4AKwANAA0ADQANAA0ADQANAAkADQANAA0ACAAEAAsABAAEAA0ACQANAA0ADAAdAB0AHgAXABcAFgAXABcAFwAWABcAHQAdAB4AHgAUABQAFAANAAEAAQAEAAQABAAEAAQACQAaABoAGgAaABoAGgAa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wArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAA0ADQANAA0ADQANAA0ADQAeAA0AFgANAB4AHgAXABcAHgAeABcAFwAWABEAFgARABYAEQAWABEADQANAA0ADQATAFAADQANAB4ADQANAB4AHgAeAB4AHgAMAAwADQANAA0AHgANAA0AFgANAA0ADQANAA0ADQANAA0AHgANAB4ADQANAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwArACsAKwArACsAKwArACsAKwArACsAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAlACUAJQAlACUAJQAlACUAJQAlACUAJQArACsAKwArAA0AEQARACUAJQBHAFcAVwAWABEAFgARABYAEQAWABEAFgARACUAJQAWABEAFgARABYAEQAWABEAFQAWABEAEQAlAFcAVwBXAFcAVwBXAFcAVwBXAAQABAAEAAQABAAEACUAVwBXAFcAVwA2ACUAJQBXAFcAVwBHAEcAJQAlACUAKwBRAFcAUQBXAFEAVwBRAFcAUQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFEAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBRAFcAUQBXAFEAVwBXAFcA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ArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADQATAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABLAEsASwBLAEsASwBLAEsASwBLAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAABAAEAAQABAAeAAQABAAEAAQABAAEAAQABAAEAAQAHgBQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUABQAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAeAA0ADQANAA0ADQArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AUAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAB4AHgAeAB4AHgAeAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAHgAeAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AUABQAFAAUABQAFAAUABQAFAAUABQAAQAUABQAFAABABQAFAAUABQAAQAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAeAB4AHgAeAAQAKwArACsAUABQAFAAUABQAFAAHgAeABoAHgArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAADgAOABMAEwArACsAKwArACsAKwArACsABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwANAA0ASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUAAeAB4AHgBQAA4AUABQAAQAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArAB4AWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYAFgAWABYACsAKwArAAQAHgAeAB4AHgAeAB4ADQANAA0AHgAeAB4AHgArAFAASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArAB4AHgBcAFwAXABcAFwAKgBcAFwAXABcAFwAXABcAFwAXABcAEsASwBLAEsASwBLAEsASwBLAEsAXABcAFwAXABcACsAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAFAAUABQAAQAUABQAFAAUABQAFAAUABQAAQABAArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAHgANAA0ADQBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKgAqACoAXAAqACoAKgBcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXAAqAFwAKgAqACoAXABcACoAKgBcAFwAXABcAFwAKgAqAFwAKgBcACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFwAXABcACoAKgBQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAA0ADQBQAFAAUAAEAAQAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAF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UABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAEQAWAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAaAB4AKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAGAARABEAGAAYABMAEwAWABEAFAArACsAKwArACsAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACUAJQAlACUAJQAWABEAFgARABYAEQAWABEAFgARABYAEQAlACUAFgARACUAJQAlACUAJQAlACUAEQAlABEAKwAVABUAEwATACUAFgARABYAEQAWABEAJQAlACUAJQAlACUAJQAlACsAJQAbABoAJQArACsAKwArAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAcAKwATACUAJQAbABoAJQAlABYAEQAlACUAEQAlABEAJQBXAFcAVwBXAFcAVwBXAFcAVwBXABUAFQAlACUAJQATACUAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXABYAJQARACUAJQAlAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwAWACUAEQAlABYAEQARABYAEQARABUAVwBRAFEAUQBRAFEAUQBRAFEAUQBRAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAEcARwArACsAVwBXAFcAVwBXAFcAKwArAFcAVwBXAFcAVwBXACsAKwBXAFcAVwBXAFcAVwArACsAVwBXAFcAKwArACsAGgAbACUAJQAlABsAGwArAB4AHgAeAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwAEAAQABAAQAB0AKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsADQANAA0AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAB4AHgAeAB4AHgAeAB4AHgAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgBQAFAAHgAeAB4AKwAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAA0AUABQAFAAUAArACsAKwArAFAAUABQAFAAUABQAFAAUAANAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwArAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwBQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwANAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAB4AUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAUABQAFAAUABQAAQABAAEACsABAAEACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAKwBQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAA0ADQANAA0ADQANAA0ADQAeACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAArACsAKwArAFAAUABQAFAAUAANAA0ADQANAA0ADQAUACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsADQANAA0ADQANAA0ADQBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAB4AHgAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArAAQABAANACsAKwBQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAB4AHgAeAB4AHgArACsAKwArACsAKwAEAAQABAAEAAQABAAEAA0ADQAeAB4AHgAeAB4AKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwAeACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEACsASwBLAEsASwBLAEsASwBLAEsASwANAA0ADQANAFAABAAEAFAAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAeAA4AUAArACsAKwArACsAKwArACsAKwAEAFAAUABQAFAADQANAB4ADQAEAAQABAAEAB4ABAAEAEsASwBLAEsASwBLAEsASwBLAEsAUAAOAFAADQANAA0AKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAANAA0AHgANAA0AHgAEACsAUABQAFAAUABQAFAAUAArAFAAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAA0AKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsABAAEAAQABAArAFAAUABQAFAAUABQAFAAUAArACsAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQACsABAAEAFAABAAEAAQABAAEAAQABAArACsABAAEACsAKwAEAAQABAArACsAUAArACsAKwArACsAKwAEACsAKwArACsAKwBQAFAAUABQAFAABAAEACsAKwAEAAQABAAEAAQABAAEACsAKwArAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsABAAEAAQABAAEAAQABABQAFAAUABQAA0ADQANAA0AHgBLAEsASwBLAEsASwBLAEsASwBLAA0ADQArAB4ABABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAFAAUAAeAFAAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABAAEAAQADgANAA0AEwATAB4AHgAeAA0ADQANAA0ADQANAA0ADQANAA0ADQANAA0ADQANAFAAUABQAFAABAAEACsAKwAEAA0ADQAeAFAAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAFAAKwArACsAKwArACsAKwBLAEsASwBLAEsASwBLAEsASwBLACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAXABcAFwAKwArACoAKgAqACoAKgAqACoAKgAqACoAKgAqACoAKgAqACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBcAFwADQANAA0AKgBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAKwArAFAAKwArAFAAUABQAFAAUABQAFAAUAArAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQAKwAEAAQAKwArAAQABAAEAAQAUAAEAFAABAAEAA0ADQANACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAArACsABAAEAAQABAAEAAQABABQAA4AUAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAABAAEAAQABAAEAAQABAAEAAQABABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAFAABAAEAAQABAAOAB4ADQANAA0ADQAOAB4ABAArACsAKwArACsAKwArACsAUAAEAAQABAAEAAQABAAEAAQABAAEAAQAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAA0ADQANAFAADgAOAA4ADQANACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAEAAQABAAEACsABAAEAAQABAAEAAQABAAEAFAADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAOABMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQACsAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAArACsAKwAEACsABAAEACsABAAEAAQABAAEAAQABABQAAQAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArACsAUABQAFAAUABQAFAAKwBQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAUAArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAABAAEAAQABAAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAB4AHgAeAB4AHgAeAB4AHgAaABoAGgAaAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArACsAKwArAA0AUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsADQANAA0ADQANACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABIAEgAQwBDAEMAUABQAFAAUABDAFAAUABQAEgAQwBIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAASABDAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwAJAAkACQAJAAkACQAJABYAEQArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABIAEMAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwANAA0AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArAAQABAAEAAQABAANACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEAA0ADQANAB4AHgAeAB4AHgAeAFAAUABQAFAADQAeACsAKwArACsAKwArACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArAFAAUABQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAANAA0AHgAeACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwAEAFAABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwAEAAQABAAEAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAARwBHABUARwAJACsAKwArACsAKwArACsAKwArACsAKwAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUQBRAFEAKwArACsAKwArACsAKwArACsAKwArACsAKwBRAFEAUQBRACsAKwArACsAKwArACsAKwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUAArACsAHgAEAAQADQAEAAQABAAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgArACsAKwArACsAKwArACsAKwArAB4AHgAeAB4AHgAeAB4AKwArAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAAQABAAEAAQABAAeAB4AHgAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAB4AHgAEAAQABAAEAAQABAAEAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4ABAAEAAQAHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQ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EsASwBLAEsASwBLAEsASwBLAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAeAB4AHgAeAB4AHgAeAB4ABAAeAB4AHgAeAB4AHgAeAB4AHgAeAAQAHgAeAA0ADQANAA0AHgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQAKwAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArAAQABAAEAAQABAAEAAQAKwAEAAQAKwAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwAEAAQABAAEAAQABAAEAFAAUABQAFAAUABQAFAAKwArAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwBQAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAEsASwBLAEsASwBLAEsASwBLAEsAKwArACsAKwArABsAUABQAFAAUABQACsAKwBQAFAAUABQAFAAUABQAFAAUAAEAAQABAAEAAQABAAEACsAKwArACsAKwArACsAKwArAB4AHgAeAB4ABAAEAAQABAAEAAQABABQACsAKwArACsASwBLAEsASwBLAEsASwBLAEsASwArACsAKwArABYAFgArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAGgBQAFAAUAAaAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAAeAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQACsAKwBQAFAAUABQACsAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUAArACsAKwArACsAKwBQACsAKwArACsAUAArAFAAKwBQACsAUABQAFAAKwBQAFAAKwBQACsAKwBQACsAUAArAFAAKwBQACsAUAArAFAAUAArAFAAKwArAFAAUABQAFAAKwBQAFAAUABQAFAAUABQACsAUABQAFAAUAArAFAAUABQAFAAKwBQACsAUABQAFAAUABQAFAAUABQAFAAUAArAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUAArACsAKwArACsAUABQAFAAKwBQAFAAUABQAFAAKwBQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAUABQAFAAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwAeAB4AKwArACsAKwArACsAKwArACsAKwArACsAKwArAE8ATwBPAE8ATwBPAE8ATwBPAE8ATwBPAE8AJQAlACUAHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHgAeAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB4AHgAeACUAJQAlAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAdAB0AHQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAKQApACkAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAlACUAJQAlACUAHgAlACUAJQAlACUAIAAgACAAJQAlACAAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACEAIQAhACEAIQAlACUAIAAgACUAJQAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAJQAlACUAIAAlACUAJQAlACAAIAAgACUAIAAgACAAJQAlACUAJQAlACUAJQAgACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAlAB4AJQAeACUAJQAlACUAJQAgACUAJQAlACUAHgAlAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlAB4AHgAeAB4AHgAeAB4AJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAgACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAHgAeAB4AHgAeAB4AHgAeACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACAAIAAgACAAIAAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeAB4AHgAeABcAFwAXABUAFQAVAB4AHgAeAB4AJQAlACUAIAAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACAAIAAgACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACAAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAeAB4AHgAeAB4AHgAeAB4AHgAe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ACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQBXAFcAVwBXAFcAVwBXAFcAVwBXAFcAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAJQAlACUAKwAEACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQABAAEAAQAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArACsAKwArAA=="),z=[O,36],Y=[1,2,3,5],Z=[y,8],q=[T,k],$=Y.concat(Z),AA=[V,_,G,L,M],eA=[b,C],tA=function(A,e,t,n){var o=n[t];if(Array.isArray(A)?-1!==A.indexOf(o):A===o)for(var r=t;r<=n.length;){if((s=n[++r])===e)return!0;if(s!==y)break}if(o===y)for(r=t;r>0;){var i=n[--r];if(Array.isArray(A)?-1!==A.indexOf(i):A===i)for(var a=t;a<=n.length;){var s;if((s=n[++a])===e)return!0;if(s!==y)break}if(i!==y)break}return!1},nA=function(A,e){for(var t=A;t>=0;){var n=e[t];if(n!==y)return n;t--}return 0},oA=function(A,e,t,n,o){if(0===t[n])return W;var r=n-1;if(Array.isArray(o)&&!0===o[r])return W;var i=r-1,a=r+1,s=e[r],c=i>=0?e[i]:0,l=e[a];if(2===s&&3===l)return W;if(-1!==Y.indexOf(s))return"!";if(-1!==Y.indexOf(l))return W;if(-1!==Z.indexOf(l))return W;if(8===nA(r,e))return J;if(11===X.get(A[r]))return W;if((s===K||s===P)&&11===X.get(A[a]))return W;if(7===s||7===l)return W;if(9===s)return W;if(-1===[y,C,b].indexOf(s)&&9===l)return W;if(-1!==[Q,F,U,I,D].indexOf(l))return W;if(nA(r,e)===S)return W;if(tA(23,S,r,e))return W;if(tA([Q,F],E,r,e))return W;if(tA(12,12,r,e))return W;if(s===y)return J;if(23===s||23===l)return W;if(16===l||16===s)return J;if(-1!==[C,b,E].indexOf(l)||14===s)return W;if(36===c&&-1!==eA.indexOf(s))return W;if(s===D&&36===l)return W;if(l===x)return W;if(-1!==z.indexOf(l)&&s===H||-1!==z.indexOf(s)&&l===H)return W;if(s===T&&-1!==[R,K,P].indexOf(l)||-1!==[R,K,P].indexOf(s)&&l===k)return W;if(-1!==z.indexOf(s)&&-1!==q.indexOf(l)||-1!==q.indexOf(s)&&-1!==z.indexOf(l))return W;if(-1!==[T,k].indexOf(s)&&(l===H||-1!==[S,b].indexOf(l)&&e[a+1]===H)||-1!==[S,b].indexOf(s)&&l===H||s===H&&-1!==[H,D,I].indexOf(l))return W;if(-1!==[H,D,I,Q,F].indexOf(l))for(var u=r;u>=0;){if((d=e[u])===H)return W;if(-1===[D,I].indexOf(d))break;u--}if(-1!==[T,k].indexOf(l))for(u=-1!==[Q,F].indexOf(s)?i:r;u>=0;){var d;if((d=e[u])===H)return W;if(-1===[D,I].indexOf(d))break;u--}if(V===s&&-1!==[V,_,L,M].indexOf(l)||-1!==[_,L].indexOf(s)&&-1!==[_,G].indexOf(l)||-1!==[G,M].indexOf(s)&&l===G)return W;if(-1!==AA.indexOf(s)&&-1!==[x,k].indexOf(l)||-1!==AA.indexOf(l)&&s===T)return W;if(-1!==z.indexOf(s)&&-1!==z.indexOf(l))return W;if(s===I&&-1!==z.indexOf(l))return W;if(-1!==z.concat(H).indexOf(s)&&l===S&&-1===N.indexOf(A[a])||-1!==z.concat(H).indexOf(l)&&s===F)return W;if(41===s&&41===l){for(var g=t[r],p=1;g>0&&41===e[--g];)p++;if(p%2!=0)return W}return s===K&&l===P?W:J},rA=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,r){var i=X.get(A);if(i>50?(o.push(!0),i-=50):o.push(!1),-1!==["normal","auto","loose"].indexOf(e)&&-1!==[8208,8211,12316,12448].indexOf(A))return n.push(r),t.push(16);if(4===i||11===i){if(0===r)return n.push(r),t.push(O);var a=t[r-1];return-1===$.indexOf(a)?(n.push(n[r-1]),t.push(a)):(n.push(r),t.push(O))}return n.push(r),31===i?t.push("strict"===e?E:R):i===j||29===i?t.push(O):43===i?A>=131072&&A<=196605||A>=196608&&A<=262141?t.push(R):t.push(O):void t.push(i)}),[n,t,o]}(A,e.lineBreak),n=t[0],o=t[1],r=t[2];"break-all"!==e.wordBreak&&"break-word"!==e.wordBreak||(o=o.map(function(A){return-1!==[H,O,j].indexOf(A)?R:A}));var i="keep-all"===e.wordBreak?r.map(function(e,t){return e&&A[t]>=19968&&A[t]<=40959}):void 0;return[n,o,i]},iA=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}(),aA=45,sA=43,cA=-1,lA=function(A){return A>=48&&A<=57},uA=function(A){return lA(A)||A>=65&&A<=70||A>=97&&A<=102},dA=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===aA},hA=function(A){return A>=0&&A<=8||11===A||A>=14&&A<=31||127===A},fA=function(A,e){return 92===A&&10!==e},BA=function(A,e,t){return A===aA?gA(e)||fA(e,t):!!gA(A)||!(92!==A||!fA(A,e))},wA=function(A,e,t){return A===sA||A===aA?!!lA(e)||46===e&&lA(t):lA(46===A?e:A)},mA=function(A){var e=0,t=1;A[e]!==sA&&A[e]!==aA||(A[e]===aA&&(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 r=[];lA(A[e]);)r.push(A[e++]);var i=r.length,a=i?parseInt(c.apply(void 0,r),10):0;69!==A[e]&&101!==A[e]||e++;var s=1;A[e]!==sA&&A[e]!==aA||(A[e]===aA&&(s=-1),e++);for(var l=[];lA(A[e]);)l.push(A[e++]);var u=l.length?parseInt(c.apply(void 0,l),10):0;return t*(o+a*Math.pow(10,-i))*Math.pow(10,s*u)},vA={type:2},yA={type:3},CA={type:4},bA={type:13},QA={type:8},FA={type:21},UA={type:9},xA={type:10},EA={type:11},SA={type:12},IA={type:14},HA={type:23},kA={type:1},TA={type:25},DA={type:24},OA={type:26},KA={type:27},PA={type:28},LA={type:29},MA={type:31},RA={type:32},VA=function(){function A(){this._value=[]}return A.prototype.write=function(A){this._value=this._value.concat(s(A))},A.prototype.read=function(){for(var A=[],e=this.consumeToken();e!==RA;)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)||fA(t,n)){var o=BA(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 vA;case 41:return yA;case 42:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),IA;break;case sA:if(wA(A,this.peekCodePoint(0),this.peekCodePoint(1)))return this.reconsumeCodePoint(A),this.consumeNumericToken();break;case 44:return CA;case aA:var r=A,i=this.peekCodePoint(0),a=this.peekCodePoint(1);if(wA(r,i,a))return this.reconsumeCodePoint(A),this.consumeNumericToken();if(BA(r,i,a))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();if(i===aA&&62===a)return this.consumeCodePoint(),this.consumeCodePoint(),DA;break;case 46:if(wA(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 s=this.consumeCodePoint();if(42===s&&47===(s=this.consumeCodePoint()))return this.consumeToken();if(s===cA)return this.consumeToken()}break;case 58:return OA;case 59:return KA;case 60:if(33===this.peekCodePoint(0)&&this.peekCodePoint(1)===aA&&this.peekCodePoint(2)===aA)return this.consumeCodePoint(),this.consumeCodePoint(),TA;break;case 64:var l=this.peekCodePoint(0),u=this.peekCodePoint(1),d=this.peekCodePoint(2);if(BA(l,u,d))return{type:7,value:this.consumeName()};break;case 91:return PA;case 92:if(fA(A,this.peekCodePoint(0)))return this.reconsumeCodePoint(A),this.consumeIdentLikeToken();break;case 93:return LA;case 61:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),QA;break;case 123:return EA;case 125:return SA;case 117:case 85:var g=this.peekCodePoint(0),p=this.peekCodePoint(1);return g!==sA||!uA(p)&&63!==p||(this.consumeCodePoint(),this.consumeUnicodeRangeToken()),this.reconsumeCodePoint(A),this.consumeIdentLikeToken();case 124:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),UA;if(124===this.peekCodePoint(0))return this.consumeCodePoint(),FA;break;case 126:if(61===this.peekCodePoint(0))return this.consumeCodePoint(),xA;break;case cA:return RA}return dA(A)?(this.consumeWhiteSpace(),MA):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();uA(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)===aA&&uA(this.peekCodePoint(1))){this.consumeCodePoint(),e=this.consumeCodePoint();for(var o=[];uA(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(),HA)}for(;;){var n=this.consumeCodePoint();if(n===cA||41===n)return{type:22,value:c.apply(void 0,A)};if(dA(n))return this.consumeWhiteSpace(),this.peekCodePoint(0)===cA||41===this.peekCodePoint(0)?(this.consumeCodePoint(),{type:22,value:c.apply(void 0,A)}):(this.consumeBadUrlRemnants(),HA);if(34===n||39===n||40===n||hA(n))return this.consumeBadUrlRemnants(),HA;if(92===n){if(!fA(n,this.peekCodePoint(0)))return this.consumeBadUrlRemnants(),HA;A.push(this.consumeEscapedCodePoint())}else A.push(n)}},A.prototype.consumeWhiteSpace=function(){for(;dA(this.peekCodePoint(0));)this.consumeCodePoint()},A.prototype.consumeBadUrlRemnants=function(){for(;;){var A=this.consumeCodePoint();if(41===A||A===cA)return;fA(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),kA;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()):fA(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!==sA&&t!==aA||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===sA||n===aA)&&lA(o)||lA(n)))for(A.push(this.consumeCodePoint(),this.consumeCodePoint()),e=8;lA(this.peekCodePoint(0));)A.push(this.consumeCodePoint());return[mA(A),e]},A.prototype.consumeNumericToken=function(){var A=this.consumeNumber(),e=A[0],t=A[1],n=this.peekCodePoint(0),o=this.peekCodePoint(1),r=this.peekCodePoint(2);return BA(n,o,r)?{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(uA(A)){for(var e=c(A);uA(this.peekCodePoint(0))&&e.length<6;)e+=c(this.consumeCodePoint());dA(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(!fA(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||ZA(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?RA:A},A.prototype.reconsumeToken=function(A){this._tokens.unshift(A)},A}(),GA=function(A){return 15===A.type},jA=function(A){return 17===A.type},NA=function(A){return 20===A.type},WA=function(A){return 0===A.type},JA=function(A,e){return NA(A)&&A.value===e},XA=function(A){return 31!==A.type},zA=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},ZA=function(A,e){return 11===e&&12===A.type||28===e&&29===A.type||2===e&&3===A.type},qA=function(A){return 17===A.type||15===A.type},$A=function(A){return 16===A.type||qA(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[re(n,e),re(void 0!==o?o:n,t)]},re=function(A,e){if(16===A.type)return A.number/100*e;if(GA(A))switch(A.unit){case"rem":case"em":return 16*A.number;default:return A.number}return A.number},ie="grad",ae="turn",se=function(A,e){if(15===e.type)switch(e.unit){case"deg":return Math.PI*e.number/180;case ie:return Math.PI/200*e.number;case"rad":return e.number;case ae:return 2*Math.PI*e.number}throw new Error("Unsupported angle type")},ce=function(A){return 15===A.type&&("deg"===A.unit||A.unit===ie||"rad"===A.unit||A.unit===ae)},le=function(A){switch(A.filter(NA).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 ue(0);case"to bottom left":case"to left bottom":case"right top":case"top right":return[ee,ne];case"to right":case"left":return ue(90);case"to top left":case"to left top":case"right bottom":case"bottom right":return[ne,ne];case"to bottom":case"top":return ue(180);case"to top right":case"to right top":case"left bottom":case"bottom left":return[ne,ee];case"to left":case"right":return ue(270)}return 0},ue=function(A){return Math.PI*A/180},de=function(A,e){if(18===e.type){var t=ve[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),r=e.value.substring(2,3);return he(parseInt(n+n,16),parseInt(o+o,16),parseInt(r+r,16),1)}if(4===e.value.length){n=e.value.substring(0,1),o=e.value.substring(1,2),r=e.value.substring(2,3);var i=e.value.substring(3,4);return he(parseInt(n+n,16),parseInt(o+o,16),parseInt(r+r,16),parseInt(i+i,16)/255)}if(6===e.value.length)return n=e.value.substring(0,2),o=e.value.substring(2,4),r=e.value.substring(4,6),he(parseInt(n,16),parseInt(o,16),parseInt(r,16),1);if(8===e.value.length)return n=e.value.substring(0,2),o=e.value.substring(2,4),r=e.value.substring(4,6),i=e.value.substring(6,8),he(parseInt(n,16),parseInt(o,16),parseInt(r,16),parseInt(i,16)/255)}if(20===e.type){var a=Ce[e.value.toUpperCase()];if(void 0!==a)return a}return Ce.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},fe=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},Be=function(A,e){var t=e.filter(zA);if(3===t.length){var n=t.map(fe),o=n[0],r=n[1],i=n[2];return he(o,r,i,1)}if(4===t.length){var a=t.map(fe),s=(o=a[0],r=a[1],i=a[2],a[3]);return he(o,r,i,s)}return 0};function we(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 me=function(A,e){var t=e.filter(zA),n=t[0],o=t[1],r=t[2],i=t[3],a=(17===n.type?ue(n.number):se(A,n))/(2*Math.PI),s=$A(o)?o.number/100:0,c=$A(r)?r.number/100:0,l=void 0!==i&&$A(i)?re(i,1):1;if(0===s)return he(255*c,255*c,255*c,1);var u=c<=.5?c*(s+1):c+s-c*s,d=2*c-u,g=we(d,u,a+1/3),p=we(d,u,a),h=we(d,u,a-1/3);return he(255*g,255*p,255*h,l)},ve={hsl:me,hsla:me,rgb:Be,rgba:Be},ye=function(A,e){return de(A,_A.create(e).parseComponentValue())},Ce={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(NA(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Qe={name:"background-color",initialValue:"transparent",prefix:!1,type:3,format:"color"},Fe=function(A,e){var t=de(A,e[0]),n=e[1];return n&&$A(n)?{color:t,stop:n}:{color:t,stop:null}},Ue=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=[],r=0,i=0;i<A.length;i++){var a=A[i].stop;if(null!==a){var s=re(a,e);s>r?o.push(s):o.push(r),r=s}else o.push(null)}var c=null;for(i=0;i<o.length;i++){var l=o[i];if(null===l)null===c&&(c=i);else if(null!==c){for(var u=i-c,d=(l-o[c-1])/(u+1),g=1;g<=u;g++)o[c+g-1]=d*g;c=null}}return A.map(function(A,t){return{color:A.color,stop:Math.max(Math.min(1,o[t]/e),0)}})},xe=function(A,e,t){var n="number"==typeof A?A:function(A,e,t){var n=e/2,o=t/2,r=re(A[0],e)-n,i=o-re(A[1],t);return(Math.atan2(i,r)+2*Math.PI)%(2*Math.PI)}(A,e,t),o=Math.abs(e*Math.sin(n))+Math.abs(t*Math.cos(n)),r=e/2,i=t/2,a=o/2,s=Math.sin(n-Math.PI/2)*a,c=Math.cos(n-Math.PI/2)*a;return[o,r-c,r+c,i-s,i+s]},Ee=function(A,e){return Math.sqrt(A*A+e*e)},Se=function(A,e,t,n,o){return[[0,0],[0,e],[A,0],[A,e]].reduce(function(A,e){var r=e[0],i=e[1],a=Ee(t-r,n-i);return(o?a<A.optimumDistance:a>A.optimumDistance)?{optimumCorner:e,optimumDistance:a}:A},{optimumDistance:o?1/0:-1/0,optimumCorner:null}).optimumCorner},Ie=function(A,e){var t=ue(180),n=[];return YA(e).forEach(function(e,o){if(0===o){var r=e[0];if(20===r.type&&-1!==["top","left","right","bottom"].indexOf(r.value))return void(t=le(e));if(ce(r))return void(t=(se(A,r)+ue(270))%ue(360))}var i=Fe(A,e);n.push(i)}),{angle:t,stops:n,type:1}},He="closest-side",ke="farthest-side",Te="closest-corner",De="farthest-corner",Oe="circle",Ke="ellipse",Pe="cover",Le="contain",Me=function(A,e){var t=0,n=3,o=[],r=[];return YA(e).forEach(function(e,i){var a=!0;if(0===i?a=e.reduce(function(A,e){if(NA(e))switch(e.value){case"center":return r.push(te),!1;case"top":case"left":return r.push(ee),!1;case"right":case"bottom":return r.push(ne),!1}else if($A(e)||qA(e))return r.push(e),!1;return A},a):1===i&&(a=e.reduce(function(A,e){if(NA(e))switch(e.value){case Oe:return t=0,!1;case Ke:return t=1,!1;case Le:case He:return n=0,!1;case ke:return n=1,!1;case Te:return n=2,!1;case Pe:case De:return n=3,!1}else if(qA(e)||$A(e))return Array.isArray(n)||(n=[]),n.push(e),!1;return A},a)),a){var s=Fe(A,e);o.push(s)}}),{size:n,shape:t,stops:o,position:r,type:2}},Re=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=ue(180),n=[];return YA(e).forEach(function(e,o){if(0===o){var r=e[0];if(20===r.type&&"to"===r.value)return void(t=le(e));if(ce(r))return void(t=se(A,r))}var i=Fe(A,e);n.push(i)}),{angle:t,stops:n,type:1}},"-moz-linear-gradient":Ie,"-ms-linear-gradient":Ie,"-o-linear-gradient":Ie,"-webkit-linear-gradient":Ie,"radial-gradient":function(A,e){var t=0,n=3,o=[],r=[];return YA(e).forEach(function(e,i){var a=!0;if(0===i){var s=!1;a=e.reduce(function(A,e){if(s)if(NA(e))switch(e.value){case"center":return r.push(te),A;case"top":case"left":return r.push(ee),A;case"right":case"bottom":return r.push(ne),A}else($A(e)||qA(e))&&r.push(e);else if(NA(e))switch(e.value){case Oe:return t=0,!1;case Ke:return t=1,!1;case"at":return s=!0,!1;case He:return n=0,!1;case Pe:case ke:return n=1,!1;case Le:case Te:return n=2,!1;case De:return n=3,!1}else if(qA(e)||$A(e))return Array.isArray(n)||(n=[]),n.push(e),!1;return A},a)}if(a){var c=Fe(A,e);o.push(c)}}),{size:n,shape:t,stops:o,position:r,type:2}},"-moz-radial-gradient":Me,"-ms-radial-gradient":Me,"-o-radial-gradient":Me,"-webkit-radial-gradient":Me,"-webkit-gradient":function(A,e){var t=ue(180),n=[],o=1;return YA(e).forEach(function(e,t){var r=e[0];if(0===t){if(NA(r)&&"linear"===r.value)return void(o=1);if(NA(r)&&"radial"===r.value)return void(o=2)}if(18===r.type)if("from"===r.name){var i=de(A,r.values[0]);n.push({stop:ee,color:i})}else if("to"===r.name)i=de(A,r.values[0]),n.push({stop:ne,color:i});else if("color-stop"===r.name){var a=r.values.filter(zA);if(2===a.length){i=de(A,a[1]);var s=a[0];jA(s)&&n.push({stop:{type:16,number:100*s.number,flags:s.flags},color:i})}}}),1===o?{angle:(t+ue(180))%ue(360),stops:n,type:o}:{size:3,shape:0,stops:n,position:[],type:o}}},Ge={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 zA(A)&&function(A){return!(20===A.type&&"none"===A.value||18===A.type&&!_e[A.name])}(A)}).map(function(e){return Re(A,e)})}},je={name:"background-origin",initialValue:"border-box",prefix:!1,type:1,parse:function(A,e){return e.map(function(A){if(NA(A))switch(A.value){case"padding-box":return 1;case"content-box":return 2}return 0})}},Ne={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)}},We={name:"background-repeat",initialValue:"repeat",prefix:!1,type:1,parse:function(A,e){return YA(e).map(function(A){return A.filter(NA).map(function(A){return A.value}).join(" ")}).map(Je)}},Je=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,ze={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 NA(A)||$A(A)},Ze=function(A){return{name:"border-"+A+"-color",initialValue:"transparent",prefix:!1,type:3,format:"color"}},qe=Ze("top"),$e=Ze("right"),At=Ze("bottom"),et=Ze("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"),rt=tt("bottom-right"),it=tt("bottom-left"),at=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}}},st=at("top"),ct=at("right"),lt=at("bottom"),ut=at("left"),dt=function(A){return{name:"border-"+A+"-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return GA(e)?e.number:0}}},gt=dt("top"),pt=dt("right"),ht=dt("bottom"),ft=dt("left"),Bt={name:"color",initialValue:"transparent",prefix:!1,type:3,format:"color"},wt={name:"direction",initialValue:"ltr",prefix:!1,type:2,parse:function(A,e){return"rtl"===e?1:0}},mt={name:"display",initialValue:"inline-block",prefix:!1,type:1,parse:function(A,e){return e.filter(NA).reduce(function(A,e){return A|vt(e.value)},0)}},vt=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},yt={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}},Ct={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,Qt={name:"line-break",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"strict"===e?Xe.STRICT:Xe.NORMAL}},Ft={name:"line-height",initialValue:"normal",prefix:!1,type:4},Ut=function(A,e){return NA(A)&&"normal"===A.value?1.2*e:17===A.type?e*A.number:$A(A)?re(A,e):e},xt={name:"list-style-image",initialValue:"none",type:0,prefix:!1,parse:function(A,e){return 20===e.type&&"none"===e.value?null:Re(A,e)}},Et={name:"list-style-position",initialValue:"outside",prefix:!1,type:2,parse:function(A,e){return"inside"===e?0:1}},St={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}}},It=function(A){return{name:"margin-"+A,initialValue:"0",prefix:!1,type:4}},Ht=It("top"),kt=It("right"),Tt=It("bottom"),Dt=It("left"),Ot={name:"overflow",initialValue:"visible",prefix:!1,type:1,parse:function(A,e){return e.filter(NA).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}})}},Kt={name:"overflow-wrap",initialValue:"normal",prefix:!1,type:2,parse:function(A,e){return"break-word"===e?"break-word":"normal"}},Pt=function(A){return{name:"padding-"+A,initialValue:"0",prefix:!1,type:3,format:"length-percentage"}},Lt=Pt("top"),Mt=Pt("right"),Rt=Pt("bottom"),Vt=Pt("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}}},Gt={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}},jt={name:"text-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&JA(e[0],"none")?[]:YA(e).map(function(e){for(var t={color:Ce.TRANSPARENT,offsetX:ee,offsetY:ee,blur:ee},n=0,o=0;o<e.length;o++){var r=e[o];qA(r)?(0===n?t.offsetX=r:1===n?t.offsetY=r:t.blur=r,n++):t.color=de(A,r)}return t})}},Nt={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}},Wt={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=Jt[e.name];if(void 0===t)throw new Error('Attempting to parse an unsupported transform function "'+e.name+'"');return t(e.values)}return null}},Jt={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],r=e[5];e[6],e[7],e[8],e[9],e[10],e[11];var i=e[12],a=e[13];return e[14],e[15],16===e.length?[t,n,o,r,i,a]:null}},Xt={type:16,number:50,flags:4},zt=[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?zt:[t[0],t[1]]}},Zt={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 qt={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(jA(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 jA(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(NA).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"},an={name:"font-weight",initialValue:"normal",type:0,prefix:!1,parse:function(A,e){return jA(e)?e.number:NA(e)&&"bold"===e.value?700:400}},sn={name:"font-variant",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return e.filter(NA).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)},un={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}},dn={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),r=0;r<o.length;r++){var i=o[r],a=o[r+1];if(20===i.type){var s=a&&jA(a)?a.number:1;n.push({counter:i.value,increment:s})}}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 r=n[o],i=n[o+1];if(NA(r)&&"none"!==r.value){var a=i&&jA(i)?i.number:0;t.push({counter:r.value,reset:a})}}return t}},pn={name:"duration",initialValue:"0s",prefix:!1,type:1,parse:function(A,e){return e.filter(GA).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(WA);if(o.length%2!=0)return null;for(var r=0;r<o.length;r+=2){var i=o[r].value,a=o[r+1].value;n.push({open:i,close:a})}return n}},fn=function(A,e,t){if(!A)return"";var n=A[Math.min(e,A.length-1)];return n?t?n.open:n.close:""},Bn={name:"box-shadow",initialValue:"none",type:1,prefix:!1,parse:function(A,e){return 1===e.length&&JA(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 r=e[o];JA(r,"inset")?t.inset=!0:qA(r)?(0===n?t.offsetX=r:1===n?t.offsetY=r:2===n?t.blur=r:t.spread=r,n++):t.color=de(A,r)}return t})}},wn={name:"paint-order",initialValue:"normal",prefix:!1,type:1,parse:function(A,e){var t=[];return e.filter(NA).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}},mn={name:"-webkit-text-stroke-color",initialValue:"currentcolor",prefix:!1,type:3,format:"color"},vn={name:"-webkit-text-stroke-width",initialValue:"0",type:0,prefix:!1,parse:function(A,e){return GA(e)?e.number:0}},yn=function(){function A(A,e){var t,n;this.animationDuration=Qn(A,pn,e.animationDuration),this.backgroundClip=Qn(A,be,e.backgroundClip),this.backgroundColor=Qn(A,Qe,e.backgroundColor),this.backgroundImage=Qn(A,Ge,e.backgroundImage),this.backgroundOrigin=Qn(A,je,e.backgroundOrigin),this.backgroundPosition=Qn(A,Ne,e.backgroundPosition),this.backgroundRepeat=Qn(A,We,e.backgroundRepeat),this.backgroundSize=Qn(A,ze,e.backgroundSize),this.borderTopColor=Qn(A,qe,e.borderTopColor),this.borderRightColor=Qn(A,$e,e.borderRightColor),this.borderBottomColor=Qn(A,At,e.borderBottomColor),this.borderLeftColor=Qn(A,et,e.borderLeftColor),this.borderTopLeftRadius=Qn(A,nt,e.borderTopLeftRadius),this.borderTopRightRadius=Qn(A,ot,e.borderTopRightRadius),this.borderBottomRightRadius=Qn(A,rt,e.borderBottomRightRadius),this.borderBottomLeftRadius=Qn(A,it,e.borderBottomLeftRadius),this.borderTopStyle=Qn(A,st,e.borderTopStyle),this.borderRightStyle=Qn(A,ct,e.borderRightStyle),this.borderBottomStyle=Qn(A,lt,e.borderBottomStyle),this.borderLeftStyle=Qn(A,ut,e.borderLeftStyle),this.borderTopWidth=Qn(A,gt,e.borderTopWidth),this.borderRightWidth=Qn(A,pt,e.borderRightWidth),this.borderBottomWidth=Qn(A,ht,e.borderBottomWidth),this.borderLeftWidth=Qn(A,ft,e.borderLeftWidth),this.boxShadow=Qn(A,Bn,e.boxShadow),this.color=Qn(A,Bt,e.color),this.direction=Qn(A,wt,e.direction),this.display=Qn(A,mt,e.display),this.float=Qn(A,yt,e.cssFloat),this.fontFamily=Qn(A,on,e.fontFamily),this.fontSize=Qn(A,rn,e.fontSize),this.fontStyle=Qn(A,cn,e.fontStyle),this.fontVariant=Qn(A,sn,e.fontVariant),this.fontWeight=Qn(A,an,e.fontWeight),this.letterSpacing=Qn(A,Ct,e.letterSpacing),this.lineBreak=Qn(A,Qt,e.lineBreak),this.lineHeight=Qn(A,Ft,e.lineHeight),this.listStyleImage=Qn(A,xt,e.listStyleImage),this.listStylePosition=Qn(A,Et,e.listStylePosition),this.listStyleType=Qn(A,St,e.listStyleType),this.marginTop=Qn(A,Ht,e.marginTop),this.marginRight=Qn(A,kt,e.marginRight),this.marginBottom=Qn(A,Tt,e.marginBottom),this.marginLeft=Qn(A,Dt,e.marginLeft),this.opacity=Qn(A,en,e.opacity);var o=Qn(A,Ot,e.overflow);this.overflowX=o[0],this.overflowY=o[o.length>1?1:0],this.overflowWrap=Qn(A,Kt,e.overflowWrap),this.paddingTop=Qn(A,Lt,e.paddingTop),this.paddingRight=Qn(A,Mt,e.paddingRight),this.paddingBottom=Qn(A,Rt,e.paddingBottom),this.paddingLeft=Qn(A,Vt,e.paddingLeft),this.paintOrder=Qn(A,wn,e.paintOrder),this.position=Qn(A,Gt,e.position),this.textAlign=Qn(A,_t,e.textAlign),this.textDecorationColor=Qn(A,tn,null!==(t=e.textDecorationColor)&&void 0!==t?t:e.color),this.textDecorationLine=Qn(A,nn,null!==(n=e.textDecorationLine)&&void 0!==n?n:e.textDecoration),this.textShadow=Qn(A,jt,e.textShadow),this.textTransform=Qn(A,Nt,e.textTransform),this.transform=Qn(A,Wt,e.transform),this.transformOrigin=Qn(A,Yt,e.transformOrigin),this.visibility=Qn(A,Zt,e.visibility),this.webkitTextStrokeColor=Qn(A,mn,e.webkitTextStrokeColor),this.webkitTextStrokeWidth=Qn(A,vn,e.webkitTextStrokeWidth),this.wordBreak=Qn(A,qt,e.wordBreak),this.zIndex=Qn(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}(),Cn=function(A,e){this.content=Qn(A,un,e.content),this.quotes=Qn(A,hn,e.quotes)},bn=function(A,e){this.counterIncrement=Qn(A,dn,e.counterIncrement),this.counterReset=Qn(A,gn,e.counterReset)},Qn=function(A,e,t){var n=new VA,o=null!=t?t.toString():e.initialValue;n.write(o);var r=new _A(n.read());switch(e.type){case 2:var i=r.parseComponentValue();return e.parse(A,NA(i)?i.value:e.initialValue);case 0:return e.parse(A,r.parseComponentValue());case 1:return e.parse(A,r.parseComponentValues());case 4:return r.parseComponentValue();case 3:switch(e.format){case"angle":return se(A,r.parseComponentValue());case"color":return de(A,r.parseComponentValue());case"image":return Re(A,r.parseComponentValue());case"length":var a=r.parseComponentValue();return qA(a)?a:ee;case"length-percentage":var s=r.parseComponentValue();return $A(s)?s:ee;case"time":return An.parse(A,r.parseComponentValue())}}},Fn=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},Un=function(A,e){this.context=A,this.textNodes=[],this.elements=[],this.flags=0,Fn(e,3),this.styles=new yn(A,window.getComputedStyle(e,null)),Ho(e)&&(this.styles.animationDuration.some(function(A){return A>0})&&(e.style.animationDuration="0s"),null!==this.styles.transform&&(e.style.transform="none")),this.bounds=a(this.context,e),Fn(e,4)&&(this.flags|=16)},xn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",En="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Sn=0;Sn<64;Sn++)En[xn.charCodeAt(Sn)]=Sn;for(var In=function(A,e,t){return A.slice?A.slice(e,t):new Uint16Array(Array.prototype.slice.call(A,e,t))},Hn=function(){function A(A,e,t,n,o,r){this.initialValue=A,this.errorValue=e,this.highStart=t,this.highValueIndex=n,this.index=o,this.data=r}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}(),kn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Tn="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Dn=0;Dn<64;Dn++)Tn[kn.charCodeAt(Dn)]=Dn;var On,Kn=8,Pn=9,Ln=11,Mn=12,Rn=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,r="";++o<t;){var i=A[o];i<=65535?n.push(i):(i-=65536,n.push(55296+(i>>10),i%1024+56320)),(o+1===t||n.length>16384)&&(r+=String.fromCharCode.apply(String,n),n.length=0)}return r},Vn=function(A){var e,t,n,o=function(A){var e,t,n,o,r,i=.75*A.length,a=A.length,s=0;"="===A[A.length-1]&&(i--,"="===A[A.length-2]&&i--);var c="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array&&void 0!==Uint8Array.prototype.slice?new ArrayBuffer(i):new Array(i),l=Array.isArray(c)?c:new Uint8Array(c);for(e=0;e<a;e+=4)t=En[A.charCodeAt(e)],n=En[A.charCodeAt(e+1)],o=En[A.charCodeAt(e+2)],r=En[A.charCodeAt(e+3)],l[s++]=t<<2|n>>4,l[s++]=(15&n)<<4|o>>2,l[s++]=(3&o)<<6|63&r;return c}(A),r=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),i=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),a=In(i,12,r[4]/2),s=2===r[5]?In(i,(24+r[4])/2):(e=r,t=Math.ceil((24+r[4])/4),e.slice?e.slice(t,n):new Uint32Array(Array.prototype.slice.call(e,t,n)));return new Hn(r[0],r[1],r[2],r[3],a,s)}("AAAAAAAAAAAAEA4AGBkAAFAaAAACAAAAAAAIABAAGAAwADgACAAQAAgAEAAIABAACAAQAAgAEAAIABAACAAQAAgAEAAIABAAQABIAEQATAAIABAACAAQAAgAEAAIABAAVABcAAgAEAAIABAACAAQAGAAaABwAHgAgACIAI4AlgAIABAAmwCjAKgAsAC2AL4AvQDFAMoA0gBPAVYBWgEIAAgACACMANoAYgFkAWwBdAF8AX0BhQGNAZUBlgGeAaMBlQGWAasBswF8AbsBwwF0AcsBYwHTAQgA2wG/AOMBdAF8AekB8QF0AfkB+wHiAHQBfAEIAAMC5gQIAAsCEgIIAAgAFgIeAggAIgIpAggAMQI5AkACygEIAAgASAJQAlgCYAIIAAgACAAKBQoFCgUTBRMFGQUrBSsFCAAIAAgACAAIAAgACAAIAAgACABdAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABoAmgCrwGvAQgAbgJ2AggAHgEIAAgACADnAXsCCAAIAAgAgwIIAAgACAAIAAgACACKAggAkQKZAggAPADJAAgAoQKkAqwCsgK6AsICCADJAggA0AIIAAgACAAIANYC3gIIAAgACAAIAAgACABAAOYCCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAkASoB+QIEAAgACAA8AEMCCABCBQgACABJBVAFCAAIAAgACAAIAAgACAAIAAgACABTBVoFCAAIAFoFCABfBWUFCAAIAAgACAAIAAgAbQUIAAgACAAIAAgACABzBXsFfQWFBYoFigWKBZEFigWKBYoFmAWfBaYFrgWxBbkFCAAIAAgACAAIAAgACAAIAAgACAAIAMEFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAMgFCADQBQgACAAIAAgACAAIAAgACAAIAAgACAAIAO4CCAAIAAgAiQAIAAgACABAAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAD0AggACAD8AggACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIANYFCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAMDvwAIAAgAJAIIAAgACAAIAAgACAAIAAgACwMTAwgACAB9BOsEGwMjAwgAKwMyAwsFYgE3A/MEPwMIAEUDTQNRAwgAWQOsAGEDCAAIAAgACAAIAAgACABpAzQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTYFNwU4BTkFOgU0BTUFNgU3BTgFOQU6BTQFNQU2BTcFOAU5BToFNAU1BTY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gACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAB+BAcACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAEABhgSMBAgACAAIAAgAlAQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAwAEAAQABAADAAMAAwADAAQABAAEAAQABAAEAAQABHATAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAAMAAwADAACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAdQMIAAgACAAIAAgACAAIAMkACAAIAAgAfQMIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACACFA4kDCAAIAAgACAAIAOcBCAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAIcDCAAIAAgACAAIAAgACAAIAAgACAAIAJEDCAAIAAgACADFAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABgBAgAZgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgAbAQCBXIECAAIAHkECAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACABAAJwEQACjBKoEsgQIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAAIAAgACAC6BMIECAAIAAgACAAIAAgACABmBAgACAAIAAgACAAIA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4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4ADgAOAAAAAAAAAAAAAAAAAAAAAAAAAAAADgAOAA4ADgAOAA4AAAAAAAAAAAAAAAAAAAAAAA4ADgAOAA4ADgAOAA4ADgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAOAA4ADgAOAA4ADgAAAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4ADgAOAA4AAAAAAAAAAAA="),_n="×",Gn=function(A){return Vn.get(A)},jn=function(A,e,t){var n=t-2,o=e[n],r=e[t-1],i=e[t];if(2===r&&3===i)return _n;if(2===r||3===r||4===r)return"÷";if(2===i||3===i||4===i)return"÷";if(r===Kn&&-1!==[Kn,Pn,Ln,Mn].indexOf(i))return _n;if(!(r!==Ln&&r!==Pn||i!==Pn&&10!==i))return _n;if((r===Mn||10===r)&&10===i)return _n;if(13===i||5===i)return _n;if(7===i)return _n;if(1===r)return _n;if(13===r&&14===i){for(;5===o;)o=e[--n];if(14===o)return _n}if(15===r&&15===i){for(var a=0;15===o;)a++,o=e[--n];if(a%2==0)return _n}return"÷"},Nn=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 r=A.charCodeAt(t++);56320==(64512&r)?e.push(((1023&o)<<10)+(1023&r)+65536):(e.push(o),t--)}else e.push(o)}return e}(A),t=e.length,n=0,o=0,r=e.map(Gn);return{next:function(){if(n>=t)return{done:!0,value:null};for(var A=_n;n<t&&(A=jn(0,r,++n))===_n;);if(A!==_n||n===t){var i=Rn.apply(null,e.slice(o,n));return o=n,{value:i,done:!1}}return{done:!0,value:null}}}},Wn=function(A){return 0===A[0]&&255===A[1]&&0===A[2]&&255===A[3]},Jn=function(A,e,t,n,o){var r="http://www.w3.org/2000/svg",i=document.createElementNS(r,"svg"),a=document.createElementNS(r,"foreignObject");return i.setAttributeNS(null,"width",A.toString()),i.setAttributeNS(null,"height",e.toString()),a.setAttributeNS(null,"width","100%"),a.setAttributeNS(null,"height","100%"),a.setAttributeNS(null,"x",t.toString()),a.setAttributeNS(null,"y",n.toString()),a.setAttributeNS(null,"externalResourcesRequired","true"),i.appendChild(a),a.appendChild(o),i},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))})},zn={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(zn,"SUPPORT_RANGE_BOUNDS",{value:A}),A},get SUPPORT_WORD_BREAKING(){var A=zn.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?"👨".repeat(10):"";var n=e.firstChild,o=s(n.data).map(function(A){return c(A)}),r=0,i={},a=o.every(function(A,e){t.setStart(n,r),t.setEnd(n,r+A.length);var o=t.getBoundingClientRect();r+=A.length;var a=o.x>i.x||o.y>i.y;return i=o,0===e||a});return A.body.removeChild(e),a}(document);return Object.defineProperty(zn,"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(zn,"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,r=e.toDataURL();o.src=r;var i=Jn(t,t,0,0,o);return n.fillStyle="red",n.fillRect(0,0,t,t),Xn(i).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 i=A.createElement("div");return i.style.backgroundImage="url("+r+")",i.style.height=t+"px",Wn(o)?Xn(Jn(t,t,0,0,i)):Promise.reject(!1)}).then(function(A){return n.drawImage(A,0,0),Wn(n.getImageData(0,0,t,t).data)}).catch(function(){return!1})}(document):Promise.resolve(!1);return Object.defineProperty(zn,"SUPPORT_FOREIGNOBJECT_DRAWING",{value:A}),A},get SUPPORT_CORS_IMAGES(){var A=void 0!==(new Image).crossOrigin;return Object.defineProperty(zn,"SUPPORT_CORS_IMAGES",{value:A}),A},get SUPPORT_RESPONSE_TYPE(){var A="string"==typeof(new XMLHttpRequest).responseType;return Object.defineProperty(zn,"SUPPORT_RESPONSE_TYPE",{value:A}),A},get SUPPORT_CORS_XHR(){var A="withCredentials"in new XMLHttpRequest;return Object.defineProperty(zn,"SUPPORT_CORS_XHR",{value:A}),A},get SUPPORT_NATIVE_TEXT_SEGMENTATION(){var A=!("undefined"==typeof Intl||!Intl.Segmenter);return Object.defineProperty(zn,"SUPPORT_NATIVE_TEXT_SEGMENTATION",{value:A}),A}},Yn=function(A,e){this.text=A,this.bounds=e},Zn=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 r=a(A,n);return n.firstChild&&o.replaceChild(n.firstChild,n),r}}return i.EMPTY},qn=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(zn.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=Nn(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(zn.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=s(A),n=rA(t,e),o=n[0],r=n[1],i=n[2],a=t.length,c=0,l=0;return{next:function(){if(l>=a)return{done:!0,value:null};for(var A=W;l<a&&(A=oA(t,r,o,++l,i))===W;);if(A!==W||l===a){var e=new iA(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=[],r=function(){if(t.value){var A=t.value.slice(),e=s(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;)r();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),r=[],a=0;return o.forEach(function(e){if(t.textDecorationLine.length||e.trim().length>0)if(zn.SUPPORT_RANGE_BOUNDS){var o=qn(n,a,e.length).getClientRects();if(o.length>1){var s=$n(e),c=0;s.forEach(function(e){r.push(new Yn(e,i.fromDOMRectList(A,qn(n,c+a,e.length).getClientRects()))),c+=e.length})}else r.push(new Yn(e,i.fromDOMRectList(A,o)))}else{var l=n.splitText(e.length);r.push(new Yn(e,Zn(A,n))),n=l}else zn.SUPPORT_RANGE_BOUNDS||(n=n.splitText(e.length));a+=e.length}),r}(A,this.text,t,e)},oo=function(A,e){switch(e){case 1:return A.toLowerCase();case 3:return A.replace(ro,io);case 2:return A.toUpperCase();default:return A}},ro=/(^|\s|:|-|\(|\))([a-z])/g,io=function(A,e,t){return A.length>0?e+t.toUpperCase():A},ao=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}(Un),so=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}(Un),co=function(A){function t(e,t){var n=A.call(this,e,t)||this,o=new XMLSerializer,r=a(e,t);return t.setAttribute("width",r.width+"px"),t.setAttribute("height",r.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}(Un),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}(Un),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}(Un),go=[{type:15,flags:0,unit:"px",number:3}],po=[{type:16,flags:0,number:50}],ho="checkbox",fo="radio",Bo="password",wo=707406591,mo=function(A){function t(e,t){var n,o,r,a=A.call(this,e,t)||this;switch(a.type=t.type.toLowerCase(),a.checked=t.checked,a.value=0===(r=(o=t).type===Bo?new Array(o.value.length+1).join("•"):o.value).length?o.placeholder||"":r,a.type!==ho&&a.type!==fo||(a.styles.backgroundColor=3739148031,a.styles.borderTopColor=a.styles.borderRightColor=a.styles.borderBottomColor=a.styles.borderLeftColor=2779096575,a.styles.borderTopWidth=a.styles.borderRightWidth=a.styles.borderBottomWidth=a.styles.borderLeftWidth=1,a.styles.borderTopStyle=a.styles.borderRightStyle=a.styles.borderBottomStyle=a.styles.borderLeftStyle=1,a.styles.backgroundClip=[0],a.styles.backgroundOrigin=[0],a.bounds=(n=a.bounds).width>n.height?new i(n.left+(n.width-n.height)/2,n.top,n.height,n.height):n.width<n.height?new i(n.left,n.top+(n.height-n.width)/2,n.width,n.width):n),a.type){case ho:a.styles.borderTopRightRadius=a.styles.borderTopLeftRadius=a.styles.borderBottomRightRadius=a.styles.borderBottomLeftRadius=go;break;case fo:a.styles.borderTopRightRadius=a.styles.borderTopLeftRadius=a.styles.borderBottomRightRadius=a.styles.borderBottomLeftRadius=po}return a}return e(t,A),t}(Un),vo=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}(Un),yo=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}(Un),Co=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=Uo(e,t.contentWindow.document.documentElement);var o=t.contentWindow.document.documentElement?ye(e,getComputedStyle(t.contentWindow.document.documentElement).backgroundColor):Ce.TRANSPARENT,r=t.contentWindow.document.body?ye(e,getComputedStyle(t.contentWindow.document.body).backgroundColor):Ce.TRANSPARENT;n.backgroundColor=ge(o)?ge(r)?n.styles.backgroundColor:r:o}}catch(A){}return n}return e(t,A),t}(Un),bo=["OL","UL","MENU"],Qo=function(A,e,t,n){for(var o=e.firstChild,r=void 0;o;o=r)if(r=o.nextSibling,So(o)&&o.data.trim().length>0)t.textNodes.push(new no(A,o,t.styles));else if(Io(o))if(No(o)&&o.assignedNodes)o.assignedNodes().forEach(function(e){return Qo(A,e,t,n)});else{var i=Fo(A,o);i.styles.isVisible()&&(xo(o,i,n)?i.flags|=4:Eo(i.styles)&&(i.flags|=2),-1!==bo.indexOf(o.tagName)&&(i.flags|=8),t.elements.push(i),o.slot,o.shadowRoot?Qo(A,o.shadowRoot,i,n):Go(o)||Ko(o)||jo(o)||Qo(A,o,i,n))}},Fo=function(A,e){return Ro(e)?new ao(A,e):Lo(e)?new so(A,e):Ko(e)?new co(A,e):To(e)?new lo(A,e):Do(e)?new uo(A,e):Oo(e)?new mo(A,e):jo(e)?new vo(A,e):Go(e)?new yo(A,e):Vo(e)?new Co(A,e):new Un(A,e)},Uo=function(A,e){var t=Fo(A,e);return t.flags|=4,Qo(A,e,t,t),t},xo=function(A,e,t){return e.styles.isPositionedWithZIndex()||e.styles.opacity<1||e.styles.isTransformed()||Po(A)&&t.styles.isTransparent()},Eo=function(A){return A.isPositioned()||A.isFloating()},So=function(A){return A.nodeType===Node.TEXT_NODE},Io=function(A){return A.nodeType===Node.ELEMENT_NODE},Ho=function(A){return Io(A)&&void 0!==A.style&&!ko(A)},ko=function(A){return"object"==typeof A.className},To=function(A){return"LI"===A.tagName},Do=function(A){return"OL"===A.tagName},Oo=function(A){return"INPUT"===A.tagName},Ko=function(A){return"svg"===A.tagName},Po=function(A){return"BODY"===A.tagName},Lo=function(A){return"CANVAS"===A.tagName},Mo=function(A){return"VIDEO"===A.tagName},Ro=function(A){return"IMG"===A.tagName},Vo=function(A){return"IFRAME"===A.tagName},_o=function(A){return"STYLE"===A.tagName},Go=function(A){return"TEXTAREA"===A.tagName},jo=function(A){return"SELECT"===A.tagName},No=function(A){return"SLOT"===A.tagName},Wo=function(A){return A.tagName.indexOf("-")>0},Jo=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 r=[];return o&&n.forEach(function(A){var t=e.counters[A.counter];r.push(A.counter),t||(t=e.counters[A.counter]=[]),t.push(A.reset)}),r},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"]},zo={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:["י׳","ט׳","ח׳","ז׳","ו׳","ה׳","ד׳","ג׳","ב׳","א׳","ת","ש","ר","ק","צ","פ","ע","ס","נ","מ","ל","כ","יט","יח","יז","טז","טו","י","ט","ח","ז","ו","ה","ד","ג","ב","א"]},Zo={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:["ჵ","ჰ","ჯ","ჴ","ხ","ჭ","წ","ძ","ც","ჩ","შ","ყ","ღ","ქ","ფ","ჳ","ტ","ს","რ","ჟ","პ","ო","ჲ","ნ","მ","ლ","კ","ი","თ","ჱ","ზ","ვ","ე","დ","გ","ბ","ა"]},qo=function(A,e,t,n,o,r){return A<e||A>t?ar(A,o,r.length>0):n.integers.reduce(function(e,t,o){for(;A>=t;)A-=t,e+=n.values[o];return e},"")+r},$o=function(A,e,t,n){var o="";do{t||A--,o=n(A)+o,A/=e}while(A*e>=e);return o},Ar=function(A,e,t,n,o){var r=t-e+1;return(A<0?"-":"")+($o(Math.abs(A),r,n,function(A){return c(Math.floor(A%r)+e)})+o)},er=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},tr=function(A,e,t,n,o,r){if(A<-9999||A>9999)return ar(A,4,o.length>0);var i=Math.abs(A),a=o;if(0===i)return e[0]+a;for(var s=0;i>0&&s<=4;s++){var c=i%10;0===c&&ln(r,1)&&""!==a?a=e[c]+a:c>1||1===c&&0===s||1===c&&1===s&&ln(r,2)||1===c&&1===s&&ln(r,4)&&A>100||1===c&&s>1&&ln(r,8)?a=e[c]+(s>0?t[s-1]:"")+a:1===c&&s>0&&(a=t[s-1]+a),i=Math.floor(i/10)}return(A<0?n:"")+a},nr="十百千萬",or="拾佰仟萬",rr="マイナス",ir="마이너스",ar=function(A,e,t){var n=t?". ":"",o=t?"、":"",r=t?", ":"",i=t?" ":"";switch(e){case 0:return"•"+i;case 1:return"◦"+i;case 2:return"◾"+i;case 5:var a=Ar(A,48,57,!0,n);return a.length<4?"0"+a:a;case 4:return er(A,"〇一二三四五六七八九",o);case 6:return qo(A,1,3999,Xo,3,n).toLowerCase();case 7:return qo(A,1,3999,Xo,3,n);case 8:return Ar(A,945,969,!1,n);case 9:return Ar(A,97,122,!1,n);case 10:return Ar(A,65,90,!1,n);case 11:return Ar(A,1632,1641,!0,n);case 12:case 49:return qo(A,1,9999,zo,3,n);case 35:return qo(A,1,9999,zo,3,n).toLowerCase();case 13:return Ar(A,2534,2543,!0,n);case 14:case 30:return Ar(A,6112,6121,!0,n);case 15:return er(A,"子丑寅卯辰巳午未申酉戌亥",o);case 16:return er(A,"甲乙丙丁戊己庚辛壬癸",o);case 17:case 48:return tr(A,"零一二三四五六七八九",nr,"負",o,14);case 47:return tr(A,"零壹貳參肆伍陸柒捌玖",or,"負",o,15);case 42:return tr(A,"零一二三四五六七八九",nr,"负",o,14);case 41:return tr(A,"零壹贰叁肆伍陆柒捌玖",or,"负",o,15);case 26:return tr(A,"〇一二三四五六七八九","十百千万",rr,o,0);case 25:return tr(A,"零壱弐参四伍六七八九","拾百千万",rr,o,7);case 31:return tr(A,"영일이삼사오육칠팔구","십백천만",ir,r,7);case 33:return tr(A,"零一二三四五六七八九","十百千萬",ir,r,0);case 32:return tr(A,"零壹貳參四五六七八九","拾百千",ir,r,7);case 18:return Ar(A,2406,2415,!0,n);case 20:return qo(A,1,19999,Zo,3,n);case 21:return Ar(A,2790,2799,!0,n);case 22:return Ar(A,2662,2671,!0,n);case 22:return qo(A,1,10999,Yo,3,n);case 23:return er(A,"あいうえおかきくけこさしすせそたちつてとなにぬねのはひふへほまみむめもやゆよらりるれろわゐゑをん");case 24:return er(A,"いろはにほへとちりぬるをわかよたれそつねならむうゐのおくやまけふこえてあさきゆめみしゑひもせす");case 27:return Ar(A,3302,3311,!0,n);case 28:return er(A,"アイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワヰヱヲン",o);case 29:return er(A,"イロハニホヘトチリヌルヲワカヨタレソツネナラムウヰノオクヤマケフコエテアサキユメミシヱヒモセス",o);case 34:return Ar(A,3792,3801,!0,n);case 37:return Ar(A,6160,6169,!0,n);case 38:return Ar(A,4160,4169,!0,n);case 39:return Ar(A,2918,2927,!0,n);case 40:return Ar(A,1776,1785,!0,n);case 43:return Ar(A,3046,3055,!0,n);case 44:return Ar(A,3174,3183,!0,n);case 45:return Ar(A,3664,3673,!0,n);case 46:return Ar(A,3872,3881,!0,n);default:return Ar(A,48,57,!0,n)}},sr="data-html2canvas-ignore",cr=function(){function A(A,e,t){if(this.context=A,this.options=t,this.scrolledElements=[],this.referenceElement=e,this.counters=new Jo,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,r=ur(A,e);if(!r.contentWindow)return Promise.reject("Unable to find iframe window");var i=A.defaultView.pageXOffset,a=A.defaultView.pageYOffset,s=r.contentWindow,c=s.document,l=pr(r).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(mr),s&&(s.scrollTo(e.left,e.top),!/(iPad|iPhone|iPod)/g.test(navigator.userAgent)||s.scrollY===e.top&&s.scrollX===e.left||(this.context.logger.warn("Unable to restore scroll position for cloned document"),this.context.windowBounds=this.context.windowBounds.add(s.scrollX-e.left,s.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,gr(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 r})]:[2,r]}})})});return c.open(),c.write(Br(document.doctype)+"<html></html>"),wr(this.referenceElement.ownerDocument,i,a),c.replaceChild(c.adoptNode(this.documentElement),c.documentElement),c.close(),l},A.prototype.createElementClone=function(A){if(Fn(A,2),Lo(A))return this.createCanvasClone(A);if(Mo(A))return this.createVideoClone(A);if(_o(A))return this.createStyleClone(A);var e=A.cloneNode(!1);return Ro(e)&&(Ro(A)&&A.currentSrc&&A.currentSrc!==A.src&&(e.src=A.currentSrc,e.srcset=""),"lazy"===e.loading&&(e.loading="eager")),Wo(e)?this.createCustomElementClone(e):e},A.prototype.createCustomElementClone=function(A){var e=document.createElement("html2canvascustomelement");return fr(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"),r=n.getContext("2d");if(r)if(!this.options.allowTaint&&o)r.putImageData(o.getImageData(0,0,A.width,A.height),0,0);else{var i=null!==(e=A.getContext("webgl2"))&&void 0!==e?e:A.getContext("webgl");if(i){var a=i.getContextAttributes();!1===(null==a?void 0:a.preserveDrawingBuffer)&&this.context.logger.warn("Unable to clone WebGL context as it has preserveDrawingBuffer=false",A)}r.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){Io(e)&&("SCRIPT"===e.tagName||e.hasAttribute(sr)||"function"==typeof this.options.ignoreElements&&this.options.ignoreElements(e))||this.options.copyStyles&&Io(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(Io(o)&&No(o)&&"function"==typeof o.assignedNodes){var r=o.assignedNodes();r.length&&r.forEach(function(A){return n.appendChildNode(e,A,t)})}else this.appendChildNode(e,o,t)},A.prototype.cloneNode=function(A,e){if(So(A))return document.createTextNode(A.data);if(!A.ownerDocument)return A.cloneNode(!1);var t=A.ownerDocument.defaultView;if(t&&Io(A)&&(Ho(A)||ko(A))){var n=this.createElementClone(A);n.style.transitionProperty="none";var o=t.getComputedStyle(A),r=t.getComputedStyle(A,":before"),i=t.getComputedStyle(A,":after");this.referenceElement===A&&Ho(n)&&(this.clonedReferenceElement=n),Po(n)&&br(n);var a=this.counters.parse(new bn(this.context,o)),s=this.resolvePseudoContent(A,n,r,On.BEFORE);Wo(A)&&(e=!0),Mo(A)||this.cloneChildNodes(A,n,e),s&&n.insertBefore(s,n.firstChild);var c=this.resolvePseudoContent(A,n,i,On.AFTER);return c&&n.appendChild(c),this.counters.pop(a),(o&&(this.options.copyStyles||ko(A))&&!Vo(A)||e)&&fr(o,n),0===A.scrollTop&&0===A.scrollLeft||this.scrolledElements.push([n,A.scrollLeft,A.scrollTop]),(Go(A)||jo(A))&&(Go(n)||jo(n))&&(n.value=A.value),n}return A.cloneNode(!1)},A.prototype.resolvePseudoContent=function(A,e,t,n){var o=this;if(t){var r=t.content,i=e.ownerDocument;if(i&&r&&"none"!==r&&"-moz-alt-content"!==r&&"none"!==t.display){this.counters.parse(new bn(this.context,t));var a=new Cn(this.context,t),s=i.createElement("html2canvaspseudoelement");fr(t,s),a.content.forEach(function(e){if(0===e.type)s.appendChild(i.createTextNode(e.value));else if(22===e.type){var t=i.createElement("img");t.src=e.value,t.style.opacity="1",s.appendChild(t)}else if(18===e.type){if("attr"===e.name){var n=e.values.filter(NA);n.length&&s.appendChild(i.createTextNode(A.getAttribute(n[0].value)||""))}else if("counter"===e.name){var r=e.values.filter(zA),c=r[0],l=r[1];if(c&&NA(c)){var u=o.counters.getCounterValue(c.value),d=l&&NA(l)?St.parse(o.context,l.value):3;s.appendChild(i.createTextNode(ar(u,d,!1)))}}else if("counters"===e.name){var g=e.values.filter(zA),p=(c=g[0],g[1]);if(l=g[2],c&&NA(c)){var h=o.counters.getCounterValues(c.value),f=l&&NA(l)?St.parse(o.context,l.value):3,B=p&&0===p.type?p.value:"",w=h.map(function(A){return ar(A,f,!1)}).join(B);s.appendChild(i.createTextNode(w))}}}else if(20===e.type)switch(e.value){case"open-quote":s.appendChild(i.createTextNode(fn(a.quotes,o.quoteDepth++,!0)));break;case"close-quote":s.appendChild(i.createTextNode(fn(a.quotes,--o.quoteDepth,!1)));break;default:s.appendChild(i.createTextNode(e.value))}}),s.className=vr+" "+yr;var c=n===On.BEFORE?" "+vr:" "+yr;return ko(e)?e.className.baseValue+=c:e.className+=c,s}}},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"}(On||(On={}));var lr,ur=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(sr,"true"),A.body.appendChild(t),t},dr=function(A){return new Promise(function(e){A.complete?e():A.src?(A.onload=e,A.onerror=e):e()})},gr=function(A){return Promise.all([].slice.call(A.images,0).map(dr))},pr=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)}})},hr=["all","d","content"],fr=function(A,e){for(var t=A.length-1;t>=0;t--){var n=A.item(t);-1===hr.indexOf(n)&&e.style.setProperty(n,A.getPropertyValue(n))}return e},Br=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},wr=function(A,e,t){A&&A.defaultView&&(e!==A.defaultView.pageXOffset||t!==A.defaultView.pageYOffset)&&A.defaultView.scrollTo(e,t)},mr=function(A){var e=A[0],t=A[1],n=A[2];e.scrollLeft=t,e.scrollTop=n},vr="___html2canvas___pseudoelement_before",yr="___html2canvas___pseudoelement_after",Cr='{\n content: "" !important;\n display: none !important;\n}',br=function(A){Qr(A,"."+vr+":before"+Cr+"\n ."+yr+":after"+Cr)},Qr=function(A,e){var t=A.ownerDocument;if(t){var n=t.createElement("style");n.textContent=e,A.appendChild(n)}},Fr=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}(),Ur=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:Tr(A)||Ir(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,r,i=this;return o(this,function(o){switch(o.label){case 0:return e=Fr.isSameOrigin(A),t=!Hr(A)&&!0===this._options.useCORS&&zn.SUPPORT_CORS_IMAGES&&!e,n=!Hr(A)&&!e&&!Tr(A)&&"string"==typeof this._options.proxy&&zn.SUPPORT_CORS_XHR&&!t,e||!1!==this._options.allowTaint||Hr(A)||Tr(A)||n||t?(r=A,n?[4,this.proxy(r)]:[3,2]):[2];case 1:r=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,(kr(r)||t)&&(n.crossOrigin="anonymous"),n.src=r,!0===n.complete&&setTimeout(function(){return A(n)},500),i._options.imageTimeout>0&&setTimeout(function(){return e("Timed out ("+i._options.imageTimeout+"ms) loading image")},i._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,r){var i=zn.SUPPORT_RESPONSE_TYPE?"blob":"text",a=new XMLHttpRequest;a.onload=function(){if(200===a.status)if("text"===i)o(a.response);else{var A=new FileReader;A.addEventListener("load",function(){return o(A.result)},!1),A.addEventListener("error",function(A){return r(A)},!1),A.readAsDataURL(a.response)}else r("Failed to proxy resource "+n+" with status code "+a.status)},a.onerror=r;var s=t.indexOf("?")>-1?"&":"?";if(a.open("GET",""+t+s+"url="+encodeURIComponent(A)+"&responseType="+i),"text"!==i&&a instanceof XMLHttpRequest&&(a.responseType=i),e._options.imageTimeout){var c=e._options.imageTimeout;a.timeout=c,a.ontimeout=function(){return r("Timed out ("+c+"ms) proxying "+n)}}a.send()})},A}(),xr=/^data:image\/svg\+xml/i,Er=/^data:image\/.*;base64,/i,Sr=/^data:image\/.*/i,Ir=function(A){return zn.SUPPORT_SVG_DRAWING||!Dr(A)},Hr=function(A){return Sr.test(A)},kr=function(A){return Er.test(A)},Tr=function(A){return"blob"===A.substr(0,4)},Dr=function(A){return"svg"===A.substr(-3).toLowerCase()||xr.test(A)},Or=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}(),Kr=function(A,e,t){return new Or(A.x+(e.x-A.x)*t,A.y+(e.y-A.y)*t)},Pr=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=Kr(this.start,this.startControl,e),o=Kr(this.startControl,this.endControl,e),r=Kr(this.endControl,this.end,e),i=Kr(n,o,e),a=Kr(o,r,e),s=Kr(i,a,e);return t?new A(this.start,n,i,s):new A(s,a,r,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}(),Lr=function(A){return 1===A.type},Mr=function(A){var e=A.styles,t=A.bounds,n=oe(e.borderTopLeftRadius,t.width,t.height),o=n[0],r=n[1],i=oe(e.borderTopRightRadius,t.width,t.height),a=i[0],s=i[1],c=oe(e.borderBottomRightRadius,t.width,t.height),l=c[0],u=c[1],d=oe(e.borderBottomLeftRadius,t.width,t.height),g=d[0],p=d[1],h=[];h.push((o+a)/t.width),h.push((g+l)/t.width),h.push((r+p)/t.height),h.push((s+u)/t.height);var f=Math.max.apply(Math,h);f>1&&(o/=f,r/=f,a/=f,s/=f,l/=f,u/=f,g/=f,p/=f);var B=t.width-a,w=t.height-u,m=t.width-l,v=t.height-p,y=e.borderTopWidth,C=e.borderRightWidth,b=e.borderBottomWidth,Q=e.borderLeftWidth,F=re(e.paddingTop,A.bounds.width),U=re(e.paddingRight,A.bounds.width),x=re(e.paddingBottom,A.bounds.width),E=re(e.paddingLeft,A.bounds.width);this.topLeftBorderDoubleOuterBox=o>0||r>0?Rr(t.left+Q/3,t.top+y/3,o-Q/3,r-y/3,lr.TOP_LEFT):new Or(t.left+Q/3,t.top+y/3),this.topRightBorderDoubleOuterBox=o>0||r>0?Rr(t.left+B,t.top+y/3,a-C/3,s-y/3,lr.TOP_RIGHT):new Or(t.left+t.width-C/3,t.top+y/3),this.bottomRightBorderDoubleOuterBox=l>0||u>0?Rr(t.left+m,t.top+w,l-C/3,u-b/3,lr.BOTTOM_RIGHT):new Or(t.left+t.width-C/3,t.top+t.height-b/3),this.bottomLeftBorderDoubleOuterBox=g>0||p>0?Rr(t.left+Q/3,t.top+v,g-Q/3,p-b/3,lr.BOTTOM_LEFT):new Or(t.left+Q/3,t.top+t.height-b/3),this.topLeftBorderDoubleInnerBox=o>0||r>0?Rr(t.left+2*Q/3,t.top+2*y/3,o-2*Q/3,r-2*y/3,lr.TOP_LEFT):new Or(t.left+2*Q/3,t.top+2*y/3),this.topRightBorderDoubleInnerBox=o>0||r>0?Rr(t.left+B,t.top+2*y/3,a-2*C/3,s-2*y/3,lr.TOP_RIGHT):new Or(t.left+t.width-2*C/3,t.top+2*y/3),this.bottomRightBorderDoubleInnerBox=l>0||u>0?Rr(t.left+m,t.top+w,l-2*C/3,u-2*b/3,lr.BOTTOM_RIGHT):new Or(t.left+t.width-2*C/3,t.top+t.height-2*b/3),this.bottomLeftBorderDoubleInnerBox=g>0||p>0?Rr(t.left+2*Q/3,t.top+v,g-2*Q/3,p-2*b/3,lr.BOTTOM_LEFT):new Or(t.left+2*Q/3,t.top+t.height-2*b/3),this.topLeftBorderStroke=o>0||r>0?Rr(t.left+Q/2,t.top+y/2,o-Q/2,r-y/2,lr.TOP_LEFT):new Or(t.left+Q/2,t.top+y/2),this.topRightBorderStroke=o>0||r>0?Rr(t.left+B,t.top+y/2,a-C/2,s-y/2,lr.TOP_RIGHT):new Or(t.left+t.width-C/2,t.top+y/2),this.bottomRightBorderStroke=l>0||u>0?Rr(t.left+m,t.top+w,l-C/2,u-b/2,lr.BOTTOM_RIGHT):new Or(t.left+t.width-C/2,t.top+t.height-b/2),this.bottomLeftBorderStroke=g>0||p>0?Rr(t.left+Q/2,t.top+v,g-Q/2,p-b/2,lr.BOTTOM_LEFT):new Or(t.left+Q/2,t.top+t.height-b/2),this.topLeftBorderBox=o>0||r>0?Rr(t.left,t.top,o,r,lr.TOP_LEFT):new Or(t.left,t.top),this.topRightBorderBox=a>0||s>0?Rr(t.left+B,t.top,a,s,lr.TOP_RIGHT):new Or(t.left+t.width,t.top),this.bottomRightBorderBox=l>0||u>0?Rr(t.left+m,t.top+w,l,u,lr.BOTTOM_RIGHT):new Or(t.left+t.width,t.top+t.height),this.bottomLeftBorderBox=g>0||p>0?Rr(t.left,t.top+v,g,p,lr.BOTTOM_LEFT):new Or(t.left,t.top+t.height),this.topLeftPaddingBox=o>0||r>0?Rr(t.left+Q,t.top+y,Math.max(0,o-Q),Math.max(0,r-y),lr.TOP_LEFT):new Or(t.left+Q,t.top+y),this.topRightPaddingBox=a>0||s>0?Rr(t.left+Math.min(B,t.width-C),t.top+y,B>t.width+C?0:Math.max(0,a-C),Math.max(0,s-y),lr.TOP_RIGHT):new Or(t.left+t.width-C,t.top+y),this.bottomRightPaddingBox=l>0||u>0?Rr(t.left+Math.min(m,t.width-Q),t.top+Math.min(w,t.height-b),Math.max(0,l-C),Math.max(0,u-b),lr.BOTTOM_RIGHT):new Or(t.left+t.width-C,t.top+t.height-b),this.bottomLeftPaddingBox=g>0||p>0?Rr(t.left+Q,t.top+Math.min(v,t.height-b),Math.max(0,g-Q),Math.max(0,p-b),lr.BOTTOM_LEFT):new Or(t.left+Q,t.top+t.height-b),this.topLeftContentBox=o>0||r>0?Rr(t.left+Q+E,t.top+y+F,Math.max(0,o-(Q+E)),Math.max(0,r-(y+F)),lr.TOP_LEFT):new Or(t.left+Q+E,t.top+y+F),this.topRightContentBox=a>0||s>0?Rr(t.left+Math.min(B,t.width+Q+E),t.top+y+F,B>t.width+Q+E?0:a-Q+E,s-(y+F),lr.TOP_RIGHT):new Or(t.left+t.width-(C+U),t.top+y+F),this.bottomRightContentBox=l>0||u>0?Rr(t.left+Math.min(m,t.width-(Q+E)),t.top+Math.min(w,t.height+y+F),Math.max(0,l-(C+U)),u-(b+x),lr.BOTTOM_RIGHT):new Or(t.left+t.width-(C+U),t.top+t.height-(b+x)),this.bottomLeftContentBox=g>0||p>0?Rr(t.left+Q+E,t.top+v,Math.max(0,g-(Q+E)),p-(b+x),lr.BOTTOM_LEFT):new Or(t.left+Q+E,t.top+t.height-(b+x))};!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"}(lr||(lr={}));var Rr=function(A,e,t,n,o){var r=(Math.sqrt(2)-1)/3*4,i=t*r,a=n*r,s=A+t,c=e+n;switch(o){case lr.TOP_LEFT:return new Pr(new Or(A,c),new Or(A,c-a),new Or(s-i,e),new Or(s,e));case lr.TOP_RIGHT:return new Pr(new Or(A,e),new Or(A+i,e),new Or(s,c-a),new Or(s,c));case lr.BOTTOM_RIGHT:return new Pr(new Or(s,e),new Or(s,e+a),new Or(A+i,c),new Or(A,c));case lr.BOTTOM_LEFT:default:return new Pr(new Or(s,c),new Or(s-i,c),new Or(A,e+a),new Or(A,e))}},Vr=function(A){return[A.topLeftBorderBox,A.topRightBorderBox,A.bottomRightBorderBox,A.bottomLeftBorderBox]},_r=function(A){return[A.topLeftPaddingBox,A.topRightPaddingBox,A.bottomRightPaddingBox,A.bottomLeftPaddingBox]},Gr=function(A,e,t){this.offsetX=A,this.offsetY=e,this.matrix=t,this.type=0,this.target=6},jr=function(A,e){this.path=A,this.target=e,this.type=1},Nr=function(A){this.opacity=A,this.type=2,this.target=6},Wr=function(A){return 1===A.type},Jr=function(A,e){return A.length===e.length&&A.some(function(A,t){return A===e[t]})},Xr=function(A){this.element=A,this.inlineLevel=[],this.nonInlineLevel=[],this.negativeZIndex=[],this.zeroOrAutoZIndexOrTransformedOrOpacity=[],this.positiveZIndex=[],this.nonPositionedFloats=[],this.nonPositionedInlineLevel=[]},zr=function(){function A(A,e){if(this.container=A,this.parent=e,this.effects=[],this.curves=new Mr(this.container),this.container.styles.opacity<1&&this.effects.push(new Nr(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 Gr(t,n,o))}if(0!==this.container.styles.overflowX){var r=Vr(this.curves),i=_r(this.curves);Jr(r,i)?this.effects.push(new jr(r,6)):(this.effects.push(new jr(r,2)),this.effects.push(new jr(i,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!Wr(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 r=Vr(t.curves),i=_r(t.curves);Jr(r,i)||n.unshift(new jr(i,6))}}else n.unshift.apply(n,o);t=t.parent}return n.filter(function(e){return ln(e.target,A)})},A}(),Yr=function(A,e,t,n){A.container.elements.forEach(function(o){var r=ln(o.flags,4),i=ln(o.flags,2),a=new zr(o,A);ln(o.styles.display,2048)&&n.push(a);var s=ln(o.flags,8)?[]:n;if(r||i){var c=r||o.styles.isPositioned()?t:e,l=new Xr(a);if(o.styles.isPositioned()||o.styles.opacity<1||o.styles.isTransformed()){var u=o.styles.zIndex.order;if(u<0){var d=0;c.negativeZIndex.some(function(A,e){return u>A.element.container.styles.zIndex.order?(d=e,!1):d>0}),c.negativeZIndex.splice(d,0,l)}else if(u>0){var g=0;c.positiveZIndex.some(function(A,e){return u>=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);Yr(a,l,r?l:t,s)}else o.styles.isInlineLevel()?e.inlineLevel.push(a):e.nonInlineLevel.push(a),Yr(a,e,t,s);ln(o.flags,8)&&Zr(o,s)})},Zr=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 r=e[o];r.container instanceof lo&&"number"==typeof r.container.value&&0!==r.container.value&&(t=r.container.value),r.listValue=ar(t,r.container.styles.listStyleType,!0),t+=n?-1:1}},qr=function(A,e){switch(e){case 0:return Ai(A.topLeftBorderBox,A.topLeftPaddingBox,A.topRightBorderBox,A.topRightPaddingBox);case 1:return Ai(A.topRightBorderBox,A.topRightPaddingBox,A.bottomRightBorderBox,A.bottomRightPaddingBox);case 2:return Ai(A.bottomRightBorderBox,A.bottomRightPaddingBox,A.bottomLeftBorderBox,A.bottomLeftPaddingBox);default:return Ai(A.bottomLeftBorderBox,A.bottomLeftPaddingBox,A.topLeftBorderBox,A.topLeftPaddingBox)}},$r=function(A,e){var t=[];return Lr(A)?t.push(A.subdivide(.5,!1)):t.push(A),Lr(e)?t.push(e.subdivide(.5,!0)):t.push(e),t},Ai=function(A,e,t,n){var o=[];return Lr(A)?o.push(A.subdivide(.5,!1)):o.push(A),Lr(t)?o.push(t.subdivide(.5,!0)):o.push(t),Lr(n)?o.push(n.subdivide(.5,!0).reverse()):o.push(n),Lr(e)?o.push(e.subdivide(.5,!1).reverse()):o.push(e),o},ei=function(A){var e=A.bounds,t=A.styles;return e.add(t.borderLeftWidth,t.borderTopWidth,-(t.borderRightWidth+t.borderLeftWidth),-(t.borderTopWidth+t.borderBottomWidth))},ti=function(A){var e=A.styles,t=A.bounds,n=re(e.paddingLeft,t.width),o=re(e.paddingRight,t.width),r=re(e.paddingTop,t.width),i=re(e.paddingBottom,t.width);return t.add(n+e.borderLeftWidth,r+e.borderTopWidth,-(e.borderRightWidth+e.borderLeftWidth+n+o),-(e.borderTopWidth+e.borderBottomWidth+r+i))},ni=function(A,e,t){var n=function(A,e){return 0===A?e.bounds:2===A?ti(e):ei(e)}(ai(A.styles.backgroundOrigin,e),A),o=function(A,e){return 0===A?e.bounds:2===A?ti(e):ei(e)}(ai(A.styles.backgroundClip,e),A),r=ii(ai(A.styles.backgroundSize,e),t,n),i=r[0],a=r[1],s=oe(ai(A.styles.backgroundPosition,e),n.width-i,n.height-a);return[si(ai(A.styles.backgroundRepeat,e),s,r,n,o),Math.round(n.left+s[0]),Math.round(n.top+s[1]),i,a]},oi=function(A){return NA(A)&&A.value===Ve.AUTO},ri=function(A){return"number"==typeof A},ii=function(A,e,t){var n=e[0],o=e[1],r=e[2],i=A[0],a=A[1];if(!i)return[0,0];if($A(i)&&a&&$A(a))return[re(i,t.width),re(a,t.height)];var s=ri(r);if(NA(i)&&(i.value===Ve.CONTAIN||i.value===Ve.COVER))return ri(r)?t.width/t.height<r!=(i.value===Ve.COVER)?[t.width,t.width/r]:[t.height*r,t.height]:[t.width,t.height];var c=ri(n),l=ri(o),u=c||l;if(oi(i)&&(!a||oi(a)))return c&&l?[n,o]:s||u?u&&s?[c?n:o*r,l?o:n/r]:[c?n:t.width,l?o:t.height]:[t.width,t.height];if(s){var d=0,g=0;return $A(i)?d=re(i,t.width):$A(a)&&(g=re(a,t.height)),oi(i)?d=g*r:a&&!oi(a)||(g=d/r),[d,g]}var p=null,h=null;if($A(i)?p=re(i,t.width):a&&$A(a)&&(h=re(a,t.height)),null===p||a&&!oi(a)||(h=c&&l?p/n*o:t.height),null!==h&&oi(i)&&(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")},ai=function(A,e){var t=A[e];return void 0===t?A[0]:t},si=function(A,e,t,n,o){var r=e[0],i=e[1],a=t[0],s=t[1];switch(A){case 2:return[new Or(Math.round(n.left),Math.round(n.top+i)),new Or(Math.round(n.left+n.width),Math.round(n.top+i)),new Or(Math.round(n.left+n.width),Math.round(s+n.top+i)),new Or(Math.round(n.left),Math.round(s+n.top+i))];case 3:return[new Or(Math.round(n.left+r),Math.round(n.top)),new Or(Math.round(n.left+r+a),Math.round(n.top)),new Or(Math.round(n.left+r+a),Math.round(n.height+n.top)),new Or(Math.round(n.left+r),Math.round(n.height+n.top))];case 1:return[new Or(Math.round(n.left+r),Math.round(n.top+i)),new Or(Math.round(n.left+r+a),Math.round(n.top+i)),new Or(Math.round(n.left+r+a),Math.round(n.top+i+s)),new Or(Math.round(n.left+r),Math.round(n.top+i+s))];default:return[new Or(Math.round(o.left),Math.round(o.top)),new Or(Math.round(o.left+o.width),Math.round(o.top)),new Or(Math.round(o.left+o.width),Math.round(o.height+o.top)),new Or(Math.round(o.left),Math.round(o.height+o.top))]}},ci="Hidden Text",li=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"),r=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",r.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(ci)),t.appendChild(o),t.appendChild(n);var i=n.offsetTop-o.offsetTop+2;t.removeChild(o),t.appendChild(this._document.createTextNode(ci)),t.style.lineHeight="normal",n.style.verticalAlign="super";var a=n.offsetTop-t.offsetTop+2;return r.removeChild(t),{baseline:i,middle:a}},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}(),ui=function(A,e){this.context=A,this.options=e},di=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 li(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)),Wr(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=Bi(A.fontFamily).join(", "),n=GA(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,r,i,a,s,c,l,u=this;return o(this,function(o){return t=this.createFontStyle(e),n=t[0],r=t[1],i=t[2],this.ctx.font=n,this.ctx.direction=1===e.direction?"rtl":"ltr",this.ctx.textAlign="left",this.ctx.textBaseline="alphabetic",a=this.fontMetrics.getMetrics(r,i),s=a.baseline,c=a.middle,l=e.paintOrder,A.textBounds.forEach(function(A){l.forEach(function(t){switch(t){case 0:u.ctx.fillStyle=pe(e.color),u.renderTextWithLetterSpacing(A,e.letterSpacing,s);var n=e.textShadow;n.length&&A.text.trim().length&&(n.slice(0).reverse().forEach(function(t){u.ctx.shadowColor=pe(t.color),u.ctx.shadowOffsetX=t.offsetX.number*u.options.scale,u.ctx.shadowOffsetY=t.offsetY.number*u.options.scale,u.ctx.shadowBlur=t.blur.number,u.renderTextWithLetterSpacing(A,e.letterSpacing,s)}),u.ctx.shadowColor="",u.ctx.shadowOffsetX=0,u.ctx.shadowOffsetY=0,u.ctx.shadowBlur=0),e.textDecorationLine.length&&(u.ctx.fillStyle=pe(e.textDecorationColor||e.color),e.textDecorationLine.forEach(function(e){switch(e){case 1:u.ctx.fillRect(A.bounds.left,Math.round(A.bounds.top+s),A.bounds.width,1);break;case 2:u.ctx.fillRect(A.bounds.left,Math.round(A.bounds.top),A.bounds.width,1);break;case 3:u.ctx.fillRect(A.bounds.left,Math.ceil(A.bounds.top+c),A.bounds.width,1)}}));break;case 1:e.webkitTextStrokeWidth&&A.text.trim().length&&(u.ctx.strokeStyle=pe(e.webkitTextStrokeColor),u.ctx.lineWidth=e.webkitTextStrokeWidth,u.ctx.lineJoin=window.chrome?"miter":"round",u.ctx.strokeText(A.text,A.bounds.left,A.bounds.top+s)),u.ctx.strokeStyle="",u.ctx.lineWidth=0,u.ctx.lineJoin="miter"}})}),[2]})})},t.prototype.renderReplacedElement=function(A,e,t){if(t&&A.intrinsicWidth>0&&A.intrinsicHeight>0){var n=ti(A),o=_r(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,r,a,s,c,l,u,d,g,p,h,f,B,w,m,v,y;return o(this,function(o){switch(o.label){case 0:this.applyEffects(A.getEffects(4)),e=A.container,n=A.curves,r=e.styles,a=0,s=e.textNodes,o.label=1;case 1:return a<s.length?(c=s[a],[4,this.renderTextNode(c,r)]):[3,4];case 2:o.sent(),o.label=3;case 3:return a++,[3,1];case 4:if(!(e instanceof ao))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 w=o.sent(),this.renderReplacedElement(e,n,w),[3,8];case 7:return o.sent(),this.context.logger.error("Error loading image "+e.src),[3,8];case 8:if(e instanceof so&&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 w=o.sent(),this.renderReplacedElement(e,n,w),[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 Co&&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 mo&&(u=Math.min(e.bounds.width,e.bounds.height),e.type===ho?e.checked&&(this.ctx.save(),this.path([new Or(e.bounds.left+.39363*u,e.bounds.top+.79*u),new Or(e.bounds.left+.16*u,e.bounds.top+.5549*u),new Or(e.bounds.left+.27347*u,e.bounds.top+.44071*u),new Or(e.bounds.left+.39694*u,e.bounds.top+.5649*u),new Or(e.bounds.left+.72983*u,e.bounds.top+.23*u),new Or(e.bounds.left+.84*u,e.bounds.top+.34085*u),new Or(e.bounds.left+.39363*u,e.bounds.top+.79*u)]),this.ctx.fillStyle=pe(wo),this.ctx.fill(),this.ctx.restore()):e.type===fo&&e.checked&&(this.ctx.save(),this.ctx.beginPath(),this.ctx.arc(e.bounds.left+u/2,e.bounds.top+u/2,u/4,0,2*Math.PI,!0),this.ctx.fillStyle=pe(wo),this.ctx.fill(),this.ctx.restore())),gi(e)&&e.value.length){switch(d=this.createFontStyle(r),v=d[0],g=d[1],p=this.fontMetrics.getMetrics(v,g).baseline,this.ctx.font=v,this.ctx.fillStyle=pe(r.color),this.ctx.textBaseline="alphabetic",this.ctx.textAlign=hi(e.styles.textAlign),y=ti(e),h=0,e.styles.textAlign){case 1:h+=y.width/2;break;case 2:h+=y.width}f=y.add(h,0,0,-y.height/2+1),this.ctx.save(),this.path([new Or(y.left,y.top),new Or(y.left+y.width,y.top),new Or(y.left+y.width,y.top+y.height),new Or(y.left,y.top+y.height)]),this.ctx.clip(),this.renderTextWithLetterSpacing(new Yn(e.value,f),r.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!==(B=e.styles.listStyleImage).type)return[3,18];w=void 0,m=B.url,o.label=15;case 15:return o.trys.push([15,17,,18]),[4,this.context.cache.match(m)];case 16:return w=o.sent(),this.ctx.drawImage(w,e.bounds.left-(w.width+10),e.bounds.top),[3,18];case 17:return o.sent(),this.context.logger.error("Error loading list-style-image "+m),[3,18];case 18:return[3,20];case 19:A.listValue&&-1!==e.styles.listStyleType&&(v=this.createFontStyle(r)[0],this.ctx.font=v,this.ctx.fillStyle=pe(r.color),this.ctx.textBaseline="middle",this.ctx.textAlign="right",y=new i(e.bounds.left,e.bounds.top+re(e.styles.paddingTop,e.bounds.width),e.bounds.width,Ut(r.lineHeight,r.fontSize.number)/2+1),this.renderTextWithLetterSpacing(new Yn(A.listValue,y),r.letterSpacing,Ut(r.lineHeight,r.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,r,i,a,s,c,l,u,d,g,p,h,f;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?(f=t[e],[4,this.renderStack(f)]):[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,r=A.nonInlineLevel,o.label=7;case 7:return n<r.length?(f=r[n],[4,this.renderNode(f)]):[3,10];case 8:o.sent(),o.label=9;case 9:return n++,[3,7];case 10:i=0,a=A.nonPositionedFloats,o.label=11;case 11:return i<a.length?(f=a[i],[4,this.renderStack(f)]):[3,14];case 12:o.sent(),o.label=13;case 13:return i++,[3,11];case 14:s=0,c=A.nonPositionedInlineLevel,o.label=15;case 15:return s<c.length?(f=c[s],[4,this.renderStack(f)]):[3,18];case 16:o.sent(),o.label=17;case 17:return s++,[3,15];case 18:l=0,u=A.inlineLevel,o.label=19;case 19:return l<u.length?(f=u[l],[4,this.renderNode(f)]):[3,22];case 20:o.sent(),o.label=21;case 21:return l++,[3,19];case 22:d=0,g=A.zeroOrAutoZIndexOrTransformedOrOpacity,o.label=23;case 23:return d<g.length?(f=g[d],[4,this.renderStack(f)]):[3,26];case 24:o.sent(),o.label=25;case 25:return d++,[3,23];case 26:p=0,h=A.positiveZIndex,o.label=27;case 27:return p<h.length?(f=h[p],[4,this.renderStack(f)]):[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=Lr(A)?A.start:A;0===t?e.ctx.moveTo(n.x,n.y):e.ctx.lineTo(n.x,n.y),Lr(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,r,i,a;return o(this,function(s){switch(s.label){case 0:e=A.styles.backgroundImage.length-1,t=function(t){var r,i,a,s,c,l,u,d,g,p,h,f,B,w,m,v,y,C,b,Q,F,U,x,E,S,I,H,k,T,D,O;return o(this,function(o){switch(o.label){case 0:if(0!==t.type)return[3,5];r=void 0,i=t.url,o.label=1;case 1:return o.trys.push([1,3,,4]),[4,n.context.cache.match(i)];case 2:return r=o.sent(),[3,4];case 3:return o.sent(),n.context.logger.error("Error loading background-image "+i),[3,4];case 4:return r&&(a=ni(A,e,[r.width,r.height,r.width/r.height]),v=a[0],U=a[1],x=a[2],b=a[3],Q=a[4],w=n.ctx.createPattern(n.resizeImage(r,b,Q),"repeat"),n.renderRepeat(v,w,U,x)),[3,6];case 5:1===t.type?(s=ni(A,e,[null,null,null]),v=s[0],U=s[1],x=s[2],b=s[3],Q=s[4],c=xe(t.angle,b,Q),l=c[0],u=c[1],d=c[2],g=c[3],p=c[4],(h=document.createElement("canvas")).width=b,h.height=Q,f=h.getContext("2d"),B=f.createLinearGradient(u,g,d,p),Ue(t.stops,l).forEach(function(A){return B.addColorStop(A.stop,pe(A.color))}),f.fillStyle=B,f.fillRect(0,0,b,Q),b>0&&Q>0&&(w=n.ctx.createPattern(h,"repeat"),n.renderRepeat(v,w,U,x))):function(A){return 2===A.type}(t)&&(m=ni(A,e,[null,null,null]),v=m[0],y=m[1],C=m[2],b=m[3],Q=m[4],F=0===t.position.length?[te]:t.position,U=re(F[0],b),x=re(F[F.length-1],Q),E=function(A,e,t,n,o){var r=0,i=0;switch(A.size){case 0:0===A.shape?r=i=Math.min(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-o)):1===A.shape&&(r=Math.min(Math.abs(e),Math.abs(e-n)),i=Math.min(Math.abs(t),Math.abs(t-o)));break;case 2:if(0===A.shape)r=i=Math.min(Ee(e,t),Ee(e,t-o),Ee(e-n,t),Ee(e-n,t-o));else if(1===A.shape){var a=Math.min(Math.abs(t),Math.abs(t-o))/Math.min(Math.abs(e),Math.abs(e-n)),s=Se(n,o,e,t,!0),c=s[0],l=s[1];i=a*(r=Ee(c-e,(l-t)/a))}break;case 1:0===A.shape?r=i=Math.max(Math.abs(e),Math.abs(e-n),Math.abs(t),Math.abs(t-o)):1===A.shape&&(r=Math.max(Math.abs(e),Math.abs(e-n)),i=Math.max(Math.abs(t),Math.abs(t-o)));break;case 3:if(0===A.shape)r=i=Math.max(Ee(e,t),Ee(e,t-o),Ee(e-n,t),Ee(e-n,t-o));else if(1===A.shape){a=Math.max(Math.abs(t),Math.abs(t-o))/Math.max(Math.abs(e),Math.abs(e-n));var u=Se(n,o,e,t,!1);c=u[0],l=u[1],i=a*(r=Ee(c-e,(l-t)/a))}}return Array.isArray(A.size)&&(r=re(A.size[0],n),i=2===A.size.length?re(A.size[1],o):r),[r,i]}(t,U,x,b,Q),S=E[0],I=E[1],S>0&&I>0&&(H=n.ctx.createRadialGradient(y+U,C+x,0,y+U,C+x,S),Ue(t.stops,2*S).forEach(function(A){return H.addColorStop(A.stop,pe(A.color))}),n.path(v),n.ctx.fillStyle=H,S!==I?(k=A.bounds.left+.5*A.bounds.width,T=A.bounds.top+.5*A.bounds.height,O=1/(D=I/S),n.ctx.save(),n.ctx.translate(k,T),n.ctx.transform(1,0,0,D,0,0),n.ctx.translate(-k,-T),n.ctx.fillRect(y,O*(C-T)+T,b,Q*O),n.ctx.restore()):n.ctx.fill())),o.label=6;case 6:return e--,[2]}})},n=this,r=0,i=A.styles.backgroundImage.slice(0).reverse(),s.label=1;case 1:return r<i.length?(a=i[r],[5,t(a)]):[3,4];case 2:s.sent(),s.label=3;case 3:return r++,[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(qr(t,e)),this.ctx.fillStyle=pe(A),this.ctx.fill(),[2]})})},t.prototype.renderDoubleBorder=function(A,e,t,r){return n(this,void 0,void 0,function(){var n,i;return o(this,function(o){switch(o.label){case 0:return e<3?[4,this.renderSolidBorder(A,t,r)]:[3,2];case 1:return o.sent(),[2];case 2:return n=function(A,e){switch(e){case 0:return Ai(A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox,A.topRightBorderBox,A.topRightBorderDoubleOuterBox);case 1:return Ai(A.topRightBorderBox,A.topRightBorderDoubleOuterBox,A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox);case 2:return Ai(A.bottomRightBorderBox,A.bottomRightBorderDoubleOuterBox,A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox);default:return Ai(A.bottomLeftBorderBox,A.bottomLeftBorderDoubleOuterBox,A.topLeftBorderBox,A.topLeftBorderDoubleOuterBox)}}(r,t),this.path(n),this.ctx.fillStyle=pe(A),this.ctx.fill(),i=function(A,e){switch(e){case 0:return Ai(A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox,A.topRightBorderDoubleInnerBox,A.topRightPaddingBox);case 1:return Ai(A.topRightBorderDoubleInnerBox,A.topRightPaddingBox,A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox);case 2:return Ai(A.bottomRightBorderDoubleInnerBox,A.bottomRightPaddingBox,A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox);default:return Ai(A.bottomLeftBorderDoubleInnerBox,A.bottomLeftPaddingBox,A.topLeftBorderDoubleInnerBox,A.topLeftPaddingBox)}}(r,t),this.path(i),this.ctx.fill(),[2]}})})},t.prototype.renderNodeBackgroundAndBorders=function(A){return n(this,void 0,void 0,function(){var e,t,n,r,i,a,s,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}],r=pi(ai(e.backgroundClip,0),A.curves),t||e.boxShadow.length?(this.ctx.save(),this.path(r),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,r,i,a=Vr(A.curves),s=e.inset?0:1e4,c=(t=a,n=-s+(e.inset?1:-1)*e.spread.number,o=(e.inset?1:-1)*e.spread.number,r=e.spread.number*(e.inset?-2:2),i=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+r,o);case 2:return A.add(n+r,o+i);case 3:return A.add(n,o+i)}return A}));e.inset?(l.path(a),l.ctx.clip(),l.mask(c)):(l.mask(a),l.ctx.clip(),l.path(c)),l.ctx.shadowOffsetX=e.offsetX.number+s,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:i=0,a=0,s=n,o.label=3;case 3:return a<s.length?0!==(c=s[a]).style&&!ge(c.color)&&c.width>0?2!==c.style?[3,5]:[4,this.renderDashedDottedBorder(c.color,c.width,i,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,i,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,i,A.curves)];case 8:return o.sent(),[3,11];case 9:return[4,this.renderSolidBorder(c.color,i,A.curves)];case 10:o.sent(),o.label=11;case 11:i++,o.label=12;case 12:return a++,[3,3];case 13:return[2]}})})},t.prototype.renderDashedDottedBorder=function(A,e,t,r,i){return n(this,void 0,void 0,function(){var n,a,s,c,l,u,d,g,p,h,f,B,w,m,v,y;return o(this,function(o){return this.ctx.save(),n=function(A,e){switch(e){case 0:return $r(A.topLeftBorderStroke,A.topRightBorderStroke);case 1:return $r(A.topRightBorderStroke,A.bottomRightBorderStroke);case 2:return $r(A.bottomRightBorderStroke,A.bottomLeftBorderStroke);default:return $r(A.bottomLeftBorderStroke,A.topLeftBorderStroke)}}(r,t),a=qr(r,t),2===i&&(this.path(a),this.ctx.clip()),Lr(a[0])?(s=a[0].start.x,c=a[0].start.y):(s=a[0].x,c=a[0].y),Lr(a[1])?(l=a[1].end.x,u=a[1].end.y):(l=a[1].x,u=a[1].y),d=0===t||2===t?Math.abs(s-l):Math.abs(c-u),this.ctx.beginPath(),3===i?this.formatPath(n):this.formatPath(a.slice(0,2)),g=e<3?3*e:2*e,p=e<3?2*e:e,3===i&&(g=e,p=e),h=!0,d<=2*g?h=!1:d<=2*g+p?(g*=f=d/(2*g+p),p*=f):(B=Math.floor((d+p)/(g+p)),w=(d-B*g)/(B-1),p=(m=(d-(B+1)*g)/B)<=0||Math.abs(p-w)<Math.abs(p-m)?w:m),h&&(3===i?this.ctx.setLineDash([0,g+p]):this.ctx.setLineDash([g,p])),3===i?(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===i&&(Lr(a[0])&&(v=a[3],y=a[0],this.ctx.beginPath(),this.formatPath([new Or(v.end.x,v.end.y),new Or(y.start.x,y.start.y)]),this.ctx.stroke()),Lr(a[1])&&(v=a[1],y=a[2],this.ctx.beginPath(),this.formatPath([new Or(v.end.x,v.end.y),new Or(y.start.x,y.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 zr(A,null),o=new Xr(n),Yr(n,o,o,r=[]),Zr(n.container,r),e=o,[4,this.renderStack(e)];case 1:return t.sent(),this.applyEffects([]),[2,this.canvas]}var n,o,r})})},t}(ui),gi=function(A){return A instanceof yo||A instanceof vo||A instanceof mo&&A.type!==fo&&A.type!==ho},pi=function(A,e){switch(A){case 0:return Vr(e);case 2:return function(A){return[A.topLeftContentBox,A.topRightContentBox,A.bottomRightContentBox,A.bottomLeftContentBox]}(e);default:return _r(e)}},hi=function(A){switch(A){case 1:return"center";case 2:return"right";default:return"left"}},fi=["-apple-system","system-ui"],Bi=function(A){return/iPhone OS 15_(0|1)/.test(window.navigator.userAgent)?A.filter(function(A){return-1===fi.indexOf(A)}):A},wi=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=Jn(this.options.width*this.options.scale,this.options.height*this.options.scale,this.options.scale,this.options.scale,A),[4,mi(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}(ui),mi=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))})},vi=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,r([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,r([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,r([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,r([this.id,this.getTime()+"ms"],A)):this.info.apply(this,A))},A.instances={},A}(),yi=function(){function A(e,t){var n;this.windowBounds=t,this.instanceName="#"+A.instanceCount++,this.logger=new vi({id:this.instanceName,enabled:e.logging}),this.cache=null!==(n=e.cache)&&void 0!==n?n:new Ur(this,e)}return A.instanceCount=1,A}();"undefined"!=typeof window&&Fr.setContext(window);var Ci=function(A,e){return n(void 0,void 0,void 0,function(){var n,r,s,c,l,u,d,g,p,h,f,B,w,m,v,y,C,b,Q,F,U,x,E,S,I,H,k,T,D,O,K,P,L,M,R,V,_,G;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(!(r=n.defaultView))throw new Error("Document is not attached to a Window");return s={allowTaint:null!==(x=e.allowTaint)&&void 0!==x&&x,imageTimeout:null!==(E=e.imageTimeout)&&void 0!==E?E:15e3,proxy:e.proxy,useCORS:null!==(S=e.useCORS)&&void 0!==S&&S},c=t({logging:null===(I=e.logging)||void 0===I||I,cache:e.cache},s),l={windowWidth:null!==(H=e.windowWidth)&&void 0!==H?H:r.innerWidth,windowHeight:null!==(k=e.windowHeight)&&void 0!==k?k:r.innerHeight,scrollX:null!==(T=e.scrollX)&&void 0!==T?T:r.pageXOffset,scrollY:null!==(D=e.scrollY)&&void 0!==D?D:r.pageYOffset},u=new i(l.scrollX,l.scrollY,l.windowWidth,l.windowHeight),d=new yi(c,u),g=null!==(O=e.foreignObjectRendering)&&void 0!==O&&O,p={allowTaint:null!==(K=e.allowTaint)&&void 0!==K&&K,onclone:e.onclone,ignoreElements:e.ignoreElements,inlineImages:g,copyStyles:g},d.logger.debug("Starting document clone with size "+u.width+"x"+u.height+" scrolled to "+-u.left+","+-u.top),h=new cr(d,A,p),(f=h.clonedReferenceElement)?[4,h.toIFrame(n,u)]:[2,Promise.reject("Unable to find element in cloned iframe")];case 1:return B=o.sent(),w=Po(f)||"HTML"===f.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 i(0,0,n,o)}(f.ownerDocument):a(d,f),m=w.width,v=w.height,y=w.left,C=w.top,b=bi(d,f,e.backgroundColor),Q={canvas:e.canvas,backgroundColor:b,scale:null!==(L=null!==(P=e.scale)&&void 0!==P?P:r.devicePixelRatio)&&void 0!==L?L:1,x:(null!==(M=e.x)&&void 0!==M?M:0)+y,y:(null!==(R=e.y)&&void 0!==R?R:0)+C,width:null!==(V=e.width)&&void 0!==V?V:Math.ceil(m),height:null!==(_=e.height)&&void 0!==_?_:Math.ceil(v)},g?(d.logger.debug("Document cloned, using foreign object rendering"),[4,new wi(d,Q).render(f)]):[3,3];case 2:return F=o.sent(),[3,5];case 3:return d.logger.debug("Document cloned, element located at "+y+","+C+" with size "+m+"x"+v+" using computed rendering"),d.logger.debug("Starting DOM parsing"),U=Uo(d,f),b===U.styles.backgroundColor&&(U.styles.backgroundColor=Ce.TRANSPARENT),d.logger.debug("Starting renderer for element at "+Q.x+","+Q.y+" with size "+Q.width+"x"+Q.height),[4,new di(d,Q).render(U)];case 4:F=o.sent(),o.label=5;case 5:return(null===(G=e.removeContainer)||void 0===G||G)&&(cr.destroy(B)||d.logger.error("Cannot detach cloned iframe as it is not in the DOM anymore")),d.logger.debug("Finished rendering"),[2,F]}})})},bi=function(A,e,t){var n=e.ownerDocument,o=n.documentElement?ye(A,getComputedStyle(n.documentElement).backgroundColor):Ce.TRANSPARENT,r=n.body?ye(A,getComputedStyle(n.body).backgroundColor):Ce.TRANSPARENT,i="string"==typeof t?ye(A,t):null===t?Ce.TRANSPARENT:4294967295;return e===n.documentElement?ge(o)?ge(r)?i:r:o:i};return function(A,e){return void 0===e&&(e={}),Ci(A,e)}}()},540:(A,e,t)=>{"use strict";A.exports=t(869)},698:(A,e)=>{"use strict";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 r in n={},e)"key"!==r&&(n[r]=e[r]);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)=>{"use strict";A.exports=t(698)},869:(A,e)=>{"use strict";Symbol.for("react.transitional.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.consumer"),Symbol.for("react.context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.activity"),Symbol.iterator;var t={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},n=Object.assign,o={};function r(A,e,n){this.props=A,this.context=e,this.refs=o,this.updater=n||t}function i(){}function a(A,e,n){this.props=A,this.context=e,this.refs=o,this.updater=n||t}r.prototype.isReactComponent={},r.prototype.setState=function(A,e){if("object"!=typeof A&&"function"!=typeof A&&null!=A)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,e,"setState")},r.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")},i.prototype=r.prototype;var s=a.prototype=new i;s.constructor=a,n(s,r.prototype),s.isPureReactComponent=!0;Array.isArray;var c={H:null,A:null,T:null,S:null};Object.prototype.hasOwnProperty;"function"==typeof reportError&&reportError;e.useEffect=function(A,e){return c.H.useEffect(A,e)},e.useRef=function(A){return c.H.useRef(A)},e.useState=function(A){return c.H.useState(A)}}},e={};function t(n){var o=e[n];if(void 0!==o)return o.exports;var r=e[n]={exports:{}};return A[n].call(r.exports,r,r.exports,t),r.exports}t.n=A=>{var e=A&&A.__esModule?()=>A.default:()=>A;return t.d(e,{a:e}),e},t.d=(A,e)=>{for(var n in e)t.o(e,n)&&!t.o(A,n)&&Object.defineProperty(A,n,{enumerable:!0,get:e[n]})},t.o=(A,e)=>Object.prototype.hasOwnProperty.call(A,e),t.r=A=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(A,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(A,"__esModule",{value:!0})};var n={};return(()=>{"use strict";t.r(n),t.d(n,{AgentSDK:()=>en,AudioPlayer:()=>yt,AudioRecorder:()=>lt,EventEmitter:()=>de,MicPermissionModals:()=>e,MicPermissionUtils:()=>A,TTPChatWidget:()=>Jn,TextChatSDK:()=>Fe,VERSION:()=>Xn,VanillaVoiceButton:()=>Gt,VoiceButton:()=>Tt,VoiceSDK_v2:()=>se,WebSocketManager:()=>ze,default:()=>zn});var A={};t.r(A),t.d(A,{checkPermissionState:()=>an,getDeviceInfo:()=>rn,getPermissionInstructions:()=>cn,openSettings:()=>ln});var e={};function o(A){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},o(A)}function r(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,i(n.key),n)}}function i(A){var e=function(A){if("object"!=o(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=o(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==o(e)?e:e+""}t.r(e),t.d(e,{showBlockedModal:()=>wn,showNoMicrophoneModal:()=>mn,showPrePromptModal:()=>Bn});const a=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.events={}},e=[{key:"on",value:function(A,e){return this.events[A]||(this.events[A]=[]),this.events[A].push(e),this}},{key:"off",value:function(A,e){return this.events[A]?(this.events[A]=this.events[A].filter(function(A){return A!==e}),this):this}},{key:"emit",value:function(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(function(A){A.apply(void 0,t)}),!0)}},{key:"once",value:function(A,e){var t=this,n=function(){e.apply(void 0,arguments),t.off(A,n)};return this.on(A,n)}},{key:"removeAllListeners",value:function(A){return A?delete this.events[A]:this.events={},this}}],e&&r(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function s(A){return s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},s(A)}function c(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,l(n.key),n)}}function l(A){var e=function(A){if("object"!=s(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=s(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==s(e)?e:e+""}const u=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.name="PCM"},(e=[{key:"decode",value:function(A){if(A instanceof ArrayBuffer)return A;if(A instanceof Uint8Array)return A.buffer;throw new Error("Invalid PCM data type")}},{key:"encode",value:function(A){return A}}])&&c(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function d(A){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},d(A)}function g(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,p(n.key),n)}}function p(A){var e=function(A){if("object"!=d(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=d(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==d(e)?e:e+""}const h=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.name="PCMU"},(e=[{key:"decode",value:function(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}},{key:"encode",value:function(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}},{key:"mulawToLinear",value:function(A){var e=1<<3+(A>>4&7);return(128&A?-1:1)*(132+(15&A)*e+(e>>1)-4)}},{key:"linearToMulaw",value:function(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)}}])&&g(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function f(A){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},f(A)}function B(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,w(n.key),n)}}function w(A){var e=function(A){if("object"!=f(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=f(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==f(e)?e:e+""}const m=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.name="PCMA"},(e=[{key:"decode",value:function(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}},{key:"encode",value:function(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}},{key:"alawToLinear",value:function(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)}},{key:"linearToAlaw",value:function(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)}}])&&B(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function v(A){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},v(A)}function y(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=function(A,e){if(A){if("string"==typeof A)return C(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?C(A,e):void 0}}(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,o=function(){};return{s:o,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){a=!0,r=A},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function C(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}function b(A){if(null!=A){var e=A["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],t=0;if(e)return e.call(A);if("function"==typeof A.next)return A;if(!isNaN(A.length))return{next:function(){return A&&t>=A.length&&(A=void 0),{value:A&&A[t++],done:!A}}}}throw new TypeError(v(A)+" is not iterable")}function Q(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return F(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(F(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,F(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,F(u,"constructor",c),F(c,"constructor",s),s.displayName="GeneratorFunction",F(c,o,"GeneratorFunction"),F(u),F(u,o,"Generator"),F(u,n,function(){return this}),F(u,"toString",function(){return"[object Generator]"}),(Q=function(){return{w:r,m:d}})()}function F(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}F=function(A,e,t,n){function r(e,t){F(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},F(A,e,t,n)}function U(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function x(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){U(r,n,o,i,a,"next",A)}function a(A){U(r,n,o,i,a,"throw",A)}i(void 0)})}}function E(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,S(n.key),n)}}function S(A){var e=function(A){if("object"!=v(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=v(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==v(e)?e:e+""}function I(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(I=function(){return!!A})()}function H(A){return H=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},H(A)}function k(A,e){return k=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},k(A,e)}const T=function(A){function e(){var A,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(A=function(A,e,t){return e=H(e),function(A,e){if(e&&("object"==v(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,I()?Reflect.construct(e,t||[],H(A).constructor):e.apply(A,t))}(this,e)).config=t,A.audioContext=null,A.audioQueue=[],A.isPlaying=!1,A.isProcessingQueue=!1,A.currentSource=null,A.outputFormat=null,A.nextStartTime=0,A.scheduledBuffers=0,A.scheduledSources=new Set,A.pcmChunkQueue=[],A.preparedBuffer=[],A.isProcessingPcmQueue=!1,A.isSchedulingFrames=!1,A.MAX_LOOKAHEAD_SECONDS=.02,A.pendingSentenceText=null,A.sentenceTimings=[],A.isCheckingTranscripts=!1,A.codecs={pcm:new u,pcmu:new h,pcma:new m},A.SUPPORTED_CONTAINERS=["wav","raw"],A.SUPPORTED_ENCODINGS=["pcm","pcmu","pcma"],A.SUPPORTED_SAMPLE_RATES=[8e3,16e3,22050,24e3,44100,48e3],A.SUPPORTED_BIT_DEPTHS=[8,16,24],A.SUPPORTED_CHANNELS=[1],console.log("🎵 AudioPlayer v2 initialized"),A}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&k(A,e)}(e,A),t=e,n=[{key:"setOutputFormat",value:function(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(),"closed"!==this.audioContext.state&&this.audioContext.close(),this.audioContext=null,console.log("ℹ️ AudioContext will be recreated on next audio chunk with correct sample rate")),this.audioContext||(this.initializeAudioContext(),this.audioContext&&"suspended"===this.audioContext.state&&this.audioContext.resume().then(function(){console.log("✅ AudioPlayer v2: AudioContext resumed and ready")}).catch(function(A){console.warn("⚠️ AudioPlayer v2: Could not resume AudioContext:",A)}))}},{key:"validateFormat",value:function(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))}},{key:"getDefaultFormat",value:function(){return{container:"raw",encoding:"pcm",sampleRate:16e3,channels:1,bitDepth:16}}},{key:"playAudio",value:function(A){var e=this;try{var t=this.createAudioBlob(A);this.audioQueue.push(t),this.isPlaying||this.isProcessingQueue||this.currentSource||setTimeout(function(){return e.processQueue()},50)}catch(A){console.error("❌ AudioPlayer v2: Playback error:",A),this.emit("playbackError",A)}}},{key:"playChunk",value:(s=x(Q().m(function A(e){var t,n,o=this;return Q().w(function(A){for(;;)switch(A.n){case 0:(t=this.prepareChunk(e))?(this.preparedBuffer.push(t),this.isSchedulingFrames?setTimeout(function(){o.preparedBuffer.length>0&&!o.isSchedulingFrames&&o.schedulePreparedFrames()},5):this.schedulePreparedFrames(),this.pcmChunkQueue.length>0&&!this.isProcessingPcmQueue&&this.processPcmQueue()):(console.error("❌ AudioPlayer: playChunk failed - prepareChunk returned null"),console.error(" pcmData length:",(null==e?void 0:e.byteLength)||"undefined"),console.error(" outputFormat:",this.outputFormat),console.error(" audioContext:",this.audioContext?"initialized":"not initialized"),console.error(" audioContext state:",(null===(n=this.audioContext)||void 0===n?void 0:n.state)||"N/A"),this.emit("playbackError",new Error("Failed to prepare PCM chunk for playback")));case 1:return A.a(2)}},A,this)})),function(A){return s.apply(this,arguments)})},{key:"prepareChunk",value:function(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),r=new Float32Array(o.length),i=1/32768,a=o.length,s=0;s<a;s++)r[s]=o[s]*i;var c=(null===(e=this.outputFormat)||void 0===e?void 0:e.sampleRate)||this.audioContext.sampleRate,l=this.audioContext.sampleRate,u=this.audioContext.createBuffer(1,r.length,c);u.getChannelData(0).set(r);var d=u.duration,g=r.length,p=d;return l!==c&&(p=g/l),{buffer:u,duration:p,sampleRate:c,contextSampleRate:l}}catch(A){return console.error("❌ AudioPlayer: Error preparing chunk:",A),null}}},{key:"applyFadeOut",value:function(A){return A}},{key:"schedulePreparedFrames",value:(a=x(Q().m(function A(){var e,t,n,o,r,i,a=this;return Q().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!this.isSchedulingFrames){A.n=1;break}return A.a(2);case 1:if(this.isSchedulingFrames=!0,e=this.preparedBuffer.length,0===(t=Math.min(e,5))&&e>0&&(t=1),A.p=2,this.audioContext||this.initializeAudioContext(),n=0===this.scheduledBuffers&&!this.isPlaying,"suspended"!==this.audioContext.state){A.n=4;break}return A.n=3,this.audioContext.resume();case 3:if(!n){A.n=4;break}return A.n=4,new Promise(function(A){return setTimeout(A,50)});case 4:if("running"===this.audioContext.state){A.n=8;break}if(console.warn("AudioPlayer v2: AudioContext not in running state:",this.audioContext.state),"suspended"!==this.audioContext.state){A.n=8;break}return A.n=5,this.audioContext.resume();case 5:if(!n){A.n=7;break}return A.n=6,new Promise(function(A){return setTimeout(A,50)});case 6:A.n=8;break;case 7:return A.n=8,new Promise(function(A){return setTimeout(A,10)});case 8:o=0,r=Q().m(function A(){var e,t,n,r,i;return Q().w(function(A){for(;;)switch(A.n){case 0:if(e=a.preparedBuffer.shift()){A.n=1;break}return A.a(2,1);case 1:(t=a.audioContext.createBufferSource()).buffer=e.buffer,t.connect(a.audioContext.destination),a.scheduledSources.add(t),n=a.audioContext.currentTime,0===a.scheduledBuffers?(a.nextStartTime<n&&(a.nextStartTime=n+a.MAX_LOOKAHEAD_SECONDS),console.log("🎵 Starting playback with minimal delay:",a.nextStartTime)):(r=n+a.MAX_LOOKAHEAD_SECONDS,a.nextStartTime<r&&(a.nextStartTime=r,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,i=a.nextStartTime-e.duration,a.scheduledBuffers<5&&(console.log("🎵 AudioPlayer: Scheduled frame ".concat(a.scheduledBuffers+1," at ").concat(i.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++,o++,t.onended=function(){if(a.scheduledSources.delete(t),a.scheduledBuffers--,0===a.scheduledBuffers&&0===a.preparedBuffer.length&&0===a.pcmChunkQueue.length)a.isPlaying=!1,a.isSchedulingFrames=!1,console.log("🛑 AudioPlayer: Emitting playbackStopped event (all buffers finished)"),a.emit("playbackStopped");else if(a.preparedBuffer.length>0)setTimeout(function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.schedulePreparedFrames()},0);else if(a.scheduledBuffers>0){var A=function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.scheduledBuffers>0?a.schedulePreparedFrames():a.scheduledBuffers>0&&setTimeout(A,10)};setTimeout(A,10)}},a.isPlaying||(a.isPlaying=!0,console.log("🎵 AudioPlayer: Emitting playbackStarted event"),a.emit("playbackStarted"));case 2:return A.a(2)}},A)});case 9:if(!(this.preparedBuffer.length>0&&o<t)){A.n=12;break}return A.d(b(r()),10);case 10:if(!A.v){A.n=11;break}return A.a(3,12);case 11:A.n=9;break;case 12:this.isSchedulingFrames=!1,this.preparedBuffer.length>0&&requestAnimationFrame(function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.schedulePreparedFrames()}),this.scheduledBuffers>0&&setTimeout(function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.scheduledBuffers>0?a.schedulePreparedFrames():a.scheduledBuffers>0&&setTimeout(function(){a.preparedBuffer.length>0&&!a.isSchedulingFrames&&a.scheduledBuffers>0&&a.schedulePreparedFrames()},10)},10),A.n=14;break;case 13:A.p=13,i=A.v,console.error("❌ AudioPlayer v2: Error scheduling frames:",i),this.emit("playbackError",i),this.isSchedulingFrames=!1;case 14:return A.a(2)}},A,this,[[2,13]])})),function(){return a.apply(this,arguments)})},{key:"processPcmQueue",value:(i=x(Q().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,g,p,h,f,B,w,m,v,y,C=this;return Q().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!this.isProcessingPcmQueue){A.n=1;break}return A.a(2);case 1:if(this.isProcessingPcmQueue=!0,A.p=2,this.audioContext||this.initializeAudioContext(),e=0===this.scheduledBuffers&&!this.isPlaying,"suspended"!==this.audioContext.state){A.n=4;break}return A.n=3,this.audioContext.resume();case 3:if(!e){A.n=4;break}return A.n=4,new Promise(function(A){return setTimeout(A,50)});case 4:if("running"===this.audioContext.state){A.n=8;break}if(console.warn("AudioPlayer v2: AudioContext not in running state:",this.audioContext.state),"suspended"!==this.audioContext.state){A.n=8;break}return A.n=5,this.audioContext.resume();case 5:if(!e){A.n=7;break}return A.n=6,new Promise(function(A){return setTimeout(A,50)});case 6:A.n=8;break;case 7:return A.n=8,new Promise(function(A){return setTimeout(A,10)});case 8:if(!(this.pcmChunkQueue.length>0)){A.n=10;break}if(o=this.pcmChunkQueue.shift()){A.n=9;break}return A.a(3,8);case 9:for(r=o,o.byteLength%2!=0&&(console.warn("⚠️ Odd PCM chunk size, padding:",o.byteLength),(i=new Uint8Array(o.byteLength+1)).set(new Uint8Array(o),0),i[o.byteLength]=0,r=i.buffer),a=new Int16Array(r),s=new Float32Array(a.length),c=1/32768,l=a.length,u=0;u<l;u++)s[u]=a[u]*c;d=(null===(t=this.outputFormat)||void 0===t?void 0:t.sampleRate)||this.audioContext.sampleRate,g=this.audioContext.sampleRate,null!==(n=this.outputFormat)&&void 0!==n&&n.sampleRate?this.scheduledBuffers<3&&console.log("🎵 AudioPlayer: Creating buffer at ".concat(d,"Hz (AudioContext: ").concat(g,"Hz)")):console.warn("⚠️ AudioPlayer: outputFormat.sampleRate not set! Using AudioContext sample rate:",g),(p=this.audioContext.createBuffer(1,s.length,d)).getChannelData(0).set(s),(h=this.audioContext.createBufferSource()).buffer=p,h.connect(this.audioContext.destination),f=this.audioContext.currentTime,this.nextStartTime<f&&(this.nextStartTime=f,0===this.scheduledBuffers&&console.log("🎵 Starting playback at current time:",f)),B=p.duration,w=s.length,m=B,g!==d&&(m=w/g,this.scheduledBuffers<3&&(console.log("🔄 Resampling detected: ".concat(d,"Hz → ").concat(g,"Hz")),console.log(" Buffer duration: ".concat(B.toFixed(4),"s, Calculated: ").concat(m.toFixed(4),"s")))),h.start(this.nextStartTime),this.nextStartTime+=m,this.nextStartTime=Math.round(1e6*this.nextStartTime)/1e6,this.scheduledBuffers<3&&(v=this.nextStartTime-m,console.log("🎵 AudioPlayer: Scheduled chunk ".concat(this.scheduledBuffers+1," at ").concat(v.toFixed(4),"s, next at ").concat(this.nextStartTime.toFixed(4),"s")),console.log(" Duration: ".concat(m.toFixed(4),"s (").concat((1e3*m).toFixed(2),"ms)"))),this.scheduledBuffers++,h.onended=function(){C.scheduledBuffers--,0===C.scheduledBuffers&&0===C.pcmChunkQueue.length&&(C.isPlaying=!1,C.isProcessingPcmQueue=!1,C.emit("playbackStopped"))},this.isPlaying||(this.isPlaying=!0,this.emit("playbackStarted")),A.n=8;break;case 10:this.isProcessingPcmQueue=!1,A.n=12;break;case 11:A.p=11,y=A.v,console.error("❌ AudioPlayer v2: Error playing chunk:",y),this.emit("playbackError",y),this.isProcessingPcmQueue=!1;case 12:return A.a(2)}},A,this,[[2,11]])})),function(){return i.apply(this,arguments)})},{key:"createAudioBlob",value:function(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)}},{key:"isWavFile",value:function(A){return A.length>=44&&82===A[0]&&73===A[1]&&70===A[2]&&70===A[3]}},{key:"handleWavFile",value:function(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),r=this.createWavHeader(o.byteLength,e.sampleRate,e.channels,16);return new Blob([r,o],{type:"audio/wav"})}},{key:"handleRawData",value:function(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 r=this.outputFormat.bitDepth||16;A.length,24===r?(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===r?(console.log("🔄 AudioPlayer: Converting 8-bit PCM to 16-bit PCM"),e=this.convert8BitTo16Bit(A),t=16):(e=A.buffer,t=r,console.log("✅ AudioPlayer: Using native ".concat(r,"-bit PCM (no conversion needed)")))}else e=o.decode(A),t=16,console.log("🔄 AudioPlayer: Decoded ".concat(n.toUpperCase()," to 16-bit PCM"));var i=this.createWavHeader(e.byteLength,this.outputFormat.sampleRate,this.outputFormat.channels,t);return new Blob([i,e],{type:"audio/wav"})}},{key:"convert24BitTo16Bit",value:function(A){for(var e=Math.floor(A.length/3),t=new Int16Array(e),n=0;n<e;n++){var o=A[3*n],r=A[3*n+1],i=A[3*n+2],a=o|r<<8|(255&i)<<16;128&i&&(a|=4278190080),t[n]=Math.max(-32768,Math.min(32767,Math.round(a/256)))}return t.buffer}},{key:"convert8BitTo16Bit",value:function(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}},{key:"getCodec",value:function(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]}},{key:"getCodecForWavFormat",value:function(A){switch(A){case 1:return this.codecs.pcm;case 6:return this.codecs.pcma;case 7:return this.codecs.pcmu;default:return null}}},{key:"getEncodingName",value:function(A){switch(A){case 1:return"PCM";case 6:return"A-law";case 7:return"μ-law";default:return"Unknown (".concat(A,")")}}},{key:"parseWavHeader",value:function(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)}}},{key:"createWavHeader",value:function(A,e,t,n){var o=new ArrayBuffer(44),r=new DataView(o);return r.setUint32(0,1380533830,!1),r.setUint32(4,36+A,!0),r.setUint32(8,1463899717,!1),r.setUint32(12,1718449184,!1),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,t,!0),r.setUint32(24,e,!0),r.setUint32(28,e*t*n/8,!0),r.setUint16(32,t*n/8,!0),r.setUint16(34,n,!0),r.setUint32(36,1684108385,!1),r.setUint32(40,A,!0),o}},{key:"initializeAudioContext",value:function(){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(),"closed"!==this.audioContext.state&&this.audioContext.close(),this.audioContext=null}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."))}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"))}}},{key:"processQueue",value:(r=x(Q().m(function A(){var e,t,n,o,r,i,a,s,c=this;return Q().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!this.isProcessingQueue&&0!==this.audioQueue.length){A.n=1;break}return A.a(2);case 1:if(this.isProcessingQueue=!0,e=this.audioQueue.shift()){A.n=2;break}return this.isProcessingQueue=!1,A.a(2);case 2:if(A.p=2,t=!this.isPlaying&&null===this.currentSource,this.audioContext||this.initializeAudioContext(),"suspended"!==(n=this.audioContext).state){A.n=4;break}return A.n=3,n.resume();case 3:if(!t){A.n=4;break}return A.n=4,new Promise(function(A){return setTimeout(A,50)});case 4:if("running"===n.state){A.n=8;break}if(console.warn("AudioPlayer v2: AudioContext not in running state:",n.state),"suspended"!==n.state){A.n=8;break}return A.n=5,n.resume();case 5:if(!t){A.n=7;break}return A.n=6,new Promise(function(A){return setTimeout(A,50)});case 6:A.n=8;break;case 7:return A.n=8,new Promise(function(A){return setTimeout(A,10)});case 8:return A.n=9,e.arrayBuffer();case 9:return o=A.v,A.n=10,n.decodeAudioData(o);case 10:r=A.v,i=t&&!this.isPlaying&&null===this.currentSource,(a=n.createBufferSource()).buffer=r,a.connect(n.destination),this.currentSource=a,this.isPlaying=!0,i&&this.emit("playbackStarted"),a.onended=function(){c.currentSource=null,c.isProcessingQueue=!1,c.audioQueue.length>0?setTimeout(function(){return c.processQueue()},50):setTimeout(function(){0!==c.audioQueue.length||c.currentSource||(c.isPlaying=!1,c.emit("playbackStopped"))},100)},a.start(),A.n=12;break;case 11:A.p=11,s=A.v,console.error("❌ AudioPlayer v2: Error processing queue:",s),this.currentSource=null,this.emit("playbackError",s),this.audioQueue.length>0?(this.isProcessingQueue=!1,setTimeout(function(){return c.processQueue()},100)):(this.isPlaying=!1,this.isProcessingQueue=!1,this.emit("playbackStopped"));case 12:return A.a(2)}},A,this,[[2,11]])})),function(){return r.apply(this,arguments)})},{key:"stop",value:function(){this.stopImmediate()}},{key:"reset",value:function(){this.stop(),this.audioQueue=[],this.pcmChunkQueue=[]}},{key:"stopImmediate",value:function(){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.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,t=0,n=y(this.scheduledSources);try{for(n.s();!(e=n.n()).done;){var o=e.value;try{o.stop(),t++}catch(A){console.log(" Source already stopped or not started:",A.message)}}}catch(A){n.e(A)}finally{n.f()}console.log(" Stopped ".concat(t," sources")),this.scheduledSources.clear()}this.isPlaying=!1,this.isProcessingQueue=!1,this.audioQueue=[],this.pcmChunkQueue=[],this.preparedBuffer=[],this.isProcessingPcmQueue=!1,this.isSchedulingFrames=!1,this.nextStartTime=0,this.scheduledBuffers=0,this.clearTranscriptState(),A&&(console.log("🛑 AudioPlayer: Emitting playbackStopped event (stopImmediate called)"),this.emit("playbackStopped"))}},{key:"markNewSentence",value:function(A){this.pendingSentenceText=A,console.log('📝 AudioPlayer: New sentence marked: "'.concat(A.substring(0,40),'..."'))}},{key:"startTranscriptChecker",value:function(){var A=this;if(!this.isCheckingTranscripts){this.isCheckingTranscripts=!0,console.log("📝 AudioPlayer: Transcript checker started");var e=function(){if(A.isCheckingTranscripts&&A.audioContext){var t,n=A.audioContext.currentTime,o=y(A.sentenceTimings);try{for(o.s();!(t=o.n()).done;){var r=t.value;!r.displayed&&n>=r.startTime&&(r.displayed=!0,console.log("📝 AudioPlayer: Display transcript at ".concat(n.toFixed(3),'s: "').concat(r.text.substring(0,40),'..."')),A.emit("transcriptDisplay",{text:r.text}))}}catch(A){o.e(A)}finally{o.f()}A.isPlaying||A.scheduledBuffers>0?requestAnimationFrame(e):(A.isCheckingTranscripts=!1,console.log("📝 AudioPlayer: Transcript checker stopped"))}};requestAnimationFrame(e)}}},{key:"clearTranscriptState",value:function(){this.pendingSentenceText=null,this.sentenceTimings=[],this.isCheckingTranscripts=!1,console.log("📝 AudioPlayer: Transcript state cleared")}},{key:"resumeAudioContext",value:(o=x(Q().m(function A(){var e;return Q().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.audioContext&&"closed"!==this.audioContext.state){A.n=2;break}return A.n=1,this.initializeAudioContext();case 1:return A.a(2);case 2:if("suspended"!==this.audioContext.state){A.n=6;break}return A.p=3,A.n=4,this.audioContext.resume();case 4:console.log("✅ AudioPlayer v2: AudioContext resumed after mic permission"),A.n=6;break;case 5:A.p=5,e=A.v,console.warn("⚠️ AudioPlayer v2: Failed to resume AudioContext:",e);case 6:return A.a(2)}},A,this,[[3,5]])})),function(){return o.apply(this,arguments)})},{key:"getStatus",value:function(){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}}},{key:"destroy",value:function(){this.stop(),this.audioContext&&"closed"!==this.audioContext.state&&(this.audioContext.close(),this.audioContext=null),this.removeAllListeners()}}],n&&E(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i,a,s}(a);function D(A){return D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},D(A)}function O(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return K(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(K(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,K(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,K(u,"constructor",c),K(c,"constructor",s),s.displayName="GeneratorFunction",K(c,o,"GeneratorFunction"),K(u),K(u,o,"Generator"),K(u,n,function(){return this}),K(u,"toString",function(){return"[object Generator]"}),(O=function(){return{w:r,m:d}})()}function K(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}K=function(A,e,t,n){function r(e,t){K(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},K(A,e,t,n)}function P(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 L(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?P(Object(t),!0).forEach(function(e){M(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):P(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function M(A,e,t){return(e=j(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function R(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function V(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){R(r,n,o,i,a,"next",A)}function a(A){R(r,n,o,i,a,"throw",A)}i(void 0)})}}function _(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}function G(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,j(n.key),n)}}function j(A){var e=function(A){if("object"!=D(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=D(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==D(e)?e:e+""}function N(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(N=function(){return!!A})()}function W(A){return W=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},W(A)}function J(A,e){return J=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},J(A,e)}var X=function(A){function e(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(A,e,t){return e=W(e),function(A,e){if(e&&("object"==D(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,N()?Reflect.construct(e,t||[],W(A).constructor):e.apply(A,t))}(this,e)).config=A,t.audioContext=null,t.audioWorkletNode=null,t.mediaStream=null,t.isRecording=!1,t}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&J(A,e)}(e,A),t=e,n=[{key:"getAudioProcessorPath",value:function(){if(this.config.audioProcessorPath)return this.config.audioProcessorPath;var A,e=function(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=function(A,e){if(A){if("string"==typeof A)return _(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_(A,e):void 0}}(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,o=function(){};return{s:o,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){a=!0,r=A},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}(document.getElementsByTagName("script"));try{for(e.s();!(A=e.n()).done;){var t=A.value.src;if(t&&(t.includes("agent-widget.js")||t.includes("ttp-agent-sdk")))try{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")}}}catch(A){e.e(A)}finally{e.f()}return"https://cdn.talktopc.com/audio-processor.js"}},{key:"start",value:(r=V(O().m(function A(){var e,t,n,o,r,i,a,s,c=this;return O().w(function(A){for(;;)switch(A.p=A.n){case 0:if(A.p=0,"https:"===location.protocol||"localhost"===location.hostname||"127.0.0.1"===location.hostname){A.n=1;break}throw e=new Error("Microphone access requires HTTPS. Please use https:// or test on localhost."),console.error("❌ AudioRecorder:",e.message),this.emit("error",e),e;case 1:if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia){A.n=2;break}throw t=new Error("getUserMedia is not supported in this browser. Please use a modern browser."),console.error("❌ AudioRecorder:",t.message),this.emit("error",t),t;case 2:return console.log("🎤 AudioRecorder: Requesting microphone access..."),n={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},o=this.config.audioConstraints?L(L({},n),this.config.audioConstraints):n,A.n=3,navigator.mediaDevices.getUserMedia({audio:L({sampleRate:this.config.sampleRate,channelCount:1},o)});case 3:if(this.mediaStream=A.v,console.log("✅ AudioRecorder: Microphone access granted"),this.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:this.config.sampleRate}),"suspended"!==this.audioContext.state){A.n=4;break}return A.n=4,this.audioContext.resume();case 4:return r=this.getAudioProcessorPath(),A.n=5,this.audioContext.audioWorklet.addModule(r);case 5:this.audioWorkletNode=new AudioWorkletNode(this.audioContext,"audio-processor"),this.audioContext.createMediaStreamSource(this.mediaStream).connect(this.audioWorkletNode),this.audioWorkletNode.port.onmessage=function(A){var e=A.data,t=e.type,n=e.data;"pcm_audio_data"===t&&c.emit("audioData",n)},this.audioWorkletNode.port.postMessage({type:"setForceContinuous",data:{enabled:!0}}),this.isRecording=!0,this.emit("recordingStarted"),A.n=7;break;case 6:throw A.p=6,s=A.v,i=s.message,"NotAllowedError"===s.name||"PermissionDeniedError"===s.name?(i="Microphone permission denied. Please allow microphone access in your browser settings and try again.",console.error("❌ AudioRecorder: Permission denied. User needs to grant microphone access.")):"NotFoundError"===s.name||"DevicesNotFoundError"===s.name?(i="No microphone found. Please connect a microphone and try again.",console.error("❌ AudioRecorder: No microphone device found.")):"NotReadableError"===s.name||"TrackStartError"===s.name?(i="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.")):s.message&&s.message.includes("not allowed by the user agent")&&(i="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.")),(a=new Error(i)).name=s.name,a.originalError=s,console.error("❌ AudioRecorder: Failed to start recording:",a),this.emit("error",a),a;case 7:return A.a(2)}},A,this,[[0,6]])})),function(){return r.apply(this,arguments)})},{key:"stop",value:(o=V(O().m(function A(){var e;return O().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.isRecording){A.n=1;break}return A.a(2);case 1:if(A.p=1,!this.audioWorkletNode){A.n=2;break}return this.audioWorkletNode.port.postMessage({type:"flush"}),A.n=2,new Promise(function(A){return setTimeout(A,100)});case 2:if(this.mediaStream&&(this.mediaStream.getTracks().forEach(function(A){return A.stop()}),this.mediaStream=null),!this.audioContext||"closed"===this.audioContext.state){A.n=4;break}return A.n=3,this.audioContext.close();case 3:this.audioContext=null;case 4:this.audioWorkletNode=null,this.isRecording=!1,this.emit("recordingStopped"),A.n=6;break;case 5:throw A.p=5,e=A.v,this.emit("error",e),e;case 6:return A.a(2)}},A,this,[[1,5]])})),function(){return o.apply(this,arguments)})},{key:"getStatus",value:function(){return{isRecording:this.isRecording,audioContextState:this.audioContext?this.audioContext.state:"closed"}}},{key:"destroy",value:function(){this.stop()}}],n&&G(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r}(a);function z(A){return z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},z(A)}function Y(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,Z(n.key),n)}}function Z(A){var e=function(A){if("object"!=z(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=z(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==z(e)?e:e+""}const q=function(){function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A)}return e=A,t=[{key:"extractPcmFromWav",value:function(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,r=-1,i=12;i<e.length-8;i+=4){if("data"===String.fromCharCode(e[i],e[i+1],e[i+2],e[i+3])){r=i;break}i+=4+(e[i+4]|e[i+5]<<8|e[i+6]<<16|e[i+7]<<24)}if(-1===r)throw new Error("No data chunk found in WAV");var a=e[r+4]|e[r+5]<<8|e[r+6]<<16|e[r+7]<<24,s=r+8,c=Math.min(a,e.length-s);return{pcmData:e.slice(s,s+c).buffer,format:{sampleRate:n,channels:t,bitDepth:o}}}},{key:"isWavFile",value:function(A){return A.length>=44&&82===A[0]&&73===A[1]&&70===A[2]&&70===A[3]}},{key:"createWavHeader",value:function(A,e,t,n){var o=new ArrayBuffer(44),r=new DataView(o);return r.setUint32(0,1380533830,!1),r.setUint32(4,36+A,!0),r.setUint32(8,1463899717,!1),r.setUint32(12,1718449184,!1),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,t,!0),r.setUint32(24,e,!0),r.setUint32(28,e*t*n/8,!0),r.setUint16(32,t*n/8,!0),r.setUint16(34,n,!0),r.setUint32(36,1684108385,!1),r.setUint32(40,A,!0),o}},{key:"wrapPcmInWav",value:function(e,t){var n=A.createWavHeader(e.byteLength,t.sampleRate,t.channels||1,t.bitDepth||16),o=new Uint8Array(n.byteLength+e.byteLength);return o.set(new Uint8Array(n),0),o.set(new Uint8Array(e),n.byteLength),o.buffer}}],null&&Y(e.prototype,null),t&&Y(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function $(A){return $="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},$(A)}function AA(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,eA(n.key),n)}}function eA(A){var e=function(A){if("object"!=$(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=$(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==$(e)?e:e+""}const tA=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.codecs={pcm:new u,pcmu:new h,pcma:new m}},(e=[{key:"decodeToPcm",value:function(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)}},{key:"encodeFromPcm",value:function(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}},{key:"getCodec",value:function(A){var e=null==A?void 0:A.toLowerCase();return this.codecs[e]||null}}])&&AA(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function nA(A){return nA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},nA(A)}function oA(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,rA(n.key),n)}}function rA(A){var e=function(A){if("object"!=nA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=nA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==nA(e)?e:e+""}const iA=function(){function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A)}return e=A,t=[{key:"convert",value:function(e,t,n){if(t===n)return e;if(8===t)throw new Error("Source bit depth cannot be 8-bit (only 16-bit or 24-bit supported)");var o=t/8,r=n/8,i=e.byteLength/o;if(new ArrayBuffer(i*r),16===t&&16===n)return e;if(24===t&&16===n)return A.convert24To16(e);if(16===t&&24===n)return A.convert16To24(e);if(16===t&&8===n)return A.convert16To8(e);if(24===t&&8===n)return A.convert24To8(e);throw new Error("Unsupported bit depth conversion: ".concat(t,"-bit → ").concat(n,"-bit"))}},{key:"convert24To16",value:function(A){for(var e=new Uint8Array(A),t=Math.floor(e.length/3),n=new Int16Array(t),o=0;o<t;o++){var r=e[3*o],i=e[3*o+1],a=e[3*o+2],s=r|i<<8|(255&a)<<16;128&a&&(s|=4278190080),n[o]=Math.max(-32768,Math.min(32767,Math.round(s/256)))}return n.buffer}},{key:"convert16To24",value:function(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}},{key:"convert16To8",value:function(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}},{key:"convert24To8",value:function(e){var t=A.convert24To16(e);return A.convert16To8(t)}}],null&&oA(e.prototype,null),t&&oA(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function aA(A){return aA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},aA(A)}function sA(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return cA(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(cA(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,cA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,cA(u,"constructor",c),cA(c,"constructor",s),s.displayName="GeneratorFunction",cA(c,o,"GeneratorFunction"),cA(u),cA(u,o,"Generator"),cA(u,n,function(){return this}),cA(u,"toString",function(){return"[object Generator]"}),(sA=function(){return{w:r,m:d}})()}function cA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}cA=function(A,e,t,n){function r(e,t){cA(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},cA(A,e,t,n)}function lA(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function uA(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,dA(n.key),n)}}function dA(A){var e=function(A){if("object"!=aA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=aA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==aA(e)?e:e+""}const gA=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A)},e=[{key:"resample",value:(t=sA().m(function A(e,t,n){var o,r,i,a,s,c,l,u,d,g,p,h,f;return sA().w(function(A){for(;;)switch(A.n){case 0:if(t!==n){A.n=1;break}return A.a(2,e);case 1:for(o=new Int16Array(e),r=new Float32Array(o.length),i=1/32768,a=0;a<o.length;a++)r[a]=o[a]*i;return s=Math.ceil(r.length*n/t),c=new OfflineAudioContext(1,s,n),(l=c.createBuffer(1,r.length,t)).getChannelData(0).set(r),(u=c.createBufferSource()).buffer=l,u.connect(c.destination),u.start(),A.n=2,c.startRendering();case 2:for(d=A.v,g=d.getChannelData(0),p=new Int16Array(g.length),h=0;h<g.length;h++)f=Math.max(-1,Math.min(1,g[h])),p[h]=Math.round(32767*f);return A.a(2,p.buffer)}},A)}),n=function(){var A=this,e=arguments;return new Promise(function(n,o){var r=t.apply(A,e);function i(A){lA(r,n,o,i,a,"next",A)}function a(A){lA(r,n,o,i,a,"throw",A)}i(void 0)})},function(A,e,t){return n.apply(this,arguments)})}],e&&uA(A,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function pA(A){return pA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},pA(A)}function hA(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,fA(n.key),n)}}function fA(A){var e=function(A){if("object"!=pA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=pA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==pA(e)?e:e+""}const BA=function(){function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A)}return e=A,t=[{key:"convert",value:function(e,t,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:16;if(t===n)return e;if(1===t&&1===n)return e;if(1===t&&2===n)return A.monoToStereo(e,o);if(2===t&&1===n)return A.stereoToMono(e,o);throw new Error("Unsupported channel conversion: ".concat(t," → ").concat(n))}},{key:"monoToStereo",value:function(A,e){for(var t=e/8,n=A.byteLength/t,o=new ArrayBuffer(n*t*2),r=new Uint8Array(A),i=new Uint8Array(o),a=0;a<n;a++)for(var s=a*t,c=a*t*2,l=0;l<t;l++)i[c+l]=r[s+l],i[c+t+l]=r[s+l];return o}},{key:"stereoToMono",value:function(A,e){var t=e/8,n=A.byteLength/(2*t),o=new ArrayBuffer(n*t),r=new Uint8Array(A),i=new Uint8Array(o);if(16===e)for(var a=0;a<n;a++){var s=a*t*2,c=s+t,l=(r[s]|r[s+1]<<8)<<16>>16,u=(r[c]|r[c+1]<<8)<<16>>16,d=Math.round((l+u)/2),g=a*t;i[g]=255&d,i[g+1]=d>>8&255}else for(var p=0;p<n;p++)for(var h=p*t*2,f=p*t,B=0;B<t;B++)i[f+B]=r[h+B];return o}}],null&&hA(e.prototype,null),t&&hA(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();function wA(A){return wA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},wA(A)}function mA(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return vA(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(vA(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,vA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,vA(u,"constructor",c),vA(c,"constructor",s),s.displayName="GeneratorFunction",vA(c,o,"GeneratorFunction"),vA(u),vA(u,o,"Generator"),vA(u,n,function(){return this}),vA(u,"toString",function(){return"[object Generator]"}),(mA=function(){return{w:r,m:d}})()}function vA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}vA=function(A,e,t,n){function r(e,t){vA(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},vA(A,e,t,n)}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 CA(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){bA(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 bA(A,e,t){return(e=UA(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function QA(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function FA(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,UA(n.key),n)}}function UA(A){var e=function(A){if("object"!=wA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=wA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==wA(e)?e:e+""}const xA=function(){return A=function A(e,t){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.requestedFormat=e,this.actualFormat=t,this.encodingConverter=new tA,this.conversionSteps=[],this._analyzeConversions()},e=[{key:"_analyzeConversions",value:function(){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")}},{key:"needsConversion",value:function(){return this.conversionSteps.length>0}},{key:"getConversionSteps",value:function(){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}},{key:"convert",value:(t=mA().m(function A(e){var t,n,o,r;return mA().w(function(A){for(;;)switch(A.n){case 0:if(this.needsConversion()){A.n=1;break}return A.a(2,e instanceof ArrayBuffer?e:e.buffer);case 1:if(t=e instanceof ArrayBuffer?e:e.buffer,n=CA({},this.actualFormat),this.conversionSteps.includes("extract_wav")&&(o=q.extractPcmFromWav(t),t=o.pcmData,n=CA(CA({},n),{},{container:"raw",sampleRate:o.format.sampleRate,channels:o.format.channels,bitDepth:o.format.bitDepth}),console.log("🔄 AudioFormatConverter: Extracted PCM from WAV",o.format)),this.conversionSteps.includes("decode_encoding")&&(t=this.encodingConverter.decodeToPcm(t,n.encoding),n.encoding="pcm",n.bitDepth=16,console.log("🔄 AudioFormatConverter: Decoded ".concat(this.actualFormat.encoding.toUpperCase()," → PCM"))),24===n.bitDepth&&n.bitDepth!==this.requestedFormat.bitDepth&&(this.conversionSteps.includes("resample")||this.conversionSteps.includes("convert_channels")||24!==this.requestedFormat.bitDepth)&&(t=iA.convert(t,24,16),n.bitDepth=16,console.log("🔄 AudioFormatConverter: Normalized 24-bit → 16-bit PCM")),!this.conversionSteps.includes("resample")){A.n=3;break}return A.n=2,gA.resample(t,n.sampleRate,this.requestedFormat.sampleRate);case 2:t=A.v,n.sampleRate=this.requestedFormat.sampleRate,console.log("🔄 AudioFormatConverter: Resampled ".concat(this.actualFormat.sampleRate,"Hz → ").concat(this.requestedFormat.sampleRate,"Hz"));case 3:return this.conversionSteps.includes("convert_channels")&&(t=BA.convert(t,n.channels,this.requestedFormat.channels,n.bitDepth),n.channels=this.requestedFormat.channels,console.log("🔄 AudioFormatConverter: Converted channels ".concat(this.actualFormat.channels," → ").concat(this.requestedFormat.channels))),this.conversionSteps.includes("convert_bitdepth")&&(t=iA.convert(t,n.bitDepth,this.requestedFormat.bitDepth),n.bitDepth=this.requestedFormat.bitDepth,console.log("🔄 AudioFormatConverter: Converted bit depth ".concat(this.actualFormat.bitDepth,"-bit → ").concat(this.requestedFormat.bitDepth,"-bit"))),this.conversionSteps.includes("encode_encoding")&&(r=this.encodingConverter.encodeFromPcm(t,this.requestedFormat.encoding),t=r instanceof ArrayBuffer?r:r.buffer,n.encoding=this.requestedFormat.encoding,console.log("🔄 AudioFormatConverter: Encoded PCM → ".concat(this.requestedFormat.encoding.toUpperCase()))),this.conversionSteps.includes("wrap_wav")&&(t=q.wrapPcmInWav(t,n),n.container="wav",console.log("🔄 AudioFormatConverter: Wrapped in WAV container")),console.log("✅ AudioFormatConverter: Conversion complete"),A.a(2,t)}},A,this)}),n=function(){var A=this,e=arguments;return new Promise(function(n,o){var r=t.apply(A,e);function i(A){QA(r,n,o,i,a,"next",A)}function a(A){QA(r,n,o,i,a,"throw",A)}i(void 0)})},function(A){return n.apply(this,arguments)})}],e&&FA(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function EA(A){return EA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},EA(A)}function SA(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return IA(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(IA(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,IA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,IA(u,"constructor",c),IA(c,"constructor",s),s.displayName="GeneratorFunction",IA(c,o,"GeneratorFunction"),IA(u),IA(u,o,"Generator"),IA(u,n,function(){return this}),IA(u,"toString",function(){return"[object Generator]"}),(SA=function(){return{w:r,m:d}})()}function IA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}IA=function(A,e,t,n){function r(e,t){IA(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},IA(A,e,t,n)}function HA(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function kA(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,TA(n.key),n)}}function TA(A){var e=function(A){if("object"!=EA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=EA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==EA(e)?e:e+""}const DA=function(){return A=function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:function(){return null};!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.handlers=new Map,this.sendMessage=e,this.getConversationId=t},e=[{key:"registerHandler",value:function(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,"'"))}},{key:"unregisterHandler",value:function(A){this.handlers.delete(A),console.log("🔧 ClientTools: Unregistered handler for '".concat(A,"'"))}},{key:"hasHandler",value:function(A){return this.handlers.has(A)}},{key:"getRegisteredTools",value:function(){return Array.from(this.handlers.keys())}},{key:"handleToolCall",value:(t=SA().m(function A(e){var t,n,o,r,i,a,s,c,l,u,d,g,p;return SA().w(function(A){for(;;)switch(A.p=A.n){case 0:if(t=e.toolCallId,n=e.toolName,o=e.parameters,r=Date.now(),i=(new Date).toISOString(),console.log("🔧 ClientTools: [".concat(i,"] Received tool call '").concat(n,"' (id: ").concat(t,")")),console.log(" 📋 Full message received:",JSON.stringify(e,null,2)),console.log(" ⏱️ Start time: ".concat(r,"ms (").concat(new Date(r).toISOString(),")")),a=this.handlers.get(n)){A.n=1;break}return console.warn("🔧 ClientTools: No handler registered for '".concat(n,"'")),this.sendError(t,n,"No handler registered for tool '".concat(n,"'"),"NO_HANDLER",r),A.a(2);case 1:return A.p=1,A.n=2,a(o);case 2:s=A.v,c=Date.now()-r,console.log("🔧 ClientTools: Tool '".concat(n,"' completed in ").concat(c,"ms")),this.sendResult(t,n,s,c),A.n=4;break;case 3:A.p=3,p=A.v,d=Date.now()-r,console.error("🔧 ClientTools: Tool '".concat(n,"' failed:"),p),g="EXECUTION_ERROR","NotAllowedError"===p.name||null!==(l=p.message)&&void 0!==l&&l.includes("permission")?g="PERMISSION_DENIED":("NotSupportedError"===p.name||null!==(u=p.message)&&void 0!==u&&u.includes("not supported"))&&(g="API_UNAVAILABLE"),this.sendError(t,n,p.message||"Unknown error",g,d);case 4:return A.a(2)}},A,this,[[1,3]])}),n=function(){var A=this,e=arguments;return new Promise(function(n,o){var r=t.apply(A,e);function i(A){HA(r,n,o,i,a,"next",A)}function a(A){HA(r,n,o,i,a,"throw",A)}i(void 0)})},function(A){return n.apply(this,arguments)})},{key:"sendResult",value:function(A,e,t,n){var o=this.getConversationId(),r=(new Date).toISOString(),i={t:"client_tool_result",toolCallId:A,toolName:e,conversationId:o,result:t,executionTimeMs:n};console.log("🔧 ClientTools: [".concat(r,"] 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(i,null,2)),this.sendMessage(i),console.log("✅ ClientTools: Result message sent at ".concat(r))}},{key:"sendError",value:function(A,e,t,n,o){var r="number"==typeof o?Date.now()-o:o,i=(new Date).toISOString(),a=this.getConversationId(),s={t:"client_tool_error",toolCallId:A,toolName:e,conversationId:a,error:t,errorCode:n,executionTimeMs:r};console.log("🔧 ClientTools: [".concat(i,"] Sending error for tool '").concat(e,"'")),console.log(" 📋 toolCallId: ".concat(A)),console.log(" 📋 conversationId: ".concat(a||"null")),console.log(" 📋 toolName: ".concat(e)),console.log(" 📋 error: ".concat(t,", errorCode: ").concat(n)),console.log(" 📋 Full message:",JSON.stringify(s,null,2)),this.sendMessage(s),console.log("✅ ClientTools: Error message sent at ".concat(i))}},{key:"setSendMessage",value:function(A){this.sendMessage=A}}],e&&kA(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();var OA=t(354),KA=t.n(OA);function PA(A){return PA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},PA(A)}function LA(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return MA(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(MA(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,MA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,MA(u,"constructor",c),MA(c,"constructor",s),s.displayName="GeneratorFunction",MA(c,o,"GeneratorFunction"),MA(u),MA(u,o,"Generator"),MA(u,n,function(){return this}),MA(u,"toString",function(){return"[object Generator]"}),(LA=function(){return{w:r,m:d}})()}function MA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}MA=function(A,e,t,n){function r(e,t){MA(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},MA(A,e,t,n)}function RA(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?RA(Object(t),!0).forEach(function(e){_A(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):RA(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"!=PA(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=PA(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==PA(e)?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function GA(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}var jA={useCORS:!0,allowTaint:!1,backgroundColor:"#ffffff",scale:1,logging:!1,imageTimeout:15e3};function NA(){return WA.apply(this,arguments)}function WA(){var A;return A=LA().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,g,p,h,f,B,w,m,v,y,C,b,Q,F,U,x=arguments;return LA().w(function(A){for(;;)switch(A.p=A.n){case 0:if(t=(e=x.length>0&&void 0!==x[0]?x[0]:{}).selector,n=void 0===t?null:t,o=e.format,r=void 0===o?"jpeg":o,i=e.quality,a=void 0===i?.85:i,s=e.scale,c=void 0===s?1:s,l=e.maxWidth,u=void 0===l?1280:l,d=e.maxHeight,g=void 0===d?1280:d,p=e.fullPage,h=void 0!==p&&p,console.log("📸 SDK Screenshot: Starting capture with options:",e),f=Date.now(),A.p=1,B=document.body,!n){A.n=3;break}if(w=document.querySelector(n)){A.n=2;break}throw new Error("Element not found: ".concat(n));case 2:B=w,console.log("📸 SDK Screenshot: Capturing element: ".concat(n)),A.n=4;break;case 3:console.log("📸 SDK Screenshot: Capturing entire page");case 4:return m=VA(VA({},jA),{},{scale:c}),h&&!n&&(m.windowHeight=document.documentElement.scrollHeight,m.height=document.documentElement.scrollHeight,m.y=0),A.n=5,KA()(B,m);case 5:return v=A.v,console.log("📸 SDK Screenshot: Canvas created (".concat(v.width,"x").concat(v.height,")")),y=v,(u||g)&&(y=JA(v,u,g))!==v&&console.log("📸 SDK Screenshot: Resized to ".concat(y.width,"x").concat(y.height)),C="jpeg"===r?"image/jpeg":"image/png",b=y.toDataURL(C,"jpeg"===r?a:void 0),Q=b.split(",")[1],F=Date.now()-f,console.log("📸 SDK Screenshot: Capture completed in ".concat(F,"ms")),console.log("📸 SDK Screenshot: Size: ".concat(Math.round(Q.length/1024),"KB")),A.a(2,{image:Q,mimeType:C,width:y.width,height:y.height,captureTimeMs:F,selector:n||"body"});case 6:throw A.p=6,U=A.v,console.error("📸 SDK Screenshot: Capture failed:",U),new Error("Screenshot capture failed: ".concat(U.message));case 7:return A.a(2)}},A,null,[[1,6]])}),WA=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){GA(r,n,o,i,a,"next",A)}function a(A){GA(r,n,o,i,a,"throw",A)}i(void 0)})},WA.apply(this,arguments)}function JA(A,e,t){var n=A.width,o=A.height,r=1;if(e&&n>e&&(r=Math.min(r,e/n)),t&&o>t&&(r=Math.min(r,t/o)),1===r)return A;var i=Math.round(n*r),a=Math.round(o*r),s=document.createElement("canvas");return s.width=i,s.height=a,s.getContext("2d").drawImage(A,0,0,i,a),s}function XA(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 zA(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?XA(Object(t),!0).forEach(function(e){re(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):XA(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function YA(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return ZA(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(ZA(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,ZA(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,ZA(u,"constructor",c),ZA(c,"constructor",s),s.displayName="GeneratorFunction",ZA(c,o,"GeneratorFunction"),ZA(u),ZA(u,o,"Generator"),ZA(u,n,function(){return this}),ZA(u,"toString",function(){return"[object Generator]"}),(YA=function(){return{w:r,m:d}})()}function ZA(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}ZA=function(A,e,t,n){function r(e,t){ZA(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},ZA(A,e,t,n)}function qA(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function $A(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){qA(r,n,o,i,a,"next",A)}function a(A){qA(r,n,o,i,a,"throw",A)}i(void 0)})}}function Ae(A){return Ae="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Ae(A)}function ee(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,ie(n.key),n)}}function te(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(te=function(){return!!A})()}function ne(A){return ne=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},ne(A)}function oe(A,e){return oe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},oe(A,e)}function re(A,e,t){return(e=ie(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function ie(A){var e=function(A){if("object"!=Ae(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Ae(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Ae(e)?e:e+""}var ae=function(A){function e(){var A,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(A=function(A,e,t){return e=ne(e),function(A,e){if(e&&("object"==Ae(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,te()?Reflect.construct(e,t||[],ne(A).constructor):e.apply(A,t))}(this,e)).version="2.0.0",A.config={signedUrl:t.signedUrl||t.websocketUrl||"wss://speech.talktopc.com/ws/conv",websocketUrl:t.signedUrl||t.websocketUrl||"wss://speech.talktopc.com/ws/conv",agentId:t.agentId,appId:t.appId,sampleRate:t.sampleRate||16e3,channels:t.channels||1,bitDepth:t.bitDepth||16,audioProcessorPath:t.audioProcessorPath,outputContainer:t.outputContainer||A.getDefaultContainer(t),outputEncoding:t.outputEncoding||t.outputCodec||"pcm",outputSampleRate:t.outputSampleRate||16e3,outputChannels:t.outputChannels||1,outputBitDepth:t.outputBitDepth||16,outputFrameDurationMs:t.outputFrameDurationMs||600,outputCodec:t.outputCodec,agentSettingsOverride:t.agentSettingsOverride||null,variables:t.variables||null,autoReconnect:!1!==t.autoReconnect,audioConstraints:t.audioConstraints||null,protocolVersion:t.protocolVersion||2},A.isConnected=!1,A.hasEverConnected=!1,A.isRecording=!1,A.isPlaying=!1,A.isDestroyed=!1,A.outputAudioFormat=null,A.requestedOutputFormat=null,A.formatConverter=null,A.websocket=null,A.conversationId=null,A.transcriptQueue=[],A.currentPlayingSentenceId=null,A.audioFrameCount=0,A.audioPlayer=new T(A.config),A.audioRecorder=new X(A.config),A.setupAudioPlayerEvents(),A.setupAudioRecorderEvents(),A.clientToolsRegistry=new DA(function(e){return A.sendMessage(e)},function(){return A.conversationId}),A._registerBuiltInTools(),A.validateConfig(),A._setupPageUnloadHandler(),console.log("🎵 VoiceSDK v2 initialized:",{version:A.version,outputContainer:A.config.outputContainer,outputEncoding:A.config.outputEncoding,outputSampleRate:A.config.outputSampleRate}),A}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&oe(A,e)}(e,A),t=e,n=[{key:"_registerBuiltInTools",value:function(){var A=this;console.log("📸 VoiceSDK: _registerBuiltInTools() called"),console.log("📸 VoiceSDK: captureScreenshot available?",void 0!==NA);try{if(void 0===NA)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:",Ae(NA)),this.clientToolsRegistry.registerHandler("capture_screen",$A(YA().m(function e(){var t,n,o,r,i,a,s,c,l,u,d,g,p,h,f,B,w,m=arguments;return YA().w(function(e){for(;;)switch(e.p=e.n){case 0:return t=m.length>0&&void 0!==m[0]?m[0]:{},console.log("📸 VoiceSDK: capture_screen tool called with params:",t),n=t.selector,o=void 0===n?null:n,r=t.format,i=void 0===r?"jpeg":r,a=t.quality,s=void 0===a?.85:a,c=t.scale,l=void 0===c?1:c,u=t.fullPage,d=void 0!==u&&u,g=t.maxWidth,p=void 0===g?1280:g,h=t.maxHeight,f=void 0===h?1280:h,e.p=1,e.n=2,NA({selector:o,format:i,quality:s,scale:l,fullPage:d,maxWidth:p,maxHeight:f});case 2:return B=e.v,console.log("📸 VoiceSDK: Screenshot captured: ".concat(B.width,"x").concat(B.height,", ").concat(Math.round(B.image.length/1024),"KB")),A.emit("screenshotCaptured",{width:B.width,height:B.height,sizeKB:Math.round(B.image.length/1024),selector:B.selector}),e.a(2,B);case 3:throw e.p=3,w=e.v,console.error("📸 VoiceSDK: Screenshot capture failed:",w),A.emit("screenshotError",{error:w.message}),w;case 4:return e.a(2)}},e,null,[[1,3]])}))),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)}}},{key:"getStoredConversationId",value:function(){try{if("undefined"==typeof sessionStorage)return console.warn("⚠️ VoiceSDK v2: sessionStorage not available (private mode?)"),null;var A=sessionStorage.getItem(e.RESUME_STORAGE_KEY);if(A){var t=JSON.parse(A);if(t&&t.conversationId)return console.log("📦 VoiceSDK v2: Found stored conversationId:",t.conversationId),t.conversationId}return null}catch(A){return console.warn("⚠️ VoiceSDK v2: Error reading sessionStorage:",A),null}}},{key:"storeConversationId",value:function(A){if(A)try{if("undefined"==typeof sessionStorage)return void console.warn("⚠️ VoiceSDK v2: sessionStorage not available (private mode?)");var t={},n=sessionStorage.getItem(e.RESUME_STORAGE_KEY);if(n)try{t=JSON.parse(n)}catch(A){}t.conversationId=A,t.timestamp=Date.now(),t.fromPage=t.fromPage||window.location.pathname+window.location.search,sessionStorage.setItem(e.RESUME_STORAGE_KEY,JSON.stringify(t)),console.log("💾 VoiceSDK v2: Stored conversationId:",A)}catch(A){console.warn("⚠️ VoiceSDK v2: Error writing to sessionStorage:",A)}}},{key:"clearStoredConversationId",value:function(){try{if("undefined"==typeof sessionStorage)return;sessionStorage.removeItem(e.RESUME_STORAGE_KEY),console.log("🗑️ VoiceSDK v2: Cleared stored conversationId")}catch(A){console.warn("⚠️ VoiceSDK v2: Error clearing sessionStorage:",A)}}},{key:"_getResumeState",value:function(){try{if("undefined"==typeof sessionStorage)return null;var A=sessionStorage.getItem(e.RESUME_STORAGE_KEY);if(!A)return null;var t=JSON.parse(A),n=Date.now()-t.timestamp;return n>e.RESUME_TTL_MS?(console.log("[VoiceSDK] Resume state expired:",n,"ms"),this._clearResumeState(),null):(console.log("[VoiceSDK] Found valid resume state:",t,"age:",n,"ms"),t)}catch(A){return console.warn("[VoiceSDK] Failed to get resume state:",A),null}}},{key:"_clearResumeState",value:function(){try{if("undefined"==typeof sessionStorage)return;sessionStorage.removeItem(e.RESUME_STORAGE_KEY)}catch(A){}}},{key:"_setupPageUnloadHandler",value:function(){var A=this;window.addEventListener("beforeunload",function(){A.conversationId&&A.websocket&&A.websocket.readyState===WebSocket.OPEN&&A.storeConversationId(A.conversationId)}),document.addEventListener("visibilitychange",function(){"hidden"===document.visibilityState&&A.conversationId&&A.websocket&&A.websocket.readyState===WebSocket.OPEN&&A.storeConversationId(A.conversationId)})}},{key:"checkAndResume",value:function(){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}}},{key:"getDefaultContainer",value:function(A){return"wav"===A.outputCodec?"wav":"raw"}},{key:"validateInputFormat",value:function(A){var t;if(!A)return"Input format is required";var n=null===(t=A.encoding)||void 0===t?void 0:t.toLowerCase();return n&&e.SUPPORTED_INPUT_ENCODINGS.includes(n)?A.sampleRate&&e.SUPPORTED_INPUT_SAMPLE_RATES.includes(A.sampleRate)?A.bitDepth&&e.SUPPORTED_INPUT_BIT_DEPTHS.includes(A.bitDepth)?A.channels&&e.SUPPORTED_INPUT_CHANNELS.includes(A.channels)?null:"Unsupported input channels: ".concat(A.channels,". Supported: ").concat(e.SUPPORTED_INPUT_CHANNELS.join(", ")):"Unsupported input bit depth: ".concat(A.bitDepth,". Supported: ").concat(e.SUPPORTED_INPUT_BIT_DEPTHS.join(", ")):"Unsupported input sample rate: ".concat(A.sampleRate,". Supported: ").concat(e.SUPPORTED_INPUT_SAMPLE_RATES.join(", ")):"Unsupported input encoding: ".concat(A.encoding,". Supported: ").concat(e.SUPPORTED_INPUT_ENCODINGS.join(", "))}},{key:"validateOutputFormat",value:function(A){var t,n;if(!A)return"Output format is required";var o=null===(t=A.encoding)||void 0===t?void 0:t.toLowerCase();if(!o||!e.SUPPORTED_OUTPUT_ENCODINGS.includes(o))return"Unsupported output encoding: ".concat(A.encoding,". Supported: ").concat(e.SUPPORTED_OUTPUT_ENCODINGS.join(", "));if(!A.sampleRate||!e.SUPPORTED_OUTPUT_SAMPLE_RATES.includes(A.sampleRate))return"Unsupported output sample rate: ".concat(A.sampleRate,". Supported: ").concat(e.SUPPORTED_OUTPUT_SAMPLE_RATES.join(", "));if(!A.bitDepth||!e.SUPPORTED_OUTPUT_BIT_DEPTHS.includes(A.bitDepth))return"Unsupported output bit depth: ".concat(A.bitDepth,". Supported: ").concat(e.SUPPORTED_OUTPUT_BIT_DEPTHS.join(", "));if(!A.channels||!e.SUPPORTED_OUTPUT_CHANNELS.includes(A.channels))return"Unsupported output channels: ".concat(A.channels,". Supported: ").concat(e.SUPPORTED_OUTPUT_CHANNELS.join(", "));var r=null===(n=A.container)||void 0===n?void 0:n.toLowerCase();return r&&e.SUPPORTED_OUTPUT_CONTAINERS.includes(r)?null:"Unsupported output container: ".concat(A.container,". Supported: ").concat(e.SUPPORTED_OUTPUT_CONTAINERS.join(", "))}},{key:"validateConfig",value:function(){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")}},{key:"setupAudioPlayerEvents",value:function(){var A=this;this.audioPlayer.on("playbackStarted",function(){A.isPlaying=!0,A.emit("playbackStarted"),A.isConnected?(console.log("📤 VoiceSDK v2: Sending audio_started_playing message to server"),A.sendMessage({t:"audio_started_playing"})):console.warn("⚠️ VoiceSDK v2: Cannot send audio_started_playing - not connected")}),this.audioPlayer.on("transcriptDisplay",function(e){var t=A.currentPlayingSentenceId?A.currentPlayingSentenceId+1:1;A.currentPlayingSentenceId=t;var n={text:e.text,role:"assistant",sentenceId:t,final:!0,timestamp:Date.now()};console.log("📝 VoiceSDK v2: Emitting synced transcriptDisplay from AudioPlayer:",n),A.emit("transcriptDisplay",n),A.emit("transcript",n)}),this.audioPlayer.on("playbackStopped",function(){A.isPlaying=!1,A.emit("playbackStopped"),A.isConnected?(console.log("📤 VoiceSDK v2: Sending audio_stopped_playing message to server"),A.sendMessage({t:"audio_stopped_playing"})):console.warn("⚠️ VoiceSDK v2: Cannot send audio_stopped_playing - not connected")}),this.audioPlayer.on("playbackError",function(e){A.emit("playbackError",e),A.emit("error",e)})}},{key:"setupAudioRecorderEvents",value:function(){var A=this;this.audioRecorder.on("recordingStarted",function(){A.isRecording=!0,A.emit("recordingStarted")}),this.audioRecorder.on("recordingStopped",function(){A.isRecording&&(A.isRecording=!1,A.emit("recordingStopped"),console.log("🛑 VoiceSDK v2: Recording stopped (from audioRecorder event)"))}),this.audioRecorder.on("audioData",function(e){A.isConnected&&A.sendBinary(e)}),this.audioRecorder.on("error",function(e){console.error("❌ AudioRecorder error:",e),A.emit("error",e)})}},{key:"buildWebSocketUrl",value:function(){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 r=t.toString();return r?"".concat(e.origin).concat(e.pathname,"?").concat(r):"".concat(e.origin).concat(e.pathname)}},{key:"connect",value:(c=$A(YA().m(function A(){var e,t,n=this;return YA().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!this.isDestroyed){A.n=1;break}return console.warn("VoiceSDK v2: Cannot connect - SDK is destroyed"),A.a(2,!1);case 1:if(!this.isConnected){A.n=2;break}return console.warn("VoiceSDK v2: Already connected"),A.a(2,!0);case 2:return A.p=2,e=this.buildWebSocketUrl(),console.log("🔌 VoiceSDK v2: Connecting to",e),A.n=3,new Promise(function(A,t){n.websocket=new WebSocket(e),n.websocket.onopen=function(){console.log("✅ VoiceSDK v2: WebSocket connected"),n.isConnected=!0,n.hasEverConnected=!0,n.clientToolsRegistry&&n.clientToolsRegistry.setSendMessage(function(A){return n.sendMessage(A)}),n.sendHelloMessage(),n.emit("connected"),A(!0)},n.websocket.onerror=function(A){console.error("❌ VoiceSDK v2: WebSocket error:",A),t(A)},n.websocket.onclose=function(A){console.log("🔌 VoiceSDK v2: WebSocket closed:",A.code,A.reason),n.isConnected=!1,n.isRecording&&n.stopRecording().catch(function(A){return console.error("Error stopping recording:",A)}),n.emit("disconnected",A),n.config.autoReconnect&&!n.isDestroyed&&n.hasEverConnected?(console.log("🔄 VoiceSDK v2: Auto-reconnecting in 3s..."),setTimeout(function(){n.isDestroyed||n.isConnected||n.connect()},3e3)):n.config.autoReconnect&&!n.hasEverConnected&&console.log("⚠️ VoiceSDK v2: Initial connection failed. Auto-reconnect disabled to prevent retry loop.")},n.websocket.onmessage=function(A){n.handleMessage(A)}});case 3:return A.a(2,A.v);case 4:return A.p=4,t=A.v,console.error("🔌 VoiceSDK v2: Connection failed:",t),this.emit("error",t),A.a(2,!1)}},A,this,[[2,4]])})),function(){return c.apply(this,arguments)})},{key:"sendHelloMessage",value:function(){if(this.isConnected){var A={encoding:"pcm",sampleRate:this.config.sampleRate,channels:this.config.channels,bitDepth:this.config.bitDepth},e={encoding:this.config.outputEncoding,sampleRate:this.config.outputSampleRate,channels:this.config.outputChannels,bitDepth:this.config.outputBitDepth,container:this.config.outputContainer},t=this.validateInputFormat(A);if(t)return console.error("❌ VoiceSDK v2: Cannot send hello - invalid input format:",t),void this.emit("error",new Error("Invalid input format: ".concat(t)));var n=this.validateOutputFormat(e);if(n)return console.error("❌ VoiceSDK v2: Cannot send hello - invalid output format:",n),void this.emit("error",new Error("Invalid output format: ".concat(n)));var o={t:"hello",v:this.config.protocolVersion,inputFormat:A,requestedOutputFormat:e,outputFrameDurationMs:this.config.outputFrameDurationMs};this.config.agentSettingsOverride&&(o.agentSettingsOverride=this.config.agentSettingsOverride),console.log("🔍 VoiceSDK v2: Checking variables:",{hasVariables:!!this.config.variables,variables:this.config.variables,keys:this.config.variables?Object.keys(this.config.variables):[]}),this.config.variables&&Object.keys(this.config.variables).length>0?(o.variables=this.config.variables,console.log("📝 VoiceSDK v2: Including variables in hello:",Object.keys(this.config.variables))):console.log("⚠️ VoiceSDK v2: Variables NOT included - condition failed"),console.log("📤 VoiceSDK v2: Sending hello:",{version:o.v,requestedFormat:o.requestedOutputFormat,variables:o.variables?Object.keys(o.variables):void 0}),console.log("📤 VoiceSDK v2: Requested output format:",{container:o.requestedOutputFormat.container,encoding:o.requestedOutputFormat.encoding,sampleRate:o.requestedOutputFormat.sampleRate,bitDepth:o.requestedOutputFormat.bitDepth}),console.log("📤 VoiceSDK v2: Full hello message being sent:",JSON.stringify(o,null,2));try{this.sendMessage(o)}catch(A){console.error("VoiceSDK v2: Failed to send hello:",A),this.emit("error",A)}}else console.warn("VoiceSDK v2: Cannot send hello - not connected")}},{key:"handleMessage",value:function(A){if(A.data instanceof ArrayBuffer||A.data instanceof Blob)this.handleBinaryMessage(A.data);else try{var e=JSON.parse(A.data);switch("audio"!==e.t&&console.log("📥 VoiceSDK v2: Received message type:",e.t,"Full message:",JSON.stringify(e).substring(0,200)),!this.conversationId&&e.conversationId&&(this.conversationId=e.conversationId,console.log("🔍 VoiceSDK v2: Captured conversationId from message:",this.conversationId),this.emit("conversationIdChanged",this.conversationId)),"audio"!==e.t&&console.log("📨 VoiceSDK v2: Received message type:",e.t,e),e.t){case"hello_ack":this.handleHelloAck(e);break;case"transcript":console.log("📝 VoiceSDK v2: Processing transcript message:",e),this.handleTranscript(e);break;case"user_transcript":console.log("📝 VoiceSDK v2: Received user_transcript:",e),this.emit("message",e);break;case"agent_response":if(console.log("📝 VoiceSDK v2: Received agent_response:",e),(e.text||e.transcript)&&(console.log("📝 VoiceSDK v2: agent_response contains transcript data:",e.text||e.transcript),e.sentenceId&&(e.text||e.transcript))){var t={t:"transcript",sentenceId:e.sentenceId,text:e.text||e.transcript,role:e.role||"assistant",final:!1!==e.final,timestamp:e.timestamp||Date.now()};console.log("📝 VoiceSDK v2: Converting agent_response to transcript:",t),this.handleTranscript(t)}this.emit("message",e);break;case"error":this.emit("message",e);break;case"barge_in":this.emit("bargeIn",e),this.stopAudioPlayback();break;case"stop_playing":this.emit("stopPlaying",e),this.stopAudioPlayback();break;case"audio_start":console.log("📝 VoiceSDK v2: Received audio_start with text:",e.text),e.text&&this.audioPlayer&&this.audioPlayer.markNewSentence(e.text),this.emit("message",e);break;case"client_tool_call":this.clientToolsRegistry.handleToolCall(e);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;default:if(console.log("VoiceSDK v2: Unknown message type:",e.t,"Full message:",JSON.stringify(e).substring(0,300)),(e.text||e.transcript||e.transcription)&&(console.log("📝 VoiceSDK v2: Unknown message contains transcript-like data:",{text:e.text,transcript:e.transcript,transcription:e.transcription,sentenceId:e.sentenceId,role:e.role}),e.sentenceId&&(e.text||e.transcript||e.transcription))){var n={t:"transcript",sentenceId:e.sentenceId,text:e.text||e.transcript||e.transcription,role:e.role||"assistant",final:!1!==e.final,timestamp:e.timestamp||Date.now()};console.log("📝 VoiceSDK v2: Attempting to process unknown message as transcript:",n),this.handleTranscript(n)}this.emit("message",e)}}catch(A){console.error("VoiceSDK v2: Error parsing message:",A)}}},{key:"handleHelloAck",value:function(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 xA(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...")):console.log("✅ VoiceSDK v2: Connected (v1 legacy mode)");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}}},{key:"handleTranscript",value:function(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)}},{key:"handleBinaryMessage",value:(s=$A(YA().m(function A(e){var t,n,o,r,i,a,s,c,l;return YA().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!(e instanceof Blob)){A.n=2;break}return A.n=1,e.arrayBuffer();case 1:t=A.v,A.n=3;break;case 2:t=e;case 3:if(n=t,!this.formatConverter||!this.formatConverter.needsConversion()){A.n=7;break}return A.p=4,A.n=5,this.formatConverter.convert(t);case 5:n=A.v,console.log("✅ VoiceSDK v2: Audio converted to requested format"),A.n=7;break;case 6:A.p=6,l=A.v,console.error("❌ VoiceSDK v2: Format conversion failed:",l),console.warn(" Using backend format without conversion"),n=t;case 7:o=this.formatConverter&&this.formatConverter.needsConversion()?this.requestedOutputFormat:this.outputAudioFormat||{container:this.config.outputContainer||"raw",encoding:this.config.outputEncoding||"pcm",sampleRate:this.config.outputSampleRate||16e3,bitDepth:this.config.outputBitDepth||16,channels:this.config.outputChannels||1},r=o.container||"raw",i=(o.encoding||"pcm").toLowerCase(),"raw"===r?(a=n,"pcm"!==i&&((s=this.audioPlayer.getCodec(i))?(c=s.decode(new Uint8Array(n)),a=c.buffer,console.log("🔄 VoiceSDK v2: Decoded ".concat(i.toUpperCase()," to PCM (").concat(c.byteLength," bytes)"))):console.warn("⚠️ VoiceSDK v2: No codec for ".concat(i,", treating as PCM"))),this.audioPlayer.outputFormat||(console.warn("⚠️ VoiceSDK v2: outputFormat not set on AudioPlayer, setting from playbackFormat"),this.audioPlayer.setOutputFormat(o)),this.audioFrameCount++,this.audioPlayer.playChunk(a)):(this.audioFrameCount++,this.audioPlayer.playAudio(n));case 8:return A.a(2)}},A,this,[[4,6]])})),function(A){return s.apply(this,arguments)})},{key:"sendMessage",value:function(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}}},{key:"sendBinary",value:function(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}}},{key:"hangup",value:function(){var A=this;if(this.websocket&&this.websocket.readyState===WebSocket.OPEN){console.log("📞 VoiceSDK v2: Hanging up call..."),this.clearStoredConversationId(),this.stopRecording(),this.audioPlayer&&this.stopAudioPlayback();try{this.sendMessage({t:"hangup"}),setTimeout(function(){A.websocket&&A.websocket.readyState===WebSocket.OPEN&&(A.websocket.close(1e3,"User hangup"),A.websocket=null),A.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}}else console.warn("🔌 VoiceSDK v2: Cannot hangup - WebSocket not open")}},{key:"startRecording",value:(a=$A(YA().m(function A(){var e,t,n;return YA().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.isConnected){A.n=1;break}throw e=new Error("Not connected to voice server"),this.emit("error",e),e;case 1:if(!this.isRecording){A.n=2;break}return console.warn("VoiceSDK v2: Already recording"),A.a(2,!0);case 2:return console.log("🎤 VoiceSDK v2: Starting recording..."),A.p=3,console.log("🎤 VoiceSDK v2: Requesting microphone permission (mobile-friendly)..."),A.n=4,this.audioRecorder.start();case 4:return A.n=5,this.audioPlayer.resumeAudioContext();case 5:return this.sendMessage({t:"start_continuous_mode",ttpId:this.generateTtpId()}),A.a(2,!0);case 6:return A.p=6,n=A.v,console.error("❌ VoiceSDK v2: Failed to start recording:",n),"NotAllowedError"===n.name||"PermissionDeniedError"===n.name?((t=new Error("Microphone permission denied. Please allow microphone access in your browser settings and try again.")).name=n.name,t.originalError=n,this.emit("error",t)):this.emit("error",n),A.a(2,!1)}},A,this,[[3,6]])})),function(){return a.apply(this,arguments)})},{key:"stopRecording",value:(i=$A(YA().m(function A(){var e;return YA().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.isRecording){A.n=1;break}return console.warn("VoiceSDK v2: Not recording"),A.a(2,!0);case 1:return console.log("🛑 VoiceSDK v2: Stopping recording..."),A.p=2,this.sendMessage({t:"stop_continuous_mode",ttpId:this.generateTtpId()}),this.isRecording=!1,this.emit("recordingStopped"),console.log("🛑 VoiceSDK v2: Recording stopped (emitted before audioRecorder.stop())"),A.n=3,this.audioRecorder.stop();case 3:return this.stopAudioPlayback(),A.a(2,!0);case 4:return A.p=4,e=A.v,console.error("VoiceSDK v2: Error stopping recording:",e),this.emit("error",e),A.a(2,!1)}},A,this,[[2,4]])})),function(){return i.apply(this,arguments)})},{key:"toggleRecording",value:(r=$A(YA().m(function A(){return YA().w(function(A){for(;;)switch(A.n){case 0:if(!this.isRecording){A.n=2;break}return A.n=1,this.stopRecording();case 1:case 3:return A.a(2,A.v);case 2:return A.n=3,this.startRecording();case 4:return A.a(2)}},A,this)})),function(){return r.apply(this,arguments)})},{key:"clearTranscriptState",value:function(){this.currentPlayingSentenceId=null,console.log("📝 VoiceSDK v2: Cleared transcript state")}},{key:"stopAudioPlayback",value:function(){this.audioPlayer.stopImmediate(),this.clearTranscriptState()}},{key:"handleBargeIn",value:(o=$A(YA().m(function A(){return YA().w(function(A){for(;;)switch(A.n){case 0:if(this.stopAudioPlayback(),this.isRecording){A.n=1;break}return A.n=1,this.startRecording();case 1:return A.a(2)}},A,this)})),function(){return o.apply(this,arguments)})},{key:"getStatus",value:function(){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()}}},{key:"updateConfig",value:function(A){this.config=zA(zA({},this.config),A)}},{key:"generateTtpId",value:function(){return"sdk_"+Math.random().toString(36).substr(2,9)+"_"+Date.now()}},{key:"registerToolHandler",value:function(A,e){return this.clientToolsRegistry.registerHandler(A,e)}},{key:"unregisterToolHandler",value:function(A){return this.clientToolsRegistry.unregisterHandler(A)}},{key:"hasToolHandler",value:function(A){return this.clientToolsRegistry.hasHandler(A)}},{key:"getRegisteredTools",value:function(){return this.clientToolsRegistry.getRegisteredTools()}},{key:"destroy",value:function(){var A=this;this.isDestroyed||(console.log("🗑️ VoiceSDK v2: Destroying..."),this.isDestroyed=!0,this.isRecording&&this.stopRecording(),this.audioPlayer&&this.stopAudioPlayback(),this.websocket&&(this.websocket.close(),this.websocket=null),this.isConnected=!1,this.audioPlayer&&this.audioPlayer.destroy(),this.audioRecorder&&this.audioRecorder.destroy(),this.clientToolsRegistry&&this.clientToolsRegistry.getRegisteredTools().forEach(function(e){return A.clientToolsRegistry.unregisterHandler(e)}),this.removeAllListeners())}}],n&&ee(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i,a,s,c}(a);re(ae,"RESUME_STORAGE_KEY","voice_resume_state"),re(ae,"RESUME_TTL_MS",1e4),re(ae,"SUPPORTED_INPUT_ENCODINGS",["pcm","pcmu","pcma"]),re(ae,"SUPPORTED_INPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),re(ae,"SUPPORTED_INPUT_BIT_DEPTHS",[8,16,24]),re(ae,"SUPPORTED_INPUT_CHANNELS",[1]),re(ae,"SUPPORTED_OUTPUT_ENCODINGS",["pcm","pcmu","pcma"]),re(ae,"SUPPORTED_OUTPUT_SAMPLE_RATES",[8e3,16e3,22050,24e3,44100,48e3]),re(ae,"SUPPORTED_OUTPUT_BIT_DEPTHS",[8,16,24]),re(ae,"SUPPORTED_OUTPUT_CHANNELS",[1]),re(ae,"SUPPORTED_OUTPUT_CONTAINERS",["raw","wav"]);const se=ae;function ce(A){return ce="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},ce(A)}function le(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,ue(n.key),n)}}function ue(A){var e=function(A){if("object"!=ce(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=ce(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==ce(e)?e:e+""}var de=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.events={}},e=[{key:"on",value:function(A,e){this.events[A]||(this.events[A]=[]),this.events[A].push(e)}},{key:"off",value:function(A,e){this.events[A]&&(this.events[A]=this.events[A].filter(function(A){return A!==e}))}},{key:"emit",value:function(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(function(e){try{e.apply(void 0,t)}catch(e){console.error("Error in event listener for ".concat(A,":"),e)}})}},{key:"removeAllListeners",value:function(A){A?delete this.events[A]:this.events={}}}],e&&le(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function ge(A){return ge="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},ge(A)}function pe(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return he(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(he(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,he(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,he(u,"constructor",c),he(c,"constructor",s),s.displayName="GeneratorFunction",he(c,o,"GeneratorFunction"),he(u),he(u,o,"Generator"),he(u,n,function(){return this}),he(u,"toString",function(){return"[object Generator]"}),(pe=function(){return{w:r,m:d}})()}function he(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}he=function(A,e,t,n){function r(e,t){he(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},he(A,e,t,n)}function fe(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Be(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 we(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?Be(Object(t),!0).forEach(function(e){me(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):Be(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function me(A,e,t){return(e=ye(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function ve(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,ye(n.key),n)}}function ye(A){var e=function(A){if("object"!=ge(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=ge(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==ge(e)?e:e+""}function Ce(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(Ce=function(){return!!A})()}function be(A){return be=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},be(A)}function Qe(A,e){return Qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},Qe(A,e)}var Fe=function(A){function e(){var A,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e);var n=(A=function(A,e,t){return e=be(e),function(A,e){if(e&&("object"==ge(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,Ce()?Reflect.construct(e,t||[],be(A).constructor):e.apply(A,t))}(this,e)).readScriptTagConfig();return A.config=we({baseWsUrl:"wss://backend.talktopc.com/chat/websocket",appId:t.appId||n.appId,agentId:t.agentId||n.agentId,conversationId:void 0!==t.conversationId?t.conversationId:A.getPersistedConversationId(),forceConversationId:t.forceConversationId,queue:[],inFlight:!1},t),A.fullResponseBuffer="",A}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&Qe(A,e)}(e,A),t=e,n=[{key:"readScriptTagConfig",value:function(){try{var A=Array.from(document.getElementsByTagName("script")).reverse().find(function(A){return 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{}}}},{key:"buildWebSocketUrl",value:function(){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())}},{key:"sendMessage",value:(o=pe().m(function A(e){var t=this;return pe().w(function(A){for(;;)if(0===A.n)return A.a(2,new Promise(function(A,n){if(e&&e.trim())if(t.config.appId&&t.config.agentId){var o={text:e,resolve:A,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"))}))},A)}),r=function(){var A=this,e=arguments;return new Promise(function(t,n){var r=o.apply(A,e);function i(A){fe(r,t,n,i,a,"next",A)}function a(A){fe(r,t,n,i,a,"throw",A)}i(void 0)})},function(A){return r.apply(this,arguments)})},{key:"executeTask",value:function(A){var e=this;if(this.config.inFlight=!0,this.fullResponseBuffer="",!this.config.conversationId){var t=this.getPersistedConversationId();t&&(this.config.conversationId=t,console.log("🔍 TextChatSDK hydrated conversationId from storage:",t))}var n,o=this.buildWebSocketUrl(this.config.baseWsUrl),r=this.config.baseWsUrl.endsWith("/websocket")?this.config.baseWsUrl.replace(/\/websocket$/,""):"".concat(this.config.baseWsUrl,"/websocket"),i=this.buildWebSocketUrl(r),a=!1,s=!1,c=null,l=function(t){if(!s)try{var n={message:A.text},o=e.config.forceConversationId||e.config.conversationId;o&&(n.conversationId=o,e.config.forceConversationId&&!e.config.conversationId&&(e.config.conversationId=o,e.persistConversationId(o))),console.log("🔍 TextChatSDK sending payload:",n,"conversationId in config:",e.config.conversationId),t.send(JSON.stringify(n)),s=!0}catch(n){A.reject(n),e.emit("error",n);try{t.close()}catch(A){}}},u=function(A){return function(){e.config.conversationId?l(A):c=setTimeout(function(){return l(A)},200)}},d=function(t){return function(n){try{try{console.log("🔎 [TextChatSDK] WS <= raw:",n.data)}catch(A){}var o=JSON.parse(n.data);try{console.log("🔎 [TextChatSDK] WS <= parsed:",o)}catch(A){}if("hello"===o.type&&o.conversationId){if(console.log("🔍 TextChatSDK received conversationId:",o.conversationId),e.config.conversationId=o.conversationId,e.persistConversationId(o.conversationId),e.emit&&e.emit("conversationIdChanged",o.conversationId),!s&&t&&1===t.readyState){if(c)try{clearTimeout(c)}catch(A){}l(t)}return}if(!e.config.conversationId&&o.conversationId&&(console.log("🔍 TextChatSDK captured conversationId from message:",o.conversationId),e.config.conversationId=o.conversationId,e.persistConversationId(o.conversationId)),"chunk"===o.type&&"string"==typeof o.content)e.fullResponseBuffer+=o.content,e.emit("chunk",o.content);else if("done"===o.type){try{var r=o.text||o.content||o.answer||o.message||"";r&&!e.fullResponseBuffer&&(e.fullResponseBuffer=r)}catch(A){}!e.config.conversationId&&o.conversationId&&(console.log("🔍 TextChatSDK captured conversationId from done:",o.conversationId),e.config.conversationId=o.conversationId),e.persistConversationId(e.config.conversationId),e.emit("done",{text:e.fullResponseBuffer}),A.resolve({conversationId:e.config.conversationId,fullText:e.fullResponseBuffer});try{t.close()}catch(A){}}else if("error"===o.type){var i=new Error(o.message||"Server error");e.emit("error",i),A.reject(i);try{t.close()}catch(A){}}}catch(A){}}},g=function(t){if(1008===t.code&&t.reason&&(t.reason.includes("Domain not whitelisted")||t.reason.includes("domain")||t.reason.includes("whitelist"))){var n=new Error("DOMAIN_NOT_WHITELISTED");return n.reason=t.reason,n.code=t.code,e.emit("domainError",n),A.reject(n),e.config.inFlight=!1,void e.drainQueue()}e.config.inFlight=!1,e.drainQueue()},p=new WebSocket(o);p.onopen=u(p),p.onmessage=d(p),p.onerror=(n=p,function(t){if(!a){a=!0;try{n.close()}catch(A){}var o=new WebSocket(i);return o.onopen=u(o),o.onmessage=d(o),o.onerror=function(t){e.emit("error",t),A.reject(t)},void(o.onclose=g)}e.emit("error",t),A.reject(t)}),p.onclose=g}},{key:"drainQueue",value:function(){if(0!==this.config.queue.length&&!this.config.inFlight){var A=this.config.queue.shift();this.executeTask(A)}}},{key:"persistConversationId",value:function(A){try{A&&localStorage.setItem("ttp_text_chat_conversation_id",A)}catch(A){}}},{key:"getPersistedConversationId",value:function(){try{return localStorage.getItem("ttp_text_chat_conversation_id")||null}catch(A){return null}}},{key:"updateConfig",value:function(A){this.config=we(we({},this.config),A)}},{key:"destroy",value:function(){this.config.queue=[],this.config.inFlight=!1,this.removeAllListeners()}}],n&&ve(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r}(de);function Ue(A){return Ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Ue(A)}function xe(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=t){var n,o,r,i,a=[],s=!0,c=!1;try{if(r=(t=t.call(A)).next,0===e){if(Object(t)!==t)return;s=!1}else for(;!(s=(n=r.call(t)).done)&&(a.push(n.value),a.length!==e);s=!0);}catch(A){c=!0,o=A}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(A,e)||Se(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ee(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=Se(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,o=function(){};return{s:o,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){a=!0,r=A},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function Se(A,e){if(A){if("string"==typeof A)return Ie(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ie(A,e):void 0}}function Ie(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}function He(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return ke(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(ke(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,ke(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,ke(u,"constructor",c),ke(c,"constructor",s),s.displayName="GeneratorFunction",ke(c,o,"GeneratorFunction"),ke(u),ke(u,o,"Generator"),ke(u,n,function(){return this}),ke(u,"toString",function(){return"[object Generator]"}),(He=function(){return{w:r,m:d}})()}function ke(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}ke=function(A,e,t,n){function r(e,t){ke(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},ke(A,e,t,n)}function Te(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function De(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,Oe(n.key),n)}}function Oe(A){var e=function(A){if("object"!=Ue(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Ue(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Ue(e)?e:e+""}function Ke(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(Ke=function(){return!!A})()}function Pe(A){return Pe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},Pe(A)}function Le(A,e){return Le=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},Le(A,e)}const Me=new(function(A){function e(){var A;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(A=function(A,e,t){return e=Pe(e),function(A,e){if(e&&("object"==Ue(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,Ke()?Reflect.construct(e,t||[],Pe(A).constructor):e.apply(A,t))}(this,e)).connections=new Map,A.connectionCounts=new Map,A.creatingConnections=new Set,A}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&Le(A,e)}(e,A),t=e,n=[{key:"getConnection",value:(o=He().m(function A(e){var t,n,o=this;return He().w(function(A){for(;;)switch(A.n){case 0:if(!this.connections.has(e)){A.n=1;break}return t=this.connections.get(e),this.connectionCounts.set(e,(this.connectionCounts.get(e)||0)+1),A.a(2,t);case 1:if(!this.creatingConnections||!this.creatingConnections.has(e)){A.n=2;break}return A.a(2,new Promise(function(A){var t=function(){if(o.connections.has(e)){var n=o.connections.get(e);o.connectionCounts.set(e,(o.connectionCounts.get(e)||0)+1),A(n)}else setTimeout(t,50)};t()}));case 2:return this.creatingConnections.add(e),n=new WebSocket(e),this.connections.set(e,n),this.connectionCounts.set(e,1),n.addEventListener("open",function(A){o.creatingConnections.delete(e),o.emit("open",A,e)}),n.addEventListener("close",function(A){o.creatingConnections.delete(e),o.connections.delete(e),o.connectionCounts.delete(e),o.emit("close",A,e)}),n.addEventListener("error",function(A){o.creatingConnections.delete(e),o.emit("error",A,e)}),n.addEventListener("message",function(A){o.emit("message",A,e)}),A.a(2,n)}},A,this)}),r=function(){var A=this,e=arguments;return new Promise(function(t,n){var r=o.apply(A,e);function i(A){Te(r,t,n,i,a,"next",A)}function a(A){Te(r,t,n,i,a,"throw",A)}i(void 0)})},function(A){return r.apply(this,arguments)})},{key:"releaseConnection",value:function(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)}}}},{key:"forceClose",value:function(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)}}},{key:"getConnectionStatus",value:function(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}}},{key:"getAllConnections",value:function(){var A,e={},t=Ee(this.connections.entries());try{for(t.s();!(A=t.n()).done;){var n=xe(A.value,2),o=n[0],r=n[1];e[o]={readyState:r.readyState,subscribers:this.connectionCounts.get(o)||0}}}catch(A){t.e(A)}finally{t.f()}return e}},{key:"clearAll",value:function(){var A,e=Ee(this.connections.entries());try{for(e.s();!(A=e.n()).done;){var t=xe(A.value,2),n=(t[0],t[1]);n&&n.readyState===WebSocket.OPEN&&n.close(1e3,"Clear all")}}catch(A){e.e(A)}finally{e.f()}this.connections.clear(),this.connectionCounts.clear(),this.creatingConnections.clear()}}],n&&De(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r}(de));function Re(A){return Re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Re(A)}function Ve(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return _e(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(_e(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,_e(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,_e(u,"constructor",c),_e(c,"constructor",s),s.displayName="GeneratorFunction",_e(c,o,"GeneratorFunction"),_e(u),_e(u,o,"Generator"),_e(u,n,function(){return this}),_e(u,"toString",function(){return"[object Generator]"}),(Ve=function(){return{w:r,m:d}})()}function _e(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}_e=function(A,e,t,n){function r(e,t){_e(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},_e(A,e,t,n)}function Ge(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function je(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,Ne(n.key),n)}}function Ne(A){var e=function(A){if("object"!=Re(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Re(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Re(e)?e:e+""}function We(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(We=function(){return!!A})()}function Je(A){return Je=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},Je(A)}function Xe(A,e){return Xe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},Xe(A,e)}var ze=function(A){function e(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(A,e,t){return e=Je(e),function(A,e){if(e&&("object"==Re(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,We()?Reflect.construct(e,t||[],Je(A).constructor):e.apply(A,t))}(this,e)).config=A,t.ws=null,t.isConnected=!1,t.connectionId=null,t}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&Xe(A,e)}(e,A),t=e,n=[{key:"connect",value:(r=Ve().m(function A(){var e=this;return Ve().w(function(A){for(;;)if(0===A.n)return A.a(2,new Promise(function(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;Me.getConnection(n,e.config).then(function(t){e.ws=t,e.setupEventListeners(),t.readyState===WebSocket.OPEN&&(e.isConnected=!0,e.emit("connected"),A(),e.connectResolve=null,e.connectReject=null)}).catch(function(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}}))},A)}),i=function(){var A=this,e=arguments;return new Promise(function(t,n){var o=r.apply(A,e);function i(A){Ge(o,t,n,i,a,"next",A)}function a(A){Ge(o,t,n,i,a,"throw",A)}i(void 0)})},function(){return i.apply(this,arguments)})},{key:"setupEventListeners",value:function(){var A=this;if(this.ws){var e=function(e,t){t===(A.config.signedUrl||A.config.websocketUrl)&&(A.isConnected=!0,A.emit("connected"),A.connectResolve&&(A.connectResolve(),A.connectResolve=null,A.connectReject=null))},t=function(e,t){t===(A.config.signedUrl||A.config.websocketUrl)&&(A.isConnected=!1,A.emit("disconnected",e))},n=function(e,t){t===(A.config.signedUrl||A.config.websocketUrl)&&(A.emit("error",e),A.connectReject&&(A.connectReject(e),A.connectResolve=null,A.connectReject=null))},o=function(e,t){t===(A.config.signedUrl||A.config.websocketUrl)&&A.handleMessage(e)};Me.on("open",e),Me.on("close",t),Me.on("error",n),Me.on("message",o),this.eventHandlers={open:e,close:t,error:n,message:o}}}},{key:"disconnect",value:function(){this.eventHandlers&&(Me.off("open",this.eventHandlers.open),Me.off("close",this.eventHandlers.close),Me.off("error",this.eventHandlers.error),Me.off("message",this.eventHandlers.message));var A=this.config.signedUrl||this.config.websocketUrl;A&&Me.releaseConnection(A),this.ws=null,this.isConnected=!1}},{key:"sendMessage",value:function(A){if(this.isConnected&&this.ws)try{this.ws.send(JSON.stringify(A))}catch(A){console.warn("🔌 WebSocketManager: Failed to send message:",A.message)}}},{key:"sendBinary",value:function(A){if(this.isConnected&&this.ws)try{this.ws.send(A)}catch(A){console.warn("🔌 WebSocketManager: Failed to send binary data:",A.message)}}},{key:"handleMessage",value:function(A){var e=this;if(A.data instanceof ArrayBuffer)this.emit("binaryAudio",A.data);else if(A.data instanceof Blob)A.data.arrayBuffer().then(function(A){e.emit("binaryAudio",A)}).catch(function(A){console.error("🔌 WebSocketManager: Error converting Blob to ArrayBuffer:",A)});else try{var t=JSON.parse(A.data);"barge_in_ack"!==t.t&&"stop_sending"!==t.t||this.emit("bargeIn",t),"stop_playing"===t.t&&this.emit("stopPlaying",t),this.emit("message",t)}catch(A){this.emit("error",A)}}},{key:"getStatus",value:function(){return{isConnected:this.isConnected,readyState:this.ws?this.ws.readyState:null,connectionId:this.connectionId}}}],o=[{key:"getSingletonStatus",value:function(){return Me.getAllConnections()}},{key:"clearAllConnections",value:function(){Me.clearAll()}}],n&&je(t.prototype,n),o&&je(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(de);function Ye(A){return Ye="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Ye(A)}function Ze(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 qe(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?Ze(Object(t),!0).forEach(function(e){$e(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):Ze(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function $e(A,e,t){return(e=it(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function At(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return et(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(et(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,et(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,et(u,"constructor",c),et(c,"constructor",s),s.displayName="GeneratorFunction",et(c,o,"GeneratorFunction"),et(u),et(u,o,"Generator"),et(u,n,function(){return this}),et(u,"toString",function(){return"[object Generator]"}),(At=function(){return{w:r,m:d}})()}function et(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}et=function(A,e,t,n){function r(e,t){et(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},et(A,e,t,n)}function tt(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function nt(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){tt(r,n,o,i,a,"next",A)}function a(A){tt(r,n,o,i,a,"throw",A)}i(void 0)})}}function ot(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}function rt(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,it(n.key),n)}}function it(A){var e=function(A){if("object"!=Ye(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Ye(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Ye(e)?e:e+""}function at(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(at=function(){return!!A})()}function st(A){return st=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},st(A)}function ct(A,e){return ct=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},ct(A,e)}var lt=function(A){function e(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(A,e,t){return e=st(e),function(A,e){if(e&&("object"==Ye(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,at()?Reflect.construct(e,t||[],st(A).constructor):e.apply(A,t))}(this,e)).config=A,t.audioContext=null,t.audioWorkletNode=null,t.mediaStream=null,t.isRecording=!1,t}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&ct(A,e)}(e,A),t=e,n=[{key:"getAudioProcessorPath",value:function(){if(this.config.audioProcessorPath)return this.config.audioProcessorPath;var A,e=function(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=function(A,e){if(A){if("string"==typeof A)return ot(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ot(A,e):void 0}}(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,o=function(){};return{s:o,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){a=!0,r=A},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}(document.getElementsByTagName("script"));try{for(e.s();!(A=e.n()).done;){var t=A.value.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")}}}catch(A){e.e(A)}finally{e.f()}return"https://cdn.talktopc.com/audio-processor.js"}},{key:"checkPermissionState",value:function(){var A=nt(At().m(function A(){var e;return At().w(function(A){for(;;)switch(A.p=A.n){case 0:if(A.p=0,!navigator.permissions||!navigator.permissions.query){A.n=2;break}return A.n=1,navigator.permissions.query({name:"microphone"});case 1:return e=A.v,A.a(2,e.state);case 2:A.n=4;break;case 3:A.p=3,A.v,console.log("⚠️ AudioRecorder: Permissions API not available or not supported for microphone");case 4:return A.a(2,null)}},A,null,[[0,3]])}));return function(){return A.apply(this,arguments)}}()},{key:"requestPermission",value:(i=nt(At().m(function A(){var e,t,n,o;return At().w(function(A){for(;;)switch(A.p=A.n){case 0:return A.p=0,A.n=1,this.checkPermissionState();case 1:if("granted"!==A.v){A.n=2;break}return console.log("✅ AudioRecorder: Microphone permission already granted"),A.a(2,!0);case 2:return console.log("🎤 AudioRecorder: Requesting microphone permission..."),e=this.config.sampleRate||this.config.outputSampleRate||44100,t={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},n=this.config.audioConstraints?qe(qe({},t),this.config.audioConstraints):t,A.n=3,navigator.mediaDevices.getUserMedia({audio:qe({sampleRate:e,channelCount:1},n)});case 3:return A.v.getTracks().forEach(function(A){return A.stop()}),console.log("✅ AudioRecorder: Microphone permission granted"),A.a(2,!0);case 4:return A.p=4,o=A.v,console.error("❌ AudioRecorder: Failed to get microphone permission:",o),A.a(2,!1)}},A,this,[[0,4]])})),function(){return i.apply(this,arguments)})},{key:"start",value:(r=nt(At().m(function A(){var e,t,n,o,r,i,a,s,c,l=this;return At().w(function(A){for(;;)switch(A.p=A.n){case 0:return A.p=0,console.log("🎤 AudioRecorder: Requesting microphone access..."),A.n=1,this.checkPermissionState();case 1:return(e=A.v)&&(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.')),t=this.config.sampleRate||this.config.outputSampleRate||44100,n={echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0},o=this.config.audioConstraints?qe(qe({},n),this.config.audioConstraints):n,A.n=2,navigator.mediaDevices.getUserMedia({audio:qe({sampleRate:t,channelCount:1},o)});case 2:if(this.mediaStream=A.v,this.audioContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:t}),"suspended"!==this.audioContext.state){A.n=3;break}return A.n=3,this.audioContext.resume();case 3:return r=this.getAudioProcessorPath(),A.n=4,this.audioContext.audioWorklet.addModule(r);case 4:this.audioWorkletNode=new AudioWorkletNode(this.audioContext,"audio-processor",{processorOptions:{sampleRate:t,outputSampleRate:this.config.outputSampleRate}}),this.audioContext.createMediaStreamSource(this.mediaStream).connect(this.audioWorkletNode),this.audioWorkletNode.port.onmessage=function(A){var e=A.data,t=e.type,n=e.data;"pcm_audio_data"===t&&l.emit("audioData",n)},this.audioWorkletNode.port.postMessage({type:"setForceContinuous",data:{enabled:!0}}),console.log("✅ AudioRecorder: Microphone access granted"),this.isRecording=!0,this.emit("recordingStarted"),A.n=9;break;case 5:if(A.p=5,c=A.v,i=c.message,"NotAllowedError"!==c.name&&"PermissionDeniedError"!==c.name){A.n=7;break}return A.n=6,this.checkPermissionState();case 6:"denied"===(a=A.v)?(i='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"===a?(i='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.')):(i="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.")),A.n=8;break;case 7:"NotFoundError"===c.name||"DevicesNotFoundError"===c.name?(i="No microphone found. Please connect a microphone and try again.",console.error("❌ AudioRecorder: No microphone device found.")):"NotReadableError"===c.name||"TrackStartError"===c.name?(i="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"!==c.name&&"PermissionDeniedError"!==c.name||(i="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."));case 8:throw(s=new Error(i)).name=c.name,s.originalError=c,this.emit("error",s),s;case 9:return A.a(2)}},A,this,[[0,5]])})),function(){return r.apply(this,arguments)})},{key:"stop",value:(o=nt(At().m(function A(){var e;return At().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.isRecording){A.n=1;break}return A.a(2);case 1:if(A.p=1,!this.audioWorkletNode){A.n=2;break}return this.audioWorkletNode.port.postMessage({type:"flush"}),A.n=2,new Promise(function(A){return setTimeout(A,100)});case 2:if(this.mediaStream&&(this.mediaStream.getTracks().forEach(function(A){return A.stop()}),this.mediaStream=null),!this.audioContext||"closed"===this.audioContext.state){A.n=4;break}return A.n=3,this.audioContext.close();case 3:this.audioContext=null;case 4:this.audioWorkletNode=null,this.isRecording=!1,this.emit("recordingStopped"),A.n=6;break;case 5:throw A.p=5,e=A.v,this.emit("error",e),e;case 6:return A.a(2)}},A,this,[[1,5]])})),function(){return o.apply(this,arguments)})},{key:"getStatus",value:function(){return{isRecording:this.isRecording,audioContextState:this.audioContext?this.audioContext.state:"closed"}}},{key:"destroy",value:function(){this.stop()}}],n&&rt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(de);function ut(A){return ut="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},ut(A)}function dt(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return gt(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(gt(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,gt(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,gt(u,"constructor",c),gt(c,"constructor",s),s.displayName="GeneratorFunction",gt(c,o,"GeneratorFunction"),gt(u),gt(u,o,"Generator"),gt(u,n,function(){return this}),gt(u,"toString",function(){return"[object Generator]"}),(dt=function(){return{w:r,m:d}})()}function gt(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}gt=function(A,e,t,n){function r(e,t){gt(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},gt(A,e,t,n)}function pt(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function ht(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){pt(r,n,o,i,a,"next",A)}function a(A){pt(r,n,o,i,a,"throw",A)}i(void 0)})}}function ft(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,Bt(n.key),n)}}function Bt(A){var e=function(A){if("object"!=ut(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=ut(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==ut(e)?e:e+""}function wt(){try{var A=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(A){}return(wt=function(){return!!A})()}function mt(A){return mt=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(A){return A.__proto__||Object.getPrototypeOf(A)},mt(A)}function vt(A,e){return vt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,e){return A.__proto__=e,A},vt(A,e)}var yt=function(A){function e(A){var t;return function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),(t=function(A,e,t){return e=mt(e),function(A,e){if(e&&("object"==ut(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(A){if(void 0===A)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}(A)}(A,wt()?Reflect.construct(e,t||[],mt(A).constructor):e.apply(A,t))}(this,e)).config=A,t.audioContext=null,t.audioQueue=[],t.isPlaying=!1,t.isProcessingQueue=!1,t.currentSource=null,t.audioContextReady=!1,t.initializeAudioContext().catch(function(){}),t}return function(A,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(e&&e.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),e&&vt(A,e)}(e,A),t=e,n=[{key:"initializeAudioContext",value:(i=ht(dt().m(function A(){var e,t,n,o,r,i;return dt().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!this.audioContext||"closed"===this.audioContext.state){A.n=1;break}return A.a(2);case 1:if(A.p=1,e=this.config.sampleRate||this.config.outputSampleRate||44100,t={sampleRate:e},this.audioContext=new(window.AudioContext||window.webkitAudioContext)(t),"suspended"!==this.audioContext.state){A.n=2;break}return A.n=2,this.audioContext.resume();case 2:if("running"===this.audioContext.state)try{n=this.audioContext.sampleRate,o=this.audioContext.createBuffer(1,.01*n,n),(r=this.audioContext.createBufferSource()).buffer=o,r.connect(this.audioContext.destination),r.start(0),r.stop(this.audioContext.currentTime+.01)}catch(A){console.debug("AudioPlayer: AudioContext warmup skipped:",A)}this.audioContextReady=!0,A.n=4;break;case 3:A.p=3,i=A.v,console.warn("AudioPlayer: Failed to pre-initialize AudioContext:",i),this.audioContextReady=!1;case 4:return A.a(2)}},A,this,[[1,3]])})),function(){return i.apply(this,arguments)})},{key:"playAudio",value:function(A){var e=this;try{var t=this.createAudioBlob(A);if(this.audioQueue.push(t),!this.isPlaying&&!this.isProcessingQueue&&!this.currentSource){var n=this.audioContextReady?0:50;setTimeout(function(){return e.processQueue()},n)}}catch(A){this.emit("playbackError",A)}}},{key:"createAudioBlob",value:function(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"})}},{key:"processQueue",value:(r=ht(dt().m(function A(){var e,t,n,o,r,i,a,s,c=this;return dt().w(function(A){for(;;)switch(A.p=A.n){case 0:if(!this.isProcessingQueue&&0!==this.audioQueue.length){A.n=1;break}return A.a(2);case 1:if(this.isProcessingQueue=!0,e=this.audioQueue.shift()){A.n=2;break}return this.isProcessingQueue=!1,A.a(2);case 2:if(A.p=2,t=!this.isPlaying&&null===this.currentSource,this.audioContext&&"closed"!==this.audioContext.state){A.n=3;break}return A.n=3,this.initializeAudioContext();case 3:if("suspended"!==(n=this.audioContext).state){A.n=5;break}return A.n=4,n.resume();case 4:if(!t){A.n=5;break}return A.n=5,new Promise(function(A){return setTimeout(A,10)});case 5:if("running"===n.state){A.n=7;break}if(console.warn("AudioPlayer: AudioContext not in running state:",n.state),"suspended"!==n.state){A.n=7;break}return A.n=6,n.resume();case 6:return A.n=7,new Promise(function(A){return setTimeout(A,10)});case 7:return A.n=8,e.arrayBuffer();case 8:return o=A.v,A.n=9,n.decodeAudioData(o);case 9:r=A.v,i=t&&!this.isPlaying&&null===this.currentSource,(a=n.createBufferSource()).buffer=r,a.connect(n.destination),this.currentSource=a,this.isPlaying=!0,i&&this.emit("playbackStarted"),a.onended=function(){c.currentSource=null,c.isProcessingQueue=!1,c.audioQueue.length>0?setTimeout(function(){return c.processQueue()},0):setTimeout(function(){0!==c.audioQueue.length||c.currentSource||(c.isPlaying=!1,c.emit("playbackStopped"))},100)},a.start(),A.n=11;break;case 10:A.p=10,s=A.v,this.currentSource=null,this.emit("playbackError",s),this.audioQueue.length>0?(this.isProcessingQueue=!1,setTimeout(function(){return c.processQueue()},100)):(this.isPlaying=!1,this.isProcessingQueue=!1,this.emit("playbackStopped"));case 11:return A.a(2)}},A,this,[[2,10]])})),function(){return r.apply(this,arguments)})},{key:"stop",value:function(){this.stopImmediate()}},{key:"stopImmediate",value:function(){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")}},{key:"resumeAudioContext",value:(o=ht(dt().m(function A(){var e;return dt().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.audioContext&&"closed"!==this.audioContext.state){A.n=2;break}return A.n=1,this.initializeAudioContext();case 1:return A.a(2);case 2:if("suspended"!==this.audioContext.state){A.n=6;break}return A.p=3,A.n=4,this.audioContext.resume();case 4:console.log("✅ AudioPlayer: AudioContext resumed after mic permission"),A.n=6;break;case 5:A.p=5,e=A.v,console.warn("⚠️ AudioPlayer: Failed to resume AudioContext:",e);case 6:return A.a(2)}},A,this,[[3,5]])})),function(){return o.apply(this,arguments)})},{key:"getStatus",value:function(){return{isPlaying:this.isPlaying,isProcessingQueue:this.isProcessingQueue,queueLength:this.audioQueue.length,audioContextState:this.audioContext?this.audioContext.state:"closed"}}},{key:"destroy",value:function(){this.stop(),this.audioContext&&"closed"!==this.audioContext.state&&(this.audioContext.close(),this.audioContext=null),this.audioContextReady=!1}}],n&&ft(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),t;var t,n,o,r,i}(de),Ct=t(540),bt=t(848);function Qt(A){return Qt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Qt(A)}function Ft(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 Ut(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?Ft(Object(t),!0).forEach(function(e){xt(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):Ft(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function xt(A,e,t){return(e=function(A){var e=function(A){if("object"!=Qt(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Qt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Qt(e)?e:e+""}(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function Et(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return St(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(St(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,St(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,St(u,"constructor",c),St(c,"constructor",s),s.displayName="GeneratorFunction",St(c,o,"GeneratorFunction"),St(u),St(u,o,"Generator"),St(u,n,function(){return this}),St(u,"toString",function(){return"[object Generator]"}),(Et=function(){return{w:r,m:d}})()}function St(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}St=function(A,e,t,n){function r(e,t){St(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},St(A,e,t,n)}function It(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Ht(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=t){var n,o,r,i,a=[],s=!0,c=!1;try{if(r=(t=t.call(A)).next,0===e){if(Object(t)!==t)return;s=!1}else for(;!(s=(n=r.call(t)).done)&&(a.push(n.value),a.length!==e);s=!0);}catch(A){c=!0,o=A}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(A,e)||function(A,e){if(A){if("string"==typeof A)return kt(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?kt(A,e):void 0}}(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function kt(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}const Tt=function(A){var e=A.signedUrl,t=A.websocketUrl,n=A.agentId,o=A.appId,r=A.voice,i=void 0===r?"default":r,a=A.language,s=void 0===a?"en":a,c=A.autoReconnect,l=void 0===c||c,u=A.agentSettingsOverride,d=void 0===u?null:u,g=A.onConnected,p=A.onDisconnected,h=A.onRecordingStarted,f=A.onRecordingStopped,B=A.onPlaybackStarted,w=A.onPlaybackStopped,m=A.onError,v=A.onMessage,y=A.onBargeIn,C=A.onStopPlaying,b=A.onStartConversation,Q=A.onEndConversation,F=A.className,U=void 0===F?"":F,x=A.style,E=void 0===x?{}:x,S=A.children,I=Ht((0,Ct.useState)(!1),2),H=I[0],k=I[1],T=Ht((0,Ct.useState)(!1),2),D=T[0],O=T[1],K=Ht((0,Ct.useState)(!1),2),P=(K[0],K[1]),L=Ht((0,Ct.useState)("Disconnected"),2),M=(L[0],L[1]),R=(0,Ct.useRef)(null);(0,Ct.useEffect)(function(){console.log("🎙️ VoiceButton: Creating VoiceSDK_v2 instance for ".concat(t||e)),R.current&&(console.log("🎙️ VoiceButton: Destroying existing VoiceSDK_v2 instance"),R.current.destroy(),R.current=null);var A=new se({signedUrl:t||e,websocketUrl:t||e,agentId:n,appId:o,voice:i,language:s,autoReconnect:l,agentSettingsOverride:d,onStartConversation:b,onEndConversation:Q});return A.on("connected",function(){k(!0),M("Connected"),null==g||g()}),A.on("disconnected",function(){k(!1),M("Disconnected"),null==p||p()}),A.on("recordingStarted",function(){O(!0),null==h||h()}),A.on("recordingStopped",function(){O(!1),null==f||f()}),A.on("playbackStarted",function(){P(!0),null==B||B()}),A.on("playbackStopped",function(){P(!1),null==w||w()}),A.on("error",function(A){null==m||m(A)}),A.on("message",function(A){null==v||v(A)}),A.on("bargeIn",function(A){null==y||y(A)}),A.on("stopPlaying",function(A){null==C||C(A)}),R.current=A,A.connect(),function(){var A=e||t;console.log("🎙️ VoiceButton: Cleaning up VoiceSDK instance for ".concat(A)),R.current&&(R.current.destroy(),R.current=null)}},[e,t,n,o,i,s,d]);var V=function(){var A,e=(A=Et().m(function A(){var e;return Et().w(function(A){for(;;)switch(A.p=A.n){case 0:if(R.current){A.n=1;break}return A.a(2);case 1:return A.p=1,A.n=2,R.current.toggleRecording();case 2:A.n=4;break;case 3:A.p=3,e=A.v,console.error("Error toggling recording:",e);case 4:return A.a(2)}},A,null,[[1,3]])}),function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){It(r,n,o,i,a,"next",A)}function a(A){It(r,n,o,i,a,"throw",A)}i(void 0)})});return function(){return e.apply(this,arguments)}}(),_=(0,bt.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[(0,bt.jsx)("div",{style:{fontSize:"20px"},children:D?"🔴":"🎤"}),(0,bt.jsx)("div",{children:D?"Stop Listening":"Start Listening"})]});return(0,bt.jsx)("button",{className:"voice-button ".concat(D?"recording":""," ").concat(U),style:Ut({padding:"12px 24px",border:"none",borderRadius:"8px",backgroundColor:D?"#dc3545":"#007bff",color:"white",cursor:"pointer",fontSize:"16px",fontWeight:"500",transition:"all 0.2s ease"},E),onClick:V,disabled:!H,children:S||_})};function Dt(A){return Dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Dt(A)}function Ot(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Kt(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Kt(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,Kt(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Kt(u,"constructor",c),Kt(c,"constructor",s),s.displayName="GeneratorFunction",Kt(c,o,"GeneratorFunction"),Kt(u),Kt(u,o,"Generator"),Kt(u,n,function(){return this}),Kt(u,"toString",function(){return"[object Generator]"}),(Ot=function(){return{w:r,m:d}})()}function Kt(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Kt=function(A,e,t,n){function r(e,t){Kt(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},Kt(A,e,t,n)}function Pt(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Lt(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Pt(r,n,o,i,a,"next",A)}function a(A){Pt(r,n,o,i,a,"throw",A)}i(void 0)})}}function Mt(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 Rt(A,e,t){return(e=_t(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function Vt(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,_t(n.key),n)}}function _t(A){var e=function(A){if("object"!=Dt(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Dt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Dt(e)?e:e+""}var Gt=function(){return A=function A(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.options=function(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?Mt(Object(t),!0).forEach(function(e){Rt(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):Mt(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}({websocketUrl:e.websocketUrl||"wss://speech.talktopc.com/ws/conv",agentId:e.agentId,voice:e.voice||"default",language:e.language||"en",container:e.container||document.body,buttonText:e.buttonText||"Start Listening",buttonClass:e.buttonClass||"voice-button"},e),this.isConnected=!1,this.isRecording=!1,this.isPlaying=!1,this.voiceSDK=new se({signedUrl:this.options.websocketUrl||this.options.signedUrl,websocketUrl:this.options.websocketUrl||this.options.signedUrl,agentId:this.options.agentId,appId:this.options.appId,voice:this.options.voice,language:this.options.language}),this.setupEventListeners(),this.createButton(),this.connect()},e=[{key:"setupEventListeners",value:function(){var A=this;this.voiceSDK.on("connected",function(){var e,t;A.isConnected=!0,A.updateButton(),null===(e=(t=A.options).onConnected)||void 0===e||e.call(t)}),this.voiceSDK.on("disconnected",function(){var e,t;A.isConnected=!1,A.updateButton(),null===(e=(t=A.options).onDisconnected)||void 0===e||e.call(t)}),this.voiceSDK.on("recordingStarted",function(){var e,t;A.isRecording=!0,A.updateButton(),null===(e=(t=A.options).onRecordingStarted)||void 0===e||e.call(t)}),this.voiceSDK.on("recordingStopped",function(){var e,t;A.isRecording=!1,A.updateButton(),null===(e=(t=A.options).onRecordingStopped)||void 0===e||e.call(t)}),this.voiceSDK.on("playbackStarted",function(){var e,t;A.isPlaying=!0,null===(e=(t=A.options).onPlaybackStarted)||void 0===e||e.call(t)}),this.voiceSDK.on("playbackStopped",function(){var e,t;A.isPlaying=!1,null===(e=(t=A.options).onPlaybackStopped)||void 0===e||e.call(t)}),this.voiceSDK.on("error",function(e){var t,n;null===(t=(n=A.options).onError)||void 0===t||t.call(n,e)}),this.voiceSDK.on("message",function(e){var t,n;null===(t=(n=A.options).onMessage)||void 0===t||t.call(n,e)}),this.voiceSDK.on("bargeIn",function(e){var t,n;null===(t=(n=A.options).onBargeIn)||void 0===t||t.call(n,e)}),this.voiceSDK.on("stopPlaying",function(e){var t,n;null===(t=(n=A.options).onStopPlaying)||void 0===t||t.call(n,e)})}},{key:"createButton",value:function(){var A=this;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",function(){return A.toggleRecording()}),this.options.container.appendChild(this.button),this.updateButton()}},{key:"updateButton",value:function(){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"}}},{key:"connect",value:(n=Lt(Ot().m(function A(){var e;return Ot().w(function(A){for(;;)switch(A.p=A.n){case 0:return A.p=0,A.n=1,this.voiceSDK.connect();case 1:A.n=3;break;case 2:A.p=2,e=A.v,console.error("Failed to connect:",e);case 3:return A.a(2)}},A,this,[[0,2]])})),function(){return n.apply(this,arguments)})},{key:"toggleRecording",value:(t=Lt(Ot().m(function A(){var e;return Ot().w(function(A){for(;;)switch(A.p=A.n){case 0:if(this.voiceSDK){A.n=1;break}return A.a(2);case 1:return A.p=1,A.n=2,this.voiceSDK.toggleRecording();case 2:A.n=4;break;case 3:A.p=3,e=A.v,console.error("Error toggling recording:",e);case 4:return A.a(2)}},A,this,[[1,3]])})),function(){return t.apply(this,arguments)})},{key:"getStatus",value:function(){return{isConnected:this.isConnected,isRecording:this.isRecording,isPlaying:this.isPlaying}}},{key:"updateConfig",value:function(A){this.voiceSDK.updateConfig(A)}},{key:"destroy",value:function(){this.button&&this.button.parentNode&&this.button.parentNode.removeChild(this.button),this.voiceSDK&&this.voiceSDK.destroy()}}],e&&Vt(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function jt(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Nt(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Nt(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,Nt(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Nt(u,"constructor",c),Nt(c,"constructor",s),s.displayName="GeneratorFunction",Nt(c,o,"GeneratorFunction"),Nt(u),Nt(u,o,"Generator"),Nt(u,n,function(){return this}),Nt(u,"toString",function(){return"[object Generator]"}),(jt=function(){return{w:r,m:d}})()}function Nt(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Nt=function(A,e,t,n){function r(e,t){Nt(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},Nt(A,e,t,n)}function Wt(A,e){return function(A){if(Array.isArray(A))return A}(A)||function(A,e){var t=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=t){var n,o,r,i,a=[],s=!0,c=!1;try{if(r=(t=t.call(A)).next,0===e){if(Object(t)!==t)return;s=!1}else for(;!(s=(n=r.call(t)).done)&&(a.push(n.value),a.length!==e);s=!0);}catch(A){c=!0,o=A}finally{try{if(!s&&null!=t.return&&(i=t.return(),Object(i)!==i))return}finally{if(c)throw o}}return a}}(A,e)||Xt(A,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Jt(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=Xt(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,o=function(){};return{s:o,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){a=!0,r=A},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function Xt(A,e){if(A){if("string"==typeof A)return zt(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?zt(A,e):void 0}}function zt(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}function Yt(A){return Yt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Yt(A)}function Zt(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function qt(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Zt(r,n,o,i,a,"next",A)}function a(A){Zt(r,n,o,i,a,"throw",A)}i(void 0)})}}function $t(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,An(n.key),n)}}function An(A){var e=function(A){if("object"!=Yt(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Yt(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Yt(e)?e:e+""}var en=function(){return A=function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),console.log("🚀 AgentSDK v2.1.8 initialized with config:",e),this.config=e,this.voiceSDK=null,this.isConnected=!1,this.isListening=!1,this.wasListening=!1,this._resumeInfo=null,this.onConnected=function(){},this.onDisconnected=function(){},this.onError=function(A){return console.error("SDK Error:",A)},this.onTranscript=function(A){},this.onAgentSpeaking=function(A){},this.onConversationStart=e.onConversationStart||function(){},this.onConversationEnd=e.onConversationEnd||function(){},this.onBargeIn=e.onBargeIn||function(){},this.onAudioStartPlaying=e.onAudioStartPlaying||function(){},this.onAudioStoppedPlaying=e.onAudioStoppedPlaying||function(){},this.onSubtitleDisplay=e.onSubtitleDisplay||function(){}},e=[{key:"checkResumeBeforeConnect",value:function(){try{var A=new se({signedUrl:"wss://placeholder",autoReconnect:!1,agentId:this.config.agentId,appId:this.config.appId,language:this.config.language||"en",protocolVersion:2}).checkAndResume();return A?(console.log("🔄 [AGENT SDK] Found resume state before connect:",A),this._resumeInfo=A,A):null}catch(A){return console.warn("⚠️ [AGENT SDK] Error checking resume:",A),null}}},{key:"connect",value:(n=qt(jt().m(function A(e){var t,n,o,r,i,a,s=this;return jt().w(function(A){for(;;)switch(A.p=A.n){case 0:if(A.p=0,e){A.n=1;break}throw new Error("signedUrl is required");case 1:if(this.voiceSDK&&(console.log("🔌 AgentSDK: Cleaning up existing connection"),this.voiceSDK.destroy(),this.voiceSDK=null),this.voiceSDK=new se({signedUrl:e,autoReconnect:!1,agentId:this.config.agentId,appId:this.config.appId,language:this.config.language||"en",agentSettingsOverride:this.config.agentSettingsOverride,protocolVersion:2,outputContainer:this.config.outputContainer||"raw",outputEncoding:this.config.outputEncoding||"pcm",outputSampleRate:this.config.outputSampleRate||44100,outputChannels:this.config.outputChannels||1,outputBitDepth:this.config.outputBitDepth||16}),this._resumeInfo&&(console.log("🔄 [AGENT SDK] Using stored resume info:",this._resumeInfo),console.log(" From:",this._resumeInfo.fromPage,"→ To:",this._resumeInfo.toPage)),this.voiceSDK.on("connected",function(){s.isConnected=!0,s.onConnected()}),setTimeout(function(){s.voiceSDK&&s.voiceSDK.isConnected&&!s.isConnected&&(s.isConnected=!0,s.onConnected())},10),this.voiceSDK.on("disconnected",function(A){if(s.isConnected=!1,A&&1008===A.code&&A.reason&&(A.reason.includes("Domain not whitelisted")||A.reason.includes("domain")||A.reason.includes("whitelist"))){var e=new Error("DOMAIN_NOT_WHITELISTED");e.reason=A.reason,e.code=A.code,s.onError(e)}if((s.isListening||s.wasListening)&&(console.log("🎤 [AGENT SDK] disconnected event - calling onConversationEnd hook (isListening:",s.isListening,", wasListening:",s.wasListening,")"),s.onConversationEnd&&"function"==typeof s.onConversationEnd))try{s.onConversationEnd(),console.log("🎤 [AGENT SDK] ✅ onConversationEnd hook called from disconnected event"),s.wasListening=!1}catch(A){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationEnd from disconnected:",A)}s.onDisconnected()}),this.voiceSDK.on("domainError",function(A){s.onError(A)}),this.voiceSDK.on("error",function(A){s.onError(A)}),this.voiceSDK.on("message",function(A){s.handleWebSocketMessage(A)}),this.voiceSDK.on("recordingStarted",function(){if(s.isListening=!0,s.wasListening=!0,s.onConversationStart&&"function"==typeof s.onConversationStart)try{s.onConversationStart()}catch(A){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationStart:",A)}}),this.voiceSDK.on("recordingStopped",function(){console.log("🎤 [AGENT SDK] recordingStopped event received");var A=s.isListening;if(s.isListening=!1,A&&s.onConversationEnd&&"function"==typeof s.onConversationEnd)try{console.log("🎤 [AGENT SDK] ✅ Calling onConversationEnd hook from recordingStopped"),s.onConversationEnd(),console.log("🎤 [AGENT SDK] ✅ onConversationEnd hook called successfully"),s.wasListening=!1}catch(A){console.error("🎤 [AGENT SDK] ❌ Error calling onConversationEnd:",A)}}),this.voiceSDK.on("playbackStarted",function(){s.onAgentSpeaking(!0),s.onAudioStartPlaying()}),this.voiceSDK.on("playbackStopped",function(){s.onAgentSpeaking(!1),s.onAudioStoppedPlaying()}),this.voiceSDK.on("bargeIn",function(A){s.onBargeIn(A)}),this.voiceSDK.on("transcriptDisplay",function(A){console.log("📝 [AGENT SDK] transcriptDisplay event received:",A),A&&A.text&&(console.log("📝 [AGENT SDK] Calling onTranscript with text:",A.text),s.onTranscript&&"function"==typeof s.onTranscript?s.onTranscript(A.text):console.warn("📝 [AGENT SDK] ⚠️ onTranscript is not a function!",Yt(s.onTranscript))),s.onSubtitleDisplay(A)}),this._pendingToolHandlers&&this._pendingToolHandlers.size>0){console.log("🔧 AgentSDK: Registering ".concat(this._pendingToolHandlers.size," pending tool handlers")),t=Jt(this._pendingToolHandlers);try{for(t.s();!(n=t.n()).done;)o=Wt(n.value,2),r=o[0],i=o[1],this.voiceSDK.registerToolHandler(r,i)}catch(A){t.e(A)}finally{t.f()}}return A.n=2,this.voiceSDK.connect();case 2:A.n=4;break;case 3:throw A.p=3,a=A.v,this.onError(a),a;case 4:return A.a(2)}},A,this,[[0,3]])})),function(A){return n.apply(this,arguments)})},{key:"handleWebSocketMessage",value:function(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"))}}},{key:"startListening",value:(t=qt(jt().m(function A(){var e;return jt().w(function(A){for(;;)switch(A.p=A.n){case 0:if(console.log("🎤 AgentSDK: startListening() called"),!this.voiceSDK){A.n=5;break}return A.p=1,console.log("🎤 AgentSDK: Starting recording..."),A.n=2,this.voiceSDK.startRecording();case 2:console.log("✅ AgentSDK: Recording started successfully"),A.n=4;break;case 3:throw A.p=3,e=A.v,console.error("❌ AgentSDK: Failed to start recording:",e),e;case 4:A.n=6;break;case 5:throw console.error("❌ AgentSDK: No voiceSDK instance available"),new Error("No voiceSDK instance available");case 6:return A.a(2)}},A,this,[[1,3]])})),function(){return t.apply(this,arguments)})},{key:"stopListening",value:function(){this.voiceSDK&&this.voiceSDK.stopRecording()}},{key:"hangup",value:function(){this.voiceSDK&&this.voiceSDK.hangup()}},{key:"updateVariables",value:function(A){this.voiceSDK&&this.isConnected&&this.voiceSDK.sendMessage({t:"update_variables",variables:A})}},{key:"disconnect",value:function(){this.voiceSDK&&(this.voiceSDK.destroy(),this.voiceSDK=null),this.isConnected=!1,this.isListening=!1}},{key:"registerToolHandler",value:function(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"))}},{key:"unregisterToolHandler",value:function(A){if(this.voiceSDK)return this.voiceSDK.unregisterToolHandler(A);this._pendingToolHandlers&&this._pendingToolHandlers.delete(A)}},{key:"hasToolHandler",value:function(A){var e;return this.voiceSDK?this.voiceSDK.hasToolHandler(A):(null===(e=this._pendingToolHandlers)||void 0===e?void 0:e.has(A))||!1}},{key:"getRegisteredTools",value:function(){return this.voiceSDK?this.voiceSDK.getRegisteredTools():this._pendingToolHandlers?Array.from(this._pendingToolHandlers.keys()):[]}}],e&&$t(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();function tn(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return nn(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(nn(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,nn(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,nn(u,"constructor",c),nn(c,"constructor",s),s.displayName="GeneratorFunction",nn(c,o,"GeneratorFunction"),nn(u),nn(u,o,"Generator"),nn(u,n,function(){return this}),nn(u,"toString",function(){return"[object Generator]"}),(tn=function(){return{w:r,m:d}})()}function nn(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}nn=function(A,e,t,n){function r(e,t){nn(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},nn(A,e,t,n)}function on(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function rn(){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),r=/Chrome/.test(A)&&!/Edg|OPR/.test(A),i=/Safari/.test(A)&&!/Chrome/.test(A),a=/Firefox/.test(A),s=/Edg/.test(A),c=/SamsungBrowser/.test(A),l="unknown";e?l="safari":c?l="samsung":r?l="chrome":i?l="safari":a?l="firefox":s&&(l="edge");var u="unknown";return e?u="ios":t?u="android":n?u="mac":o&&(u="windows"),{platform:u,browser:l,isIOS:e,isAndroid:t,isMac:n,isWindows:o,isMobile:e||t,isDesktop:!e&&!t}}function an(){return sn.apply(this,arguments)}function sn(){var A;return A=tn().m(function A(){var e;return tn().w(function(A){for(;;)switch(A.p=A.n){case 0:if(A.p=0,!navigator.permissions||!navigator.permissions.query){A.n=2;break}return A.n=1,navigator.permissions.query({name:"microphone"});case 1:return e=A.v,A.a(2,e.state);case 2:A.n=4;break;case 3:A.p=3,A.v,console.log("⚠️ MicPermissionUtils: Permissions API not available or not supported for microphone");case 4:return A.a(2,"unknown")}},A,null,[[0,3]])}),sn=function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){on(r,n,o,i,a,"next",A)}function a(A){on(r,n,o,i,a,"throw",A)}i(void 0)})},sn.apply(this,arguments)}function cn(A){var e=A.platform,t=A.browser,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 ln(A){var e=A.isIOS,t=A.isAndroid,n=A.browser;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}function un(A){return un="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},un(A)}function dn(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,gn(n.key),n)}}function gn(A){var e=function(A){if("object"!=un(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=un(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==un(e)?e:e+""}function pn(A,e){var t="undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(!t){if(Array.isArray(A)||(t=function(A,e){if(A){if("string"==typeof A)return hn(A,e);var t={}.toString.call(A).slice(8,-1);return"Object"===t&&A.constructor&&(t=A.constructor.name),"Map"===t||"Set"===t?Array.from(A):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?hn(A,e):void 0}}(A))||e&&A&&"number"==typeof A.length){t&&(A=t);var n=0,o=function(){};return{s:o,n:function(){return n>=A.length?{done:!0}:{done:!1,value:A[n++]}},e:function(A){throw A},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i=!0,a=!1;return{s:function(){t=t.call(A)},n:function(){var A=t.next();return i=A.done,A},e:function(A){a=!0,r=A},f:function(){try{i||null==t.return||t.return()}finally{if(a)throw r}}}}function hn(A,e){(null==e||e>A.length)&&(e=A.length);for(var t=0,n=Array(e);t<e;t++)n[t]=A[t];return n}var fn=function(){return A=function A(){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.overlay=null,this.modal=null},(e=[{key:"createOverlay",value:function(){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}},{key:"injectStyles",value:function(){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)}}},{key:"close",value:function(){this.overlay&&this.overlay.parentNode&&this.overlay.parentNode.removeChild(this.overlay),this.overlay=null,this.modal=null}},{key:"show",value:function(){this.overlay&&this.modal&&document.body.appendChild(this.overlay)}}])&&dn(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e}();function Bn(A,e){var t=new fn,n=t.createOverlay(),o=rn(),r=document.createElement("div");return r.className="mic-permission-modal",r.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(r),t.overlay=n,t.modal=r,r.querySelector('[data-action="accept"]').addEventListener("click",function(){t.close(),A()}),r.querySelector('[data-action="cancel"]').addEventListener("click",function(){t.close(),e()}),n.addEventListener("click",function(A){A.target===n&&(t.close(),e())}),t.show(),t}function wn(A,e){var t,n,o,r=new fn,i=r.createOverlay(),a=rn(),s=cn(a),c=document.createElement("div");c.className="mic-permission-modal";var l="";s.altSteps&&s.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(s.altTitle||"Alternative method",'\n </button>\n <ol style="margin: 0; padding-left: 20px; display: none;">\n ').concat(s.altSteps.map(function(A){return'<li style="padding: 8px 0; font-size: 14px; color: #6b7280;">'.concat(A,"</li>")}).join(""),"\n </ol>\n </div>\n "));var u=function(A){var e,t=A.platform,n=A.browser,o=document.getElementsByTagName("script"),r="",i=pn(o);try{for(i.s();!(e=i.n()).done;){var a=e.value.src;if(a&&(a.includes("agent-widget.js")||a.includes("ttp-agent-sdk")||a.includes("ttp-sdk-front")))try{new URL(a),r=a.substring(0,a.lastIndexOf("/"));break}catch(A){var s=a.match(/^(.*\/)[^\/]+$/);if(s){r=s[1];break}}}}catch(A){i.e(A)}finally{i.f()}var c;if(c="ios"===t?"ios-settings.svg":"android"===t?"android-chrome.svg":"chrome"===n?"desktop-chrome.svg":"safari"===n?"desktop-safari.svg":"firefox"===n?"desktop-firefox.svg":"edge"===n?"desktop-edge.svg":"desktop-chrome.svg",!r||""===r||r.startsWith("/")){var l,u=pn(o);try{for(u.s();!(l=u.n()).done;){var d=l.value.src;if(d&&(d.includes("cdn.talktopc.com")||d.includes("talktopc.com"))){if(d.includes("/ttp-agent-sdk/")||d.includes("/ttp-sdk-front/")){var g=d.match(/(https?:\/\/[^\/]+(?:\/[^\/]+)*)/);if(g){r=g[1].replace(/\/[^\/]+\.js$/,"");break}}if(!r&&(d.includes("cdn.talktopc.com")||d.includes("talktopc.com"))){r="https://cdn.talktopc.com/ttp-agent-sdk";break}}}}catch(A){u.e(A)}finally{u.f()}if(!r||""===r)if(window.location.hostname.includes("cdn.talktopc.com")||window.location.hostname.includes("talktopc.com"))r="https://cdn.talktopc.com/ttp-agent-sdk";else{var p=window.location.pathname.split("/");p.pop(),(r=window.location.origin+p.join("/"))&&r!==window.location.origin||(r=window.location.origin)}}r=r.replace(/\/$/,"");var h="".concat(r,"/shared/mic-permission-assets/").concat(c);return"undefined"!=typeof console&&console.log&&console.log("[MicPermission] Visual guide path:",h,"Base path:",r,"Platform:",t,"Browser:",n),h}(a);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(s.icon,'</span>\n <h2 class="mic-permission-modal__title" style="text-align: left; margin: 0;">').concat(s.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(s.note?'\n <div class="mic-permission-modal__note">\n <span>ℹ️</span>\n <span>'.concat(s.note,"</span>\n </div>\n "):"",'\n <div class="mic-permission-modal__visual-guide-container">\n <img src="').concat(u,'" 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(s.steps.map(function(A){return"<li>".concat(A,"</li>")}).join(""),"\n </ol>\n </div>\n ").concat(l,'\n <div class="mic-permission-modal__actions">\n ').concat(s.canOpenSettings?'\n <button class="mic-permission-modal__btn mic-permission-modal__btn--primary" data-action="open-settings">\n '.concat(s.settingsButtonText||"Open Settings","\n </button>\n "):"","\n ").concat(s.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 '),i.appendChild(c),r.overlay=i,r.modal=c,null===(t=c.querySelector('[data-action="close"]'))||void 0===t||t.addEventListener("click",function(){r.close(),A()}),null===(n=c.querySelector('[data-action="open-settings"]'))||void 0===n||n.addEventListener("click",function(){ln(a)}),null===(o=c.querySelector('[data-action="refresh"]'))||void 0===o||o.addEventListener("click",function(){window.location.reload()});var d=c.querySelector('[data-action="show-hint"]');d&&d.addEventListener("click",function(){r.close(),A(),function(){var A=document.getElementById("mic-address-bar-hint");A&&A.remove(),rn();var e,t=document.getElementsByTagName("script"),n="",o=pn(t);try{for(o.s();!(e=o.n()).done;){var r=e.value.src;if(r&&(r.includes("agent-widget.js")||r.includes("ttp-agent-sdk")||r.includes("ttp-sdk-front")))try{new URL(r),n=r.substring(0,r.lastIndexOf("/"));break}catch(A){var i=r.match(/^(.*\/)[^\/]+$/);if(i){n=i[1];break}}}}catch(A){o.e(A)}finally{o.f()}if(!n||""===n||n.startsWith("/")){var a,s=pn(t);try{for(s.s();!(a=s.n()).done;){var c=a.value.src;if(c&&(c.includes("cdn.talktopc.com")||c.includes("talktopc.com"))){if(c.includes("/ttp-agent-sdk/")||c.includes("/ttp-sdk-front/")){var l=c.match(/(https?:\/\/[^\/]+(?:\/[^\/]+)*)/);if(l){n=l[1].replace(/\/[^\/]+\.js$/,"");break}}if(!n&&(c.includes("cdn.talktopc.com")||c.includes("talktopc.com"))){n="https://cdn.talktopc.com/ttp-agent-sdk";break}}}}catch(A){s.e(A)}finally{s.f()}if(!n||""===n)if(window.location.hostname.includes("cdn.talktopc.com")||window.location.hostname.includes("talktopc.com"))n="https://cdn.talktopc.com/ttp-agent-sdk";else{var u=window.location.pathname.split("/");u.pop(),(n=window.location.origin+u.join("/"))&&n!==window.location.origin||(n=window.location.origin)}}n=n.replace(/\/$/,"");var d="".concat(n,"/shared/mic-permission-assets/address-bar-hint.svg"),g=document.createElement("div");g.id="mic-address-bar-hint",g.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 p=document.createElement("div");p.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 h=document.createElement("div");h.style.cssText="\n flex-shrink: 0;\n ";var f=document.createElement("img");f.src=d,f.alt="Address bar hint",f.style.cssText="\n width: auto;\n height: 80px;\n display: block;\n ",f.onerror=function(){h.style.display="none"},h.appendChild(f);var B=document.createElement("div");B.style.cssText="\n display: flex;\n flex-direction: column;\n gap: 4px;\n flex: 1;\n ";var w=document.createElement("div");w.style.cssText="\n font-size: 15px;\n font-weight: 500;\n ",w.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",function(){g.remove()}),m.addEventListener("mouseenter",function(){m.style.background="rgba(255, 255, 255, 0.3)"}),m.addEventListener("mouseleave",function(){m.style.background="rgba(255, 255, 255, 0.2)"}),!document.getElementById("mic-address-bar-hint-styles")){var v=document.createElement("style");v.id="mic-address-bar-hint-styles",v.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(v)}B.appendChild(w),p.appendChild(h),p.appendChild(B),p.appendChild(m),g.appendChild(p),document.body.appendChild(g),setTimeout(function(){g.parentNode&&(g.style.opacity="0",g.style.transition="opacity 0.3s ease-out",setTimeout(function(){g.parentNode&&g.remove()},300))},1e4)}()});var g=c.querySelector(".mic-permission-modal__alt-toggle");if(g&&s.altSteps){var p=g.nextElementSibling;p&&(p.style.display="none",g.addEventListener("click",function(){"none"===p.style.display?(p.style.display="block",g.innerHTML="▼ ".concat(s.altTitle||"Alternative method")):(p.style.display="none",g.innerHTML="▶ ".concat(s.altTitle||"Alternative method"))}))}return i.addEventListener("click",function(e){e.target===i&&(r.close(),A())}),r.show(),r}function mn(A){var e=new fn,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",function(){window.location.reload()}),n.querySelector('[data-action="close"]').addEventListener("click",function(){e.close(),A()}),t.addEventListener("click",function(n){n.target===t&&(e.close(),A())}),e.show(),e}function vn(A){return vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},vn(A)}function yn(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Cn(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Cn(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,Cn(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Cn(u,"constructor",c),Cn(c,"constructor",s),s.displayName="GeneratorFunction",Cn(c,o,"GeneratorFunction"),Cn(u),Cn(u,o,"Generator"),Cn(u,n,function(){return this}),Cn(u,"toString",function(){return"[object Generator]"}),(yn=function(){return{w:r,m:d}})()}function Cn(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Cn=function(A,e,t,n){function r(e,t){Cn(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},Cn(A,e,t,n)}function bn(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Qn(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){bn(r,n,o,i,a,"next",A)}function a(A){bn(r,n,o,i,a,"throw",A)}i(void 0)})}}function Fn(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,Un(n.key),n)}}function Un(A){var e=function(A){if("object"!=vn(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=vn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==vn(e)?e:e+""}var xn=function(){return A=function A(e){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.config=e,this.audioStream=null,this.callStartTime=null,this.callTimerInterval=null,this.sdk=null,this.isActive=!1,this.shadowRoot=e.shadowRoot||document,this.textSDK=e.textSDK||null,this.deviceInfo=rn(),this.isMobile=this.deviceInfo.isMobile,this.messages=[],this.isTranscriptExpanded=!1,this.waveformBars=[.3,.5,.8,.4,.6,.9,.5,.7],this.waveformInterval=null,this.isMicMuted=!1,this.isSpeakerMuted=!1,this.sdk=new en({agentId:e.agentId,appId:e.appId,signedUrl:e.signedUrl,agentSettingsOverride:e.agentSettingsOverride,variables:e.variables||{},language:e.language||"en",outputContainer:e.outputContainer,outputEncoding:e.outputEncoding,outputSampleRate:e.outputSampleRate,outputChannels:e.outputChannels,outputBitDepth:e.outputBitDepth,onConversationStart:e.onConversationStart,onConversationEnd:e.onConversationEnd,onBargeIn:e.onBargeIn,onAudioStartPlaying:e.onAudioStartPlaying,onAudioStoppedPlaying:e.onAudioStoppedPlaying,onSubtitleDisplay:e.onSubtitleDisplay}),this.setupSDKEventHandlers(),this.checkAndHandleResume()},e=[{key:"checkAndHandleResume",value:function(){if(this._resumeInfo)return console.log("🔄 [VOICE INTERFACE] Returning cached resume info:",this._resumeInfo),this._resumeInfo;var A=this.sdk.checkResumeBeforeConnect();return A?(console.log("🔄 [WIDGET] Auto-resuming call:",A),console.log(" From:",A.fromPage,"→ To:",A.toPage),this._resumeInfo=A,this.config.onResume&&this.config.onResume(A),A):null}},{key:"setupSDKEventHandlers",value:function(){var A=this;this.sdk.onTranscript=function(e){console.log("📝 [VOICE INTERFACE] onTranscript called with text:",e),A.updateTranscript(e)},this.sdk.onAgentSpeaking=function(e){var t=A.shadowRoot.getElementById("voiceAvatarActive");t&&(e?(t.classList.add("speaking"),A.isMobile&&(A.updateMobileStatus("speaking"),A.startWaveformAnimation())):(t.classList.remove("speaking"),A.isMobile&&(A.updateMobileStatus("listening"),A.startWaveformAnimation())))},this.sdk.onDisconnected=function(){console.log("🔌 WebSocket disconnected, hanging up call..."),A.isActive&&(A.isActive=!1,A.endVoiceCall())},this.sdk.onError=function(e){console.error("❌ Voice SDK Error:",e),e&&("DOMAIN_NOT_WHITELISTED"===e.message||e.message&&e.message.includes("Domain not whitelisted"))?A.showDomainError():A.showError(e.message||e)}}},{key:"t",value:function(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}},{key:"getText",value:function(A,e){return void 0!==this.config[A]&&null!==this.config[A]?this.config[A]:this.t(e)}},{key:"getTooltip",value:function(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]||""}},{key:"generateHTML",value:function(){return this.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 --\x3e\n <div id="voiceActiveState" style="display: none;">\n <div class="voice-avatar-active" id="voiceAvatarActive">\n <div class="voice-rings">\n <div class="voice-ring"></div>\n <div class="voice-ring"></div>\n <div class="voice-ring"></div>\n </div>\n 🤖\n </div>\n <div class="voice-status">\n <div class="voice-status-title" id="voiceStatusTitleActive">').concat(this.t("listening"),'</div>\n <div class="voice-status-subtitle" id="voiceStatusSubtitleActive">').concat(this.t("speakFreely"),'</div>\n </div>\n <div class="voice-transcript">\n <div class="transcript-label">').concat(this.t("liveTranscript"),'</div>\n <div class="transcript-text empty" id="transcriptText">\n ').concat(this.t("transcriptWillAppear"),'\n </div>\n </div>\n <div class="voice-controls">\n <button class="voice-control-btn secondary" id="muteBtn" title="').concat(this.getTooltip("mute"),'">\n <svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" class="mute-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 <line x1="8" y1="23" x2="16" y2="23"/>\n <line x1="2" y1="2" x2="22" y2="22" class="mute-cross" style="display: none; stroke: #ef4444; stroke-width: 3.5;"/>\n </svg>\n </button>\n <button class="voice-control-btn primary active" id="endCallBtn" title="').concat(this.getTooltip("endCall"),'">\n <svg width="56" height="56" viewBox="0 0 24 24" fill="#ef4444">\n <rect x="6" y="6" width="12" height="12" rx="2"/>\n </svg>\n <div class="voice-timer" id="voiceTimer">00:00</div>\n </button>\n <button class="voice-control-btn secondary" id="speakerBtn" title="').concat(this.getTooltip("speaker"),'">\n <svg width="64" height="64" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round">\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 0 1 0 14.14"/>\n <path d="M15.54 8.46a5 5 0 0 1 0 7.07"/>\n </svg>\n </button>\n </div>\n </div>\n </div>')}},{key:"generateMobileHTML",value:function(){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(function(A,e){return'<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>')}},{key:"generateCSS",value:function(){var A=this.config.avatarBackgroundColor||"#667eea",e=this.config.avatarActiveBackgroundColor||this.config.avatarBackgroundColor||"#667eea",t=this.config.statusTitleColor||"#1e293b",n=this.config.statusSubtitleColor||"#64748b",o=this.config.startCallButtonColor||"#667eea",r=this.config.startCallButtonTextColor||"#FFFFFF",i=this.config.transcriptBackgroundColor||"#FFFFFF",a=this.config.transcriptTextColor||"#1e293b",s=this.config.transcriptLabelColor||"#94a3b8",c=this.config.controlButtonColor||"#FFFFFF",l=this.config.controlButtonSecondaryColor||"#64748b",u=(this.config.endCallButtonColor,!1===this.config.useShadowDOM?" !important":"");return"\n /* Voice Interface Styles - Ultra-compact for Wix iframes */\n .voice-interface { \n display: none".concat(u,"; \n flex: 1; \n flex-direction: column;\n align-items: center; \n justify-content: center; \n padding: 6px 10px 6px 10px; \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(u,'; }\n \n /* Voice States - Better scaling gaps */\n #voiceIdleState,\n #voiceActiveState {\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[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(A," 0%, ").concat(e," 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: 1;\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: 1;\n min-height: 0;\n }\n \n .voice-status-title {\n font-size: clamp(12px, 3vh, 20px);\n font-weight: 600;\n color: ").concat(t,";\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(n,";\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);\n height: clamp(48px, 8vh, 64px);\n border-radius: clamp(24px, 4vh, 32px);\n border: none;\n background: ").concat(o,";\n color: ").concat(r,";\n font-size: clamp(14px, 2.5vh, 18px);\n font-weight: 600;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\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 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 \n /* Voice Transcript - Scales with container */\n .voice-transcript {\n background: ").concat(i,";\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(100px, 18vh, 140px);\n max-height: clamp(120px, 22vh, 160px);\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(s,";\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(a,";\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 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: clamp(5px, 1.2vh, 10px);\n }\n \n .voice-control-btn {\n width: clamp(48px, 9vh, 72px);\n height: clamp(48px, 9vh, 72px);\n aspect-ratio: 1;\n border-radius: 50%;\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all 0.2s;\n position: relative;\n flex-shrink: 0;\n }\n \n .voice-control-btn svg {\n width: 48%;\n height: 48%;\n }\n \n .voice-control-btn.primary {\n width: clamp(54px, 10vh, 80px);\n height: clamp(54px, 10vh, 80px);\n background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);\n color: white;\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: white;\n animation: recordingPulse 1.5s ease-in-out infinite;\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(c,";\n color: ").concat(l,";\n box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);\n }\n \n .voice-control-btn.secondary:hover {\n background: #f8fafc;\n transform: scale(1.05);\n }\n \n .voice-control-btn.secondary.muted {\n background: #f3f4f6;\n }\n \n .voice-control-btn.secondary.muted .mute-icon {\n stroke: #9ca3af !important;\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 /* 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 Styles - Fixed at bottom of viewport */\n /* These styles are injected into document head when mobile bar is created */\n \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;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n border: none;\n cursor: pointer;\n transition: all 0.2s ease;\n background-color: rgba(255,255,255,0.15);\n }\n \n .mobile-control-btn:hover {\n background-color: rgba(255,255,255,0.25);\n }\n \n .mobile-control-btn.muted {\n background-color: rgba(239, 68, 68, 0.3);\n }\n \n .mobile-end-call-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border-radius: 50%;\n border: none;\n cursor: pointer;\n background-color: #ef4444;\n box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);\n transition: all 0.2s ease;\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 }\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-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: opacity 0.2s ease;\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 }\n ")}},{key:"setupEventHandlers",value:function(A){var e=this,t=this.shadowRoot.getElementById("startCallBtn"),n=this.shadowRoot.getElementById("endCallBtn"),o=this.shadowRoot.getElementById("muteBtn"),r=this.shadowRoot.getElementById("speakerBtn");t&&(t.onclick=function(){return e.startVoiceCall()}),n&&(n.onclick=function(){return e.endVoiceCall()}),o&&(o.onclick=function(){return e.toggleMute()}),r&&(r.onclick=function(){return e.toggleSpeaker()}),this.isMobile&&this.setupMobileEventHandlers();var i=function(){var A=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=e.shadowRoot.getElementById("voiceInterface");t&&t.classList.contains("active")&&t.clientHeight>100?(console.log("✅ Interface is active and has proper dimensions, adjusting sizes (attempt",A+1,")"),e.adjustSizesForContainer(),0===A&&setTimeout(function(){return e.adjustSizesForContainer()},500)):A<15?(console.log("⏳ Interface not ready yet (height:",null==t?void 0:t.clientHeight,"), retrying... (attempt",A+1,")"),setTimeout(function(){return i(A+1)},250)):(console.warn("⚠️ Interface never became fully ready, adjusting sizes anyway"),e.adjustSizesForContainer())};setTimeout(function(){return i()},200),window.addEventListener("resize",function(){console.log("🔄 Window resized, re-adjusting sizes"),e.adjustSizesForContainer()})}},{key:"setupMobileEventHandlers",value:function(){var A=this,e=this.isMobile?document:this.shadowRoot,t=e.getElementById("mobileMuteBtn"),n=e.getElementById("mobileSpeakerBtn"),o=e.getElementById("mobileEndCallBtn"),r=e.getElementById("mobileTranscriptRow"),i=e.getElementById("mobileCloseTranscriptBtn"),a=e.getElementById("mobileSendBtn"),s=e.getElementById("mobileTextInput"),c=e.getElementById("mobileTranscriptOverlay");t&&(t.onclick=function(e){e.stopPropagation(),A.toggleMute()}),n&&(n.onclick=function(e){e.stopPropagation(),A.toggleSpeaker()}),o&&(o.onclick=function(e){e.stopPropagation(),A.endVoiceCall()}),r&&(r.onclick=function(){A.expandMobileTranscript()}),i&&(i.onclick=function(){A.collapseMobileTranscript()}),c&&(c.onclick=function(e){e.target===c&&A.collapseMobileTranscript()}),a&&(a.onclick=function(){A.sendMobileTextMessage()}),s&&(s.onkeypress=function(e){"Enter"!==e.key||e.shiftKey||(e.preventDefault(),A.sendMobileTextMessage())},s.oninput=function(){var A=s.value.trim().length>0;a&&(a.disabled=!A)})}},{key:"expandMobileTranscript",value:function(){var A=document.getElementById("mobileTranscriptOverlay");if(A){A.style.display="flex",this.isTranscriptExpanded=!0;var e=document.getElementById("mobileTextInput");e&&setTimeout(function(){return e.focus()},100);var t=document.getElementById("mobileMessagesContainer");t&&setTimeout(function(){t.scrollTop=t.scrollHeight},100)}}},{key:"collapseMobileTranscript",value:function(){var A=document.getElementById("mobileTranscriptOverlay");A&&(A.style.display="none",this.isTranscriptExpanded=!1)}},{key:"sendMobileTextMessage",value:(r=Qn(yn().m(function A(){var e,t,n,o;return yn().w(function(A){for(;;)switch(A.p=A.n){case 0:if(e=document.getElementById("mobileTextInput"),t=document.getElementById("mobileSendBtn"),e&&t){A.n=1;break}return A.a(2);case 1:if(n=e.value.trim()){A.n=2;break}return A.a(2);case 2:if(this.addMobileMessage("user",n),e.value="",t.disabled=!0,A.p=3,!this.textSDK){A.n=5;break}return A.n=4,this.textSDK.sendMessage(n);case 4:A.n=6;break;case 5:this.sdk&&this.sdk.voiceSDK&&console.warn("Text sending via VoiceSDK not yet implemented");case 6:A.n=8;break;case 7:A.p=7,o=A.v,console.error("❌ Failed to send text message:",o),this.addMobileMessage("assistant","Error: ".concat(o.message));case 8:return A.a(2)}},A,this,[[3,7]])})),function(){return r.apply(this,arguments)})},{key:"addMobileMessage",value:function(A,e){this.messages.push({type:A,text:e});var t=document.getElementById("mobileTranscriptText");t&&(t.textContent=e);var n=document.getElementById("mobileMessagesContainer");if(n){var o=document.createElement("div");o.className="mobile-message-bubble ".concat(A),o.textContent=e,n.appendChild(o),setTimeout(function(){n.scrollTop=n.scrollHeight},50)}}},{key:"startWaveformAnimation",value:function(){this.waveformInterval||(this.waveformInterval=setInterval(function(){var A=document.getElementById("mobileWaveform");A&&A.querySelectorAll(".mobile-waveform-bar").forEach(function(A,e){var t=.2+.8*Math.random();A.style.height="".concat(24*t,"px")})},150))}},{key:"stopWaveformAnimation",value:function(){this.waveformInterval&&(clearInterval(this.waveformInterval),this.waveformInterval=null);var A=document.getElementById("mobileWaveform");A&&A.querySelectorAll(".mobile-waveform-bar").forEach(function(A){A.style.height="4px"})}},{key:"createMobileMinimizedBar",value:function(){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.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">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(function(A,e){return'<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">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 '),document.body.appendChild(t),this.setupMobileEventHandlers(),console.log("✅ Mobile minimized bar created and appended to body")}},{key:"removeMobileMinimizedBar",value:function(){var A=document.getElementById("mobile-voice-call-bar-container");A&&A.remove()}},{key:"generateMobileCSS",value:function(){return"\n /* Mobile Voice Call UI Styles - Fixed at bottom of viewport */\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 .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;\n align-items: center;\n justify-content: center;\n width: 32px;\n height: 32px;\n border-radius: 50%;\n border: none;\n cursor: pointer;\n transition: all 0.2s ease;\n background-color: rgba(255,255,255,0.15);\n }\n \n .mobile-control-btn:hover {\n background-color: rgba(255,255,255,0.25);\n }\n \n .mobile-control-btn.muted {\n background-color: rgba(239, 68, 68, 0.3);\n }\n \n .mobile-end-call-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n width: 36px;\n height: 36px;\n border-radius: 50%;\n border: none;\n cursor: pointer;\n background-color: #ef4444;\n box-shadow: 0 4px 14px rgba(239, 68, 68, 0.5);\n transition: all 0.2s ease;\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 }\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-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: opacity 0.2s ease;\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 }\n "}},{key:"getSignedUrl",value:(o=Qn(yn().m(function A(){var e,t;return yn().w(function(A){for(;;)switch(A.n){case 0:if(!this.config.signedUrl){A.n=1;break}return A.a(2,this.config.signedUrl);case 1:if(this.config.agentId){A.n=2;break}throw new Error("agentId is required when signedUrl is not provided");case 2:return e=this.config.websocketUrl||"wss://speech.talktopc.com/ws/conv",(t=new URLSearchParams).append("agentId",this.config.agentId),this.config.appId&&t.append("appId",this.config.appId),!1!==this.config.demo&&t.append("demo","true"),A.a(2,"".concat(e,"?").concat(t.toString()))}},A,this)})),function(){return o.apply(this,arguments)})},{key:"adjustSizesForContainer",value:function(){var A=this.shadowRoot.getElementById("voiceInterface");if(A){var e=A.clientHeight,t=A.clientWidth;console.log("📏 Container size:",e,"x",t);var n,o,r,i,a,s,c,l,u,d=this.shadowRoot.getElementById("voiceIdleState"),g=this.shadowRoot.getElementById("voiceActiveState"),p=d&&"none"!==d.style.display,h=g&&"none"!==g.style.display;console.log("👁️ Visible state - Idle:",p,"Active:",h),e<=350?(u=5,n=70,o=35,r=11,i=9,a=32,s=100,c=42,l=48):e<=450?(u=7,n=110,o=55,r=15,i=11,a=38,s=110,c=52,l=58):e<=550?(u=8,n=140,o=70,r=16,i=12,a=42,s=120,c=56,l=64):e<=700?(u=10,n=130,o=65,r=18,i=13,a=46,s=130,c=60,l=70):(u=12,n=150,o=75,r=20,i=14,a=50,s=140,c=66,l=76),this.shadowRoot.querySelectorAll("#voiceIdleState, #voiceActiveState").forEach(function(A){A.style.gap="".concat(u,"px")});var f=this.shadowRoot.querySelectorAll(".voice-avatar, .voice-avatar-active");console.log("🤖 Found",f.length,"avatars, setting size to",n,"px"),f.forEach(function(A){A.style.width="".concat(n,"px"),A.style.height="".concat(n,"px"),A.style.fontSize="".concat(o,"px")}),this.shadowRoot.querySelectorAll(".voice-status-title").forEach(function(A){return A.style.fontSize="".concat(r,"px")}),this.shadowRoot.querySelectorAll(".voice-status-subtitle").forEach(function(A){return A.style.fontSize="".concat(i,"px")});var B=this.shadowRoot.querySelector(".voice-transcript");B&&(B.style.minHeight="".concat(s,"px"),B.style.maxHeight="".concat(s,"px"),B.style.height="".concat(s,"px"),B.style.width="min(360px, ".concat(t-40,"px)"),B.style.boxSizing="border-box");var w=this.shadowRoot.querySelector(".transcript-label");w&&(w.style.fontSize="".concat(Math.max(8,r-4),"px"));var m=this.shadowRoot.querySelector(".transcript-text");m&&(m.style.fontSize="".concat(Math.max(10,r-2),"px")),this.shadowRoot.querySelectorAll(".voice-control-btn.secondary").forEach(function(A){A.style.width="".concat(c,"px"),A.style.height="".concat(c,"px");var e=A.querySelector("svg");if(e){var t=.65*c;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 v=this.shadowRoot.querySelector(".voice-control-btn.primary");if(v){v.style.width="".concat(l,"px"),v.style.height="".concat(l,"px");var y=v.querySelector("svg");if(y){var C=.7*l;y.style.setProperty("width","".concat(C,"px"),"important"),y.style.setProperty("height","".concat(C,"px"),"important"),y.style.setProperty("min-width","".concat(C,"px"),"important"),y.style.setProperty("min-height","".concat(C,"px"),"important")}}var b=this.shadowRoot.querySelector(".start-call-btn");if(b){var Q,F;e<=350?(Q=48,F=14):e<=450?(Q=52,F=15):e<=550?(Q=58,F=17):e<=700?(Q=62,F=18):(Q=64,F=18),b.style.height="".concat(Q,"px"),b.style.fontSize="".concat(F,"px");var U=b.querySelector("svg");if(U){var x=Math.max(22,.5*Q);U.style.width="".concat(x,"px"),U.style.height="".concat(x,"px")}}console.log("✅ Sizes adjusted - Avatar:",n,"Status:",a,"Transcript:",s,"Buttons:",c)}else console.warn("⚠️ voiceInterface not found, skipping size adjustment")}},{key:"startVoiceCall",value:(n=Qn(yn().m(function A(){var e,t=this;return yn().w(function(A){for(;;)switch(A.n){case 0:if(!this.isActive){A.n=1;break}return console.log("⚠️ Voice call already active"),A.a(2);case 1:return console.log("🎤 Starting voice call..."),A.n=2,an();case 2:if(e=A.v,console.log("📋 Current permission state: ".concat(e)),"denied"!==e){A.n=3;break}return console.log("🚫 Permission is denied, showing blocked modal..."),rn(),wn(function(){console.log("Blocked modal closed")}),A.a(2);case 3:if("prompt"!==e&&"unknown"!==e){A.n=4;break}return console.log("📋 Permission is in prompt state, showing pre-prompt modal..."),A.a(2,new Promise(function(A){Bn(Qn(yn().m(function e(){return yn().w(function(e){for(;;)switch(e.n){case 0:return console.log("✅ Pre-prompt accepted, proceeding with voice call..."),e.n=1,t.proceedWithVoiceCall();case 1:A();case 2:return e.a(2)}},e)})),function(){console.log("❌ Pre-prompt cancelled"),A()})}));case 4:return A.n=5,this.proceedWithVoiceCall();case 5:return A.a(2)}},A,this)})),function(){return n.apply(this,arguments)})},{key:"proceedWithVoiceCall",value:(t=Qn(yn().m(function A(){var e,t,n,o,r,i,a,s,c,l,u,d,g,p=this;return yn().w(function(A){for(;;)switch(A.p=A.n){case 0:return A.p=0,this.isMobile?(e=this.shadowRoot.getElementById("voiceIdleState"))&&(e.style.display="none"):(t=this.shadowRoot.getElementById("voiceIdleState"),n=this.shadowRoot.getElementById("voiceActiveState"),t&&(t.style.display="none"),n&&(n.style.display="flex")),o=this.shadowRoot.getElementById("voiceInterface"),setTimeout(function(){return p.adjustSizesForContainer()},50),o&&(o.scrollTop=0),A.n=1,this.getSignedUrl();case 1:if(r=A.v,console.log("🔗 Got signed URL:",r),!this.sdk||!this.sdk.isConnected){A.n=5;break}return console.log("🔄 SDK already connected, disconnecting for clean retry..."),A.p=2,this.sdk.disconnect(),A.n=3,new Promise(function(A){return setTimeout(A,100)});case 3:A.n=5;break;case 4:A.p=4,d=A.v,console.warn("Warning: Error disconnecting existing connection:",d);case 5:return A.n=6,this.sdk.connect(r);case 6:i=A.v,console.log("✅ Connected to WebSocket, connected:",i),a=0;case 7:if(!(a<50)){A.n=10;break}if(!this.sdk.isConnected){A.n=8;break}if(!(this.sdk.voiceSDK&&this.sdk.voiceSDK.isConnected&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN)){A.n=8;break}return A.a(3,10);case 8:return A.n=9,new Promise(function(A){return setTimeout(A,100)});case 9:a++,A.n=7;break;case 10:if(!(this.sdk.isConnected&&this.sdk.voiceSDK&&this.sdk.voiceSDK.websocket&&this.sdk.voiceSDK.websocket.readyState===WebSocket.OPEN)){A.n=12;break}return console.log("✅ WebSocket ready, starting listening..."),A.n=11,this.sdk.startListening();case 11:console.log("🎤 Started listening"),this.isActive=!0,this.isMobile&&(console.log("📱 Mobile device - permission granted, creating minimized bar"),(s=this.shadowRoot.getElementById("text-chat-panel"))?(s.classList.remove("open"),s.style.display="none",console.log("✅ Widget panel closed and hidden")):(c=document.getElementById("text-chat-panel"))&&(c.classList.remove("open"),c.style.display="none",console.log("✅ Widget panel closed and hidden (fallback)")),this.createMobileMinimizedBar(),0===this.messages.length&&this.messages.push({type:"assistant",text:this.t("transcriptWillAppear")}),this.startWaveformAnimation(),this.updateMobileStatus("listening")),this.callStartTime=Date.now(),this.callTimerInterval=setInterval(function(){var A=Date.now()-p.callStartTime,e=Math.floor(A/6e4),t=Math.floor(A%6e4/1e3),n="".concat(e.toString().padStart(2,"0"),":").concat(t.toString().padStart(2,"0")),o=p.shadowRoot.getElementById("voiceTimer");if(o&&(o.textContent=n),p.isMobile){var r=document.getElementById("mobileDurationText"),i=document.getElementById("mobileHeaderDuration");r&&(r.textContent=n),i&&(i.textContent=n)}},1e3),A.n=14;break;case 12:return console.warn("⚠️ Connection not fully ready, but trying to start listening anyway..."),A.n=13,this.sdk.startListening();case 13:console.log("🎤 Started listening"),this.isActive=!0,this.isMobile&&(console.log("📱 Mobile device - permission granted, creating minimized bar"),(l=this.shadowRoot.getElementById("text-chat-panel"))?(l.classList.remove("open"),l.style.display="none",console.log("✅ Widget panel closed and hidden")):(u=document.getElementById("text-chat-panel"))&&(u.classList.remove("open"),u.style.display="none",console.log("✅ Widget panel closed and hidden (fallback)")),this.createMobileMinimizedBar(),0===this.messages.length&&this.messages.push({type:"assistant",text:this.t("transcriptWillAppear")}),this.startWaveformAnimation(),this.updateMobileStatus("listening")),this.callStartTime=Date.now(),this.callTimerInterval=setInterval(function(){var A=Date.now()-p.callStartTime,e=Math.floor(A/6e4),t=Math.floor(A%6e4/1e3),n="".concat(e.toString().padStart(2,"0"),":").concat(t.toString().padStart(2,"0")),o=p.shadowRoot.getElementById("voiceTimer");if(o&&(o.textContent=n),p.isMobile){var r=document.getElementById("mobileDurationText"),i=document.getElementById("mobileHeaderDuration");r&&(r.textContent=n),i&&(i.textContent=n)}},1e3);case 14:console.log("✅ Voice call started successfully"),A.n=16;break;case 15:if(A.p=15,g=A.v,console.error("❌ Error starting voice call:",g),this.isActive=!1,this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null),this.sdk&&this.sdk.isConnected)try{this.sdk.disconnect()}catch(A){console.warn("Error disconnecting SDK on error:",A)}"NotAllowedError"===g.name||"PermissionDeniedError"===g.name?(rn(),wn(function(){p.resetUIState()})):"NotFoundError"===g.name||"DevicesNotFoundError"===g.name?mn(function(){p.resetUIState()}):(this.showError(g.message||g),this.resetUIState());case 16:return A.a(2)}},A,this,[[2,4],[0,15]])})),function(){return t.apply(this,arguments)})},{key:"resetUIState",value:function(){var A=this.shadowRoot.getElementById("voiceIdleState"),e=this.shadowRoot.getElementById("voiceActiveState");A&&(A.style.display="flex"),e&&(e.style.display="none")}},{key:"endVoiceCall",value:function(){var A=this;if(console.log("🔴 Ending voice call..."),this.sdk&&this.isActive&&(this.sdk.stopListening(),this.sdk.hangup(),this.isActive=!1),this.audioStream&&(this.audioStream.getTracks().forEach(function(A){return A.stop()}),this.audioStream=null),this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null),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("voiceIdleState"),o=this.shadowRoot.getElementById("voiceActiveState");n&&(n.style.display="flex"),o&&(o.style.display="none"),setTimeout(function(){return A.adjustSizesForContainer()},50);var r=this.shadowRoot.getElementById("transcriptText");if(r&&(r.textContent=this.t("transcriptWillAppear"),r.classList.add("empty")),this.isMobile){var i=document.getElementById("mobileTranscriptText");i&&(i.textContent=this.t("transcriptWillAppear"))}var a=this.shadowRoot.getElementById("voiceAvatarActive");a&&a.classList.remove("speaking"),console.log("✅ Voice call ended")}},{key:"updateTranscript",value:function(A){console.log("📝 [VOICE INTERFACE] updateTranscript called with text:",A);var e=this.shadowRoot.getElementById("transcriptText");if(e?(console.log("📝 [VOICE INTERFACE] Found transcript element, updating text"),e.textContent=A,e.classList.remove("empty")):console.warn("📝 [VOICE INTERFACE] ⚠️ transcriptText element not found!"),this.isMobile){var t=document.getElementById("mobileTranscriptText");t&&(t.textContent=A),this.messages.length>0&&"assistant"===this.messages[this.messages.length-1].type?this.messages[this.messages.length-1].text=A:this.messages.push({type:"assistant",text:A});var n=document.getElementById("mobileMessagesContainer");if(n){var o=n.querySelector(".mobile-message-bubble.assistant:last-child");o?o.textContent=A:this.addMobileMessage("assistant",A)}}}},{key:"showError",value:function(A){var e=this.shadowRoot.getElementById("transcriptText");e&&(e.textContent="".concat(this.t("error"),": ").concat(A),e.classList.remove("empty"))}},{key:"showDomainError",value:function(){var A=this.shadowRoot.getElementById("transcriptText");if(A){var e=this.t("domainNotValidated"),t=this.t("domainErrorMessage");A.innerHTML='<div style="font-weight: 600; font-size: 16px; margin-bottom: 8px; color: #991B1B;">'.concat(e,'</div><div style="font-size: 14px; color: #991B1B; line-height: 1.5;">').concat(t,"</div>"),A.classList.remove("empty")}}},{key:"toggleMute",value:function(){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("muteBtn"),t=null==e?void 0:e.querySelector(".mute-icon"),n=null==e?void 0:e.querySelector(".mute-cross");if(e&&t&&n&&(A.enabled?(t.style.stroke="",n.style.display="none",e.classList.remove("muted")):(t.style.stroke="#9ca3af",n.style.display="block",e.classList.add("muted"))),this.isMobile){var o=document.getElementById("mobileMuteBtn"),r=null==o?void 0:o.querySelector(".mobile-mic-icon"),i=null==o?void 0:o.querySelector(".mobile-mic-off-icon");o&&(A.enabled?(o.classList.remove("muted"),r&&(r.style.display="block"),i&&(i.style.display="none")):(o.classList.add("muted"),r&&(r.style.display="none"),i&&(i.style.display="block")))}console.log(A.enabled?"🔊 Unmuted":"🔇 Muted")}else console.warn("⚠️ No audio track available for mute toggle")}}},{key:"toggleSpeaker",value:function(){if(this.isSpeakerMuted=!this.isSpeakerMuted,console.log("🔊 Speaker toggle:",this.isSpeakerMuted?"muted":"unmuted"),this.isMobile){var A=document.getElementById("mobileSpeakerBtn"),e=null==A?void 0:A.querySelector(".mobile-speaker-icon"),t=null==A?void 0:A.querySelector(".mobile-speaker-off-icon");A&&(this.isSpeakerMuted?(A.classList.add("muted"),e&&(e.style.display="none"),t&&(t.style.display="block")):(A.classList.remove("muted"),e&&(e.style.display="block"),t&&(t.style.display="none")))}}},{key:"updateMobileStatus",value:function(A){if(this.isMobile){var e=document.getElementById("mobileStatusText"),t=document.getElementById("mobileHeaderStatusText"),n=document.getElementById("mobileStatusDot"),o="Paused",r="#facc15";"listening"===A||"recording"===A?(o="Listening...",r="#22c55e"):"speaking"===A&&(o="Speaking...",r="#a855f7"),e&&(e.textContent=o),t&&(t.textContent=o),n&&(n.style.backgroundColor=r,n.style.boxShadow="paused"===A?"none":"0 0 8px ".concat(r))}}},{key:"destroy",value:function(){this.isActive&&this.endVoiceCall(),this.audioStream&&(this.audioStream.getTracks().forEach(function(A){return A.stop()}),this.audioStream=null),this.callTimerInterval&&(clearInterval(this.callTimerInterval),this.callTimerInterval=null),this.sdk&&(this.sdk.disconnect(),this.sdk=null)}}],e&&Fn(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n,o,r}();function En(A){return En="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},En(A)}function Sn(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return In(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(In(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,In(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,In(u,"constructor",c),In(c,"constructor",s),s.displayName="GeneratorFunction",In(c,o,"GeneratorFunction"),In(u),In(u,o,"Generator"),In(u,n,function(){return this}),In(u,"toString",function(){return"[object Generator]"}),(Sn=function(){return{w:r,m:d}})()}function In(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}In=function(A,e,t,n){function r(e,t){In(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},In(A,e,t,n)}function Hn(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function kn(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Hn(r,n,o,i,a,"next",A)}function a(A){Hn(r,n,o,i,a,"throw",A)}i(void 0)})}}function Tn(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,Dn(n.key),n)}}function Dn(A){var e=function(A){if("object"!=En(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=En(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==En(e)?e:e+""}var On=function(){return A=function A(e,t){!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.config=e,this.sdk=t,this.streamingEl=null,this.hasStartedStreaming=!1,this.isActive=!1,this.shadowRoot=e.shadowRoot||document,this.eventHandlers={autoResize:null,keydown:null},this.eventHandlersSetup=!1},e=[{key:"t",value:function(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}},{key:"generateHTML",value:function(){var A,e,t,n,o,r,i,a,s,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===(r=this.config.sendButtonHint)||void 0===r?void 0:r.fontSize)||(null===(i=this.config.panel)||void 0===i||null===(i=i.sendButtonHint)||void 0===i?void 0:i.fontSize)||"12px",'; text-align: center; margin-top: 4px;">\n ').concat((null===(a=this.config.sendButtonHint)||void 0===a?void 0:a.text)||(null===(s=this.config.panel)||void 0===s||null===(s=s.sendButtonHint)||void 0===s?void 0:s.text),"\n </div>\n "):"","\n </div>\n </div>")}},{key:"generateCSS",value:function(){var A,e,t,n,o,r,i,a,s,c,l,u,d,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",f=this.config.sendButtonTextColor||(null===(t=this.config.panel)||void 0===t?void 0:t.sendButtonTextColor)||"#FFFFFF",B=(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"),w=this.config.inputFocusColor||(null===(r=this.config.panel)||void 0===r?void 0:r.inputFocusColor)||"#7C3AED",m=this.config.inputBackgroundColor||(null===(i=this.config.panel)||void 0===i?void 0:i.inputBackgroundColor)||"#FFFFFF",v=this.config.inputTextColor||(null===(a=this.config.panel)||void 0===a?void 0:a.inputTextColor)||"#1F2937",y=this.config.inputFontSize||(null===(s=this.config.panel)||void 0===s?void 0:s.inputFontSize)||"14px",C=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",Q=!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(Q,"; \n flex: 1; \n flex-direction: column; \n min-height: 0; \n overflow: hidden; \n }\n .text-interface.active { display: flex").concat(Q,"; }\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; \n max-width: 80%; \n font-size: ").concat(g.fontSize,"; \n color: ").concat(g.textColor,"; \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 { \n background: ").concat(g.userBackgroundColor,"; \n align-self: ").concat("rtl"===this.config.direction?"flex-start":"flex-end","; \n }\n .message.agent { \n background: ").concat(g.agentBackgroundColor,"; \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(B,";\n border-radius: ").concat(C,"px;\n font-size: ").concat(y,";\n font-family: inherit;\n line-height: 1.3;\n resize: none;\n overflow-y: auto;\n background: ").concat(m,";\n color: ").concat(v,";\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(w,";\n background: ").concat("#FFFFFF"===m?"#FFFFFF":m,";\n box-shadow: 0 0 0 3px ").concat(w,"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(f,";\n font-size: ").concat(this.config.sendButtonFontSize||(null===(u=this.config.panel)||void 0===u?void 0:u.sendButtonFontSize)||"18px",";\n font-weight: ").concat(this.config.sendButtonFontWeight||(null===(d=this.config.panel)||void 0===d?void 0:d.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 ")}},{key:"setupEventHandlers",value:function(){var A=this,e=this.shadowRoot.getElementById("sendButton"),t=this.shadowRoot.getElementById("messageInput"),n=this.shadowRoot.getElementById("newChatBtn");if(e&&(e.onclick=function(){return A.sendMessage()}),n&&(n.onclick=function(){return A.startNewChat()}),this.updateInputAttributes(),t){t.style.height="32px",t.style.overflow="hidden";var o=function(){t.style.height="auto";var A=Math.min(t.scrollHeight,120);t.style.height=A+"px",t.style.overflowY=A>=120?"auto":"hidden",A>=120&&setTimeout(function(){t.scrollTop=t.scrollHeight},0)};t.addEventListener("input",o),t.addEventListener("keydown",function(e){"Enter"!==e.key||e.shiftKey?"Enter"===e.key&&e.shiftKey&&setTimeout(o,0):(e.preventDefault(),A.sendMessage())})}}},{key:"startNewChat",value:function(){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()}},{key:"updateInputAttributes",value:function(){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"}}},{key:"show",value:function(){var A=this,e=this.shadowRoot.getElementById("textInterface");e&&e.classList.add("active"),setTimeout(function(){var e=A.shadowRoot.getElementById("messageInput");e&&e.focus()},50)}},{key:"hide",value:function(){var A=this.shadowRoot.getElementById("textInterface");A&&A.classList.remove("active")}},{key:"startChat",value:(n=kn(Sn().m(function A(){return Sn().w(function(A){for(;;)switch(A.n){case 0:this.isActive=!0,this.updateSendButtonState();case 1:return A.a(2)}},A,this)})),function(){return n.apply(this,arguments)})},{key:"sendMessage",value:(t=kn(Sn().m(function A(){var e,t,n;return Sn().w(function(A){for(;;)switch(A.p=A.n){case 0:if(e=this.shadowRoot.getElementById("messageInput"),t=e.value.trim()){A.n=1;break}return A.a(2);case 1:if(this.isActive){A.n=2;break}return A.n=2,this.startChat();case 2:return this.addMessage("user",t),e.value="",e.style.height="32px",e.style.overflow="hidden",A.p=3,this.beginStreaming(),A.n=4,this.sdk.sendMessage(t);case 4:A.n=6;break;case 5:A.p=5,n=A.v,console.error("❌ Failed to send message:",n),n&&("DOMAIN_NOT_WHITELISTED"===n.message||n.message&&n.message.includes("Domain not whitelisted"))||this.showError(n),this.stopStreamingState();case 6:return A.a(2)}},A,this,[[3,5]])})),function(){return t.apply(this,arguments)})},{key:"updateSendButtonState",value:function(){var A=this.shadowRoot.getElementById("sendButton");A&&(A.disabled=!this.isActive)}},{key:"addMessage",value:function(A,e){var t=this.shadowRoot.getElementById("messagesContainer");if(t){var n=t.querySelector(".empty-state");n&&n.remove();var o=document.createElement("div"),r="rtl"===this.config.direction?"user"===A?"edge-left":"edge-right":"user"===A?"edge-right":"edge-left";o.className="message ".concat(A," ").concat(r);var i=document.createElement("div");i.className="message-avatar ".concat(A),i.textContent="user"===A?"👤":"🤖";var a=document.createElement("div");a.className="message-bubble",a.textContent=e,o.appendChild(i),o.appendChild(a),t.appendChild(o),t.scrollTop=t.scrollHeight}}},{key:"beginStreaming",value:function(){var A=this.shadowRoot.getElementById("messagesContainer");if(A){this.stopStreamingState();var e=document.createElement("div"),t="rtl"===this.config.direction?"edge-right":"edge-left";e.className="message agent ".concat(t),e.id="agent-streaming";var n=document.createElement("div");n.className="message-avatar agent",n.textContent="🤖";var o=document.createElement("div");o.className="message-bubble",o.innerHTML='<span class="typing-indicator"><span class="typing-dot"></span><span class="typing-dot"></span><span class="typing-dot"></span></span>',e.appendChild(n),e.appendChild(o),A.appendChild(e),this.streamingEl=o,this.hasStartedStreaming=!1,A.scrollTop=A.scrollHeight}}},{key:"appendStreamingChunk",value:function(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)}}},{key:"finalizeStreaming",value:function(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()}},{key:"stopStreamingState",value:function(){var A=this.shadowRoot.getElementById("agent-streaming");A&&A.remove(),this.streamingEl=null,this.hasStartedStreaming=!1}},{key:"showError",value:function(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 r=document.createElement("div");r.style.cssText="font-size: 14px; color: #991B1B; line-height: 1.5;",r.textContent=this.t("domainErrorMessage"),n.appendChild(o),n.appendChild(r),e.appendChild(n)}else{var i=document.createElement("div");i.className="error-message",i.textContent="string"==typeof A?A:(null==A?void 0:A.message)||A,e.appendChild(i)}e.scrollTop=e.scrollHeight}}},{key:"setActive",value:function(A){this.isActive=A,this.updateSendButtonState()}}],e&&Tn(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n}();const Kn={en:{landingTitle:"How would you like to communicate?",voiceCall:"Voice Call",textChat:"Text Chat",clickToStartCall:"Click to Start Call",realTimeVoice:"Real-time voice conversation",startCall:"Start Call",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:"איך תרצה לתקשר?",voiceCall:"שיחה קולית",textChat:"צ'אט טקסט",clickToStartCall:"לחץ להתחלת שיחה",realTimeVoice:"שיחה קולית בזמן אמת",startCall:"התחל שיחה",listening:"מקשיב...",speakFreely:"דבר בחופשיות",liveTranscript:"תמלול בזמן אמת",transcriptWillAppear:"התמלול יופיע כאן במהלך השיחה...",mute:"השתק",speaker:"רמקול",endCall:"סיים שיחה",hello:"שלום! איך אפשר לעזור?",sendMessage:"שלח הודעה או עבור למצב קולי לשיחה בזמן אמת",online:"מקוון",newChat:"צ'אט חדש",back:"חזור",close:"סגור",error:"שגיאה",typeMessage:"הקלד הודעה...",sendMessageAria:"שלח הודעה",domainNotValidated:"דומיין לא מאומת",domainErrorMessage:"דומיין זה לא ברשימת המורשים. אנא פנה למנהל המערכת כדי להוסיף את כתובת האתר שלך לרשימה."},ar:{landingTitle:"كيف تريد التواصل؟",voiceCall:"مكالمة صوتية",textChat:"دردشة نصية",clickToStartCall:"انقر لبدء المكالمة",realTimeVoice:"محادثة صوتية في الوقت الفعلي",startCall:"ابدأ المكالمة",listening:"الاستماع...",speakFreely:"تكلم بحرية",liveTranscript:"نص مباشر",transcriptWillAppear:"سيظهر النص هنا أثناء المكالمة...",mute:"كتم الصوت",speaker:"مكبر الصوت",endCall:"إنهاء المكالمة",hello:"مرحبا! كيف يمكنني المساعدة؟",sendMessage:"أرسل رسالة للبدء",online:"متصل",newChat:"محادثة جديدة",back:"رجوع",close:"إغلاق",error:"خطأ",typeMessage:"اكتب رسالة...",sendMessageAria:"إرسال رسالة",domainNotValidated:"النطاق غير معتمد",domainErrorMessage:"هذا النطاق غير مسموح به. يرجى الاتصال بالمسؤول لإضافة عنوان موقع الويب الخاص بك إلى القائمة."},ru:{landingTitle:"Как вы хотите общаться?",voiceCall:"Голосовой звонок",textChat:"Текстовый чат",clickToStartCall:"Нажмите, чтобы начать звонок",realTimeVoice:"Голосовой разговор в реальном времени",startCall:"Начать звонок",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?",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",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?",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",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?",voiceCall:"Sprachanruf",textChat:"Text-Chat",clickToStartCall:"Klicken Sie, um den Anruf zu starten",realTimeVoice:"Sprachanruf in Echtzeit",startCall:"Anruf starten",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 Pn(){var A,e,t="function"==typeof Symbol?Symbol:{},n=t.iterator||"@@iterator",o=t.toStringTag||"@@toStringTag";function r(t,n,o,r){var s=n&&n.prototype instanceof a?n:a,c=Object.create(s.prototype);return Ln(c,"_invoke",function(t,n,o){var r,a,s,c=0,l=o||[],u=!1,d={p:0,n:0,v:A,a:g,f:g.bind(A,4),d:function(e,t){return r=e,a=0,s=A,d.n=t,i}};function g(t,n){for(a=t,s=n,e=0;!u&&c&&!o&&e<l.length;e++){var o,r=l[e],g=d.p,p=r[2];t>3?(o=p===n)&&(s=r[(a=r[4])?5:(a=3,3)],r[4]=r[5]=A):r[0]<=g&&((o=t<2&&g<r[1])?(a=0,d.v=n,d.n=r[1]):g<p&&(o=t<3||r[0]>n||n>p)&&(r[4]=t,r[5]=n,d.n=p,a=0))}if(o||t>1)return i;throw u=!0,n}return function(o,l,p){if(c>1)throw TypeError("Generator is already running");for(u&&1===l&&g(l,p),a=l,s=p;(e=a<2?A:s)||!u;){r||(a?a<3?(a>1&&(d.n=-1),g(a,s)):d.n=s:d.v=s);try{if(c=2,r){if(a||(o="next"),e=r[o]){if(!(e=e.call(r,s)))throw TypeError("iterator result is not an object");if(!e.done)return e;s=e.value,a<2&&(a=0)}else 1===a&&(e=r.return)&&e.call(r),a<2&&(s=TypeError("The iterator does not provide a '"+o+"' method"),a=1);r=A}else if((e=(u=d.n<0)?s:t.call(n,d))!==i)break}catch(e){r=A,a=1,s=e}finally{c=1}}return{value:e,done:u}}}(t,o,r),!0),c}var i={};function a(){}function s(){}function c(){}e=Object.getPrototypeOf;var l=[][n]?e(e([][n]())):(Ln(e={},n,function(){return this}),e),u=c.prototype=a.prototype=Object.create(l);function d(A){return Object.setPrototypeOf?Object.setPrototypeOf(A,c):(A.__proto__=c,Ln(A,o,"GeneratorFunction")),A.prototype=Object.create(u),A}return s.prototype=c,Ln(u,"constructor",c),Ln(c,"constructor",s),s.displayName="GeneratorFunction",Ln(c,o,"GeneratorFunction"),Ln(u),Ln(u,o,"Generator"),Ln(u,n,function(){return this}),Ln(u,"toString",function(){return"[object Generator]"}),(Pn=function(){return{w:r,m:d}})()}function Ln(A,e,t,n){var o=Object.defineProperty;try{o({},"",{})}catch(A){o=0}Ln=function(A,e,t,n){function r(e,t){Ln(A,e,function(A){return this._invoke(e,t,A)})}e?o?o(A,e,{value:t,enumerable:!n,configurable:!n,writable:!n}):A[e]=t:(r("next",0),r("throw",1),r("return",2))},Ln(A,e,t,n)}function Mn(A,e,t,n,o,r,i){try{var a=A[r](i),s=a.value}catch(A){return void t(A)}a.done?e(s):Promise.resolve(s).then(n,o)}function Rn(A){return function(){var e=this,t=arguments;return new Promise(function(n,o){var r=A.apply(e,t);function i(A){Mn(r,n,o,i,a,"next",A)}function a(A){Mn(r,n,o,i,a,"throw",A)}i(void 0)})}}function Vn(A){return Vn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},Vn(A)}function _n(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 Gn(A){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?_n(Object(t),!0).forEach(function(e){jn(A,e,t[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(t)):_n(Object(t)).forEach(function(e){Object.defineProperty(A,e,Object.getOwnPropertyDescriptor(t,e))})}return A}function jn(A,e,t){return(e=Wn(e))in A?Object.defineProperty(A,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):A[e]=t,A}function Nn(A,e){for(var t=0;t<e.length;t++){var n=e[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(A,Wn(n.key),n)}}function Wn(A){var e=function(A){if("object"!=Vn(A)||!A)return A;var e=A[Symbol.toPrimitive];if(void 0!==e){var t=e.call(A,"string");if("object"!=Vn(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}(A);return"symbol"==Vn(e)?e:e+""}var Jn=function(){return A=function A(){var e,t,n,o,r,i,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(A,e){if(!(A instanceof e))throw new TypeError("Cannot call a class as a function")}(this,A),this.config=this.mergeWithDefaults(a),this.sdk=new Fe(this.config),this.isOpen=!1,this.isActive=!1,this.translations=Kn,this.currentView="landing",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 s=Gn(Gn(Gn({},this.config),this.config.voice),{},{language:(null===(e=this.config.voice)||void 0===e?void 0:e.language)||this.config.language||"en",signedUrl:this.config.signedUrl,agentSettingsOverride:this.config.agentSettingsOverride,translations:this.translations,shadowRoot:this.shadowRoot,textSDK:this.sdk,outputContainer:(null===(t=this.config.voice)||void 0===t?void 0:t.outputContainer)||"raw",outputEncoding:(null===(n=this.config.voice)||void 0===n?void 0:n.outputEncoding)||"pcm",outputSampleRate:(null===(o=this.config.voice)||void 0===o?void 0:o.outputSampleRate)||44100,outputChannels:(null===(r=this.config.voice)||void 0===r?void 0:r.outputChannels)||1,outputBitDepth:(null===(i=this.config.voice)||void 0===i?void 0:i.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 xn(s);var c=Gn(Gn(Gn({},this.config),this.config.text),{},{translations:this.translations,shadowRoot:this.shadowRoot});if(this.textInterface=new On(c,this.sdk),this.createWidget(),this.setupEventHandlers(),this.config.behavior.startOpen||this.config.behavior.autoOpen){var l,u=null===(l=this.shadowRoot)||void 0===l?void 0:l.getElementById("text-chat-panel");u&&(this.isOpen=!0,u.classList.add("open"))}this.checkAndHandleResume()},e=[{key:"checkAndHandleResume",value:function(){var A=this,e=this.voiceInterface.checkAndHandleResume();e&&(console.log("🔄 [WIDGET] Auto-resuming call from page navigation"),console.log(" From:",e.fromPage,"→ To:",e.toPage),this.open(),this.showVoice(),setTimeout(function(){A.startVoiceCall().then(function(){console.log("✅ [WIDGET] Auto-resumed call successfully")}).catch(function(A){console.error("❌ [WIDGET] Failed to auto-resume call:",A)})},100))}},{key:"open",value:function(){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"))}}},{key:"mergeWithDefaults",value:function(A){var e,t,n,o,r,i,a,s,c,l,u,d,g,p,h,f,B,w,m,v,y,C,b,Q,F,U,x,E,S,I,H,k,T,D,O,K,P,L,M,R,V,_,G,j,N,W,J,X,z,Y,Z,q,$,AA,eA,tA,nA,oA,rA,iA,aA,sA,cA,lA,uA,dA,gA,pA,hA,fA,BA,wA,mA,vA,yA,CA,bA,QA,FA,UA,xA,EA,SA,IA,HA,kA,TA,DA,OA,KA,PA,LA,MA,RA,VA,_A,GA,jA,NA,WA,JA,XA,zA,YA,ZA,qA,$A,Ae,ee,te,ne,oe,re,ie,ae,se,ce,le,ue,de,ge,pe,he,fe,Be,we,me,ve,ye,Ce,be,Qe,Fe,Ue,xe,Ee,Se,Ie,He,ke,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 Oe=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",Ke=(null===(n=A.header)||void 0===n?void 0:n.backgroundColor)||"#7C3AED";return Gn({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:Gn({type:(null===(o=A.icon)||void 0===o?void 0:o.type)||"custom",customImage:(null===(r=A.icon)||void 0===r?void 0:r.customImage)||"https://talktopc.com/logo192.png",emoji:(null===(i=A.icon)||void 0===i?void 0:i.emoji)||"🎤",text:(null===(a=A.icon)||void 0===a?void 0:a.text)||"AI",size:(null===(s=A.icon)||void 0===s?void 0:s.size)||"medium",backgroundColor:(null===(c=A.icon)||void 0===c?void 0:c.backgroundColor)||"#FFFFFF"},A.icon),position:Gn({vertical:Te.vertical||"bottom",horizontal:Te.horizontal||"right",offset:Te.offset||{x:20,y:20}},"object"===Vn(A.position)?A.position:{}),button:Gn({size:(null===(l=A.button)||void 0===l?void 0:l.size)||"medium",shape:(null===(u=A.button)||void 0===u?void 0:u.shape)||"circle",backgroundColor:(null===(d=A.button)||void 0===d?void 0:d.backgroundColor)||(null===(g=A.icon)||void 0===g?void 0:g.backgroundColor)||"#FFFFFF",hoverColor:(null===(p=A.button)||void 0===p?void 0:p.hoverColor)||"#D3D3D3",shadow:!1!==(null===(h=A.button)||void 0===h?void 0:h.shadow),shadowColor:(null===(f=A.button)||void 0===f?void 0:f.shadowColor)||"rgba(0,0,0,0.15)",primaryColor:(null===(B=A.button)||void 0===B?void 0:B.backgroundColor)||(null===(w=A.icon)||void 0===w?void 0:w.backgroundColor)||"#FFFFFF"},A.button),panel:Gn({width:(null===(m=A.panel)||void 0===m?void 0:m.width)||350,height:(null===(v=A.panel)||void 0===v?void 0:v.height)||500,borderRadius:(null===(y=A.panel)||void 0===y?void 0:y.borderRadius)||12,backgroundColor:(null===(C=A.panel)||void 0===C?void 0:C.backgroundColor)||"#FFFFFF",backdropFilter:(null===(b=A.panel)||void 0===b?void 0:b.backdropFilter)||null,border:(null===(Q=A.panel)||void 0===Q?void 0:Q.border)||"1px solid #E5E7EB"},A.panel),voice:Gn({micButtonColor:(null===(F=A.voice)||void 0===F?void 0:F.micButtonColor)||(null===(U=A.panel)||void 0===U?void 0:U.micButtonColor)||Oe,micButtonActiveColor:(null===(x=A.voice)||void 0===x?void 0:x.micButtonActiveColor)||(null===(E=A.panel)||void 0===E?void 0:E.micButtonActiveColor)||"#EF4444",micButtonHint:Gn(Gn({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===(H=A.voice)||void 0===H||null===(H=H.micButtonHint)||void 0===H?void 0:H.color)||(null===(k=A.panel)||void 0===k||null===(k=k.micButtonHint)||void 0===k?void 0:k.color)||"#6B7280",fontSize:(null===(T=A.voice)||void 0===T||null===(T=T.micButtonHint)||void 0===T?void 0:T.fontSize)||(null===(D=A.panel)||void 0===D||null===(D=D.micButtonHint)||void 0===D?void 0:D.fontSize)||"12px"},null===(O=A.voice)||void 0===O?void 0:O.micButtonHint),null===(K=A.panel)||void 0===K?void 0:K.micButtonHint),avatarBackgroundColor:(null===(P=A.voice)||void 0===P?void 0:P.avatarBackgroundColor)||"#667eea",avatarActiveBackgroundColor:(null===(L=A.voice)||void 0===L?void 0:L.avatarActiveBackgroundColor)||"#667eea",statusTitleColor:(null===(M=A.voice)||void 0===M?void 0:M.statusTitleColor)||"#1e293b",statusSubtitleColor:(null===(R=A.voice)||void 0===R?void 0:R.statusSubtitleColor)||"#64748b",startCallButtonColor:(null===(V=A.voice)||void 0===V?void 0:V.startCallButtonColor)||"#667eea",startCallButtonTextColor:(null===(_=A.voice)||void 0===_?void 0:_.startCallButtonTextColor)||"#FFFFFF",startCallTitle:(null===(G=A.voice)||void 0===G?void 0:G.startCallTitle)||null,startCallSubtitle:(null===(j=A.voice)||void 0===j?void 0:j.startCallSubtitle)||null,startCallButtonText:(null===(N=A.voice)||void 0===N?void 0:N.startCallButtonText)||null,transcriptBackgroundColor:(null===(W=A.voice)||void 0===W?void 0:W.transcriptBackgroundColor)||"#FFFFFF",transcriptTextColor:(null===(J=A.voice)||void 0===J?void 0:J.transcriptTextColor)||"#1e293b",transcriptLabelColor:(null===(X=A.voice)||void 0===X?void 0:X.transcriptLabelColor)||"#94a3b8",controlButtonColor:(null===(z=A.voice)||void 0===z?void 0:z.controlButtonColor)||"#FFFFFF",controlButtonSecondaryColor:(null===(Y=A.voice)||void 0===Y?void 0:Y.controlButtonSecondaryColor)||"#64748b",endCallButtonColor:(null===(Z=A.voice)||void 0===Z?void 0:Z.endCallButtonColor)||"#ef4444",language:(null===(q=A.voice)||void 0===q?void 0:q.language)||A.language||"en"},A.voice),text:Gn({sendButtonColor:(null===($=A.text)||void 0===$?void 0:$.sendButtonColor)||(null===(AA=A.panel)||void 0===AA?void 0:AA.sendButtonColor)||"#7C3AED",sendButtonHoverColor:(null===(eA=A.text)||void 0===eA?void 0:eA.sendButtonHoverColor)||(null===(tA=A.panel)||void 0===tA?void 0:tA.sendButtonHoverColor)||"#6D28D9",sendButtonActiveColor:(null===(nA=A.text)||void 0===nA?void 0:nA.sendButtonActiveColor)||(null===(oA=A.panel)||void 0===oA?void 0:oA.sendButtonActiveColor)||"#6D28D9",sendButtonText:(null===(rA=A.text)||void 0===rA?void 0:rA.sendButtonText)||(null===(iA=A.panel)||void 0===iA?void 0:iA.sendButtonText)||"➤",sendButtonTextColor:(null===(aA=A.text)||void 0===aA?void 0:aA.sendButtonTextColor)||(null===(sA=A.panel)||void 0===sA?void 0:sA.sendButtonTextColor)||"#FFFFFF",sendButtonFontSize:(null===(cA=A.text)||void 0===cA?void 0:cA.sendButtonFontSize)||(null===(lA=A.panel)||void 0===lA?void 0:lA.sendButtonFontSize)||"18px",sendButtonFontWeight:(null===(uA=A.text)||void 0===uA?void 0:uA.sendButtonFontWeight)||(null===(dA=A.panel)||void 0===dA?void 0:dA.sendButtonFontWeight)||"500",sendButtonHint:Gn(Gn({text:(null===(gA=A.text)||void 0===gA||null===(gA=gA.sendButtonHint)||void 0===gA?void 0:gA.text)||(null===(pA=A.panel)||void 0===pA||null===(pA=pA.sendButtonHint)||void 0===pA?void 0:pA.text)||"",color:(null===(hA=A.text)||void 0===hA||null===(hA=hA.sendButtonHint)||void 0===hA?void 0:hA.color)||(null===(fA=A.panel)||void 0===fA||null===(fA=fA.sendButtonHint)||void 0===fA?void 0:fA.color)||"#6B7280",fontSize:(null===(BA=A.text)||void 0===BA||null===(BA=BA.sendButtonHint)||void 0===BA?void 0:BA.fontSize)||(null===(wA=A.panel)||void 0===wA||null===(wA=wA.sendButtonHint)||void 0===wA?void 0:wA.fontSize)||"12px"},null===(mA=A.text)||void 0===mA?void 0:mA.sendButtonHint),null===(vA=A.panel)||void 0===vA?void 0:vA.sendButtonHint),inputPlaceholder:(null===(yA=A.text)||void 0===yA?void 0:yA.inputPlaceholder)||(null===(CA=A.panel)||void 0===CA?void 0:CA.inputPlaceholder)||"Type your message...",inputBorderColor:(null===(bA=A.text)||void 0===bA?void 0:bA.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===(xA=A.text)||void 0===xA?void 0:xA.inputBackgroundColor)||(null===(EA=A.panel)||void 0===EA?void 0:EA.inputBackgroundColor)||"#FFFFFF",inputTextColor:(null===(SA=A.text)||void 0===SA?void 0:SA.inputTextColor)||(null===(IA=A.panel)||void 0===IA?void 0:IA.inputTextColor)||"#1F2937",inputFontSize:(null===(HA=A.text)||void 0===HA?void 0:HA.inputFontSize)||(null===(kA=A.panel)||void 0===kA?void 0:kA.inputFontSize)||"14px",inputBorderRadius:(null===(TA=A.text)||void 0===TA?void 0:TA.inputBorderRadius)||(null===(DA=A.panel)||void 0===DA?void 0:DA.inputBorderRadius)||20,inputPadding:(null===(OA=A.text)||void 0===OA?void 0:OA.inputPadding)||(null===(KA=A.panel)||void 0===KA?void 0:KA.inputPadding)||"6px 14px"},A.text),landing:Gn({backgroundColor:(null===(PA=A.landing)||void 0===PA?void 0:PA.backgroundColor)||"linear-gradient(180deg, #f8fafc 0%, #e0e7ff 100%)",logo:(null===(LA=A.landing)||void 0===LA?void 0:LA.logo)||"🤖",title:(null===(MA=A.landing)||void 0===MA?void 0:MA.title)||null,titleColor:(null===(RA=A.landing)||void 0===RA?void 0:RA.titleColor)||"#1e293b",modeCardBackgroundColor:(null===(VA=A.landing)||void 0===VA?void 0:VA.modeCardBackgroundColor)||"#FFFFFF",modeCardBorderColor:(null===(_A=A.landing)||void 0===_A?void 0:_A.modeCardBorderColor)||"#E2E8F0",modeCardHoverBorderColor:(null===(GA=A.landing)||void 0===GA?void 0:GA.modeCardHoverBorderColor)||Ke,modeCardIconBackgroundColor:(null===(jA=A.landing)||void 0===jA?void 0:jA.modeCardIconBackgroundColor)||Ke,modeCardTitleColor:(null===(NA=A.landing)||void 0===NA?void 0:NA.modeCardTitleColor)||"#111827",voiceCardIcon:(null===(WA=A.landing)||void 0===WA?void 0:WA.voiceCardIcon)||"🎤",textCardIcon:(null===(JA=A.landing)||void 0===JA?void 0:JA.textCardIcon)||"💬",voiceCardTitle:(null===(XA=A.landing)||void 0===XA?void 0:XA.voiceCardTitle)||null,textCardTitle:(null===(zA=A.landing)||void 0===zA?void 0:zA.textCardTitle)||null},A.landing),header:Gn({title:(null===(YA=A.header)||void 0===YA?void 0:YA.title)||"Chat Assistant",showTitle:!1!==(null===(ZA=A.header)||void 0===ZA?void 0:ZA.showTitle),backgroundColor:(null===(qA=A.header)||void 0===qA?void 0:qA.backgroundColor)||"#7C3AED",textColor:(null===($A=A.header)||void 0===$A?void 0:$A.textColor)||"#FFFFFF",showCloseButton:!1!==(null===(Ae=A.header)||void 0===Ae?void 0:Ae.showCloseButton)},A.header),footer:Gn({show:!1!==(null===(ee=A.footer)||void 0===ee?void 0:ee.show),backgroundColor:(null===(te=A.footer)||void 0===te?void 0:te.backgroundColor)||"#f9fafb",textColor:(null===(ne=A.footer)||void 0===ne?void 0:ne.textColor)||"#9ca3af",hoverColor:(null===(oe=A.footer)||void 0===oe?void 0:oe.hoverColor)||"#7C3AED"},A.footer),tooltips:Gn({newChat:(null===(re=A.tooltips)||void 0===re?void 0:re.newChat)||null,back:(null===(ie=A.tooltips)||void 0===ie?void 0:ie.back)||null,close:(null===(ae=A.tooltips)||void 0===ae?void 0:ae.close)||null,mute:(null===(se=A.tooltips)||void 0===se?void 0:se.mute)||null,speaker:(null===(ce=A.tooltips)||void 0===ce?void 0:ce.speaker)||null,endCall:(null===(le=A.tooltips)||void 0===le?void 0:le.endCall)||null},A.tooltips),messages:Gn({userBackgroundColor:(null===(ue=A.messages)||void 0===ue?void 0:ue.userBackgroundColor)||"#E5E7EB",agentBackgroundColor:(null===(de=A.messages)||void 0===de?void 0:de.agentBackgroundColor)||"#F3F4F6",systemBackgroundColor:(null===(ge=A.messages)||void 0===ge?void 0:ge.systemBackgroundColor)||"#DCFCE7",errorBackgroundColor:(null===(pe=A.messages)||void 0===pe?void 0:pe.errorBackgroundColor)||"#FEE2E2",textColor:(null===(he=A.messages)||void 0===he?void 0:he.textColor)||"#1F2937",fontSize:(null===(fe=A.messages)||void 0===fe?void 0:fe.fontSize)||"14px",borderRadius:(null===(Be=A.messages)||void 0===Be?void 0:Be.borderRadius)||8},A.messages),animation:Gn({enableHover:!1!==(null===(we=A.animation)||void 0===we?void 0:we.enableHover),enablePulse:!1!==(null===(me=A.animation)||void 0===me?void 0:me.enablePulse),enableSlide:!1!==(null===(ve=A.animation)||void 0===ve?void 0:ve.enableSlide),duration:(null===(ye=A.animation)||void 0===ye?void 0:ye.duration)||.3},A.animation),behavior:Gn({autoOpen:(null===(Ce=A.behavior)||void 0===Ce?void 0:Ce.autoOpen)||!1,startOpen:(null===(be=A.behavior)||void 0===be?void 0:be.startOpen)||!1,hidden:(null===(Qe=A.behavior)||void 0===Qe?void 0:Qe.hidden)||!1,autoConnect:(null===(Fe=A.behavior)||void 0===Fe?void 0:Fe.autoConnect)||!1,showWelcomeMessage:!1!==(null===(Ue=A.behavior)||void 0===Ue?void 0:Ue.showWelcomeMessage),welcomeMessage:(null===(xe=A.behavior)||void 0===xe?void 0:xe.welcomeMessage)||"Hello! How can I help you today?",enableVoiceMode:void 0===(null===(Ee=A.behavior)||void 0===Ee?void 0:Ee.enableVoiceMode)||A.behavior.enableVoiceMode,mode:(null===(Se=A.behavior)||void 0===Se?void 0:Se.mode)||"unified"},A.behavior),accessibility:Gn({ariaLabel:(null===(Ie=A.accessibility)||void 0===Ie?void 0:Ie.ariaLabel)||"Chat Assistant",ariaDescription:(null===(He=A.accessibility)||void 0===He?void 0:He.ariaDescription)||"Click to open chat assistant",keyboardNavigation:!1!==(null===(ke=A.accessibility)||void 0===ke?void 0:ke.keyboardNavigation)},A.accessibility),customStyles:A.customStyles||"",useShadowDOM:!1!==A.useShadowDOM,variables:A.variables||{},forceConversationId:A.forceConversationId,onConversationStart:A.onConversationStart,onConversationEnd:A.onConversationEnd,onBargeIn:A.onBargeIn,onAudioStartPlaying:A.onAudioStartPlaying,onAudioStoppedPlaying:A.onAudioStoppedPlaying,onSubtitleDisplay:A.onSubtitleDisplay,primaryColor:Oe},"string"==typeof A.position?{positionString:A.position}:{})}},{key:"setupEventHandlers",value:function(){var A=this;this.sdk.on("domainError",function(e){A.textInterface.showError(e),A.textInterface.stopStreamingState()}),this.sdk.on("error",function(e){e&&("DOMAIN_NOT_WHITELISTED"===e.message||e.message&&e.message.includes("Domain not whitelisted"))||(A.textInterface.showError(e.message||e),A.textInterface.stopStreamingState())}),this.sdk.on("chunk",function(e){A.textInterface.appendStreamingChunk(e)}),this.sdk.on("done",function(e){var t=e.text;A.textInterface.finalizeStreaming(t)})}},{key:"createShadowHost",value:function(){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)}},{key:"createRegularContainer",value:function(){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}},{key:"createWidget",value:function(){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"))}},{key:"injectStylesIntoHead",value:function(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,r={small:20,medium:28,large:36,xl:44}[null===(t=this.config.icon)||void 0===t?void 0:t.size]||28,i=this.generatePositionStyles(),a=this.generateCSS(i,o,r),s=document.createElement("style");s.id="ttp-widget-styles",s.textContent=A+"\n"+a,this.config.customStyles&&(s.textContent+="\n"+this.config.customStyles),document.head.appendChild(s)}},{key:"generateWidgetHTML",value:function(){var A,e,t,n,o=this,r=(this.config.position,this.config.button),i=this.config.icon,a=(this.config.panel,this.config.header),s=(this.config.animation,{small:50,medium:60,large:70,xl:80}[r.size]||60),c={small:20,medium:28,large:36,xl:44}[i.size]||28,l=this.generatePositionStyles(),u=this.generateIconHTML(c),d=this.config.behavior.mode||"unified",g="unified"===d,p="unified"===d||"voice-only"===d,h="unified"===d||"text-only"===d,f=function(A){var e=o.config.language||"en";return(o.translations[e]||o.translations.en)[A]||A},B=function(A){var e,t=null===(e=o.config.tooltips)||void 0===e?void 0:e[A];return null!=t?t:{newChat:f("newChat"),back:f("back"),close:f("close"),mute:f("mute"),speaker:f("speaker"),endCall:f("endCall")}[A]||""},w=this.config.useShadowDOM?"\n <style>\n ".concat(this.generateCSS(l,s,c),"\n ").concat(this.config.customStyles,"\n </style>\n "):"";return"\n ".concat(w,"\n \n ").concat(this.config.behavior.hidden?"":'\n <button id="text-chat-button" \n aria-label="'.concat(this.config.accessibility.ariaLabel,'"\n aria-description="').concat(this.config.accessibility.ariaDescription,'">\n ').concat(u,"\n </button>\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(a.backgroundColor,"; color: ").concat(a.textColor,';">\n <div>\n ').concat(a.showTitle?'<div class="header-title">'.concat(a.title,"</div>"):"",'\n <div class="header-status">\n <span class="status-dot"></span>\n <span>').concat(f("online"),'</span>\n </div>\n </div>\n \n <div style="display: flex; gap: 12px; align-items: center;">\n \x3c!-- New Chat Button (hide on landing screen, show otherwise) --\x3e\n <button class="header-icon new-chat-btn" id="newChatBtn" title="').concat(B("newChat"),'" style="').concat(g?"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"===d?'<button class="header-icon back-btn" id="backBtn" title="'.concat(B("back"),'" style="display: none;">\n <span style="font-size: 16px;">‹</span>\n </button>'):"","\n \n \x3c!-- Close Button --\x3e\n ").concat(a.showCloseButton?'<button class="header-icon close-btn" id="closeBtn" title="'+B("close")+'"><span style="font-size: 18px; font-weight: bold;">×</span></button>':"","\n </div>\n </div>\n\n ").concat(g?'\n <div class="landing-screen" id="landingScreen">\n <div class="landing-logo">'.concat((null===(A=this.config.landing)||void 0===A?void 0:A.logo)||"🤖",'</div>\n <div class="landing-title">').concat((null===(e=this.config.landing)||void 0===e?void 0:e.title)||f("landingTitle"),'</div>\n <div class="mode-selection">\n ').concat(p?'<div class="mode-card voice" id="mode-card-voice">\n <div class="mode-card-icon">🎤</div>\n <div class="mode-card-title">'.concat((null===(t=this.config.landing)||void 0===t?void 0:t.voiceCardTitle)||f("voiceCall"),"</div>\n </div>"):"","\n ").concat(h?'<div class="mode-card text" id="mode-card-text">\n <div class="mode-card-icon">💬</div>\n <div class="mode-card-title">'.concat((null===(n=this.config.landing)||void 0===n?void 0:n.textCardTitle)||f("textChat"),"</div>\n </div>"):"","\n </div>\n </div>"):"","\n\n ").concat(p?this.voiceInterface.generateHTML():"","\n ").concat(h?this.textInterface.generateHTML():"","\n ").concat(this.generateFooterHTML(),"\n </div>\n </div>\n </div>\n ")}},{key:"generateFooterHTML",value:function(){var A=this.config.footer;if(!A.show)return"";var e=encodeURIComponent(window.location.hostname||"widget"),t="https://talktopc.com?ref=widget&source=".concat(e);return'\n <div class="widget-footer" style="\n height: 36px;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background-color: '.concat(A.backgroundColor,';\n border-top: 1px solid #e5e7eb;\n flex-shrink: 0;\n ">\n <a \n href="').concat(t,'" \n target="_blank" \n rel="noopener noreferrer"\n aria-label="Visit TalkToPC website"\n class="footer-brand-link"\n style="\n display: flex;\n flex-direction: column;\n align-items: center;\n text-decoration: none;\n color: ').concat(A.textColor,';\n transition: color 0.2s ease;\n "\n onmouseover="this.style.color=\'').concat(A.hoverColor,"'\"\n onmouseout=\"this.style.color='").concat(A.textColor,'\'"\n >\n <span style="font-size: 11px; line-height: 1.3;">\n ⚡ Powered by <strong>TalkToPC</strong>\n </span>\n <span style="font-size: 9px; opacity: 0.7; line-height: 1.2;">\n https://talktopc.com\n </span>\n </a>\n </div>\n ')}},{key:"generatePositionStyles",value:function(){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}},{key:"generateIconHTML",value:function(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>')}}},{key:"generateCSS",value:function(A,e,t){var n,o,r,i,a,s,c,l,u,d,g,p=this.config.button,h=this.config.icon,f=this.config.panel,B=this.config.header,w=(this.config.messages,this.config.animation),m=this.config.behavior.mode||"unified",v="unified"===m||"voice-only"===m,y="unified"===m||"text-only"===m,C=!1===this.config.useShadowDOM?" !important":"",b=B.backgroundColor;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: fixed;\n ").concat("bottom"===this.config.position.vertical?"bottom: ".concat((null===(n=this.config.position.offset)||void 0===n?void 0:n.y)||20,"px;"):"top: ".concat((null===(o=this.config.position.offset)||void 0===o?void 0:o.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===(i=this.config.position.offset)||void 0===i?void 0:i.x)||20,"px;"),"\n width: ").concat(e,"px;\n height: ").concat(e,"px;\n border-radius: ").concat("circle"===p.shape?"50%":"square"===p.shape?"0":"12px",";\n background: ").concat(p.backgroundColor||h.backgroundColor||"#7C3AED",";\n border: none;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: all ").concat(w.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: 10001;\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 {\n right: 10px !important;\n bottom: 10px !important;\n left: auto !important;\n top: auto !important;\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 {\n right: 8px !important;\n bottom: 8px !important;\n left: auto !important;\n top: auto !important;\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(w.enableHover?"\n #text-chat-button:hover {\n ".concat(p.hoverColor?"background: ".concat(p.hoverColor,";"):"","\n transform: scale(1.05);\n box-shadow: 0 8px 20px rgba(102, 126, 234, 0.5);\n }\n "):"","\n \n #text-chat-panel {\n display: none").concat(C,";\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(f.width,"px;\n max-width: calc(100vw - 40px);\n height: ").concat(f.height,"px;\n max-height: calc(100vh - ").concat(e,"px - 40px - 20px); /* Account for footer height */\n background: transparent;\n border-radius: ").concat(f.borderRadius,"px;\n border: none;\n flex-direction: column;\n overflow: hidden;\n ").concat(f.backdropFilter?"backdrop-filter: ".concat(f.backdropFilter,";"):"","\n ").concat(w.enableSlide?"transition: all ".concat(w.duration,"s ease;"):"","\n box-sizing: border-box;\n }\n \n #text-chat-panel.open {\n display: flex").concat(C,";\n ").concat(w.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(f.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(f.borderRadius,"px; border: ").concat(f.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%; min-height: 0; background: #FFFFFF; overflow: hidden; display: flex; flex-direction: column; border-radius: ").concat(f.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 min-height: 0;\n overflow-y: auto;\n overflow-x: hidden;\n }\n \n /* Header should not scroll */\n #text-chat-panel .widget-header {\n padding: 12px 16px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-top-left-radius: ").concat(f.borderRadius,"px;\n border-top-right-radius: ").concat(f.borderRadius,"px;\n flex-shrink: 0;\n min-height: 60px;\n box-sizing: border-box;\n }\n #text-chat-panel .header-title { font-size: 16px; font-weight: 600; }\n #text-chat-panel .header-status { display: flex; align-items: center; gap: 8px; font-size: 12px; opacity: 0.9; }\n #text-chat-panel .status-dot { width: 8px; height: 8px; background: #4ade80; border-radius: 50%; animation: pulse 2s ease-in-out infinite; }\n @keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }\n /* Header icon buttons */\n .header-icon {\n background: rgba(255, 255, 255, 0.2);\n border: none;\n color: white;\n width: 36px;\n height: 36px;\n min-width: 36px;\n min-height: 36px;\n border-radius: 50%;\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 }\n \n .header-icon:hover {\n background: rgba(255, 255, 255, 0.3);\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 /* Landing and mode selection (shown only if voice enabled) */\n .landing-screen { \n display: none").concat(C,"; \n flex: 1; \n padding: 20px; \n background: ").concat((null===(a=this.config.landing)||void 0===a?void 0:a.backgroundColor)||"linear-gradient(180deg, #f8fafc 0%, #e0e7ff 100%)","; \n align-items: center; \n justify-content: flex-start; \n flex-direction: column; \n gap: 16px; \n overflow-y: auto; \n min-height: 0; \n }\n .landing-screen.active { display: flex").concat(C,"; }\n .landing-logo { font-size: 48px; }\n .landing-title { \n font-size: 20px; \n color: ").concat((null===(s=this.config.landing)||void 0===s?void 0:s.titleColor)||"#1e293b","; \n font-weight: 700; \n margin-bottom: 20px; \n text-align: center;\n width: 100%;\n }\n .mode-selection { display: flex; gap: 16px; width: 100%; justify-content: center; }\n .mode-card { \n flex: 1; \n max-width: 180px; \n background: ").concat((null===(c=this.config.landing)||void 0===c?void 0:c.modeCardBackgroundColor)||"#FFFFFF","; \n border: 2px solid ").concat((null===(l=this.config.landing)||void 0===l?void 0:l.modeCardBorderColor)||"#E2E8F0","; \n border-radius: 20px; \n padding: 20px 12px; \n cursor: pointer; \n display: flex; \n flex-direction: column; \n align-items: center; \n gap: 8px; \n transition: transform ").concat(w.duration,"s ease, box-shadow ").concat(w.duration,"s ease, border-color ").concat(w.duration,"s ease; \n box-shadow: 0 4px 12px rgba(0,0,0,0.05); \n }\n .mode-card:hover { \n transform: translateY(-6px); \n box-shadow: 0 12px 24px rgba(102, 126, 234, 0.2); \n border-color: ").concat((null===(u=this.config.landing)||void 0===u?void 0:u.modeCardHoverBorderColor)||b,"; \n }\n .mode-card-icon { \n width: 60px; \n height: 60px; \n display: flex; \n align-items: center; \n justify-content: center; \n border-radius: 50%; \n background: ").concat((null===(d=this.config.landing)||void 0===d?void 0:d.modeCardIconBackgroundColor)||b,"; \n color: #fff; \n font-size: 32px; \n }\n .mode-card-title { \n color: ").concat((null===(g=this.config.landing)||void 0===g?void 0:g.modeCardTitleColor)||"#111827","; \n font-weight: 600; \n text-align: center;\n width: 100%;\n }\n\n ").concat(v?this.voiceInterface.generateCSS():"","\n ").concat(y?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 ")}},{key:"setupWidgetEvents",value:function(){var A=this;if(this.shadowRoot){var e=this.shadowRoot.getElementById("text-chat-button");e&&(e.onclick=function(){return A.togglePanel()});var t=this.shadowRoot.getElementById("closeBtn");t&&(t.onclick=function(){return A.togglePanel()});var n=this.config.behavior.mode||"unified",o="unified"===n,r="unified"===n||"voice-only"===n,i="unified"===n||"text-only"===n,a=this.shadowRoot.getElementById("backBtn"),s=this.shadowRoot.getElementById("landingScreen"),c=this.shadowRoot.getElementById("mode-card-voice"),l=this.shadowRoot.getElementById("mode-card-text"),u=this.shadowRoot.getElementById("textInterface"),d=this.shadowRoot.getElementById("voiceInterface");a&&(a.onclick=function(){return A.showLanding()}),o?(c&&(c.onclick=function(){return A.showVoice()}),l&&(l.onclick=function(){return A.showText()}),"text"===this.currentView?(s&&s.classList.remove("active"),u&&u.classList.add("active"),d&&d.classList.remove("active"),a&&"unified"===n&&a.classList.add("visible"),g&&(g.style.display="")):"voice"===this.currentView?(s&&s.classList.remove("active"),u&&u.classList.remove("active"),d&&d.classList.add("active"),a&&"unified"===n&&a.classList.add("visible"),g&&(g.style.display="none")):(this.currentView="landing",s&&s.classList.add("active"),u&&u.classList.remove("active"),d&&d.classList.remove("active"),a&&"unified"===n&&a.classList.remove("visible"))):"voice-only"===n?(d&&d.classList.add("active"),u&&u.classList.remove("active"),s&&s.classList.remove("active")):"text-only"===n&&(u&&u.classList.add("active"),d&&d.classList.remove("active"),s&&s.classList.remove("active")),r&&(console.log("⚙️ Setting up voice interface event handlers"),this.voiceInterface.setupEventHandlers()),i&&(console.log("⚙️ Setting up text interface event handlers"),this.textInterface.setupEventHandlers());var g=this.shadowRoot.getElementById("newChatBtn");g&&(g.onclick=function(){return A.textInterface.startNewChat()},o&&(g.style.display="none")),this.config.accessibility.keyboardNavigation&&this.setupKeyboardNavigation()}}},{key:"startNewChat",value:function(){this.textInterface.startNewChat()}},{key:"showLanding",value:function(){if(this.shadowRoot&&"unified"===(this.config.behavior.mode||"unified")){this.currentView="landing";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.add("active"),e&&e.classList.remove("active"),t&&t.classList.remove("active"),n&&n.classList.remove("visible"),o&&(o.style.display="none")}}},{key:"showText",value:function(){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="")}}},{key:"showVoice",value:function(){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 r=this.config.behavior.mode||"unified";n&&"unified"===r&&n.classList.add("visible"),o&&(o.style.display="none")}}},{key:"setupKeyboardNavigation",value:function(){var A=this;document.addEventListener("keydown",function(e){"Escape"===e.key&&A.isOpen&&A.togglePanel()})}},{key:"togglePanel",value:function(){var A=this;if(this.shadowRoot){this.isOpen=!this.isOpen;var e=this.shadowRoot.getElementById("text-chat-panel");e&&e.classList.toggle("open"),this.isOpen&&setTimeout(function(){var e=A.shadowRoot.getElementById("messageInput");e&&e.focus()},100),this.isOpen&&!this.isActive&&this.config.behavior.autoConnect&&this.startChat()}}},{key:"startChat",value:(r=Rn(Pn().m(function A(){return Pn().w(function(A){for(;;)switch(A.n){case 0:this.isActive=!0,this.textInterface.setActive(!0);case 1:return A.a(2)}},A,this)})),function(){return r.apply(this,arguments)})},{key:"sendMessage",value:(o=Rn(Pn().m(function A(){return Pn().w(function(A){for(;;)switch(A.n){case 0:return A.n=1,this.textInterface.sendMessage();case 1:return A.a(2)}},A,this)})),function(){return o.apply(this,arguments)})},{key:"updateSendButtonState",value:function(){this.textInterface.updateSendButtonState()}},{key:"getSignedUrl",value:(n=Rn(Pn().m(function A(){var e,t;return Pn().w(function(A){for(;;)switch(A.n){case 0:if(!this.config.signedUrl){A.n=1;break}return A.a(2,this.config.signedUrl);case 1:if(this.config.agentId){A.n=2;break}throw new Error("agentId is required when signedUrl is not provided");case 2:return e=this.config.websocketUrl||"wss://backend.talktopc.com/ws/conv",(t=new URLSearchParams).append("agentId",this.config.agentId),this.config.appId&&t.append("appId",this.config.appId),!1!==this.config.demo&&t.append("demo","true"),A.a(2,"".concat(e,"?").concat(t.toString()))}},A,this)})),function(){return n.apply(this,arguments)})},{key:"addMessage",value:function(A,e){this.textInterface.addMessage(A,e)}},{key:"beginStreaming",value:function(){this.textInterface.beginStreaming()}},{key:"appendStreamingChunk",value:function(A){this.textInterface.appendStreamingChunk(A)}},{key:"finalizeStreaming",value:function(A){this.textInterface.finalizeStreaming(A)}},{key:"stopStreamingState",value:function(){this.textInterface.stopStreamingState()}},{key:"showError",value:function(A){this.textInterface.showError(A)}},{key:"updateStatus",value:function(A){}},{key:"updateConfig",value:function(A){var e,t,n,o,r,i,a,s,c,l=Gn({},this.config);A.panel&&(l.panel=Gn(Gn({},this.config.panel),A.panel)),A.voice&&(l.voice=Gn(Gn({},this.config.voice),A.voice),A.voice.micButtonHint&&(l.voice.micButtonHint=Gn(Gn({},null===(s=this.config.voice)||void 0===s?void 0:s.micButtonHint),A.voice.micButtonHint))),A.text&&(l.text=Gn(Gn({},this.config.text),A.text),A.text.sendButtonHint&&(l.text.sendButtonHint=Gn(Gn({},null===(c=this.config.text)||void 0===c?void 0:c.sendButtonHint),A.text.sendButtonHint))),void 0!==A.language&&(l.language=A.language),void 0!==A.language&&(["he","ar"].includes(A.language)?l.direction="rtl":void 0===A.direction&&(l.direction="ltr")),A.translations&&(l.translations=A.translations,this.translations=A.translations),A.button&&(l.button=Gn(Gn({},this.config.button),A.button)),A.header&&(l.header=Gn(Gn({},this.config.header),A.header)),A.icon&&(l.icon=Gn(Gn({},this.config.icon),A.icon)),A.messages&&(l.messages=Gn(Gn({},this.config.messages),A.messages)),A.animation&&(l.animation=Gn(Gn({},this.config.animation),A.animation)),A.behavior&&(l.behavior=Gn(Gn({},this.config.behavior),A.behavior)),A.accessibility&&(l.accessibility=Gn(Gn({},this.config.accessibility),A.accessibility)),A.tooltips&&(l.tooltips=Gn(Gn({},this.config.tooltips),A.tooltips)),A.landing&&(l.landing=Gn(Gn({},this.config.landing),A.landing)),A.footer&&(l.footer=Gn(Gn({},this.config.footer),A.footer)),void 0!==A.direction&&void 0===l.direction&&(l.direction=A.direction),void 0!==A.primaryColor&&(l.primaryColor=A.primaryColor),l.onConversationStart=void 0!==A.onConversationStart?A.onConversationStart:this.config.onConversationStart,l.onConversationEnd=void 0!==A.onConversationEnd?A.onConversationEnd:this.config.onConversationEnd,l.onBargeIn=void 0!==A.onBargeIn?A.onBargeIn:this.config.onBargeIn,l.onAudioStartPlaying=void 0!==A.onAudioStartPlaying?A.onAudioStartPlaying:this.config.onAudioStartPlaying,l.onAudioStoppedPlaying=void 0!==A.onAudioStoppedPlaying?A.onAudioStoppedPlaying:this.config.onAudioStoppedPlaying,l.onSubtitleDisplay=void 0!==A.onSubtitleDisplay?A.onSubtitleDisplay:this.config.onSubtitleDisplay,void 0!==A.useShadowDOM&&(l.useShadowDOM=A.useShadowDOM),Object.keys(A).forEach(function(e){["panel","button","header","footer","icon","messages","direction","voice","text","animation","behavior","accessibility","language","tooltips","landing","primaryColor","useShadowDOM","onConversationStart","onConversationEnd","onBargeIn","onAudioStartPlaying","onAudioStoppedPlaying","onSubtitleDisplay"].includes(e)||(l[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(l),!1!==this.config.useShadowDOM===u&&this.container){var d=document.getElementById("ttp-widget-shadow-host");d&&!this.config.useShadowDOM&&d.remove();var g=document.getElementById("ttp-widget-container");if(g&&this.config.useShadowDOM&&g.remove(),this.config.useShadowDOM)if(this.shadowRoot)this.container=this.shadowRoot;else{var p=document.getElementById("ttp-widget-shadow-host");p?(this.shadowRoot=p.shadowRoot,this.container=this.shadowRoot):(this.createShadowHost(),this.container=this.shadowRoot)}else{if(this.regularContainer)this.container=this.regularContainer;else{var h=document.getElementById("ttp-widget-container");h?(this.regularContainer=h,this.container=h):(this.createRegularContainer(),this.container=this.regularContainer)}this.shadowRoot=document}}else{var f=document.getElementById("ttp-widget-shadow-host");f&&f.remove();var B=document.getElementById("ttp-widget-container");if(B&&B.remove(),!1===u){var w=document.getElementById("ttp-widget-styles");w&&w.remove()}this.config.useShadowDOM?(this.createShadowHost(),this.container=this.shadowRoot):(this.createRegularContainer(),this.container=this.regularContainer,this.shadowRoot=document)}var m=this.config.language||"en",v=Gn(Gn(Gn({},this.config),this.config.voice),{},{language:m,translations:this.translations,shadowRoot:this.shadowRoot,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===(r=this.config.voice)||void 0===r?void 0:r.outputSampleRate)||44100,outputChannels:(null===(i=this.config.voice)||void 0===i?void 0:i.outputChannels)||1,outputBitDepth:(null===(a=this.config.voice)||void 0===a?void 0:a.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 xn(v);var y=Gn(Gn(Gn({},this.config),this.config.text),{},{language:m,translations:this.translations,shadowRoot:this.shadowRoot});this.textInterface=new On(y,this.sdk),this.createWidget(),this.textInterface&&this.textInterface.updateInputAttributes&&this.textInterface.updateInputAttributes()}},{key:"destroy",value:function(){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()}},{key:"startVoiceCall",value:(t=Rn(Pn().m(function A(){return Pn().w(function(A){for(;;)switch(A.n){case 0:return A.n=1,this.voiceInterface.startVoiceCall();case 1:this._flushPendingClientTools();case 2:return A.a(2)}},A,this)})),function(){return t.apply(this,arguments)})},{key:"endVoiceCall",value:function(){this.voiceInterface.endVoiceCall()}},{key:"toggleMute",value:function(){this.voiceInterface.toggleMute()}},{key:"toggleSpeaker",value:function(){this.voiceInterface.toggleSpeaker()}},{key:"registerToolHandler",value:function(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)}},{key:"unregisterToolHandler",value:function(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(function(e){return e.name!==A})),this)}},{key:"hasToolHandler",value:function(A){var e;return!(null===(e=this.voiceInterface)||void 0===e||!e.sdk)&&this.voiceInterface.sdk.hasToolHandler(A)}},{key:"getRegisteredTools",value:function(){var A;return null!==(A=this.voiceInterface)&&void 0!==A&&A.sdk?this.voiceInterface.sdk.getRegisteredTools():this._pendingClientTools?this._pendingClientTools.map(function(A){return A.name}):[]}},{key:"_flushPendingClientTools",value:function(){var A,e=this;this._pendingClientTools&&null!==(A=this.voiceInterface)&&void 0!==A&&A.sdk&&(this._pendingClientTools.forEach(function(A){var t=A.name,n=A.handler;e.voiceInterface.sdk.registerToolHandler(t,n)}),this._pendingClientTools=null,console.log("TTPChatWidget: Flushed pending client tools"))}},{key:"registerClientTool",value:function(A,e){return this.registerToolHandler(A,e)}},{key:"unregisterClientTool",value:function(A){return this.unregisterToolHandler(A)}},{key:"hasClientTool",value:function(A){return this.hasToolHandler(A)}},{key:"getRegisteredClientTools",value:function(){return this.getRegisteredTools()}}],e&&Nn(A.prototype,e),Object.defineProperty(A,"prototype",{writable:!1}),A;var A,e,t,n,o,r}(),Xn="2.18.0";const zn={VoiceSDK_v2:se,TextChatSDK:Fe,WebSocketManager:ze,AudioRecorder:lt,AudioPlayer:yt,EventEmitter:de,VoiceButton:Tt,VanillaVoiceButton:Gt,AgentSDK:en,TTPChatWidget:Jn,VERSION:Xn}})(),n})());
|
|
3
3
|
//# sourceMappingURL=agent-widget.js.map
|