PageSourceSearch

https://www.nicasiabank.com/_next/static/chunks/1428.98f427ac24d7aaf5.js

js nicasiabank.com collected 2026-09-24 10:18:10 UTC 14,484 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1428],{21428:function(e,t,n){n.r(t),n.d(t,{default:function(){return T}});var o=n(85893),r=n(67294),i=function(){return(i=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)};function a(e,t,n,o){return new(n||(n=Promise))(function(r,i){function a(e){try{c(o.next(e))}catch(e){i(e)}}function s(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?r(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,s)}c((o=o.apply(e,t||[])).next())})}function s(e,t){var n,o,r,i,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw TypeError("Generator is already executing.");for(;a;)try{if(n=1,o&&(r=2&i[0]?o.return:i[0]?o.throw||((r=o.return)&&r.call(o),0):o.next)&&!(r=r.call(o,i[1])).done)return r;switch(o=0,r&&(i=[2&i[0],r.value]),i[0]){case 0:case 1:r=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,o=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(r=(r=a.trys).length>0&&r[r.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!r||i[1]>r[0]&&i[1]<r[3])){a.label=i[1];break}if(6===i[0]&&a.label<r[1]){a.label=r[1],r=i;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(i);break}r[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],o=0}finally{n=r=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function c(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;var o=Array(e),r=0;for(t=0;t<n;t++)for(var i=arguments[t],a=0,s=i.length;a<s;a++,r++)o[r]=i[a];return o}function l(){}l.mixin=function(e){var t=e.prototype||e;t.isWildEmitter=!0,t.on=function(e,t,n){this.callbacks=this.callbacks||{};var o=3==arguments.length,r=o?arguments[1]:void 0,i=o?arguments[2]:arguments[1];return i._groupName=r,(this.callbacks[e]=this.callbacks[e]||[]).push(i),this},t.once=function(e,t,n){var o=this,r=3==arguments.length,i=r?arguments[1]:void 0,a=r?arguments[2]:arguments[1];return this.on(e,i,function t(){o.off(e,t),a.apply(this,arguments)}),this},t.releaseGroup=function(e){var t,n,o,r;for(t in this.callbacks=this.callbacks||{},this.callbacks)for(n=0,o=(r=this.callbacks[t]).length;n<o;n++)r[n]._groupName===e&&(r.splice(n,1),n--,o--);return this},t.off=function(e,t){this.callbacks=this.callbacks||{};var n,o=this.callbacks[e];return o?1==arguments.length?(delete this.callbacks[e],this):(-1!==(n=o.indexOf(t))&&(o.splice(n,1),0===o.length&&delete this.callbacks[e]),this):this},t.emit=function(e){this.callbacks=this.callbacks||{};var t,n,o,r=[].slice.call(arguments,1),i=this.callbacks[e],a=this.getWildcardCallbacks(e);if(i)for(t=0,n=(o=i.slice()).length;t<n&&o[t];++t)o[t].apply(this,r);if(a)for(n=a.length,t=0,n=(o=a.slice()).length;t<n&&o[t];++t)o[t].apply(this,[e].concat(r));return this},t.getWildcardCallbacks=function(e){this.callbacks=this.callbacks||{};var t,n,o=[];for(t in this.callbacks)n=t.split("*"),("*"===t||2===n.length&&e.slice(0,n[0].length)===n[0])&&(o=o.concat(this.callbacks[t]));return o}},l.mixin(l),"undefined"!=typeof window&&(k=window.AudioContext||window.webkitAudioContext);var u=null,f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==n.g?n.g:"undefined"!=typeof self?self:{},h=!!(f===f.window&&f.URL&&f.Blob&&f.Worker);function d(e,t){var n,o=this;if(t=t||{},h)return n=e.toString().trim().match(/^function\s*\w*\s*\([\w\s,]*\)\s*{([\w\W]*?)}$/)[1],new f.Worker(f.URL.createObjectURL(new f.Blob([n],{type:"text/javascript"})));this.self=t,this.self.postMessage=function(e){setTimeout(function(){o.onmessage({data:e})},0)},setTimeout(e.bind(t,t),0)}d.prototype.postMessage=function(e){var t=this;setTimeout(function(){t.self.onmessage({data:e})},0)};class p{constructor(e,t){this.config={bufferLen:4096,numChannels:1,mimeType:"audio/wav",...t},this.recording=!1,this.callbacks={getBuffer:[],exportWAV:[]},this.context=e.context,this.node=(this.context.createScriptProcessor||this.context.createJavaScriptNode).call(this.context,this.config.bufferLen,this.config.numChannels,this.config.numChannels),this.node.onaudioprocess=e=>{if(this.recording){for(var t=[],n=0;n<this.config.numChannels;n++)t.push(e.inputBuffer.getChannelData(n));this.worker.postMessage({command:"record",buffer:t})}},e.connect(this.node),this.node.connect(this.context.destination),this.worker=new d(function(){let e,t,n,o=0,r=[];function i(){for(let e=0;e<t;e++)r[e]=[]}function a(e,t){let n=new Float32Array(t),o=0;for(let t=0;t<e.length;t++)n.set(e[t],o),o+=e[t].length;return n}function s(e,t,n){for(let o=0;o<n.length;
1o++)e.setUint8(t+o,n.charCodeAt(o))}this.onmessage=function(c){var l;switch(c.data.command){case"init":e=(l=c.data.config).sampleRate,t=l.numChannels,i(),n=e>48e3?48e3:e;break;case"record":!function(e){for(var n=0;n<t;n++)r[n].push(e[n]);o+=e[0].length}(c.data.buffer);break;case"exportWAV":!function(i){var c;let l,u,f=[];for(let e=0;e<t;e++)f.push(a(r[e],o));let h=(c=function(t,n){if(n==e)return t;if(n>e)throw"downsampling rate show be smaller than original sample rate";for(var o=e/n,r=Math.round(t.length/o),i=new Float32Array(r),a=0,s=0;a<i.length;){for(var c=Math.round((a+1)*o),l=0,u=0,f=s;f<c&&f<t.length;f++)l+=t[f],u++;i[a]=l/u,a++,s=c}return i}(2===t?function(e,t){let n=e.length+t.length,o=new Float32Array(n),r=0,i=0;for(;r<n;)o[r++]=e[i],o[r++]=t[i],i++;return o}(f[0],f[1]):f[0],n),l=new ArrayBuffer(44+2*c.length),s(u=new DataView(l),0,"RIFF"),u.setUint32(4,36+2*c.length,!0),s(u,8,"WAVE"),s(u,12,"fmt "),u.setUint32(16,16,!0),u.setUint16(20,1,!0),u.setUint16(22,t,!0),u.setUint32(24,n,!0),u.setUint32(28,4*n,!0),u.setUint16(32,2*t,!0),u.setUint16(34,16,!0),s(u,36,"data"),u.setUint32(40,2*c.length,!0),function(e,t,n){for(let o=0;o<n.length;o++,t+=2){let r=Math.max(-1,Math.min(1,n[o]));e.setInt16(t,r<0?32768*r:32767*r,!0)}}(u,44,c),u),d=new Blob([h],{type:i});this.postMessage({command:"exportWAV",data:d})}(c.data.type);break;case"getBuffer":!function(){let e=[];for(let n=0;n<t;n++)e.push(a(r[n],o));this.postMessage({command:"getBuffer",data:e})}();break;case"clear":o=0,r=[],i()}}},{}),this.worker.postMessage({command:"init",config:{sampleRate:this.context.sampleRate,numChannels:this.config.numChannels}}),this.worker.onmessage=e=>{let t=this.callbacks[e.data.command].pop();"function"==typeof t&&t(e.data.data)}}record(){this.recording=!0}stop(){this.recording=!1}clear(){this.worker.postMessage({command:"clear"})}getBuffer(e){if(!(e=e||this.config.callback))throw Error("Callback not set");this.callbacks.getBuffer.push(e),this.worker.postMessage({command:"getBuffer"})}exportWAV(e,t){if(t=t||this.config.mimeType,!(e=e||this.config.callback))throw Error("Callback not set");this.callbacks.exportWAV.push(e),this.worker.postMessage({command:"exportWAV",type:t})}static forceDownload(e,t){let n=(window.URL||window.webkitURL).createObjectURL(e),o=window.document.createElement("a");o.href=n,o.download=t||"output.wav";let r=document.createEvent("Event");r.initEvent("click",!0,!0),o.dispatchEvent(r)}}let g,v,m=p;async function b({audioContext:e,errHandler:t,onStreamLoad:n}){try{let t=await navigator.mediaDevices.getUserMedia({audio:!0});return n&&n(),g=t,v=e.createMediaStreamSource(t),(m=new p(v)).record(),t}catch(e){console.log(e),t&&t()}}function w({exportWAV:e,wavCallback:t}){m.stop(),g.getAudioTracks()[0].stop(),e&&t&&m.exportWAV(e=>t(e)),m.clear()}var k,y,x=-1!==navigator.userAgent.indexOf("Edg/"),A=window.AudioContext||window.webkitAudioContext,C=window.SpeechRecognition||window.webkitSpeechRecognition;navigator.brave&&navigator.brave.isBrave().then(function(e){e&&(y=null)}),!x&&C&&(y=new C);var R=function(e){var t=this,n=e.continuous,o=e.crossBrowser,f=e.googleApiKey,h=e.googleCloudRecognitionConfig,d=e.onStartSpeaking,p=e.onStoppedSpeaking,g=e.speechRecognitionProperties,v=void 0===g?{interimResults:!0}:g,m=e.timeout,x=void 0===m?1e4:m,C=e.useOnlyGoogleCloud,R=void 0!==C&&C,S=e.useLegacyResults,T=void 0===S||S,M=(0,r.useState)(!1),U=M[0],E=M[1],L=(0,r.useRef)(),W=(0,r.useState)([]),j=W[0],N=W[1],B=(0,r.useState)([]),H=B[0],I=B[1],O=(0,r.useState)(),V=O[0],F=O[1],_=(0,r.useState)(""),D=_[0],P=_[1],q=(0,r.useRef)(),G=(0,r.useRef)();(0,r.useEffect)(function(){var e;o||y||P("Speech Recognition API is only available on Chrome"),(null===(e=null==navigator?void 0:navigator.mediaDevices)||void 0===e?void 0:e.getUserMedia)||P("getUserMedia is not supported on this device/browser :("),(o||R)&&!f&&console.error("No google cloud API key was passed, google API will not be able to process speech"),L.current||(L.current=new A),T&&console.warn("react-hook-speech-to-text is using legacy results, pass useLegacyResults: false to the hook to use the new array of objects results. Legacy array of str
1ings results will be removed in a future version.")},[]);var z=function(){return a(t,void 0,void 0,function(){var e,t,r,i;return s(this,function(a){switch(a.label){case 0:return!R&&y?(function(){if(y){n&&(y.continuous=!0);var e=v||{},t=e.grammars,o=e.interimResults,r=e.lang,i=e.maxAlternatives;t&&(y.grammars=t),r&&(y.lang=r),y.interimResults=o||!1,y.maxAlternatives=i||1,y.start(),y.onresult=function(e){var t=e.results[e.results.length-1],n=t[0].transcript,r=Math.floor(Date.now()/1e3);if(o){if(t.isFinal)F(void 0),I(function(e){return c(e,[{transcript:n,timestamp:r}])}),N(function(e){return c(e,[n])});else{for(var i="",a=e.resultIndex;a<e.results.length;a++)i+=e.results[a][0].transcript;F(i)}}else I(function(e){return c(e,[{transcript:n,timestamp:r}])}),N(function(e){return c(e,[n])})},y.onaudiostart=function(){return E(!0)},y.onend=function(){E(!1)}}}(),[2]):o||R?("suspended"===(null===(r=L.current)||void 0===r?void 0:r.state)&&(null===(i=L.current)||void 0===i||i.resume()),[4,b({errHandler:function(){return P("Microphone permission was denied")},audioContext:L.current})]):[2];case 1:return e=a.sent(),E(!0),x&&(clearTimeout(q.current),J()),G.current&&Y(),G.current=e.clone(),(t=function(e,t){var n=new l;if(!k)return n;var o,r,i,a=(t=t||{}).smoothing||.1,s=t.interval||50,c=t.threshold,f=t.play,h=t.history||10,d=!0;(i=(u=t.audioContext||u||new k).createAnalyser()).fftSize=512,i.smoothingTimeConstant=a,r=new Float32Array(i.frequencyBinCount),e.jquery&&(e=e[0]),e instanceof HTMLAudioElement||e instanceof HTMLVideoElement?(o=u.createMediaElementSource(e),void 0===f&&(f=!0),c=c||-50):(o=u.createMediaStreamSource(e),c=c||-50),o.connect(i),f&&i.connect(u.destination),n.speaking=!1,n.suspend=function(){return u.suspend()},n.resume=function(){return u.resume()},Object.defineProperty(n,"state",{get:function(){return u.state}}),u.onstatechange=function(){n.emit("state_change",u.state)},n.setThreshold=function(e){c=e},n.setInterval=function(e){s=e},n.stop=function(){d=!1,n.emit("volume_change",-100,c),n.speaking&&(n.speaking=!1,n.emit("stopped_speaking")),i.disconnect(),o.disconnect()},n.speakingHistory=[];for(var p=0;p<h;p++)n.speakingHistory.push(0);var g=function(){setTimeout(function(){if(d){var e=function(e,t){var n=-1/0;e.getFloatFrequencyData(t);for(var o=4,r=t.length;o<r;o++)t[o]>n&&t[o]<0&&(n=t[o]);return n}(i,r);n.emit("volume_change",e,c);var t=0;if(e>c&&!n.speaking){for(var o=n.speakingHistory.length-3;o<n.speakingHistory.length;o++)t+=n.speakingHistory[o];t>=2&&(n.speaking=!0,n.emit("speaking"))}else if(e<c&&n.speaking){for(o=0;o<n.speakingHistory.length;o++)t+=n.speakingHistory[o];0==t&&(n.speaking=!1,n.emit("stopped_speaking"))}n.speakingHistory.shift(),n.speakingHistory.push(0+(e>c)),g()}},s)};return g(),n}(G.current,{audioContext:L.current})).on("speaking",function(){d&&d(),clearTimeout(q.current)}),t.on("stopped_speaking",function(){p&&p(),w({exportWAV:!0,wavCallback:function(e){return K({blob:e,continuous:n||!1})}})}),[2]}})})},J=function(){q.current=window.setTimeout(function(){E(!1),Y(),w({exportWAV:!1})},x)},K=function(e){var n=e.blob,o=e.continuous,r=new FileReader;
1r.readAsDataURL(n),r.onloadend=function(){return a(t,void 0,void 0,function(){var e,t,a,l,u,d,p,g;return s(this,function(s){switch(s.label){case 0:return e=r.result,(t=null===(p=L.current)||void 0===p?void 0:p.sampleRate)&&t>48e3&&(t=48e3),a={content:""},l={config:i({encoding:"LINEAR16",languageCode:"en-US",sampleRateHertz:t},h),audio:a},a.content=e.substr(e.indexOf(",")+1),[4,fetch("https://speech.googleapis.com/v1/speech:recognize?key="+f,{method:"POST",body:JSON.stringify(l)})];case 1:return[4,s.sent().json()];case 2:return(null===(g=(u=s.sent()).results)||void 0===g?void 0:g.length)>0&&(d=u.results[0].alternatives[0].transcript,N(function(e){return c(e,[d])}),I(function(e){return c(e,[{speechBlob:n,transcript:d,timestamp:Math.floor(Date.now()/1e3)}])})),o?z():(Y(),E(!1)),[2]}})})}},Y=function(){var e;null===(e=G.current)||void 0===e||e.getAudioTracks()[0].stop()};return{error:D,interimResult:V,isRecording:U,results:T?j:H,setResults:I,startSpeechToText:z,stopSpeechToText:function(){y&&!R?y.stop():(E(!1),Y(),w({exportWAV:!0,wavCallback:function(e){return K({blob:e,continuous:!1})}}))}}},S=n(89583);function T(e){var t=e.callback,n=e.btnClassName,i=R({continuous:!1,useLegacyResults:!1,googleApiKey:"AIzaSyD86GqPHqcmUUAwIakp0slOR3_M0hFFmkM",useOnlyGoogleCloud:!0,crossBrowser:!0,googleCloudRecognitionConfig:{languageCode:"en-IN"}}),a=i.error,s=(i.interimResult,i.isRecording),c=i.results,l=i.startSpeechToText,u=i.stopSpeechToText;return(0,r.useEffect)(function(){if(!a){var e=null==c?void 0:c.pop();e&&t(null==e?void 0:e.transcript)}},[c.length]),(0,r.useEffect)(function(){if(!a){var e=setInterval(function(){s&&u()},8e3);return function(){return clearInterval(e)}}},[]),(0,o.jsx)(r.Fragment,{children:(0,o.jsxs)("div",{className:"speech-to-text ".concat(n),children:[(0,o.jsx)("button",{type:"button","aria-label":s&&!a?"Stop voice search":"Start voice search",onClick:function(){if(!a){if(s)return u();l()}},className:"voice-search-button",children:s&&!a?(0,o.jsxs)("div",{className:"cortana","aria-hidden":"true",children:[(0,o.jsx)("div",{className:"blue"}),(0,o.jsx)("div",{className:"teal"})]}):(0,o.jsx)(S.uYL,{className:"micIcon","aria-hidden":"true"})}),"only-icon"!==n&&(0,o.jsx)("span",{className:"speechText",children:s&&!a?"Listening ...":"Tap To Speech Search"})]})})}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.