From bfff7c632938d5c060c487bb9a899a4f29d5c87b Mon Sep 17 00:00:00 2001 From: Takeshi NAMAO Date: Mon, 17 Jun 2024 15:10:47 +0900 Subject: [PATCH 1/5] =?UTF-8?q?LocalVideo=20=E3=81=AE=E3=82=B9=E3=83=9D?= =?UTF-8?q?=E3=83=83=E3=83=88=E3=83=A9=E3=82=A4=E3=83=88=E3=83=95=E3=82=A9?= =?UTF-8?q?=E3=83=BC=E3=82=AB=E3=82=B9=E6=99=82=E3=81=AE=E3=82=B9=E3=82=BF?= =?UTF-8?q?=E3=82=A4=E3=83=AB=E3=82=92=E4=BF=AE=E6=AD=A3=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Video/LocalVideo.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Video/LocalVideo.tsx b/src/components/Video/LocalVideo.tsx index 3709da13..2a456077 100644 --- a/src/components/Video/LocalVideo.tsx +++ b/src/components/Video/LocalVideo.tsx @@ -35,8 +35,8 @@ const VideoBox: React.FC = () => { <>
{mediaStats && localMediaStream && localMediaStream.getVideoTracks().length > 0 && ( From 65a87130d5b8080899748b5eca59eb8fe172364d Mon Sep 17 00:00:00 2001 From: Takeshi NAMAO Date: Mon, 17 Jun 2024 15:12:28 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=E5=A4=89=E6=9B=B4=E5=B1=A5=E6=AD=B4?= =?UTF-8?q?=E3=81=AB=E8=BF=BD=E8=A8=98=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index 475f7e4f..16ccd423 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,10 @@ ## develop +- [FIX] LocalVideo のスポットライトフォーカス時の表示を修正する + - CSS クラスの指定が正しくなかった + - @tnamao + ## 2024.1.1 **2024-06-10** From 1e9ec34d1ab4aacdf0a2adf766752b7c06e289cc Mon Sep 17 00:00:00 2001 From: voluntas Date: Mon, 17 Jun 2024 18:38:25 +0900 Subject: [PATCH 3/5] =?UTF-8?q?=E3=83=90=E3=83=BC=E3=82=B8=E3=83=A7?= =?UTF-8?q?=E3=83=B3=E3=82=92=E3=81=82=E3=81=92=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6b1dd6b4..5e850155 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sora-devtools", - "version": "2024.1.3", + "version": "2024.1.4", "description": "WebRTC SFU Sora DevTools", "repository": { "type": "git", From 8e3aacc60bae034b1e6bf994fd156fcf11b73c6e Mon Sep 17 00:00:00 2001 From: voluntas Date: Mon, 17 Jun 2024 18:38:56 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=E5=A4=89=E6=9B=B4=E5=B1=A5=E6=AD=B4?= =?UTF-8?q?=E3=82=92=E6=9B=B4=E6=96=B0=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGES.md b/CHANGES.md index ec65d905..89df2252 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,10 @@ ## develop +## 2024.1.4 + +**2024-06-17** + - [FIX] LocalVideo のスポットライトフォーカス時の表示を修正する - CSS クラスの指定が正しくなかった - @tnamao From df94f0de64e0d58abcea4e834f774e19896124ea Mon Sep 17 00:00:00 2001 From: voluntas Date: Mon, 17 Jun 2024 18:39:31 +0900 Subject: [PATCH 5/5] =?UTF-8?q?=E6=88=90=E6=9E=9C=E7=89=A9=E3=82=92?= =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/404.html | 2 +- .../{_app-e264f49c8f9c025d.js => _app-7f2ea7262f5d296b.js} | 2 +- ...evtools-7bc173685e1c8bb6.js => devtools-e382fa421704869f.js} | 2 +- dist/_next/static/sora_devtools/_buildManifest.js | 2 +- dist/devtools.html | 2 +- dist/index.html | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) rename dist/_next/static/chunks/pages/{_app-e264f49c8f9c025d.js => _app-7f2ea7262f5d296b.js} (99%) rename dist/_next/static/chunks/pages/{devtools-7bc173685e1c8bb6.js => devtools-e382fa421704869f.js} (56%) diff --git a/dist/404.html b/dist/404.html index 0c095b30..cb414ff0 100644 --- a/dist/404.html +++ b/dist/404.html @@ -1 +1 @@ -404: This page could not be found

404

This page could not be found.

\ No newline at end of file +404: This page could not be found

404

This page could not be found.

\ No newline at end of file diff --git a/dist/_next/static/chunks/pages/_app-e264f49c8f9c025d.js b/dist/_next/static/chunks/pages/_app-7f2ea7262f5d296b.js similarity index 99% rename from dist/_next/static/chunks/pages/_app-e264f49c8f9c025d.js rename to dist/_next/static/chunks/pages/_app-7f2ea7262f5d296b.js index 44477907..34084657 100644 --- a/dist/_next/static/chunks/pages/_app-e264f49c8f9c025d.js +++ b/dist/_next/static/chunks/pages/_app-7f2ea7262f5d296b.js @@ -1,4 +1,4 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{6689:function(A,e,t){"use strict";var n,r;A.exports=(null==(n=t.g.process)?void 0:n.env)&&"object"==typeof(null==(r=t.g.process)?void 0:r.env)?t.g.process:t(5021)},8085:function(A,e,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return t(3632)}])},2838:function(A,e,t){"use strict";t.d(e,{slice:function(){return c}});var n=t(5810),r=t(7124),o=t(8426),i=t(4029),a=t(983);let s={alertMessages:[],audio:!0,audioBitRate:"",audioCodecType:"",audioContentHint:"",audioInput:"",audioInputDevices:[],audioOutput:"",audioOutputDevices:[],autoGainControl:"",blurRadius:"",bundleId:"",enabledBundleId:!1,clientId:"",channelId:"sora",googCpuOveruseDetection:null,timelineMessages:[],debug:!1,debugFilterText:"",debugType:"timeline",dataChannelSignaling:"",dataChannels:"",dataChannelMessages:[],displayResolution:"",e2ee:!1,echoCancellation:"",echoCancellationType:"",enabledClientId:!1,enabledDataChannel:!1,enabledDataChannels:!1,enabledForwardingFilter:!1,enabledMetadata:!1,enabledSignalingNotifyMetadata:!1,enabledSignalingUrlCandidates:!1,enabledVideoVP9Params:!1,enabledVideoH264Params:!1,enabledVideoH265Params:!1,enabledVideoAV1Params:!1,audioStreamingLanguageCode:"",enabledAudioStreamingLanguageCode:!1,fakeVolume:"0",fakeContents:{worker:null,colorCode:0,gainNode:null},frameRate:"",soraContents:{connectionStatus:"initializing",reconnecting:!1,reconnectingTrials:0,sora:null,connectionId:null,clientId:null,sessionId:null,localMediaStream:null,remoteClients:[],prevStatsReport:[],statsReport:[],datachannels:[],turnUrl:null},ignoreDisconnectWebSocket:"",logMessages:[],mediaProcessorsNoiseSuppression:!1,mediaStats:!1,mediaType:"getUserMedia",metadata:"",multistream:"",mute:!1,noiseSuppression:"",notifyMessages:[],pushMessages:[],resolution:"",showStats:!1,simulcast:"",spotlight:"",signalingMessages:[],signalingNotifyMetadata:"",signalingUrlCandidates:[],forwardingFilter:"",simulcastRid:"",spotlightNumber:"",spotlightFocusRid:"",spotlightUnfocusRid:"",focusedSpotlightConnectionIds:{},video:!0,videoBitRate:"",videoCodecType:"",videoContentHint:"",videoInput:"",videoInputDevices:[],videoVP9Params:"",videoH264Params:"",videoH265Params:"",videoAV1Params:"",version:"2024.1.3",cameraDevice:!0,videoTrack:!0,micDevice:!0,audioTrack:!0,role:"sendrecv",reconnect:!1,apiUrl:null,aspectRatio:"",resizeMode:"",lightAdjustment:"",lightAdjustmentProcessor:null,noiseSuppressionProcessor:null,virtualBackgroundProcessor:null,facingMode:""},c=(0,n.oM)({name:"soraDevtools",initialState:s,reducers:{resetState:A=>{Object.assign(A,s)},setAudio:(A,e)=>{A.audio=e.payload},setAudioInput:(A,e)=>{A.audioInput=e.payload},setAudioOutput:(A,e)=>{A.audioOutput=e.payload},setAudioBitRate:(A,e)=>{A.audioBitRate=e.payload},setAudioCodecType:(A,e)=>{A.audioCodecType=e.payload},setAudioContentHint:(A,e)=>{if(A.audioContentHint=e.payload,A.soraContents.localMediaStream)for(let e of A.soraContents.localMediaStream.getAudioTracks())e.contentHint=A.audioContentHint},setAutoGainControl:(A,e)=>{A.autoGainControl=e.payload},setClientId:(A,e)=>{A.clientId=e.payload},setChannelId:(A,e)=>{A.channelId=e.payload},setTimelineMessage:(A,e)=>{A.timelineMessages.push(e.payload)},setDataChannelSignaling:(A,e)=>{A.dataChannelSignaling=e.payload},setDataChannels:(A,e)=>{A.dataChannels=e.payload},setDataChannelMessage:(A,e)=>{A.dataChannelMessages.push(e.payload)},setGoogCpuOveruseDetection:(A,e)=>{A.googCpuOveruseDetection=e.payload},setDisplayResolution:(A,e)=>{A.displayResolution=e.payload},setE2EE:(A,e)=>{A.e2ee=e.payload},setEchoCancellation:(A,e)=>{A.echoCancellation=e.payload},setEchoCancellationType:(A,e)=>{A.echoCancellationType=e.payload},setEnabledClientId:(A,e)=>{A.enabledClientId=e.payload},setEnabledDataChannels:(A,e)=>{A.enabledDataChannels=e.payload},setEnabledDataChannel:(A,e)=>{A.enabledDataChannel=e.payload},setEnabledMetadata:(A,e)=>{A.enabledMetadata=e.payload},setIgnoreDisconnectWebSocket:(A,e)=>{A.ignoreDisconnectWebSocket=e.payload},setSignalingMessage:(A,e)=>{A.signalingMessages.push(e.payload)},setEnabledForwardingFilter:(A,e)=>{A.enabledForwardingFilter=e.payload},setEnabledSignalingNotifyMetadata:(A,e)=>{A.enabledSignalingNotifyMetadata=e.payload},setEnabledSignalingUrlCandidates:(A,e)=>{A.enabledSignalingUrlCandidates=e.payload},setEnabledVideoVP9Params:(A,e)=>{A.enabledVideoVP9Params=e.payload},setEnabledVideoH264Params:(A,e)=>{A.enabledVideoH264Params=e.payload},setEnabledVideoH265Params:(A,e)=>{A.enabledVideoH265Params=e.payload},setEnabledVideoAV1Params:(A,e)=>{A.enabledVideoAV1Params=e.payload},setFakeVolume:(A,e)=>{let t=Number.parseFloat(e.payload);Number.isNaN(t)?A.fakeVolume="0":1{A.fakeContents.gainNode=e.payload},setInitialFakeContents:A=>{if(A.fakeContents.colorCode=Math.floor(16777215*Math.random()),URL.createObjectURL){let e=URL.createObjectURL(new Blob([a.lt],{type:"application/javascript"}));A.fakeContents.worker=new Worker(e)}},setFrameRate:(A,e)=>{A.frameRate=e.payload},setMute:(A,e)=>{A.mute=e.payload},setMediaStats:(A,e)=>{A.mediaStats=e.payload},setNoiseSuppression:(A,e)=>{A.noiseSuppression=e.payload},setMediaType:(A,e)=>{"mediacaptureRegion"===e.payload&&void 0===window.CropTarget?A.mediaType="getUserMedia":A.mediaType=e.payload},setMetadata:(A,e)=>{A.metadata=e.payload},setResolution:(A,e)=>{A.resolution=e.payload},setSignalingNotifyMetadata:(A,e)=>{A.signalingNotifyMetadata=e.payload},setSignalingUrlCandidates:(A,e)=>{A.signalingUrlCandidates=e.payload},setForwardingFilter:(A,e)=>{A.forwardingFilter=e.payload},setSimulcastRid:(A,e)=>{A.simulcastRid=e.payload},setSpotlightNumber:(A,e)=>{A.spotlightNumber=e.payload},setSpotlightFocusRid:(A,e)=>{A.spotlightFocusRid=e.payload},setSpotlightUnfocusRid:(A,e)=>{A.spotlightUnfocusRid=e.payload},setVideo:(A,e)=>{A.video=e.payload},setVideoInput:(A,e)=>{A.videoInput=e.payload},setVideoBitRate:(A,e)=>{A.videoBitRate=e.payload},setVideoCodecType:(A,e)=>{A.videoCodecType=e.payload},setVideoContentHint:(A,e)=>{if(A.videoContentHint=e.payload,A.soraContents.localMediaStream)for(let e of A.soraContents.localMediaStream.getVideoTracks())e.contentHint=A.videoContentHint},setVideoVP9Params:(A,e)=>{A.videoVP9Params=e.payload},setVideoH264Params:(A,e)=>{A.videoH264Params=e.payload},setVideoH265Params:(A,e)=>{A.videoH265Params=e.payload},setVideoAV1Params:(A,e)=>{A.videoAV1Params=e.payload},setSora:(A,e)=>{A.soraContents.sora=e.payload,A.soraContents.sora||(A.soraContents.datachannels=[])},setSoraSessionId:(A,e)=>{A.soraContents.sessionId=e.payload},setSoraConnectionId:(A,e)=>{A.soraContents.connectionId=e.payload},setSoraClientId:(A,e)=>{A.soraContents.clientId=e.payload},setSoraTurnUrl:(A,e)=>{A.soraContents.turnUrl=e.payload},setSoraConnectionStatus:(A,e)=>{A.soraContents.connectionStatus=e.payload},setSoraReconnecting:(A,e)=>{A.soraContents.reconnecting=e.payload,!1===A.soraContents.reconnecting&&(A.soraContents.reconnectingTrials=0)},setSoraReconnectingTrials:(A,e)=>{A.soraContents.reconnectingTrials=e.payload},setSoraDataChannels:(A,e)=>{A.soraContents.datachannels.push(e.payload)},setLocalMediaStream:(A,e)=>{A.soraContents.localMediaStream&&A.soraContents.localMediaStream.getTracks().filter(A=>{A.stop()}),A.soraContents.localMediaStream=e.payload},setRemoteClient:(A,e)=>{A.soraContents.remoteClients.push(e.payload)},setSoraRemoteClientId:(A,e)=>{for(let t of A.soraContents.remoteClients)t.connectionId===e.payload.connectionId&&(t.clientId=e.payload.clientId)},setStatsReport:(A,e)=>{A.soraContents.prevStatsReport=A.soraContents.statsReport,A.soraContents.statsReport=e.payload},removeRemoteClient:(A,e)=>{let t=A.soraContents.remoteClients.filter(A=>A.connectionId!==e.payload);A.soraContents.remoteClients=t},removeAllRemoteClients:A=>{A.soraContents.remoteClients=[]},setAudioInputDevices:(A,e)=>{A.audioInputDevices=e.payload},setVideoInputDevices:(A,e)=>{A.videoInputDevices=e.payload},setAudioOutputDevices:(A,e)=>{A.audioOutputDevices=e.payload},setSoraInfoAlertMessage:(A,e)=>{let t={title:"Sora info",type:"info",message:e.payload,timestamp:new Date().getTime()};l(A.alertMessages,A.logMessages,t)},setSoraErrorAlertMessage:(A,e)=>{let t={title:"Sora error",type:"error",message:e.payload,timestamp:new Date().getTime()};l(A.alertMessages,A.logMessages,t)},setAPIInfoAlertMessage:(A,e)=>{let t={title:"API info",type:"info",message:e.payload,timestamp:new Date().getTime()};l(A.alertMessages,A.logMessages,t)},setAPIErrorAlertMessage:(A,e)=>{let t={title:"API error",type:"error",message:e.payload,timestamp:new Date().getTime()};l(A.alertMessages,A.logMessages,t)},deleteAlertMessage:(A,e)=>{let t=A.alertMessages.filter(A=>A.timestamp!==e.payload);A.alertMessages=t},setDebug:(A,e)=>{A.debug=e.payload},setDebugFilterText:(A,e)=>{A.debugFilterText=e.payload},setDebugType:(A,e)=>{A.debugFilterText="",A.debugType=e.payload},setLogMessages:(A,e)=>{A.logMessages.push({timestamp:new Date().getTime(),message:{title:e.payload.title,description:e.payload.description}})},setNotifyMessages:(A,e)=>{A.notifyMessages.push(e.payload)},setPushMessages:(A,e)=>{A.pushMessages.push(e.payload)},setFocusedSpotlightConnectionId:(A,e)=>{A.focusedSpotlightConnectionIds[e.payload]=!0},setUnFocusedSpotlightConnectionId:(A,e)=>{A.focusedSpotlightConnectionIds[e.payload]=!1},deleteFocusedSpotlightConnectionId:(A,e)=>{delete A.focusedSpotlightConnectionIds[e.payload]},setShowStats:(A,e)=>{A.showStats=e.payload},setCameraDevice:(A,e)=>{A.cameraDevice=e.payload},setMicDevice:(A,e)=>{A.micDevice=e.payload},setAudioTrack:(A,e)=>{if(A.audioTrack=e.payload,A.soraContents.localMediaStream)for(let e of A.soraContents.localMediaStream.getAudioTracks())e.enabled=A.audioTrack},setVideoTrack:(A,e)=>{if(A.videoTrack=e.payload,A.soraContents.localMediaStream)for(let e of A.soraContents.localMediaStream.getVideoTracks())e.enabled=A.videoTrack},setRole:(A,e)=>{A.role=e.payload},setMultistream:(A,e)=>{A.multistream=e.payload},setSimulcast:(A,e)=>{A.simulcast=e.payload},setSpotlight:(A,e)=>{A.spotlight=e.payload},setReconnect:(A,e)=>{A.reconnect=e.payload},setApiUrl:(A,e)=>{A.apiUrl=e.payload},clearDataChannelMessages:A=>{A.dataChannelMessages=[]},setAspectRatio:(A,e)=>{A.aspectRatio=e.payload},setResizeMode:(A,e)=>{A.resizeMode=e.payload},setLightAdjustment:(A,e)=>{if(""!==e.payload&&null===A.lightAdjustmentProcessor){let e=new r.jA;A.lightAdjustmentProcessor=e}A.lightAdjustment=e.payload},setBlurRadius:(A,e)=>{if(""!==e.payload&&null===A.virtualBackgroundProcessor){let e=new i.sz("https://cdn.jsdelivr.net/npm/@shiguredo/virtual-background@latest/dist");A.virtualBackgroundProcessor=e}A.blurRadius=e.payload},setMediaProcessorsNoiseSuppression:(A,e)=>{if(e.payload&&null===A.noiseSuppressionProcessor){let e=new o.b("https://cdn.jsdelivr.net/npm/@shiguredo/noise-suppression@latest/dist");A.noiseSuppressionProcessor=e}A.mediaProcessorsNoiseSuppression=e.payload},setBundleId:(A,e)=>{A.bundleId=e.payload},setEnabledBundleId:(A,e)=>{A.enabledBundleId=e.payload},setFacingMode:(A,e)=>{A.facingMode=e.payload},setAudioStreamingLanguageCode:(A,e)=>{A.audioStreamingLanguageCode=e.payload},setEnabledAudioStreamingLanguageCode:(A,e)=>{A.enabledAudioStreamingLanguageCode=e.payload}}});function l(A,e,t){if(10<=A.length)for(let e=0;e<=A.length-5;e++)A.pop();A.unshift(t),e.push({timestamp:t.timestamp,message:{title:"ALERT MESSAGE ".concat(t.title),description:JSON.stringify({title:t.title,type:t.type,message:t.message})}})}},8154:function(A,e,t){"use strict";t.d(e,{h:function(){return o}});var n=t(5810);t(3054);var r=t(2838);let o=(0,n.xC)({reducer:r.slice.reducer,middleware:A=>A({serializableCheck:{ignoredActions:["soraDevtools/setSora","soraDevtools/setLocalMediaStream","soraDevtools/setRemoteClient","soraDevtools/setFakeContentsGainNode","soraDevtools/setDataChannelMessage"],ignoredPaths:["soraContents","fakeContents","dataChannelMessages","logMessages","notifyMessages","pushMessages","signalingMessages","lightAdjustmentProcessor","virtualBackgroundProcessor","noiseSuppressionProcessor"]},immutableCheck:{ignoredPaths:["soraContents","fakeContents","dataChannelMessages","logMessages","notifyMessages","pushMessages","signalingMessages","noiseSuppressionProcessor"]}})})},983:function(A,e,t){"use strict";t.d(e,{Ii:function(){return y},xR:function(){return s},o1:function(){return a},nT:function(){return I},iN:function(){return g},G_:function(){return m},l9:function(){return w},aF:function(){return C},PS:function(){return d},cJ:function(){return f},pT:function(){return O},kt:function(){return Q},x$:function(){return T},Xv:function(){return v},w_:function(){return h},u9:function(){return r},ad:function(){return u},L4:function(){return b},K$:function(){return M},VE:function(){return o},WJ:function(){return B},VJ:function(){return i},I7:function(){return p},Xr:function(){return E},Q5:function(){return l},Sh:function(){return c},QO:function(){return D},lt:function(){return F}});var n=JSON.parse('{"channelId":{"description":"接続するチャネルの ID を指定します。\\n1-255 文字までの文字列を指定できます。"},"role":{"description":"クライアントの役割を指定します。"},"multistream":{"description":"マルチストリームを使用するかどうかを指定します。Sora は未指定の場合、マルチストリームを使用します。"},"simulcast":{"description":"サイマルキャストを使用するかどうかを指定します。"},"simulcastRid":{"description":"サイマルキャストで配信されている映像を受信する際のエンコードの初期値を指定します。"},"spotlight":{"description":"スポットライトを使用するかどうかを指定します。"},"spotlightNumber":{"description":"スポットライトでフォーカスする配信数の最大値を指定します。"},"spotlightFocusRid":{"description":"スポットライトでフォーカスした場合の映像を受信する際のエンコードの初期値を指定します。"},"spotlightUnfocusRid":{"description":"スポットライトでフォーカスが外れた場合の映像を受信する際のエンコードの初期値を指定します。"},"audio":{"description":"音声配信をするかどうかを指定します。"},"audioCodecType":{"description":"音声のコーデックタイプを指定します。"},"audioBitRate":{"description":"音声のビットレートを指定します。"},"video":{"description":"映像配信をするかどうかを指定します。"},"videoCodecType":{"description":"映像のコーデックタイプを指定します。"},"videoBitRate":{"description":"映像のビットレートを指定します。"},"videoVP9Params":{"description":"映像のコーデックタイプに VP9 を指定した場合の設定を指定します。"},"videoH264Params":{"description":"映像のコーデックタイプに H264 を指定した場合の設定を指定します。"},"videoH265Params":{"description":"映像のコーデックタイプに H265 を指定した場合の設定を指定します。"},"videoAV1Params":{"description":"映像のコーデックタイプに AV1 を指定した場合の設定を指定します。"},"e2ee":{"description":"E2EE(End-to-End Encryption) を使用するかどうかを指定します。"},"reconnect":{"description":"一度接続に成功したあとに意図しない切断があった場合に再接続するかどうかを指定します。"},"clientId":{"description":"接続時に任意のクライアント ID を指定できます。"},"metadata":{"description":"認証するための判断材料としてのメタデータを指定します。"},"bundleId":{"description":"複数接続時に同一の bundle_id を指定すると、同一 bundle_id の接続から音声や映像やメッセージングを受信しなくなります。"},"signalingNotifyMetadata":{"description":"クライアントが参加や離脱したときに送られるシグナリング通知に含まれるメタデータを指定します。"},"signalingUrlCandidates":{"description":"シグナリングをするURLを改行区切りで複数指定します。"},"forwardingFilter":{"description":"デフォルトの転送フィルターを指定します。"},"audioStreamingLanguageCode":{"description":"音声解析用の言語コードを指定します。"},"dataChannels":{"description":"メッセージング用の DataChannel を指定します。"},"dataChannelSignaling":{"description":"シグナリングを DataChannel 経由に切り替えるかどうかを指定します。"},"ignoreDisconnectWebSocket":{"description":"シグナリングを DataChannel 経由に切り替えた際に、 WebSocket が閉じても、接続が切断しないようにするかどうかを指定します。"},"mediaType":{"description":"メディアタイプを指定します。\\ngetUserMedia: デバイスのカメラ/マイクをメディアとして使用します。\\ngetDisplayMedia: ディスプレイまたはその一部(ウィンドウ等)をメディアとして使用します。\\nfakeMedia: ダミーの映像と音声をメディアとして使用します\\nmediacaptureRegion: 現在開いているタブの一部をメディアとして使用します。"},"fakeVolume":{"description":"mediaType に fakeMedia を選択した際の音量を指定します。"},"audioContentHint":{"description":"MediaStreamTrack audio の contentHint を指定します。"},"autoGainControl":{"description":"MediaTrackConstraints の autoGainControl を指定します。"},"noiseSuppression":{"description":"MediaTrackConstraints の noiseSuppression を指定します。"},"echoCancellation":{"description":"MediaTrackConstraints の echoCancellation を指定します。"},"echoCancellationType":{"description":"MediaTrackConstraints の echoCancellationType を指定します。"},"mediaProcessorsNoiseSuppression":{"description":"shiguredo Media Processors のノイズ抑制を使用するかどうか指定します。"},"videoContentHint":{"description":"MediaStreamTrack video の contentHint を指定します。"},"resolution":{"description":"解像度を指定します。任意の解像度を指定する場合は、幅と高さを x 区切りで指定します。 (例: 640x480)"},"mediaStats":{"description":"映像の統計情報を映像に重ねて表示します。"},"frameRate":{"description":"MediaTrackConstraints の frameRate を指定します。"},"aspectRatio":{"description":"MediaTrackConstraints の aspectRatio を指定します。"},"resizeMode":{"description":"MediaTrackConstraints の resizeMode を指定します。"},"blurRadius":{"description":"shiguredo Media Processors の背景ぼかしを使用するかどうか指定します。"},"lightAdjustment":{"description":"shiguredo Media Processors のライト調整を使用するかどうか指定します。"},"audioInput":{"description":"音声入力を指定します。"},"videoInput":{"description":"映像入力を指定します。"},"audioOutput":{"description":"音声出力を指定します。"},"displayResolution":{"description":"画面に表示する際の解像度を指定します。任意の解像度を指定する場合は、幅と高さを x 区切りで指定します。 (例: 640x480)"},"micDevice":{"description":"Audio MediaStreamTrack を生成するかどうかを切り替えます。"},"cameraDevice":{"description":"Video MediaStreamTrack を生成するかどうかを切り替えます。"},"audioTrack":{"description":"Audio MediaStreamTrack の enabled 属性を切り替えます。"},"videoTrack":{"description":"video MediaStreamTrack の enabled 属性を切り替えます。"},"facingMode":{"description":"モバイルカメラのフロント/バックを切り替えます。"},"changeAllRecvStream":{"description":"サイマルキャストで受信中の全てのストリームの rid を操作します。"}}');let r=["","true","false"],o=["","true","false"],i=["","true","false"],a=["","OPUS"],s=["","8","16","24","32","64","96","128","256"],c=["","VP8","VP9","AV1","H264","H265"],l=["","10","30","50","100","300","500","800","1000","1500","2000","2500","3000","5000","10000","15000","20000","30000","50000"],g=["","true","false"],u=["","true","false"],d=["","true","false"],f=["","browser","system"],h=["getUserMedia","getDisplayMedia","fakeMedia","mediacaptureRegion"],E=["","1","2","3","4","5","6","7","8"],p=["","none","r0","r1","r2"],B=["","r0","r1","r2"],w=["","true","false"],Q=["","true","false"],C=["log","notify","push","stats","timeline","signaling","messaging","codec"],I=["","speech","speech-recognition","music"],D=["","motion","detail","text"],y=["","4:3","16:9","21:9"],b=["","none","crop-and-scale"],m=["","weak","medium","strong"],v=["","weak","medium","strong"],M=["sendrecv","sendonly","recvonly"],O=["","front","back"],F='\nself.onmessage = (event) => {\n const data = event.data;\n if (data.type === "start") {\n const interval = data.interval;\n self.counter = 0;\n const intervalId = setInterval(() => {\n const message = { type: "update", counter: self.counter };\n self.postMessage(message);\n self.counter++;\n }, interval);\n self.intervalId = intervalId;\n } else if (data.type === "stop") {\n if (self.intervalId) {\n clearInterval(self.intervalId);\n }\n const message = { type: "stop" };\n self.postMessage(message);\n }\n};\n',T=n},3632:function(A,e,t){"use strict";t.r(e);var n=t(2676);t(9377),t(8772);var r=t(4690),o=t(8154);e.default=A=>{let{Component:e,pageProps:t}=A;return(0,n.jsx)(r.zt,{store:o.h,children:(0,n.jsx)(e,{...t})})}},9377:function(){},8772:function(){},5021:function(A){!function(){var e={229:function(A){var e,t,n,r=A.exports={};function o(){throw Error("setTimeout has not been defined")}function i(){throw Error("clearTimeout has not been defined")}function a(A){if(e===setTimeout)return setTimeout(A,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(A,0);try{return e(A,0)}catch(t){try{return e.call(null,A,0)}catch(t){return e.call(this,A,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(A){e=o}try{t="function"==typeof clearTimeout?clearTimeout:i}catch(A){t=i}}();var s=[],c=!1,l=-1;function g(){c&&n&&(c=!1,n.length?s=n.concat(s):l=-1,s.length&&u())}function u(){if(!c){var A=a(g);c=!0;for(var e=s.length;e;){for(n=s,s=[];++l1)for(var t=1;t=e.length?t(new a(h,f,new i(void 0,A[f]))):l(A[f],e[f],t,n,h,f,d);for(;f=0?(l(A[r],e[r],t,n,h,r,d),D=s(D,i)):l(A[r],void 0,t,n,h,r,d)}),D.forEach(function(A){l(void 0,e[A],t,n,h,A,d)})}d.length=d.length-1}}else A!==e&&("number"===p&&isNaN(A)&&isNaN(e)||t(new r(h,A,e)))}function g(A,e,t,n){return n=n||[],l(A,e,function(A){A&&n.push(A)},t),n.length?n:void 0}function u(A,e,t){if(A&&e&&t&&t.kind){for(var n=A,r=-1,o=t.path?t.path.length-1:0;++r0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},y,A),t=e.logger,n=e.stateTransformer,r=e.errorTransformer,o=e.predicate,i=e.logErrors,a=e.diffPredicate;if(void 0===t)return function(){return function(A){return function(e){return A(e)}}};if(A.getState&&A.dispatch)return console.error("[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware:\n// Logger with default options\nimport { logger } from 'redux-logger'\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n// Or you can create your own logger with custom options http://bit.ly/redux-logger-options\nimport createLogger from 'redux-logger'\nconst logger = createLogger({\n // ...options\n});\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n"),function(){return function(A){return function(e){return A(e)}}};var s=[];return function(A){var t=A.getState;return function(A){return function(c){if("function"==typeof o&&!o(t,c))return A(c);var l={};s.push(l),l.started=w.now(),l.startedTime=new Date,l.prevState=n(t()),l.action=c;var u=void 0;if(i)try{u=A(c)}catch(A){l.error=r(A)}else u=A(c);l.took=w.now()-l.started,l.nextState=n(t());var f=e.diff&&"function"==typeof a?a(t,c):e.diff;if(function(A,e){var t,n,r=e.logger,o=e.actionTransformer,i=e.titleFormatter,a=void 0===i?(t=e.timestamp,n=e.duration,function(A,e,r){var o=["action"];return o.push("%c"+String(A.type)),t&&o.push("%c@ "+e),n&&o.push("%c(in "+r.toFixed(2)+" ms)"),o.join(" ")}):i,s=e.collapsed,c=e.colors,l=e.level,u=e.diff,f=void 0===e.titleFormatter;A.forEach(function(t,n){var i=t.started,h=t.startedTime,E=t.action,p=t.prevState,w=t.error,Q=t.took,I=t.nextState,y=A[n+1];y&&(I=y.prevState,Q=y.started-i);var b=o(E),m="function"==typeof s?s(function(){return I},E,t):s,v=B(h),M=c.title?"color: "+c.title(b)+";":"",O=["color: gray; font-weight: lighter;"];O.push(M),e.timestamp&&O.push("color: gray; font-weight: lighter;"),e.duration&&O.push("color: gray; font-weight: lighter;");var F=a(b,v,Q);try{m?c.title&&f?r.groupCollapsed.apply(r,["%c "+F].concat(O)):r.groupCollapsed(F):c.title&&f?r.group.apply(r,["%c "+F].concat(O)):r.group(F)}catch(A){r.log(F)}var T=d(l,b,[p],"prevState"),R=d(l,b,[b],"action"),S=d(l,b,[w,p],"error"),k=d(l,b,[I],"nextState");if(T){if(c.prevState){var P="color: "+c.prevState(p)+"; font-weight: bold";r[T]("%c prev state",P,p)}else r[T]("prev state",p)}if(R){if(c.action){var G="color: "+c.action(b)+"; font-weight: bold";r[R]("%c action ",G,b)}else r[R]("action ",b)}if(w&&S){if(c.error){var U="color: "+c.error(w,p)+"; font-weight: bold;";r[S]("%c error ",U,w)}else r[S]("error ",w)}if(k){if(c.nextState){var Y="color: "+c.nextState(I)+"; font-weight: bold";r[k]("%c next state",Y,I)}else r[k]("next state",I)}u&&function(A,e,t,n){var r=g(A,e);try{n?t.groupCollapsed("diff"):t.group("diff")}catch(A){t.log("diff")}r?r.forEach(function(A){var e=A.kind,n=function(A){var e=A.kind,t=A.path,n=A.lhs,r=A.rhs,o=A.index,i=A.item;switch(e){case"E":return[t.join("."),n,"→",r];case"N":return[t.join("."),r];case"D":return[t.join(".")];case"A":return[t.join(".")+"["+o+"]",i];default:return[]}}(A);t.log.apply(t,["%c "+D[e].text,"color: "+D[e].color+"; font-weight: bold"].concat(C(n)))}):t.log("—— no diff ——");try{t.groupEnd()}catch(A){t.log("—— diff end —— ")}}(p,I,r,m);try{r.groupEnd()}catch(A){r.log("—— log end ——")}})}(s,Object.assign({},e,{diff:f})),s.length=0,l.error)throw l.error;return u}}}}var h,E,p=function(A,e){return Array(e-A.toString().length+1).join("0")+A},B=function(A){return p(A.getHours(),2)+":"+p(A.getMinutes(),2)+":"+p(A.getSeconds(),2)+"."+p(A.getMilliseconds(),3)},w="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance:Date,Q="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},C=function(A){if(Array.isArray(A)){for(var e=0,t=Array(A.length);e0&&void 0!==arguments[0]?arguments[0]:{},e=A.dispatch,t=A.getState;return"function"==typeof e||"function"==typeof t?f()({dispatch:e,getState:t}):void console.error("\n[redux-logger v3] BREAKING CHANGE\n[redux-logger v3] Since 3.0.0 redux-logger exports by default logger with default settings.\n[redux-logger v3] Change\n[redux-logger v3] import createLogger from 'redux-logger'\n[redux-logger v3] to\n[redux-logger v3] import { createLogger } from 'redux-logger'\n")};A.defaults=y,A.createLogger=f,A.logger=b,A.default=b,Object.defineProperty(A,"__esModule",{value:!0})}(e)},6393:function(A,e,t){"use strict";/** +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{6689:function(A,e,t){"use strict";var n,r;A.exports=(null==(n=t.g.process)?void 0:n.env)&&"object"==typeof(null==(r=t.g.process)?void 0:r.env)?t.g.process:t(5021)},8085:function(A,e,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return t(3632)}])},2838:function(A,e,t){"use strict";t.d(e,{slice:function(){return c}});var n=t(5810),r=t(7124),o=t(8426),i=t(4029),a=t(983);let s={alertMessages:[],audio:!0,audioBitRate:"",audioCodecType:"",audioContentHint:"",audioInput:"",audioInputDevices:[],audioOutput:"",audioOutputDevices:[],autoGainControl:"",blurRadius:"",bundleId:"",enabledBundleId:!1,clientId:"",channelId:"sora",googCpuOveruseDetection:null,timelineMessages:[],debug:!1,debugFilterText:"",debugType:"timeline",dataChannelSignaling:"",dataChannels:"",dataChannelMessages:[],displayResolution:"",e2ee:!1,echoCancellation:"",echoCancellationType:"",enabledClientId:!1,enabledDataChannel:!1,enabledDataChannels:!1,enabledForwardingFilter:!1,enabledMetadata:!1,enabledSignalingNotifyMetadata:!1,enabledSignalingUrlCandidates:!1,enabledVideoVP9Params:!1,enabledVideoH264Params:!1,enabledVideoH265Params:!1,enabledVideoAV1Params:!1,audioStreamingLanguageCode:"",enabledAudioStreamingLanguageCode:!1,fakeVolume:"0",fakeContents:{worker:null,colorCode:0,gainNode:null},frameRate:"",soraContents:{connectionStatus:"initializing",reconnecting:!1,reconnectingTrials:0,sora:null,connectionId:null,clientId:null,sessionId:null,localMediaStream:null,remoteClients:[],prevStatsReport:[],statsReport:[],datachannels:[],turnUrl:null},ignoreDisconnectWebSocket:"",logMessages:[],mediaProcessorsNoiseSuppression:!1,mediaStats:!1,mediaType:"getUserMedia",metadata:"",multistream:"",mute:!1,noiseSuppression:"",notifyMessages:[],pushMessages:[],resolution:"",showStats:!1,simulcast:"",spotlight:"",signalingMessages:[],signalingNotifyMetadata:"",signalingUrlCandidates:[],forwardingFilter:"",simulcastRid:"",spotlightNumber:"",spotlightFocusRid:"",spotlightUnfocusRid:"",focusedSpotlightConnectionIds:{},video:!0,videoBitRate:"",videoCodecType:"",videoContentHint:"",videoInput:"",videoInputDevices:[],videoVP9Params:"",videoH264Params:"",videoH265Params:"",videoAV1Params:"",version:"2024.1.4",cameraDevice:!0,videoTrack:!0,micDevice:!0,audioTrack:!0,role:"sendrecv",reconnect:!1,apiUrl:null,aspectRatio:"",resizeMode:"",lightAdjustment:"",lightAdjustmentProcessor:null,noiseSuppressionProcessor:null,virtualBackgroundProcessor:null,facingMode:""},c=(0,n.oM)({name:"soraDevtools",initialState:s,reducers:{resetState:A=>{Object.assign(A,s)},setAudio:(A,e)=>{A.audio=e.payload},setAudioInput:(A,e)=>{A.audioInput=e.payload},setAudioOutput:(A,e)=>{A.audioOutput=e.payload},setAudioBitRate:(A,e)=>{A.audioBitRate=e.payload},setAudioCodecType:(A,e)=>{A.audioCodecType=e.payload},setAudioContentHint:(A,e)=>{if(A.audioContentHint=e.payload,A.soraContents.localMediaStream)for(let e of A.soraContents.localMediaStream.getAudioTracks())e.contentHint=A.audioContentHint},setAutoGainControl:(A,e)=>{A.autoGainControl=e.payload},setClientId:(A,e)=>{A.clientId=e.payload},setChannelId:(A,e)=>{A.channelId=e.payload},setTimelineMessage:(A,e)=>{A.timelineMessages.push(e.payload)},setDataChannelSignaling:(A,e)=>{A.dataChannelSignaling=e.payload},setDataChannels:(A,e)=>{A.dataChannels=e.payload},setDataChannelMessage:(A,e)=>{A.dataChannelMessages.push(e.payload)},setGoogCpuOveruseDetection:(A,e)=>{A.googCpuOveruseDetection=e.payload},setDisplayResolution:(A,e)=>{A.displayResolution=e.payload},setE2EE:(A,e)=>{A.e2ee=e.payload},setEchoCancellation:(A,e)=>{A.echoCancellation=e.payload},setEchoCancellationType:(A,e)=>{A.echoCancellationType=e.payload},setEnabledClientId:(A,e)=>{A.enabledClientId=e.payload},setEnabledDataChannels:(A,e)=>{A.enabledDataChannels=e.payload},setEnabledDataChannel:(A,e)=>{A.enabledDataChannel=e.payload},setEnabledMetadata:(A,e)=>{A.enabledMetadata=e.payload},setIgnoreDisconnectWebSocket:(A,e)=>{A.ignoreDisconnectWebSocket=e.payload},setSignalingMessage:(A,e)=>{A.signalingMessages.push(e.payload)},setEnabledForwardingFilter:(A,e)=>{A.enabledForwardingFilter=e.payload},setEnabledSignalingNotifyMetadata:(A,e)=>{A.enabledSignalingNotifyMetadata=e.payload},setEnabledSignalingUrlCandidates:(A,e)=>{A.enabledSignalingUrlCandidates=e.payload},setEnabledVideoVP9Params:(A,e)=>{A.enabledVideoVP9Params=e.payload},setEnabledVideoH264Params:(A,e)=>{A.enabledVideoH264Params=e.payload},setEnabledVideoH265Params:(A,e)=>{A.enabledVideoH265Params=e.payload},setEnabledVideoAV1Params:(A,e)=>{A.enabledVideoAV1Params=e.payload},setFakeVolume:(A,e)=>{let t=Number.parseFloat(e.payload);Number.isNaN(t)?A.fakeVolume="0":1{A.fakeContents.gainNode=e.payload},setInitialFakeContents:A=>{if(A.fakeContents.colorCode=Math.floor(16777215*Math.random()),URL.createObjectURL){let e=URL.createObjectURL(new Blob([a.lt],{type:"application/javascript"}));A.fakeContents.worker=new Worker(e)}},setFrameRate:(A,e)=>{A.frameRate=e.payload},setMute:(A,e)=>{A.mute=e.payload},setMediaStats:(A,e)=>{A.mediaStats=e.payload},setNoiseSuppression:(A,e)=>{A.noiseSuppression=e.payload},setMediaType:(A,e)=>{"mediacaptureRegion"===e.payload&&void 0===window.CropTarget?A.mediaType="getUserMedia":A.mediaType=e.payload},setMetadata:(A,e)=>{A.metadata=e.payload},setResolution:(A,e)=>{A.resolution=e.payload},setSignalingNotifyMetadata:(A,e)=>{A.signalingNotifyMetadata=e.payload},setSignalingUrlCandidates:(A,e)=>{A.signalingUrlCandidates=e.payload},setForwardingFilter:(A,e)=>{A.forwardingFilter=e.payload},setSimulcastRid:(A,e)=>{A.simulcastRid=e.payload},setSpotlightNumber:(A,e)=>{A.spotlightNumber=e.payload},setSpotlightFocusRid:(A,e)=>{A.spotlightFocusRid=e.payload},setSpotlightUnfocusRid:(A,e)=>{A.spotlightUnfocusRid=e.payload},setVideo:(A,e)=>{A.video=e.payload},setVideoInput:(A,e)=>{A.videoInput=e.payload},setVideoBitRate:(A,e)=>{A.videoBitRate=e.payload},setVideoCodecType:(A,e)=>{A.videoCodecType=e.payload},setVideoContentHint:(A,e)=>{if(A.videoContentHint=e.payload,A.soraContents.localMediaStream)for(let e of A.soraContents.localMediaStream.getVideoTracks())e.contentHint=A.videoContentHint},setVideoVP9Params:(A,e)=>{A.videoVP9Params=e.payload},setVideoH264Params:(A,e)=>{A.videoH264Params=e.payload},setVideoH265Params:(A,e)=>{A.videoH265Params=e.payload},setVideoAV1Params:(A,e)=>{A.videoAV1Params=e.payload},setSora:(A,e)=>{A.soraContents.sora=e.payload,A.soraContents.sora||(A.soraContents.datachannels=[])},setSoraSessionId:(A,e)=>{A.soraContents.sessionId=e.payload},setSoraConnectionId:(A,e)=>{A.soraContents.connectionId=e.payload},setSoraClientId:(A,e)=>{A.soraContents.clientId=e.payload},setSoraTurnUrl:(A,e)=>{A.soraContents.turnUrl=e.payload},setSoraConnectionStatus:(A,e)=>{A.soraContents.connectionStatus=e.payload},setSoraReconnecting:(A,e)=>{A.soraContents.reconnecting=e.payload,!1===A.soraContents.reconnecting&&(A.soraContents.reconnectingTrials=0)},setSoraReconnectingTrials:(A,e)=>{A.soraContents.reconnectingTrials=e.payload},setSoraDataChannels:(A,e)=>{A.soraContents.datachannels.push(e.payload)},setLocalMediaStream:(A,e)=>{A.soraContents.localMediaStream&&A.soraContents.localMediaStream.getTracks().filter(A=>{A.stop()}),A.soraContents.localMediaStream=e.payload},setRemoteClient:(A,e)=>{A.soraContents.remoteClients.push(e.payload)},setSoraRemoteClientId:(A,e)=>{for(let t of A.soraContents.remoteClients)t.connectionId===e.payload.connectionId&&(t.clientId=e.payload.clientId)},setStatsReport:(A,e)=>{A.soraContents.prevStatsReport=A.soraContents.statsReport,A.soraContents.statsReport=e.payload},removeRemoteClient:(A,e)=>{let t=A.soraContents.remoteClients.filter(A=>A.connectionId!==e.payload);A.soraContents.remoteClients=t},removeAllRemoteClients:A=>{A.soraContents.remoteClients=[]},setAudioInputDevices:(A,e)=>{A.audioInputDevices=e.payload},setVideoInputDevices:(A,e)=>{A.videoInputDevices=e.payload},setAudioOutputDevices:(A,e)=>{A.audioOutputDevices=e.payload},setSoraInfoAlertMessage:(A,e)=>{let t={title:"Sora info",type:"info",message:e.payload,timestamp:new Date().getTime()};l(A.alertMessages,A.logMessages,t)},setSoraErrorAlertMessage:(A,e)=>{let t={title:"Sora error",type:"error",message:e.payload,timestamp:new Date().getTime()};l(A.alertMessages,A.logMessages,t)},setAPIInfoAlertMessage:(A,e)=>{let t={title:"API info",type:"info",message:e.payload,timestamp:new Date().getTime()};l(A.alertMessages,A.logMessages,t)},setAPIErrorAlertMessage:(A,e)=>{let t={title:"API error",type:"error",message:e.payload,timestamp:new Date().getTime()};l(A.alertMessages,A.logMessages,t)},deleteAlertMessage:(A,e)=>{let t=A.alertMessages.filter(A=>A.timestamp!==e.payload);A.alertMessages=t},setDebug:(A,e)=>{A.debug=e.payload},setDebugFilterText:(A,e)=>{A.debugFilterText=e.payload},setDebugType:(A,e)=>{A.debugFilterText="",A.debugType=e.payload},setLogMessages:(A,e)=>{A.logMessages.push({timestamp:new Date().getTime(),message:{title:e.payload.title,description:e.payload.description}})},setNotifyMessages:(A,e)=>{A.notifyMessages.push(e.payload)},setPushMessages:(A,e)=>{A.pushMessages.push(e.payload)},setFocusedSpotlightConnectionId:(A,e)=>{A.focusedSpotlightConnectionIds[e.payload]=!0},setUnFocusedSpotlightConnectionId:(A,e)=>{A.focusedSpotlightConnectionIds[e.payload]=!1},deleteFocusedSpotlightConnectionId:(A,e)=>{delete A.focusedSpotlightConnectionIds[e.payload]},setShowStats:(A,e)=>{A.showStats=e.payload},setCameraDevice:(A,e)=>{A.cameraDevice=e.payload},setMicDevice:(A,e)=>{A.micDevice=e.payload},setAudioTrack:(A,e)=>{if(A.audioTrack=e.payload,A.soraContents.localMediaStream)for(let e of A.soraContents.localMediaStream.getAudioTracks())e.enabled=A.audioTrack},setVideoTrack:(A,e)=>{if(A.videoTrack=e.payload,A.soraContents.localMediaStream)for(let e of A.soraContents.localMediaStream.getVideoTracks())e.enabled=A.videoTrack},setRole:(A,e)=>{A.role=e.payload},setMultistream:(A,e)=>{A.multistream=e.payload},setSimulcast:(A,e)=>{A.simulcast=e.payload},setSpotlight:(A,e)=>{A.spotlight=e.payload},setReconnect:(A,e)=>{A.reconnect=e.payload},setApiUrl:(A,e)=>{A.apiUrl=e.payload},clearDataChannelMessages:A=>{A.dataChannelMessages=[]},setAspectRatio:(A,e)=>{A.aspectRatio=e.payload},setResizeMode:(A,e)=>{A.resizeMode=e.payload},setLightAdjustment:(A,e)=>{if(""!==e.payload&&null===A.lightAdjustmentProcessor){let e=new r.jA;A.lightAdjustmentProcessor=e}A.lightAdjustment=e.payload},setBlurRadius:(A,e)=>{if(""!==e.payload&&null===A.virtualBackgroundProcessor){let e=new i.sz("https://cdn.jsdelivr.net/npm/@shiguredo/virtual-background@latest/dist");A.virtualBackgroundProcessor=e}A.blurRadius=e.payload},setMediaProcessorsNoiseSuppression:(A,e)=>{if(e.payload&&null===A.noiseSuppressionProcessor){let e=new o.b("https://cdn.jsdelivr.net/npm/@shiguredo/noise-suppression@latest/dist");A.noiseSuppressionProcessor=e}A.mediaProcessorsNoiseSuppression=e.payload},setBundleId:(A,e)=>{A.bundleId=e.payload},setEnabledBundleId:(A,e)=>{A.enabledBundleId=e.payload},setFacingMode:(A,e)=>{A.facingMode=e.payload},setAudioStreamingLanguageCode:(A,e)=>{A.audioStreamingLanguageCode=e.payload},setEnabledAudioStreamingLanguageCode:(A,e)=>{A.enabledAudioStreamingLanguageCode=e.payload}}});function l(A,e,t){if(10<=A.length)for(let e=0;e<=A.length-5;e++)A.pop();A.unshift(t),e.push({timestamp:t.timestamp,message:{title:"ALERT MESSAGE ".concat(t.title),description:JSON.stringify({title:t.title,type:t.type,message:t.message})}})}},8154:function(A,e,t){"use strict";t.d(e,{h:function(){return o}});var n=t(5810);t(3054);var r=t(2838);let o=(0,n.xC)({reducer:r.slice.reducer,middleware:A=>A({serializableCheck:{ignoredActions:["soraDevtools/setSora","soraDevtools/setLocalMediaStream","soraDevtools/setRemoteClient","soraDevtools/setFakeContentsGainNode","soraDevtools/setDataChannelMessage"],ignoredPaths:["soraContents","fakeContents","dataChannelMessages","logMessages","notifyMessages","pushMessages","signalingMessages","lightAdjustmentProcessor","virtualBackgroundProcessor","noiseSuppressionProcessor"]},immutableCheck:{ignoredPaths:["soraContents","fakeContents","dataChannelMessages","logMessages","notifyMessages","pushMessages","signalingMessages","noiseSuppressionProcessor"]}})})},983:function(A,e,t){"use strict";t.d(e,{Ii:function(){return y},xR:function(){return s},o1:function(){return a},nT:function(){return I},iN:function(){return g},G_:function(){return m},l9:function(){return w},aF:function(){return C},PS:function(){return d},cJ:function(){return f},pT:function(){return O},kt:function(){return Q},x$:function(){return T},Xv:function(){return v},w_:function(){return h},u9:function(){return r},ad:function(){return u},L4:function(){return b},K$:function(){return M},VE:function(){return o},WJ:function(){return B},VJ:function(){return i},I7:function(){return p},Xr:function(){return E},Q5:function(){return l},Sh:function(){return c},QO:function(){return D},lt:function(){return F}});var n=JSON.parse('{"channelId":{"description":"接続するチャネルの ID を指定します。\\n1-255 文字までの文字列を指定できます。"},"role":{"description":"クライアントの役割を指定します。"},"multistream":{"description":"マルチストリームを使用するかどうかを指定します。Sora は未指定の場合、マルチストリームを使用します。"},"simulcast":{"description":"サイマルキャストを使用するかどうかを指定します。"},"simulcastRid":{"description":"サイマルキャストで配信されている映像を受信する際のエンコードの初期値を指定します。"},"spotlight":{"description":"スポットライトを使用するかどうかを指定します。"},"spotlightNumber":{"description":"スポットライトでフォーカスする配信数の最大値を指定します。"},"spotlightFocusRid":{"description":"スポットライトでフォーカスした場合の映像を受信する際のエンコードの初期値を指定します。"},"spotlightUnfocusRid":{"description":"スポットライトでフォーカスが外れた場合の映像を受信する際のエンコードの初期値を指定します。"},"audio":{"description":"音声配信をするかどうかを指定します。"},"audioCodecType":{"description":"音声のコーデックタイプを指定します。"},"audioBitRate":{"description":"音声のビットレートを指定します。"},"video":{"description":"映像配信をするかどうかを指定します。"},"videoCodecType":{"description":"映像のコーデックタイプを指定します。"},"videoBitRate":{"description":"映像のビットレートを指定します。"},"videoVP9Params":{"description":"映像のコーデックタイプに VP9 を指定した場合の設定を指定します。"},"videoH264Params":{"description":"映像のコーデックタイプに H264 を指定した場合の設定を指定します。"},"videoH265Params":{"description":"映像のコーデックタイプに H265 を指定した場合の設定を指定します。"},"videoAV1Params":{"description":"映像のコーデックタイプに AV1 を指定した場合の設定を指定します。"},"e2ee":{"description":"E2EE(End-to-End Encryption) を使用するかどうかを指定します。"},"reconnect":{"description":"一度接続に成功したあとに意図しない切断があった場合に再接続するかどうかを指定します。"},"clientId":{"description":"接続時に任意のクライアント ID を指定できます。"},"metadata":{"description":"認証するための判断材料としてのメタデータを指定します。"},"bundleId":{"description":"複数接続時に同一の bundle_id を指定すると、同一 bundle_id の接続から音声や映像やメッセージングを受信しなくなります。"},"signalingNotifyMetadata":{"description":"クライアントが参加や離脱したときに送られるシグナリング通知に含まれるメタデータを指定します。"},"signalingUrlCandidates":{"description":"シグナリングをするURLを改行区切りで複数指定します。"},"forwardingFilter":{"description":"デフォルトの転送フィルターを指定します。"},"audioStreamingLanguageCode":{"description":"音声解析用の言語コードを指定します。"},"dataChannels":{"description":"メッセージング用の DataChannel を指定します。"},"dataChannelSignaling":{"description":"シグナリングを DataChannel 経由に切り替えるかどうかを指定します。"},"ignoreDisconnectWebSocket":{"description":"シグナリングを DataChannel 経由に切り替えた際に、 WebSocket が閉じても、接続が切断しないようにするかどうかを指定します。"},"mediaType":{"description":"メディアタイプを指定します。\\ngetUserMedia: デバイスのカメラ/マイクをメディアとして使用します。\\ngetDisplayMedia: ディスプレイまたはその一部(ウィンドウ等)をメディアとして使用します。\\nfakeMedia: ダミーの映像と音声をメディアとして使用します\\nmediacaptureRegion: 現在開いているタブの一部をメディアとして使用します。"},"fakeVolume":{"description":"mediaType に fakeMedia を選択した際の音量を指定します。"},"audioContentHint":{"description":"MediaStreamTrack audio の contentHint を指定します。"},"autoGainControl":{"description":"MediaTrackConstraints の autoGainControl を指定します。"},"noiseSuppression":{"description":"MediaTrackConstraints の noiseSuppression を指定します。"},"echoCancellation":{"description":"MediaTrackConstraints の echoCancellation を指定します。"},"echoCancellationType":{"description":"MediaTrackConstraints の echoCancellationType を指定します。"},"mediaProcessorsNoiseSuppression":{"description":"shiguredo Media Processors のノイズ抑制を使用するかどうか指定します。"},"videoContentHint":{"description":"MediaStreamTrack video の contentHint を指定します。"},"resolution":{"description":"解像度を指定します。任意の解像度を指定する場合は、幅と高さを x 区切りで指定します。 (例: 640x480)"},"mediaStats":{"description":"映像の統計情報を映像に重ねて表示します。"},"frameRate":{"description":"MediaTrackConstraints の frameRate を指定します。"},"aspectRatio":{"description":"MediaTrackConstraints の aspectRatio を指定します。"},"resizeMode":{"description":"MediaTrackConstraints の resizeMode を指定します。"},"blurRadius":{"description":"shiguredo Media Processors の背景ぼかしを使用するかどうか指定します。"},"lightAdjustment":{"description":"shiguredo Media Processors のライト調整を使用するかどうか指定します。"},"audioInput":{"description":"音声入力を指定します。"},"videoInput":{"description":"映像入力を指定します。"},"audioOutput":{"description":"音声出力を指定します。"},"displayResolution":{"description":"画面に表示する際の解像度を指定します。任意の解像度を指定する場合は、幅と高さを x 区切りで指定します。 (例: 640x480)"},"micDevice":{"description":"Audio MediaStreamTrack を生成するかどうかを切り替えます。"},"cameraDevice":{"description":"Video MediaStreamTrack を生成するかどうかを切り替えます。"},"audioTrack":{"description":"Audio MediaStreamTrack の enabled 属性を切り替えます。"},"videoTrack":{"description":"video MediaStreamTrack の enabled 属性を切り替えます。"},"facingMode":{"description":"モバイルカメラのフロント/バックを切り替えます。"},"changeAllRecvStream":{"description":"サイマルキャストで受信中の全てのストリームの rid を操作します。"}}');let r=["","true","false"],o=["","true","false"],i=["","true","false"],a=["","OPUS"],s=["","8","16","24","32","64","96","128","256"],c=["","VP8","VP9","AV1","H264","H265"],l=["","10","30","50","100","300","500","800","1000","1500","2000","2500","3000","5000","10000","15000","20000","30000","50000"],g=["","true","false"],u=["","true","false"],d=["","true","false"],f=["","browser","system"],h=["getUserMedia","getDisplayMedia","fakeMedia","mediacaptureRegion"],E=["","1","2","3","4","5","6","7","8"],p=["","none","r0","r1","r2"],B=["","r0","r1","r2"],w=["","true","false"],Q=["","true","false"],C=["log","notify","push","stats","timeline","signaling","messaging","codec"],I=["","speech","speech-recognition","music"],D=["","motion","detail","text"],y=["","4:3","16:9","21:9"],b=["","none","crop-and-scale"],m=["","weak","medium","strong"],v=["","weak","medium","strong"],M=["sendrecv","sendonly","recvonly"],O=["","front","back"],F='\nself.onmessage = (event) => {\n const data = event.data;\n if (data.type === "start") {\n const interval = data.interval;\n self.counter = 0;\n const intervalId = setInterval(() => {\n const message = { type: "update", counter: self.counter };\n self.postMessage(message);\n self.counter++;\n }, interval);\n self.intervalId = intervalId;\n } else if (data.type === "stop") {\n if (self.intervalId) {\n clearInterval(self.intervalId);\n }\n const message = { type: "stop" };\n self.postMessage(message);\n }\n};\n',T=n},3632:function(A,e,t){"use strict";t.r(e);var n=t(2676);t(9377),t(8772);var r=t(4690),o=t(8154);e.default=A=>{let{Component:e,pageProps:t}=A;return(0,n.jsx)(r.zt,{store:o.h,children:(0,n.jsx)(e,{...t})})}},9377:function(){},8772:function(){},5021:function(A){!function(){var e={229:function(A){var e,t,n,r=A.exports={};function o(){throw Error("setTimeout has not been defined")}function i(){throw Error("clearTimeout has not been defined")}function a(A){if(e===setTimeout)return setTimeout(A,0);if((e===o||!e)&&setTimeout)return e=setTimeout,setTimeout(A,0);try{return e(A,0)}catch(t){try{return e.call(null,A,0)}catch(t){return e.call(this,A,0)}}}!function(){try{e="function"==typeof setTimeout?setTimeout:o}catch(A){e=o}try{t="function"==typeof clearTimeout?clearTimeout:i}catch(A){t=i}}();var s=[],c=!1,l=-1;function g(){c&&n&&(c=!1,n.length?s=n.concat(s):l=-1,s.length&&u())}function u(){if(!c){var A=a(g);c=!0;for(var e=s.length;e;){for(n=s,s=[];++l1)for(var t=1;t=e.length?t(new a(h,f,new i(void 0,A[f]))):l(A[f],e[f],t,n,h,f,d);for(;f=0?(l(A[r],e[r],t,n,h,r,d),D=s(D,i)):l(A[r],void 0,t,n,h,r,d)}),D.forEach(function(A){l(void 0,e[A],t,n,h,A,d)})}d.length=d.length-1}}else A!==e&&("number"===p&&isNaN(A)&&isNaN(e)||t(new r(h,A,e)))}function g(A,e,t,n){return n=n||[],l(A,e,function(A){A&&n.push(A)},t),n.length?n:void 0}function u(A,e,t){if(A&&e&&t&&t.kind){for(var n=A,r=-1,o=t.path?t.path.length-1:0;++r0&&void 0!==arguments[0]?arguments[0]:{},e=Object.assign({},y,A),t=e.logger,n=e.stateTransformer,r=e.errorTransformer,o=e.predicate,i=e.logErrors,a=e.diffPredicate;if(void 0===t)return function(){return function(A){return function(e){return A(e)}}};if(A.getState&&A.dispatch)return console.error("[redux-logger] redux-logger not installed. Make sure to pass logger instance as middleware:\n// Logger with default options\nimport { logger } from 'redux-logger'\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n// Or you can create your own logger with custom options http://bit.ly/redux-logger-options\nimport createLogger from 'redux-logger'\nconst logger = createLogger({\n // ...options\n});\nconst store = createStore(\n reducer,\n applyMiddleware(logger)\n)\n"),function(){return function(A){return function(e){return A(e)}}};var s=[];return function(A){var t=A.getState;return function(A){return function(c){if("function"==typeof o&&!o(t,c))return A(c);var l={};s.push(l),l.started=w.now(),l.startedTime=new Date,l.prevState=n(t()),l.action=c;var u=void 0;if(i)try{u=A(c)}catch(A){l.error=r(A)}else u=A(c);l.took=w.now()-l.started,l.nextState=n(t());var f=e.diff&&"function"==typeof a?a(t,c):e.diff;if(function(A,e){var t,n,r=e.logger,o=e.actionTransformer,i=e.titleFormatter,a=void 0===i?(t=e.timestamp,n=e.duration,function(A,e,r){var o=["action"];return o.push("%c"+String(A.type)),t&&o.push("%c@ "+e),n&&o.push("%c(in "+r.toFixed(2)+" ms)"),o.join(" ")}):i,s=e.collapsed,c=e.colors,l=e.level,u=e.diff,f=void 0===e.titleFormatter;A.forEach(function(t,n){var i=t.started,h=t.startedTime,E=t.action,p=t.prevState,w=t.error,Q=t.took,I=t.nextState,y=A[n+1];y&&(I=y.prevState,Q=y.started-i);var b=o(E),m="function"==typeof s?s(function(){return I},E,t):s,v=B(h),M=c.title?"color: "+c.title(b)+";":"",O=["color: gray; font-weight: lighter;"];O.push(M),e.timestamp&&O.push("color: gray; font-weight: lighter;"),e.duration&&O.push("color: gray; font-weight: lighter;");var F=a(b,v,Q);try{m?c.title&&f?r.groupCollapsed.apply(r,["%c "+F].concat(O)):r.groupCollapsed(F):c.title&&f?r.group.apply(r,["%c "+F].concat(O)):r.group(F)}catch(A){r.log(F)}var T=d(l,b,[p],"prevState"),R=d(l,b,[b],"action"),S=d(l,b,[w,p],"error"),k=d(l,b,[I],"nextState");if(T){if(c.prevState){var P="color: "+c.prevState(p)+"; font-weight: bold";r[T]("%c prev state",P,p)}else r[T]("prev state",p)}if(R){if(c.action){var G="color: "+c.action(b)+"; font-weight: bold";r[R]("%c action ",G,b)}else r[R]("action ",b)}if(w&&S){if(c.error){var U="color: "+c.error(w,p)+"; font-weight: bold;";r[S]("%c error ",U,w)}else r[S]("error ",w)}if(k){if(c.nextState){var Y="color: "+c.nextState(I)+"; font-weight: bold";r[k]("%c next state",Y,I)}else r[k]("next state",I)}u&&function(A,e,t,n){var r=g(A,e);try{n?t.groupCollapsed("diff"):t.group("diff")}catch(A){t.log("diff")}r?r.forEach(function(A){var e=A.kind,n=function(A){var e=A.kind,t=A.path,n=A.lhs,r=A.rhs,o=A.index,i=A.item;switch(e){case"E":return[t.join("."),n,"→",r];case"N":return[t.join("."),r];case"D":return[t.join(".")];case"A":return[t.join(".")+"["+o+"]",i];default:return[]}}(A);t.log.apply(t,["%c "+D[e].text,"color: "+D[e].color+"; font-weight: bold"].concat(C(n)))}):t.log("—— no diff ——");try{t.groupEnd()}catch(A){t.log("—— diff end —— ")}}(p,I,r,m);try{r.groupEnd()}catch(A){r.log("—— log end ——")}})}(s,Object.assign({},e,{diff:f})),s.length=0,l.error)throw l.error;return u}}}}var h,E,p=function(A,e){return Array(e-A.toString().length+1).join("0")+A},B=function(A){return p(A.getHours(),2)+":"+p(A.getMinutes(),2)+":"+p(A.getSeconds(),2)+"."+p(A.getMilliseconds(),3)},w="undefined"!=typeof performance&&null!==performance&&"function"==typeof performance.now?performance:Date,Q="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},C=function(A){if(Array.isArray(A)){for(var e=0,t=Array(A.length);e0&&void 0!==arguments[0]?arguments[0]:{},e=A.dispatch,t=A.getState;return"function"==typeof e||"function"==typeof t?f()({dispatch:e,getState:t}):void console.error("\n[redux-logger v3] BREAKING CHANGE\n[redux-logger v3] Since 3.0.0 redux-logger exports by default logger with default settings.\n[redux-logger v3] Change\n[redux-logger v3] import createLogger from 'redux-logger'\n[redux-logger v3] to\n[redux-logger v3] import { createLogger } from 'redux-logger'\n")};A.defaults=y,A.createLogger=f,A.logger=b,A.default=b,Object.defineProperty(A,"__esModule",{value:!0})}(e)},6393:function(A,e,t){"use strict";/** * @license React * use-sync-external-store-with-selector.production.min.js * diff --git a/dist/_next/static/chunks/pages/devtools-7bc173685e1c8bb6.js b/dist/_next/static/chunks/pages/devtools-e382fa421704869f.js similarity index 56% rename from dist/_next/static/chunks/pages/devtools-7bc173685e1c8bb6.js rename to dist/_next/static/chunks/pages/devtools-e382fa421704869f.js index 1d8e2a05..e8d3fa65 100644 --- a/dist/_next/static/chunks/pages/devtools-7bc173685e1c8bb6.js +++ b/dist/_next/static/chunks/pages/devtools-e382fa421704869f.js @@ -1 +1 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[893],{4047:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/devtools",function(){return a(7034)}])},7034:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return iR}});var n=a(2676),i=a(5271),s=a(7124),o=a(8426),l=a(4029),r=a(511),c=a(8039),d=a(983);function u(e){let t=new Date(e),a=t.getFullYear(),n=t.getMonth()+1,i=t.getDate(),s=t.getHours().toString().padStart(2,"0"),o=t.getMinutes().toString().padStart(2,"0"),l=t.getSeconds().toString().padStart(2,"0"),r=t.getMilliseconds().toString().padStart(3,"0");return"".concat(a,"-").concat(n,"-").concat(i," ").concat(s,":").concat(o,":").concat(l,".").concat(r)}function m(e){return navigator.clipboard?navigator.clipboard.writeText(e):Promise.resolve()}function g(e,t){return"string"==typeof e&&t.indexOf(e)>=0}function h(e,t){if(e)return t.filter(e=>""!==e);let a="https:"===window.location.protocol?"wss://":"ws://",n=window.location.port?":".concat(window.location.port):"";return"".concat(a+window.location.hostname+n,"/signaling")}let p=/^(\d+)x(\d+)$/;function v(e){if(p.test(e)){let t=e.match(p);if(t)return{width:Number.parseInt(t[1],10),height:Number.parseInt(t[2],10)}}return{width:0,height:0}}function x(e){switch(e){case"4:3":return 4/3;case"16:9":return 16/9;case"21:9":return 20/9;default:return Number.NaN}}function j(e){let{audio:t,autoGainControl:a,noiseSuppression:n,echoCancellation:i,echoCancellationType:s}=e;if(!t)return!1;if(!a&&!n&&!i&&!s)return!0;let o={},l=C(a);void 0!==l&&(o.autoGainControl=l);let r=C(n);void 0!==r&&(o.noiseSuppression=r);let c=C(i);return void 0!==c&&(o.echoCancellation=c),s&&(o.echoCancellationType=s),o}function f(e){let{aspectRatio:t,frameRate:a,resizeMode:n,resolution:i}=e;if(!a&&!i&&!t&&!n)return!0;let s={};if(a){let e=Number.parseInt(a,10);Number.isNaN(e)||(s.frameRate=e)}if(i){let{width:e,height:t}=v(i);0async(e,t)=>{e(T.slice.actions.resetState());let a=function(){let e;let t=e=>{if("string"==typeof e)return e},a=e=>{if("string"==typeof e)return C(e)},n=(e,t)=>{if(g(e,t))return e},i=c.Z.parse(location.search);if("string"==typeof i.signalingUrlCandidates)try{e=JSON.parse(i.signalingUrlCandidates)}catch(e){}let s={apiUrl:t(i.apiUrl),audio:a(i.audio),audioBitRate:n(i.audioBitRate,d.xR),audioCodecType:n(i.audioCodecType,d.o1),audioStreamingLanguageCode:t(i.audioStreamingLanguageCode),autoGainControl:n(i.autoGainControl,d.iN),bundleId:t(i.bundleId),channelId:t(i.channelId),clientId:t(i.clientId),googCpuOveruseDetection:a(i.googCpuOveruseDetection),debug:a(i.debug),debugType:n(i.debugType,d.aF),displayResolution:t(i.displayResolution),e2ee:a(i.e2ee),echoCancellation:n(i.echoCancellation,d.PS),echoCancellationType:n(i.echoCancellationType,d.cJ),noiseSuppression:n(i.noiseSuppression,d.ad),facingMode:n(i.facingMode,d.pT),fakeVolume:t(i.fakeVolume),frameRate:t(i.frameRate),mediaStats:a(i.mediaStats),mediaType:n(i.mediaType,d.w_),metadata:t(i.metadata),showStats:a(i.showStats),signalingNotifyMetadata:t(i.signalingNotifyMetadata),signalingUrlCandidates:Array.isArray(e)?e:void 0,forwardingFilter:t(i.forwardingFilter),simulcast:n(i.simulcast,d.VE),simulcastRid:n(i.simulcastRid,d.WJ),spotlight:n(i.spotlight,d.VJ),spotlightNumber:n(i.spotlightNumber,d.Xr),spotlightFocusRid:n(i.spotlightFocusRid,d.I7),spotlightUnfocusRid:n(i.spotlightUnfocusRid,d.I7),resolution:t(i.resolution),video:a(i.video),videoBitRate:n(i.videoBitRate,d.Q5),videoCodecType:n(i.videoCodecType,d.Sh),videoVP9Params:t(i.videoVP9Params),videoH264Params:t(i.videoH264Params),videoH265Params:t(i.videoH265Params),videoAV1Params:t(i.videoAV1Params),audioInput:t(i.audioInput),videoInput:t(i.videoInput),audioOutput:t(i.audioOutput),mute:a(i.mute),dataChannelSignaling:n(i.dataChannelSignaling,d.l9),ignoreDisconnectWebSocket:n(i.ignoreDisconnectWebSocket,d.kt),micDevice:a(i.micDevice),cameraDevice:a(i.cameraDevice),audioTrack:a(i.audioTrack),videoTrack:a(i.videoTrack),dataChannels:t(i.dataChannels),reconnect:a(i.reconnect),audioContentHint:n(i.audioContentHint,d.nT),videoContentHint:n(i.videoContentHint,d.QO),aspectRatio:n(i.aspectRatio,d.Ii),resizeMode:n(i.resizeMode,d.L4),blurRadius:n(i.blurRadius,d.G_),lightAdjustment:n(i.lightAdjustment,d.Xv),mediaProcessorsNoiseSuppression:a(i.mediaProcessorsNoiseSuppression),multistream:n(i.multistream,d.u9),role:n(i.role,d.K$)};return Object.keys(s).map(e=>{void 0===s[e]&&delete s[e]}),s}();void 0!==a.audio&&e(T.slice.actions.setAudio(a.audio)),void 0!==a.audioBitRate&&e(T.slice.actions.setAudioBitRate(a.audioBitRate)),void 0!==a.audioCodecType&&e(T.slice.actions.setAudioCodecType(a.audioCodecType));let n=await S(),i=n.find(e=>"audioinput"===e.kind&&e.deviceId===a.audioInput);void 0!==i&&e(T.slice.actions.setAudioInput(i.deviceId));let s=n.find(e=>"audiooutput"===e.kind&&e.deviceId===a.audioOutput);void 0!==s&&e(T.slice.actions.setAudioOutput(s.deviceId));let o=n.find(e=>"videoinput"===e.kind&&e.deviceId===a.videoInput);void 0!==o&&e(T.slice.actions.setVideoInput(o.deviceId)),void 0!==a.autoGainControl&&e(T.slice.actions.setAutoGainControl(a.autoGainControl)),void 0!==a.channelId&&e(T.slice.actions.setChannelId(a.channelId)),void 0!==a.displayResolution&&e(T.slice.actions.setDisplayResolution(a.displayResolution)),void 0!==a.e2ee&&e(T.slice.actions.setE2EE(a.e2ee)),void 0!==a.echoCancellation&&e(T.slice.actions.setEchoCancellation(a.echoCancellation)),void 0!==a.echoCancellationType&&e(T.slice.actions.setEchoCancellationType(a.echoCancellationType)),void 0!==a.mediaStats&&e(T.slice.actions.setMediaStats(a.mediaStats)),void 0!==a.mediaType&&e(T.slice.actions.setMediaType(a.mediaType)),void 0!==a.facingMode&&e(T.slice.actions.setFacingMode(a.facingMode)),void 0!==a.fakeVolume&&e(T.slice.actions.setFakeVolume(a.fakeVolume)),void 0!==a.frameRate&&e(T.slice.actions.setFrameRate(a.frameRate)),void 0!==a.multistream&&e(T.slice.actions.setMultistream(a.multistream)),void 0!==a.noiseSuppression&&e(T.slice.actions.setNoiseSuppression(a.noiseSuppression)),void 0!==a.resolution&&e(T.slice.actions.setResolution(a.resolution)),void 0!==a.showStats&&e(T.slice.actions.setShowStats(a.showStats)),void 0!==a.simulcast&&e(T.slice.actions.setSimulcast(a.simulcast)),void 0!==a.simulcastRid&&e(T.slice.actions.setSimulcastRid(a.simulcastRid)),void 0!==a.spotlight&&e(T.slice.actions.setSpotlight(a.spotlight)),void 0!==a.spotlightNumber&&e(T.slice.actions.setSpotlightNumber(a.spotlightNumber)),void 0!==a.spotlightFocusRid&&e(T.slice.actions.setSpotlightFocusRid(a.spotlightFocusRid)),void 0!==a.spotlightUnfocusRid&&e(T.slice.actions.setSpotlightUnfocusRid(a.spotlightUnfocusRid)),void 0!==a.video&&e(T.slice.actions.setVideo(a.video)),void 0!==a.videoBitRate&&e(T.slice.actions.setVideoBitRate(a.videoBitRate)),void 0!==a.videoCodecType&&e(T.slice.actions.setVideoCodecType(a.videoCodecType)),void 0!==a.videoVP9Params&&e(T.slice.actions.setVideoVP9Params(a.videoVP9Params)),void 0!==a.videoH264Params&&e(T.slice.actions.setVideoH264Params(a.videoH264Params)),void 0!==a.videoH265Params&&e(T.slice.actions.setVideoH265Params(a.videoH265Params)),void 0!==a.videoAV1Params&&e(T.slice.actions.setVideoAV1Params(a.videoAV1Params)),void 0!==a.debug&&e(T.slice.actions.setDebug(a.debug)),void 0!==a.debugType&&e(T.slice.actions.setDebugType(a.debugType)),void 0!==a.mute&&e(T.slice.actions.setMute(a.mute)),void 0!==a.dataChannelSignaling&&e(T.slice.actions.setDataChannelSignaling(a.dataChannelSignaling)),void 0!==a.ignoreDisconnectWebSocket&&e(T.slice.actions.setIgnoreDisconnectWebSocket(a.ignoreDisconnectWebSocket)),void 0!==a.micDevice&&e(T.slice.actions.setMicDevice(a.micDevice)),void 0!==a.cameraDevice&&e(T.slice.actions.setCameraDevice(a.cameraDevice)),void 0!==a.audioTrack&&e(T.slice.actions.setAudioTrack(a.audioTrack)),void 0!==a.videoTrack&&e(T.slice.actions.setVideoTrack(a.videoTrack)),void 0!==a.googCpuOveruseDetection&&null!==a.googCpuOveruseDetection&&e(T.slice.actions.setGoogCpuOveruseDetection(a.googCpuOveruseDetection)),void 0!==a.bundleId&&e(T.slice.actions.setBundleId(a.bundleId)),void 0!==a.clientId&&e(T.slice.actions.setClientId(a.clientId)),void 0!==a.metadata&&e(T.slice.actions.setMetadata(a.metadata)),void 0!==a.signalingNotifyMetadata&&e(T.slice.actions.setSignalingNotifyMetadata(a.signalingNotifyMetadata)),void 0!==a.signalingUrlCandidates&&e(T.slice.actions.setSignalingUrlCandidates(a.signalingUrlCandidates)),void 0!==a.forwardingFilter&&e(T.slice.actions.setForwardingFilter(a.forwardingFilter)),void 0!==a.dataChannels&&e(T.slice.actions.setDataChannels(a.dataChannels)),void 0!==a.audioContentHint&&e(T.slice.actions.setAudioContentHint(a.audioContentHint)),void 0!==a.videoContentHint&&e(T.slice.actions.setVideoContentHint(a.videoContentHint)),void 0!==a.reconnect&&e(T.slice.actions.setReconnect(a.reconnect)),void 0!==a.aspectRatio&&e(T.slice.actions.setAspectRatio(a.aspectRatio)),void 0!==a.resizeMode&&e(T.slice.actions.setResizeMode(a.resizeMode)),void 0!==a.blurRadius&&e(T.slice.actions.setBlurRadius(a.blurRadius)),void 0!==a.lightAdjustment&&e(T.slice.actions.setLightAdjustment(a.lightAdjustment)),void 0!==a.mediaProcessorsNoiseSuppression&&e(T.slice.actions.setMediaProcessorsNoiseSuppression(a.mediaProcessorsNoiseSuppression)),void 0!==a.apiUrl&&null!==a.apiUrl&&e(T.slice.actions.setApiUrl(a.apiUrl)),void 0!==a.role&&e(T.slice.actions.setRole(a.role)),void 0!==a.audioStreamingLanguageCode&&e(T.slice.actions.setAudioStreamingLanguageCode(a.audioStreamingLanguageCode)),e(T.slice.actions.setInitialFakeContents());let{audioStreamingLanguageCode:l,bundleId:u,clientId:m,dataChannelSignaling:h,dataChannels:p,e2ee:v,ignoreDisconnectWebSocket:x,metadata:j,signalingNotifyMetadata:f,signalingUrlCandidates:b,forwardingFilter:y,videoVP9Params:N,videoH264Params:k,videoH265Params:w,videoAV1Params:I}=t();if(v)try{await r.Z.initE2EE("https://sora-e2ee-wasm.shiguredo.app/2020.2/wasm.wasm")}catch(t){e(T.slice.actions.setSoraErrorAlertMessage("Faild to execute WebAssembly '".concat("https://sora-e2ee-wasm.shiguredo.app/2020.2/wasm.wasm","'.")));return}""!==u&&e(T.slice.actions.setEnabledBundleId(!0)),""!==m&&e(T.slice.actions.setEnabledClientId(!0)),""!==j&&e(T.slice.actions.setEnabledMetadata(!0)),""!==f&&e(T.slice.actions.setEnabledSignalingNotifyMetadata(!0)),0(e,t)=>{let a=t(),n=!("recvonly"===a.role&&("true"===a.multistream||""===a.multistream)),i={channelId:a.channelId,role:a.role,audio:a.audio,video:a.video,debug:a.debug,mediaType:"getUserMedia"!==a.mediaType?a.mediaType:void 0,audioBitRate:n&&""!==a.audioBitRate?a.audioBitRate:void 0,audioCodecType:n&&""!==a.audioCodecType?a.audioCodecType:void 0,videoBitRate:n&&""!==a.videoBitRate?a.videoBitRate:void 0,videoCodecType:n&&""!==a.videoCodecType?a.videoCodecType:void 0,videoVP9Params:n&&""!==a.videoVP9Params&&a.enabledVideoVP9Params?a.videoVP9Params:void 0,videoH264Params:n&&""!==a.videoH264Params&&a.enabledVideoH264Params?a.videoH264Params:void 0,videoH265Params:n&&""!==a.videoH265Params&&a.enabledVideoH265Params?a.videoH265Params:void 0,videoAV1Params:n&&""!==a.videoAV1Params&&a.enabledVideoAV1Params?a.videoAV1Params:void 0,audioContentHint:""!==a.audioContentHint?a.audioContentHint:void 0,autoGainControl:""!==a.autoGainControl?a.autoGainControl:void 0,noiseSuppression:""!==a.noiseSuppression?a.noiseSuppression:void 0,echoCancellation:""!==a.echoCancellation?a.echoCancellation:void 0,echoCancellationType:""!==a.echoCancellationType?a.echoCancellationType:void 0,videoContentHint:""!==a.videoContentHint?a.videoContentHint:void 0,resolution:""!==a.resolution?a.resolution:void 0,facingMode:""!==a.facingMode?a.facingMode:void 0,frameRate:""!==a.frameRate?a.frameRate:void 0,aspectRatio:""!==a.aspectRatio?a.aspectRatio:void 0,resizeMode:""!==a.resizeMode?a.resizeMode:void 0,blurRadius:""!==a.blurRadius?a.blurRadius:void 0,lightAdjustment:""!==a.lightAdjustment?a.lightAdjustment:void 0,multistream:""!==a.multistream?a.multistream:void 0,simulcast:""!==a.simulcast?a.simulcast:void 0,simulcastRid:""!==a.simulcastRid?a.simulcastRid:void 0,spotlight:""!==a.spotlight?a.spotlight:void 0,spotlightNumber:""!==a.spotlightNumber?a.spotlightNumber:void 0,spotlightFocusRid:""!==a.spotlightFocusRid?a.spotlightFocusRid:void 0,spotlightUnfocusRid:""!==a.spotlightUnfocusRid?a.spotlightUnfocusRid:void 0,audioInput:"getUserMedia"===a.mediaType&&""!==a.audioInput?a.audioInput:void 0,audioOutput:""!==a.audioOutput?a.audioOutput:void 0,videoInput:"getUserMedia"===a.mediaType&&""!==a.videoInput?a.videoInput:void 0,displayResolution:""!==a.displayResolution?a.displayResolution:void 0,mediaStats:!0===a.mediaStats||void 0,bundleId:""!==a.bundleId&&a.enabledBundleId?a.bundleId:void 0,clientId:""!==a.clientId&&a.enabledClientId?a.clientId:void 0,metadata:""!==a.metadata&&a.enabledMetadata?a.metadata:void 0,signalingNotifyMetadata:""!==a.signalingNotifyMetadata&&a.enabledSignalingNotifyMetadata?a.signalingNotifyMetadata:void 0,forwardingFilter:""!==a.forwardingFilter&&a.enabledForwardingFilter?a.forwardingFilter:void 0,dataChannelSignaling:""!==a.dataChannelSignaling&&a.enabledDataChannel?a.dataChannelSignaling:void 0,ignoreDisconnectWebSocket:""!==a.ignoreDisconnectWebSocket&&a.enabledDataChannel?a.ignoreDisconnectWebSocket:void 0,dataChannels:""!==a.dataChannels&&a.enabledDataChannels?a.dataChannels:void 0,reconnect:!0===a.reconnect||void 0,e2ee:!0===a.e2ee||void 0,mediaProcessorsNoiseSuppression:!0===a.mediaProcessorsNoiseSuppression||void 0,micDevice:!1!==a.micDevice&&void 0,cameraDevice:!1!==a.cameraDevice&&void 0,audioTrack:!1!==a.audioTrack&&void 0,videoTrack:!1!==a.videoTrack&&void 0,signalingUrlCandidates:0{let t=i[e];return void 0===t?void 0:"signalingUrlCandidates"===e?"".concat(e,"=").concat(encodeURIComponent(JSON.stringify(t))):"".concat(e,"=").concat(encodeURIComponent(t))}).filter(e=>void 0!==e);m("".concat(location.origin).concat(location.pathname,"?").concat(s.join("&"))),window.history.replaceState(null,"","".concat(location.pathname,"?").concat(s.join("&")))};async function R(e,t){let a="MEDIA_CONSTRAINTS";if("getDisplayMedia"===t.mediaType){if(!t.video||!t.cameraDevice)return[new MediaStream,null];if(void 0===navigator.mediaDevices)throw Error("Failed to call getUserMedia. Make sure domain is secure");let n={audio:j({audio:t.audio,autoGainControl:t.autoGainControl,noiseSuppression:t.noiseSuppression,echoCancellation:t.echoCancellation,echoCancellationType:t.echoCancellationType}),video:f({frameRate:t.frameRate,resolution:t.resolution,aspectRatio:t.aspectRatio,resizeMode:t.resizeMode})};e(T.slice.actions.setLogMessages({title:a,description:JSON.stringify(n)})),e(T.slice.actions.setTimelineMessage(P("media-constraints",n)));let i=await navigator.mediaDevices.getDisplayMedia(n);for(let a of(e(T.slice.actions.setTimelineMessage(P("succeed-get-display-media"))),i.getVideoTracks()))void 0!==a.contentHint&&(a.contentHint=t.videoContentHint),a.enabled=t.videoTrack,e(T.slice.actions.setTimelineMessage(V("start",a)));return[i,null]}if("mediacaptureRegion"===t.mediaType){if(!t.video||!t.cameraDevice)return[new MediaStream,null];if(void 0===window.CropTarget)throw Error("Failed to call CropTarget");if(void 0===navigator.mediaDevices)throw Error("Failed to call getDisplayMedia. Make sure domain is secure");let n={audio:j({audio:t.audio,autoGainControl:t.autoGainControl,noiseSuppression:t.noiseSuppression,echoCancellation:t.echoCancellation,echoCancellationType:t.echoCancellationType}),video:f({frameRate:t.frameRate,resolution:t.resolution,aspectRatio:t.aspectRatio,resizeMode:t.resizeMode})};n.preferCurrentTab=!0,e(T.slice.actions.setLogMessages({title:a,description:JSON.stringify(n)})),e(T.slice.actions.setTimelineMessage(P("media-constraints",n)));let i=await navigator.mediaDevices.getDisplayMedia(n),s=document.querySelector("#cropArea");if(null===s)throw Error("Failed to get CropTraget Element");let o=await window.CropTarget.fromElement(s);for(let a of(e(T.slice.actions.setTimelineMessage(P("succeed-get-display-media"))),i.getVideoTracks()))void 0!==a.contentHint&&(a.contentHint=t.videoContentHint),a.enabled=t.videoTrack,await a.cropTo(o),e(T.slice.actions.setTimelineMessage(V("start",a)));return[i,null]}if("fakeMedia"===t.mediaType&&t.fakeContents.worker){let n=function(e){let{audio:t,video:a,frameRate:n,resolution:i,volume:s,aspectRatio:o,resizeMode:l}=e,r=Number.parseInt(n,10),c=Number.isNaN(r)?30:r,d=v(i),u=d.width||240,m={audio:t,video:a,frameRate:c,width:u,height:d.height||160,fontSize:Math.floor(u/5),volume:Number.parseFloat(s)};return a&&(o||l)&&(m.videoTrackConstraints={},o&&(m.videoTrackConstraints.aspectRatio=x(o)),l&&(m.videoTrackConstraints.resizeMode=l)),m}({audio:t.audio&&t.micDevice,video:t.video&&t.cameraDevice,frameRate:t.frameRate,resolution:t.resolution,volume:t.fakeVolume,aspectRatio:t.aspectRatio,resizeMode:t.resizeMode});e(T.slice.actions.setLogMessages({title:a,description:JSON.stringify(n)})),e(T.slice.actions.setTimelineMessage(P("media-constraints",n)));let{canvas:i,mediaStream:s,gainNode:o}=function(e){let t=new MediaStream,a=null;if(e.video){(a=document.createElement("canvas")).getContext("2d"),a.width=e.width,a.height=e.height;let n=a.captureStream(e.frameRate).getTracks()[0];e.videoTrackConstraints&&n.applyConstraints(e.videoTrackConstraints),t.addTrack(n)}let n=null;if(e.audio){let a=new(window.AudioContext||window.webkitAudioContext),i=a.createOscillator();i.type="sine",n=a.createGain(),i.connect(n),i.start(0);let s=a.createMediaStreamDestination();n.connect(s);let o=s.stream.getTracks();t.addTrack(o[0]),n.gain.setValueAtTime(e.volume,0)}return{canvas:a,mediaStream:t,gainNode:n}}(n);for(let a of(null!==i&&(t.fakeContents.worker.onmessage=e=>{let a=e.data;"update"===a.type&&function(e,t,a,n){if(null===e)return;let i=e.getContext("2d");if(!i)return;i.globalCompositeOperation="source-over",i.clearRect(0,0,e.width,e.height),i.fillStyle="#".concat(("0".repeat(6)+t.toString(16)).slice(-6)),i.fillRect(0,0,e.width,e.height),i.fillStyle="#".concat(("0".repeat(6)+(16777215-t).toString(16)).slice(-6)),i.font="".concat(a,"px Arial");let s=e.width/2-a/2,o=a/4*(n.length-1),l=e.height/2+a/2.5;i.fillText(n,s-o,l)}(i,t.fakeContents.colorCode,n.fontSize,a.counter.toString())},t.fakeContents.worker.postMessage({type:"stop"}),t.fakeContents.worker.postMessage({type:"start",interval:1e3/n.frameRate})),s.getVideoTracks()))void 0!==a.contentHint&&(a.contentHint=t.videoContentHint),a.enabled=t.videoTrack,e(T.slice.actions.setTimelineMessage(V("start",a)));for(let a of s.getAudioTracks())void 0!==a.contentHint&&(a.contentHint=t.audioContentHint),a.enabled=t.audioTrack,e(T.slice.actions.setTimelineMessage(V("start",a)));return e(T.slice.actions.setTimelineMessage(P("succeed-create-fake-media"))),[s,o]}if(void 0===navigator.mediaDevices)throw Error("Failed to call getUserMedia. Make sure domain is secure");let n=new MediaStream,i=function(e){let{audio:t,autoGainControl:a,noiseSuppression:n,echoCancellation:i,echoCancellationType:s,audioInput:o}=e;if(!t)return!1;if(!a&&!n&&!i&&!s&&!o)return t;let l={};o&&(l.deviceId={exact:o});let r=C(a);void 0!==r&&(l.autoGainControl=r);let c=C(n);void 0!==c&&(l.noiseSuppression=c);let d=C(i);return void 0!==d&&(l.echoCancellation=d),s&&(l.echoCancellationType=s),l}({audio:t.audio&&t.micDevice,autoGainControl:t.autoGainControl,noiseSuppression:t.noiseSuppression,echoCancellation:t.echoCancellation,echoCancellationType:t.echoCancellationType,audioInput:t.audioInput}),r=function(e){let{video:t,frameRate:a,resolution:n,videoInput:i,aspectRatio:s,resizeMode:o,facingMode:l}=e;if(!t)return!1;if(!a&&!n&&!i&&!s&&!o&&!l)return t;let r={};if(a){let e=Number.parseInt(a,10);Number.isNaN(e)||(r.frameRate={min:e,max:e})}if(n){let{width:e,height:t}=v(n);0{throw n.getTracks().filter(e=>{e.stop()}),e});if(i){let a=d.getAudioTracks()[0];if(e(T.slice.actions.setTimelineMessage(V("start",a))),t.mediaProcessorsNoiseSuppression&&o.b.isSupported()){if(null===t.noiseSuppressionProcessor)throw Error("Failed to start NoiseSuppressionProcessor. NoiseSuppressionProcessor is 'null'");t.noiseSuppressionProcessor.stopProcessing(),a=await t.noiseSuppressionProcessor.startProcessing(a)}e(T.slice.actions.setTimelineMessage(P("succeed-audio-get-user-media"))),n.addTrack(a)}if(r){let a=d.getVideoTracks()[0];if(e(T.slice.actions.setTimelineMessage(V("start",a))),""!==t.lightAdjustment&&s.jA.isSupported()){if(null===t.lightAdjustmentProcessor)throw Error("Failed to start LightAdjustmentProcessor. LightAdjustmentProcessor is 'null'");let e=function(e){switch(e){case"weak":return{adjustmentLevel:30,sharpnessLevel:0};case"medium":return{adjustmentLevel:50,sharpnessLevel:10,focusMask:new s.MH("https://cdn.jsdelivr.net/npm/@shiguredo/light-adjustment@latest/dist")};case"strong":return{adjustmentLevel:70,sharpnessLevel:20,minIntensity:10,focusMask:new s.MH("https://cdn.jsdelivr.net/npm/@shiguredo/light-adjustment@latest/dist")};default:return{}}}(t.lightAdjustment);t.lightAdjustmentProcessor.stopProcessing(),a=await t.lightAdjustmentProcessor.startProcessing(a,e)}if(""!==t.blurRadius&&l.sz.isSupported()){if(null===t.virtualBackgroundProcessor)throw Error("Failed to start VirtualBackgroundProcessor. VirtualBackgroundProcessor is 'null'");let e={blurRadius:function(e){switch(e){case"weak":return 5;case"medium":return 10;case"strong":return 15;default:return 0}}(t.blurRadius)};t.virtualBackgroundProcessor.stopProcessing(),a=await t.virtualBackgroundProcessor.startProcessing(a,e)}e(T.slice.actions.setTimelineMessage(P("succeed-video-get-user-media"))),n.addTrack(a)}}for(let e of n.getVideoTracks())void 0!==e.contentHint&&(e.contentHint=t.videoContentHint),e.enabled=t.videoTrack;for(let e of n.getAudioTracks())void 0!==e.contentHint&&(e.contentHint=t.audioContentHint),e.enabled=t.audioTrack;return[n,null]}function Z(e,t,a){a.on("log",(t,a)=>{e(T.slice.actions.setLogMessages({title:t,description:JSON.stringify(a)}))}),a.on("notify",(a,n)=>{var i;"spotlight.focused"===a.event_type&&"string"==typeof a.connection_id&&e(T.slice.actions.setFocusedSpotlightConnectionId(a.connection_id)),"spotlight.unfocused"===a.event_type&&"string"==typeof a.connection_id&&e(T.slice.actions.setUnFocusedSpotlightConnectionId(a.connection_id)),"connection.destroyed"===a.event_type&&"string"==typeof a.connection_id&&e(T.slice.actions.deleteFocusedSpotlightConnectionId(a.connection_id));let{soraContents:s}=t();if("connection.created"===a.event_type&&"string"==typeof a.connection_id&&a.connection_id===(null===(i=s.sora)||void 0===i?void 0:i.connectionId)){if("string"==typeof a.session_id&&e(T.slice.actions.setSoraSessionId(a.session_id)),"string"==typeof a.connection_id&&e(T.slice.actions.setSoraConnectionId(a.connection_id)),"string"==typeof a.client_id&&e(T.slice.actions.setSoraClientId(a.client_id)),Array.isArray(a.data))for(let t of a.data)"string"==typeof t.connection_id&&"string"==typeof t.client_id&&e(T.slice.actions.setSoraRemoteClientId({connectionId:t.connection_id,clientId:t.client_id}))}else"connection.created"===a.event_type&&"string"==typeof a.connection_id&&"string"==typeof a.client_id&&e(T.slice.actions.setSoraRemoteClientId({connectionId:a.connection_id,clientId:a.client_id}));e(T.slice.actions.setNotifyMessages({timestamp:new Date().getTime(),message:a,transportType:n}))}),a.on("push",(t,a)=>{e(T.slice.actions.setPushMessages({timestamp:new Date().getTime(),message:t,transportType:a}))}),a.on("track",a=>{e(T.slice.actions.setTimelineMessage(P("event-on-track")));let{soraContents:n}=t();if(!n.remoteClients.find(e=>e.connectionId===a.streams[0].id)){for(let t of a.streams[0].getTracks())e(T.slice.actions.setTimelineMessage(P("remote-".concat(t.kind,"-mediastream-track"),N(t))));e(T.slice.actions.setRemoteClient({mediaStream:a.streams[0],connectionId:a.streams[0].id,clientId:null}))}}),a.on("removetrack",a=>{e(T.slice.actions.setTimelineMessage(P("event-on-removetrack")));let{soraContents:n}=t(),i=n.remoteClients.find(e=>{if(null==a?void 0:a.target)return e.connectionId===a.target.id});i&&e(T.slice.actions.removeRemoteClient(i.connectionId))}),a.on("disconnect",a=>{let n={type:a.type,title:a.title};void 0!==a.code&&(n.code=a.code),void 0!==a.reason&&(n.reason=a.reason),void 0!==a.params&&(n.params=a.params),e(T.slice.actions.setTimelineMessage(P("event-on-disconnect",n)));let{fakeContents:i,soraContents:s,reconnect:o,lightAdjustmentProcessor:l,virtualBackgroundProcessor:r,noiseSuppressionProcessor:c}=t(),{localMediaStream:d,remoteClients:u}=s,m=z(l,r);(async()=>{await G(e,d,m)})(),W(e,d,c),u.filter(e=>{e.mediaStream.getTracks().filter(e=>{e.stop()})}),i.worker&&i.worker.postMessage({type:"stop"}),e(T.slice.actions.setSora(null)),e(T.slice.actions.setSoraSessionId(null)),e(T.slice.actions.setSoraConnectionId(null)),e(T.slice.actions.setSoraClientId(null)),e(T.slice.actions.setSoraTurnUrl(null)),e(T.slice.actions.setSoraConnectionStatus("disconnected")),e(T.slice.actions.setLocalMediaStream(null)),e(T.slice.actions.removeAllRemoteClients()),e(T.slice.actions.setSoraInfoAlertMessage("Disconnect Sora.")),e(T.slice.actions.setTimelineMessage(P("disconnected"))),"abend"===a.type&&o&&e(T.slice.actions.setSoraReconnecting(!0))}),a.on("timeline",t=>{let a={timestamp:new Date().getTime(),type:t.type,data:t.data,dataChannelId:t.dataChannelId,dataChannelLabel:t.dataChannelLabel,logType:t.logType};e(T.slice.actions.setTimelineMessage(a)),t.data&&"object"==typeof t.data&&"sdp"in t.data&&e(T.slice.actions.setTimelineMessage(P("".concat(t.type,"-sdp"),t.data.sdp)))}),a.on("signaling",t=>{let a={timestamp:new Date().getTime(),transportType:t.transportType,type:t.type,data:t.data};e(T.slice.actions.setSignalingMessage(a))}),a.on("message",t=>{e(T.slice.actions.setDataChannelMessage({timestamp:new Date().getTime(),label:t.label,data:t.data}))}),a.on("datachannel",t=>{e(T.slice.actions.setSoraDataChannels(t.datachannel))})}function M(e){return{audio:e.audio,audioBitRate:e.audioBitRate,audioCodecType:e.audioCodecType,audioStreamingLanguageCode:e.audioStreamingLanguageCode,bundleId:e.bundleId,clientId:e.clientId,dataChannelSignaling:e.dataChannelSignaling,dataChannels:e.enabledDataChannels?e.dataChannels:"",e2ee:e.e2ee,enabledAudioStreamingLanguageCode:e.enabledAudioStreamingLanguageCode,enabledBundleId:e.enabledBundleId,enabledClientId:e.enabledClientId,enabledDataChannel:e.enabledDataChannel,enabledSignalingNotifyMetadata:e.enabledSignalingNotifyMetadata,enabledForwardingFilter:e.enabledForwardingFilter,enabledVideoVP9Params:e.enabledVideoVP9Params,enabledVideoH264Params:e.enabledVideoH264Params,enabledVideoH265Params:e.enabledVideoH265Params,enabledVideoAV1Params:e.enabledVideoAV1Params,ignoreDisconnectWebSocket:e.ignoreDisconnectWebSocket,multistream:e.multistream,signalingNotifyMetadata:e.signalingNotifyMetadata,forwardingFilter:e.forwardingFilter,simulcast:e.simulcast,simulcastRid:e.simulcastRid,spotlight:e.spotlight,spotlightFocusRid:e.spotlightFocusRid,spotlightNumber:e.spotlightNumber,spotlightUnfocusRid:e.spotlightUnfocusRid,video:e.video,videoBitRate:e.videoBitRate,videoCodecType:e.videoCodecType,videoVP9Params:e.videoVP9Params,videoH264Params:e.videoH264Params,videoH265Params:e.videoH265Params,videoAV1Params:e.videoAV1Params,role:e.role}}function P(e,t){return{type:e,logType:"sora-devtools",timestamp:new Date().getTime(),data:t}}function V(e,t){let a=N(t);return P("".concat(e,"-").concat(t.kind,"-mediastream-track"),a)}async function D(e,t){var a;if(t.pc&&(null===(a=t.pc)||void 0===a?void 0:a.iceConnectionState)!=="closed"){let a=await t.pc.getStats(),n=[],i=[];for(let t of(a.forEach(e=>{n.push(e),"local-candidate"===e.type&&i.push(e)}),e(T.slice.actions.setStatsReport(n)),i))if(void 0!==t.url){e(T.slice.actions.setSoraTurnUrl(t.url));break}}}let A=()=>async(e,t)=>{let a,n;let i=t();try{[a,n]=await R(e,i).catch(e=>{throw e})}catch(n){var s,o,l;let t;if(n instanceof Error&&(e(T.slice.actions.setLogMessages({title:"REQUEST_MEDIA",description:JSON.stringify(n.message)})),e(T.slice.actions.setAPIErrorAlertMessage("Failed to get user devices. ".concat(n.message)))),(null===(s=i.lightAdjustmentProcessor)||void 0===s?void 0:s.isProcessing())&&(t=i.lightAdjustmentProcessor.getOriginalTrack(),i.lightAdjustmentProcessor.stopProcessing()),(null===(o=i.virtualBackgroundProcessor)||void 0===o?void 0:o.isProcessing())&&(void 0===t&&(t=i.virtualBackgroundProcessor.getOriginalTrack()),i.virtualBackgroundProcessor.stopProcessing()),t?(t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))):a&&a.getVideoTracks().filter(t=>{t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))}),null===(l=i.noiseSuppressionProcessor)||void 0===l?void 0:l.isProcessing()){let t=i.noiseSuppressionProcessor.getOriginalTrack();t&&(t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))),i.noiseSuppressionProcessor.stopProcessing()}else a&&a.getAudioTracks().filter(t=>{t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))});throw n}n&&e(T.slice.actions.setFakeContentsGainNode(n)),e(T.slice.actions.setLocalMediaStream(a))},F=()=>async(e,t)=>{let a;let{fakeContents:n,soraContents:i,lightAdjustmentProcessor:s,noiseSuppressionProcessor:o,virtualBackgroundProcessor:l}=t(),{localMediaStream:r}=i;if((null==s?void 0:s.isProcessing())&&(a=s.getOriginalTrack(),s.stopProcessing()),(null==l?void 0:l.isProcessing())&&(void 0===a&&(a=l.getOriginalTrack()),l.stopProcessing()),void 0!==a?(a.stop(),null==r||r.removeTrack(a),e(T.slice.actions.setTimelineMessage(V("stop",a)))):r&&r.getVideoTracks().filter(t=>{t.stop(),r.removeTrack(t),e(T.slice.actions.setTimelineMessage(V("stop",t)))}),null==o?void 0:o.isProcessing()){let t=o.getOriginalTrack();t&&(t.stop(),null==r||r.removeTrack(t),e(T.slice.actions.setTimelineMessage(V("stop",t)))),o.stopProcessing()}else r&&r.getAudioTracks().filter(t=>{t.stop(),r.removeTrack(t),e(T.slice.actions.setTimelineMessage(V("stop",t)))});n.worker&&n.worker.postMessage({type:"stop"}),e(T.slice.actions.setLocalMediaStream(null))},O=()=>async(e,t)=>{let a,n,i;e(T.slice.actions.setTimelineMessage(P("start-connection"))),e(T.slice.actions.setSoraConnectionStatus("preparing"));let s=t(),o=!1;s.soraContents.sora&&(await s.soraContents.sora.disconnect(),o=!0);let l=h(s.enabledSignalingUrlCandidates,s.signalingUrlCandidates);e(T.slice.actions.setLogMessages({title:"SIGNALING_URL",description:JSON.stringify(l)}));let c=r.Z.connection(l,s.debug),d=k(M(s)),u=b(s.enabledMetadata,s.metadata);try{"sendonly"===s.role?((a=c.sendonly(s.channelId,null,d)).metadata=u,"boolean"==typeof s.googCpuOveruseDetection&&(a.constraints={optional:[{googCpuOveruseDetection:s.googCpuOveruseDetection}]}),Z(e,t,a),!o&&s.soraContents.localMediaStream?n=s.soraContents.localMediaStream:[n,i]=await R(e,s).catch(t=>{throw e(T.slice.actions.setSoraErrorAlertMessage(t.toString())),e(T.slice.actions.setSoraConnectionStatus("disconnected")),t}),e(T.slice.actions.setSoraConnectionStatus("connecting")),e(T.slice.actions.setSora(a)),await a.connect(n)):"sendrecv"===s.role?((a=c.sendrecv(s.channelId,null,d)).metadata=u,"boolean"==typeof s.googCpuOveruseDetection&&(a.constraints={optional:[{googCpuOveruseDetection:s.googCpuOveruseDetection}]}),Z(e,t,a),!o&&s.soraContents.localMediaStream?n=s.soraContents.localMediaStream:[n,i]=await R(e,s).catch(t=>{throw e(T.slice.actions.setSoraErrorAlertMessage(t.toString())),e(T.slice.actions.setSoraConnectionStatus("disconnected")),t}),e(T.slice.actions.setSora(a)),await a.connect(n)):"recvonly"===s.role&&((a=c.recvonly(s.channelId,null,d)).metadata=u,Z(e,t,a),e(T.slice.actions.setSoraConnectionStatus("connecting")),e(T.slice.actions.setSora(a)),await a.connect())}catch(a){var m,g,p;let t;if(e(T.slice.actions.setSora(null)),a instanceof Error&&e(T.slice.actions.setSoraErrorAlertMessage("Failed to connect Sora. ".concat(a.message))),(null===(m=s.lightAdjustmentProcessor)||void 0===m?void 0:m.isProcessing())&&(t=s.lightAdjustmentProcessor.getOriginalTrack(),s.lightAdjustmentProcessor.stopProcessing()),(null===(g=s.virtualBackgroundProcessor)||void 0===g?void 0:g.isProcessing())&&(void 0===t&&(t=s.virtualBackgroundProcessor.getOriginalTrack()),s.virtualBackgroundProcessor.stopProcessing()),t?(t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))):n&&n.getVideoTracks().filter(t=>{t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))}),null===(p=s.noiseSuppressionProcessor)||void 0===p?void 0:p.isProcessing()){let t=s.noiseSuppressionProcessor.getOriginalTrack();t&&(t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))),s.noiseSuppressionProcessor.stopProcessing()}else n&&n.getAudioTracks().filter(t=>{t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))});throw e(T.slice.actions.setSoraConnectionStatus("disconnected")),a}if(void 0===a)throw Error("Failed to connect Sora. Connection object is 'undefined'");e(T.slice.actions.setSoraInfoAlertMessage("Succeeded to connect Sora.")),await D(e,a);let v=setInterval(async()=>{let{soraContents:a}=t();a.sora?await D(e,a.sora):clearInterval(v)},1e3);a.stream=null,n&&(null===s.soraContents.localMediaStream||o)&&e(T.slice.actions.setLocalMediaStream(n)),i&&e(T.slice.actions.setFakeContentsGainNode(i)),e(T.slice.actions.setSoraConnectionStatus("connected")),e(T.slice.actions.setTimelineMessage(P("connected")))},H=()=>async(e,t)=>{let a,n,i;e(T.slice.actions.setTimelineMessage(P("start-reconnect"))),e(T.slice.actions.setSoraConnectionStatus("connecting"));let s=t();s.soraContents.sora&&"connected"===s.soraContents.connectionStatus&&await s.soraContents.sora.disconnect();let o=h(s.enabledSignalingUrlCandidates,s.signalingUrlCandidates);e(T.slice.actions.setLogMessages({title:"SIGNALING_URL",description:JSON.stringify(o)}));let l=r.Z.connection(o,s.debug),c=k(M(s)),d=b(s.enabledMetadata,s.metadata);("sendonly"===s.role||"sendrecv"===s.role)&&([n,i]=await R(e,s).catch(t=>{throw e(T.slice.actions.setSoraErrorAlertMessage(t.toString())),e(T.slice.actions.setSoraConnectionStatus("disconnected")),t}));for(let i=1;i<=10;i++){let{soraContents:o}=t();if(!1===o.reconnecting)break;e(T.slice.actions.setSoraReconnectingTrials(i));try{"sendonly"===s.role?((a=l.sendonly(s.channelId,null,c)).metadata=d,"boolean"==typeof s.googCpuOveruseDetection&&(a.constraints={optional:[{googCpuOveruseDetection:s.googCpuOveruseDetection}]}),Z(e,t,a),n&&await a.connect(n)):"sendrecv"===s.role?((a=l.sendrecv(s.channelId,null,c)).metadata=d,"boolean"==typeof s.googCpuOveruseDetection&&(a.constraints={optional:[{googCpuOveruseDetection:s.googCpuOveruseDetection}]}),Z(e,t,a),n&&await a.connect(n)):"recvonly"===s.role&&((a=l.recvonly(s.channelId,null,c)).metadata=d,Z(e,t,a),await a.connect())}catch(t){t instanceof Error&&e(T.slice.actions.setSoraErrorAlertMessage("(trials ".concat(i,") Failed to connect Sora. ").concat(t.message))),a=void 0}if(void 0!==a)break;await new Promise(e=>setTimeout(e,500*i+500))}if(void 0===a){e(T.slice.actions.setSoraErrorAlertMessage("Failed to reconnect Sora.")),e(T.slice.actions.setSoraConnectionStatus("disconnected")),e(T.slice.actions.setSoraReconnecting(!1));return}e(T.slice.actions.setSoraInfoAlertMessage("Succeeded to reconnect Sora.")),await D(e,a);let u=setInterval(async()=>{let{soraContents:a}=t();a.sora?await D(e,a.sora):clearInterval(u)},1e3);e(T.slice.actions.setSora(a)),n&&e(T.slice.actions.setLocalMediaStream(n)),i&&e(T.slice.actions.setFakeContentsGainNode(i)),e(T.slice.actions.setSoraConnectionStatus("connected")),e(T.slice.actions.setTimelineMessage(P("connected"))),e(T.slice.actions.setSoraReconnecting(!1))},B=()=>async(e,t)=>{let{soraContents:a}=t();a.sora&&"connected"===a.connectionStatus&&(e(T.slice.actions.setSoraConnectionStatus("disconnecting")),await a.sora.disconnect(),e(T.slice.actions.setSoraConnectionStatus("disconnected")))},U=()=>async(e,t)=>{let a=await S(),n=[],i=[],s=[];a.filter(e=>{""!==e.deviceId&&("audioinput"===e.kind?n.push(e.toJSON()):"audiooutput"===e.kind?s.push(e.toJSON()):"videoinput"===e.kind&&i.push(e.toJSON()))}),e(T.slice.actions.setAudioInputDevices(n)),e(T.slice.actions.setVideoInputDevices(i)),e(T.slice.actions.setAudioOutputDevices(s))},E=()=>async(e,t)=>{var a,n;let i=t();if(!i.soraContents.localMediaStream)return;if(null===(a=i.virtualBackgroundProcessor)||void 0===a?void 0:a.isProcessing()){let t=i.virtualBackgroundProcessor.getOriginalTrack();t&&(t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))),i.virtualBackgroundProcessor.stopProcessing()}else i.soraContents.localMediaStream&&i.soraContents.localMediaStream.getVideoTracks().filter(t=>{t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))});if(null===(n=i.noiseSuppressionProcessor)||void 0===n?void 0:n.isProcessing()){let t=i.noiseSuppressionProcessor.getOriginalTrack();t&&(t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))),i.noiseSuppressionProcessor.stopProcessing()}else i.soraContents.localMediaStream&&i.soraContents.localMediaStream.getAudioTracks().filter(t=>{t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))});let[s,o]=await R(e,i).catch(t=>{throw e(T.slice.actions.setSoraErrorAlertMessage(t.toString())),e(T.slice.actions.setSoraConnectionStatus("disconnected")),t});s.getTracks().filter(e=>{if(!i.soraContents.sora||!i.soraContents.sora.pc)return;let t=i.soraContents.sora.pc.getSenders().find(t=>!!t.track&&t.track.kind===e.kind);t&&t.replaceTrack(e)}),e(T.slice.actions.setLocalMediaStream(s)),e(T.slice.actions.setFakeContentsGainNode(o))},_=e=>async(t,a)=>{if(e)try{await r.Z.initE2EE("https://sora-e2ee-wasm.shiguredo.app/2020.2/wasm.wasm")}catch(e){t(T.slice.actions.setSoraErrorAlertMessage("Faild to execute WebAssembly '".concat("https://sora-e2ee-wasm.shiguredo.app/2020.2/wasm.wasm","'.")));return}t(T.slice.actions.setE2EE(e))},L=e=>async(t,a)=>{let n=a();if(!n.soraContents.localMediaStream||!n.soraContents.sora){t(T.slice.actions.setMicDevice(e));return}if(e){let a={aspectRatio:n.aspectRatio,audio:n.audio,audioContentHint:n.audioContentHint,audioInput:n.audioInput,audioTrack:n.audioTrack,autoGainControl:n.autoGainControl,blurRadius:n.blurRadius,cameraDevice:n.cameraDevice,echoCancellation:n.echoCancellation,echoCancellationType:n.echoCancellationType,facingMode:n.facingMode,fakeContents:n.fakeContents,fakeVolume:n.fakeVolume,frameRate:n.frameRate,lightAdjustment:n.lightAdjustment,lightAdjustmentProcessor:n.lightAdjustmentProcessor,mediaProcessorsNoiseSuppression:n.mediaProcessorsNoiseSuppression,mediaType:n.mediaType,micDevice:e,noiseSuppression:n.noiseSuppression,noiseSuppressionProcessor:n.noiseSuppressionProcessor,resizeMode:n.resizeMode,resolution:n.resolution,video:!1,videoContentHint:n.videoContentHint,videoInput:n.videoInput,videoTrack:n.videoTrack,virtualBackgroundProcessor:n.virtualBackgroundProcessor},[i,s]=await R(t,a).catch(e=>{throw t(T.slice.actions.setSoraErrorAlertMessage(e.toString())),e});0{var t;e.enabled=!1,e.stop(),null===(t=n.soraContents.localMediaStream)||void 0===t||t.removeTrack(e)}),n.soraContents.localMediaStream.addTrack(i.getAudioTracks()[0])),t(T.slice.actions.setFakeContentsGainNode(s)))}else n.soraContents.sora&&"connected"===n.soraContents.connectionStatus&&n.soraContents.localMediaStream?(W(t,n.soraContents.localMediaStream,n.noiseSuppressionProcessor),n.soraContents.sora.stopAudioTrack(n.soraContents.localMediaStream)):n.soraContents.localMediaStream&&W(t,n.soraContents.localMediaStream,n.noiseSuppressionProcessor);t(T.slice.actions.setMicDevice(e))},J=e=>async(t,a)=>{let n=a();if(!n.soraContents.localMediaStream&&!n.soraContents.sora&&"connected"!==n.soraContents.connectionStatus){t(T.slice.actions.setCameraDevice(e));return}if(e){let a={aspectRatio:n.aspectRatio,audio:!1,audioContentHint:n.audioContentHint,audioInput:n.audioInput,audioTrack:n.audioTrack,autoGainControl:n.autoGainControl,blurRadius:n.blurRadius,cameraDevice:e,echoCancellation:n.echoCancellation,echoCancellationType:n.echoCancellationType,facingMode:n.facingMode,fakeContents:n.fakeContents,fakeVolume:n.fakeVolume,frameRate:n.frameRate,lightAdjustment:n.lightAdjustment,lightAdjustmentProcessor:n.lightAdjustmentProcessor,mediaProcessorsNoiseSuppression:n.mediaProcessorsNoiseSuppression,mediaType:n.mediaType,micDevice:n.micDevice,noiseSuppression:n.noiseSuppression,noiseSuppressionProcessor:n.noiseSuppressionProcessor,resizeMode:n.resizeMode,resolution:n.resolution,video:n.video,videoContentHint:n.videoContentHint,videoInput:n.videoInput,videoTrack:n.videoTrack,virtualBackgroundProcessor:n.virtualBackgroundProcessor},[i,s]=await R(t,a).catch(e=>{throw t(T.slice.actions.setSoraErrorAlertMessage(e.toString())),e});0{var t;e.enabled=!1,e.stop(),null===(t=n.soraContents.localMediaStream)||void 0===t||t.removeTrack(e)}),n.soraContents.localMediaStream.addTrack(i.getVideoTracks()[0])),t(T.slice.actions.setFakeContentsGainNode(s)))}else if(n.soraContents.sora&&"connected"===n.soraContents.connectionStatus&&n.soraContents.localMediaStream){let e=z(n.lightAdjustmentProcessor,n.virtualBackgroundProcessor);await G(t,n.soraContents.localMediaStream,e),n.soraContents.sora.stopVideoTrack(n.soraContents.localMediaStream)}else if(n.soraContents.localMediaStream){let e=z(n.lightAdjustmentProcessor,n.virtualBackgroundProcessor);await G(t,n.soraContents.localMediaStream,e)}t(T.slice.actions.setCameraDevice(e))},z=(e,t)=>{let a;return(null==e?void 0:e.isProcessing())&&(a=e.getOriginalTrack(),e.stopProcessing()),(null==t?void 0:t.isProcessing())&&(void 0===a&&(a=t.getOriginalTrack()),t.stopProcessing()),a},G=async(e,t,a)=>{if(void 0!==a)a.enabled=!1,await new Promise(e=>setTimeout(e,100)),a.stop(),null==t||t.removeTrack(a),e(T.slice.actions.setTimelineMessage(V("stop",a)));else{if(!t)return;t.getVideoTracks().filter(e=>{e.enabled=!1}),await new Promise(e=>setTimeout(e,100)),t.getVideoTracks().filter(a=>{a.stop(),t.removeTrack(a),e(T.slice.actions.setTimelineMessage(V("stop",a)))})}},W=(e,t,a)=>{if(null==a?void 0:a.isProcessing()){let n=a.getOriginalTrack();n&&(n.stop(),null==t||t.removeTrack(n),e(T.slice.actions.setTimelineMessage(V("stop",n)))),a.stopProcessing()}else t&&t.getAudioTracks().filter(a=>{a.stop(),t.removeTrack(a),e(T.slice.actions.setTimelineMessage(V("stop",a)))})},{clearDataChannelMessages:K,deleteAlertMessage:q,setAPIErrorAlertMessage:Q,setAPIInfoAlertMessage:X,setAspectRatio:$,setAudio:Y,setAudioBitRate:ee,setAudioCodecType:et,setAudioContentHint:ea,setAudioInput:en,setAudioOutput:ei,setAudioTrack:es,setAutoGainControl:eo,setBlurRadius:el,setBundleId:er,setChannelId:ec,setClientId:ed,setDataChannels:eu,setDataChannelSignaling:em,setDebug:eg,setDebugFilterText:eh,setDebugType:ep,setDisplayResolution:ev,setEchoCancellation:ex,setEchoCancellationType:ej,setEnabledBundleId:ef,setEnabledClientId:eC,setEnabledDataChannels:eb,setEnabledDataChannel:eS,setEnabledForwardingFilter:ey,setEnabledMetadata:eN,setEnabledSignalingNotifyMetadata:ek,setEnabledSignalingUrlCandidates:eT,setEnabledVideoVP9Params:ew,setEnabledVideoH264Params:eI,setEnabledVideoH265Params:eR,setEnabledVideoAV1Params:eZ,setAudioStreamingLanguageCode:eM,setEnabledAudioStreamingLanguageCode:eP,setFakeVolume:eV,setFacingMode:eD,setFrameRate:eA,setIgnoreDisconnectWebSocket:eF,setLightAdjustment:eO,setLocalMediaStream:eH,setLogMessages:eB,setMediaProcessorsNoiseSuppression:eU,setMediaStats:eE,setMediaType:e_,setMetadata:eL,setMultistream:eJ,setNoiseSuppression:ez,setNotifyMessages:eG,setReconnect:eW,setResizeMode:eK,setRole:eq,setResolution:eQ,setSignalingNotifyMetadata:eX,setSignalingUrlCandidates:e$,setForwardingFilter:eY,setSimulcast:e0,setSimulcastRid:e1,setSora:e2,setSoraReconnecting:e5,setSoraErrorAlertMessage:e4,setSoraInfoAlertMessage:e6,setSpotlight:e9,setSpotlightFocusRid:e3,setSpotlightNumber:e8,setSpotlightUnfocusRid:e7,setVideo:te,setVideoBitRate:tt,setVideoCodecType:ta,setVideoContentHint:tn,setVideoInput:ti,setVideoTrack:ts,setVideoVP9Params:to,setVideoH264Params:tl,setVideoH265Params:tr,setVideoAV1Params:tc}=T.slice.actions;var td=a(4690);let tu=()=>(0,td.I0)(),tm=td.v9;var tg=a(4754),th=a(7006),tp=a(5544);let tv=()=>(0,n.jsxs)("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",className:"bi bi-clipboard",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("title",{children:"ClipboardIcon"}),(0,n.jsx)("path",{fillRule:"evenodd",d:"M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"}),(0,n.jsx)("path",{fillRule:"evenodd",d:"M9.5 1h-3a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z"})]}),tx=e=>e.disabled?(0,n.jsx)("div",{style:{height:"31px"}}):(0,n.jsx)("button",{type:"button",className:"btn btn-sm btn-dark",onClick:t=>{m(e.text),t.currentTarget.blur()},children:(0,n.jsx)(tv,{})}),tj=e=>{let{description:t}=e;return void 0===t?null:"object"!=typeof t?(0,n.jsx)("div",{className:"debug-message",children:(0,n.jsx)("div",{className:"col-sm-12",children:(0,n.jsx)("pre",{className:e.wordBreak?"word-break":"",children:t})})}):(0,n.jsx)("div",{className:"debug-message",children:(0,n.jsx)("div",{className:"col-sm-12",children:(0,n.jsx)("pre",{className:e.wordBreak?"word-break":"",children:JSON.stringify(t,null,2)})})})},tf=e=>{let{defaultShow:t,description:a,title:s,timestamp:o,label:l}=e,[r,c]=(0,i.useState)(void 0!==t&&t),d=o?s+o:s,m=void 0===a;return(0,n.jsxs)("div",{className:"border border-light rounded mb-1 bg-dark","data-title":s,children:[(0,n.jsxs)("div",{className:"d-flex justify-content-between align-items-center text-break",children:[(0,n.jsxs)("a",{className:"debug-title ".concat(m?"disabled":""),onClick:()=>c(!r),"aria-controls":d,"aria-expanded":r,children:[(0,n.jsx)("i",{className:"".concat(r?"arrow-bottom":"arrow-right"," ").concat(m?"disabled":"")})," ",o?(0,n.jsxs)("span",{className:"text-white-50 me-1",children:["[",u(o),"]"]}):null,l,(0,n.jsx)("span",{children:s})]}),(0,n.jsx)("div",{className:"border-left",children:(0,n.jsx)(tx,{text:"string"==typeof a?a:JSON.stringify(a,null,2),disabled:m})})]}),(0,n.jsx)(tp.Z,{in:r,children:(0,n.jsx)("div",{className:"border-top",children:(0,n.jsx)(tj,{description:a,wordBreak:e.wordBreak})})})]})},tC=e=>{let{title:t,codecs:a}=e;return(0,n.jsx)(tf,{title:t,timestamp:null,description:JSON.stringify(a,null,2)})},tb=i.memo(e=>(0,n.jsx)(tC,{...e})),tS=(e,t)=>{if(!e)return[];let a=e(t);return a&&a.codecs?a.codecs:[]},ty=()=>{let e=tS(RTCRtpSender.getCapabilities,"audio"),t=tS(RTCRtpSender.getCapabilities,"video"),a=tS(RTCRtpReceiver.getCapabilities,"audio"),i=tS(RTCRtpReceiver.getCapabilities,"video");return(0,n.jsxs)("div",{className:"capabilities-codec",children:[(0,n.jsx)(tb,{title:"Audio RTCRtpSender CapabilitiesCodec",codecs:e}),(0,n.jsx)(tb,{title:"Video RTCRtpSender CapabilitiesCodec",codecs:t}),(0,n.jsx)(tb,{title:"Audio RTCRtpReceiver CapabilitiesCodec",codecs:a}),(0,n.jsx)(tb,{title:"Video RTCRtpReceiver CapabilitiesCodec",codecs:i})]})},tN=()=>{let e=tu();return(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"clear",defaultValue:"clear",onClick:()=>{e(K())}})},tk=e=>{let{data:t,label:a,timestamp:i}=e;if("ZAKURO"===new TextDecoder().decode(t.slice(0,6))){let e=new TextDecoder().decode(t.slice(22,48)),s=new DataView(t),o=s.getBigInt64(6),l=s.getBigInt64(14),r=t.byteLength,c="connectionId: ".concat(e,"\nUnixTimeMicro: ").concat(o,"\nCounter: ").concat(l,"\nByteLength: ").concat(r);return(0,n.jsx)(tf,{title:"".concat(a," ZAKURO"),timestamp:i,description:c,defaultShow:!0,wordBreak:!0})}let s=new Uint8Array(t),o="".concat(s.toString(),"\n(").concat(new TextDecoder().decode(t),")");return(0,n.jsx)(tf,{title:a,timestamp:i,description:o,defaultShow:!0,wordBreak:!0})},tT=i.memo(e=>(0,n.jsx)(tk,{...e})),tw=()=>{let e=tm(e=>e.dataChannelMessages);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"py-1",children:(0,n.jsx)(tN,{})}),(0,n.jsx)("div",{className:"debug-messages",children:e.map(e=>{let t=e.label+e.timestamp;return(0,n.jsx)(tT,{...e},t)})})]})};var tI=a(4408),tR=a(6862),tZ=a(7058);let tM=()=>{let e=tm(e=>e.debugFilterText),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline debug-filter",controlId:"channelId",children:[(0,n.jsx)(tR.Z,{className:"text-white",children:"Filter:"}),(0,n.jsx)(tZ.Z,{type:"text",placeholder:"Filter",value:e,onChange:e=>{t(eh(e.target.value))},autoComplete:"off"})]})},tP=e=>{let{message:t,timestamp:a}=e;return(0,n.jsx)(tf,{title:t.title,timestamp:a,description:JSON.parse(t.description)})},tV=i.memo(e=>(0,n.jsx)(tP,{...e})),tD=()=>{let e=tm(e=>e.logMessages),t=tm(e=>e.debugFilterText),a=e.filter(e=>t.split(" ").every(t=>""===t||0<=JSON.stringify(e).indexOf(t)));return(0,n.jsx)("div",{className:"debug-messages",children:a.map((e,t)=>(0,n.jsx)(tV,{...e},e.message.title+String(t)+e.timestamp))})},tA={websocket:"#00ff00",datachannel:"#ff00ff"},tF=e=>{let{text:t}=e,a=Object.keys(tA).includes(t)?tA[t]:void 0;return(0,n.jsxs)("span",{className:"me-1",style:a?{color:a}:{},children:["[",t,"]"]})},tO=e=>{let{notify:t}=e,a=t.transportType?(0,n.jsx)(tF,{text:t.transportType}):null;return(0,n.jsx)(tf,{title:t.message.event_type,timestamp:t.timestamp,description:t.message,label:a})},tH=i.memo(e=>(0,n.jsx)(tO,{...e})),tB=()=>{let e=tm(e=>e.notifyMessages),t=tm(e=>e.debugFilterText),a=e.filter(e=>t.split(" ").every(t=>""===t||0<=JSON.stringify(e).indexOf(t)));return(0,n.jsx)("div",{className:"debug-messages",children:a.map(e=>(0,n.jsx)(tH,{notify:e},e.message.type+e.timestamp))})},tU={websocket:"#00ff00",datachannel:"#ff00ff"},tE=e=>{let{text:t}=e,a=Object.keys(tU).includes(t)?tU[t]:void 0;return(0,n.jsxs)("span",{style:a?{color:a}:{},children:["[",t,"]"]})},t_=e=>{let{push:t}=e,a=t.transportType?(0,n.jsx)(tE,{text:t.transportType}):null;return(0,n.jsx)(tf,{title:t.message.type,timestamp:t.timestamp,description:t.message,label:a})},tL=i.memo(e=>(0,n.jsx)(t_,{...e})),tJ=()=>{let e=tm(e=>e.pushMessages),t=tm(e=>e.debugFilterText),a=e.filter(e=>t.split(" ").every(t=>""===t||0<=JSON.stringify(e).indexOf(t)));return(0,n.jsx)("div",{className:"debug-messages",children:a.map((e,t)=>{let a="".concat(e.timestamp,"-").concat(t);return(0,n.jsx)(tL,{ariaControls:a,push:e},a)})})};var tz=a(3124),tG=a(2765);let tW=()=>{let e=(0,i.useRef)(null),t=(0,i.useRef)(null),a=tm(e=>e.soraContents.sora),s=tm(e=>e.soraContents.connectionStatus),o=tm(e=>e.soraContents.datachannels);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"d-flex mt-2",children:[(0,n.jsx)(tI.Z,{className:"me-1",controlId:"sendDataChannelMessageLabel",children:(0,n.jsx)(tz.Z,{name:"sendDataChannelMessageLabel",ref:e,children:o.map(e=>(0,n.jsx)("option",{value:e.label,children:e.label},e.label))})}),(0,n.jsx)(tI.Z,{className:"flex-grow-1 me-1",controlId:"sendDataChannelMessage",children:(0,n.jsx)(tZ.Z,{className:"flex-fill",placeholder:"sendDataChannelMessageを指定",type:"text",ref:t})}),(0,n.jsx)(tG.Z,{variant:"secondary",onClick:()=>{if(null===e.current||null===t.current)return;let n=e.current.value;a&&"connected"===s&&a.sendMessage(n,new TextEncoder().encode(t.current.value))},disabled:0===o.length,children:"send"})]}),0{let{text:t}=e,a=Object.keys(tK).includes(t)?tK[t]:void 0;return(0,n.jsxs)("span",{className:"me-1",style:a?{color:a}:{},children:["[",t,"]"]})},tQ=e=>{let{data:t,type:a,timestamp:i,transportType:s}=e,o=s?(0,n.jsx)(tq,{text:s}):null;return(0,n.jsx)(tf,{title:a,timestamp:i,description:t,label:o})},tX=i.memo(e=>(0,n.jsx)(tQ,{...e})),t$=()=>{let e=tm(e=>e.signalingMessages),t=tm(e=>e.debugFilterText),a=e.filter(e=>t.split(" ").every(t=>""===t||0<=JSON.stringify(e).indexOf(t)));return(0,n.jsx)("div",{className:"debug-messages",children:a.map(e=>{let t=e.type+e.timestamp;return(0,n.jsx)(tX,{...e},t)})})},tY=e=>(0,n.jsx)(tf,{title:"".concat(e.id,"(").concat(e.type,")"),timestamp:null,description:e}),t0=i.memo(e=>(0,n.jsx)(tY,{...e})),t1=()=>{let e=tm(e=>e.soraContents.statsReport),t=tm(e=>e.debugFilterText),a=e.filter(e=>t.split(" ").every(t=>""===t||0<=JSON.stringify(e).indexOf(t)));return(0,n.jsx)("div",{className:"debug-messages",children:a.map(e=>(0,n.jsx)(t0,{...e},e.id))})},t2={signaling:"#ff00ff",notify:"#ffff00",push:"#98fb98",e2ee:"#00ffff",stats:"#ffc0cb"},t5=()=>(0,n.jsx)("span",{className:"me-1",style:{color:"#00ff00"},children:"[websocket]"}),t4=()=>(0,n.jsx)("span",{className:"me-1",style:{color:"#ff8c00"},children:"[peerconnection]"}),t6=()=>(0,n.jsx)("span",{className:"me-1",style:{color:"#bce2e8"},children:"[sora]"}),t9=()=>(0,n.jsx)("span",{className:"me-1",style:{color:"#73b8e2"},children:"[sora-devtools]"}),t3=e=>{let{label:t,id:a}=e,i=t&&Object.keys(t2).includes(t)?t2[t]:void 0;return(0,n.jsxs)("span",{className:"me-1",style:i?{color:i}:{},children:["[datachannel]",t?"[".concat(t,"]"):"","number"==typeof a?"[".concat(a,"]"):""]})},t8=e=>{let t;let{timestamp:a,logType:i,dataChannelId:s,dataChannelLabel:o,type:l,data:r}=e;return"websocket"===i?t=(0,n.jsx)(t5,{}):"datachannel"===i?t=(0,n.jsx)(t3,{id:s,label:o}):"peerconnection"===i?t=(0,n.jsx)(t4,{}):"sora"===i?t=(0,n.jsx)(t6,{}):"sora-devtools"===i&&(t=(0,n.jsx)(t9,{})),(0,n.jsx)(tf,{title:"".concat(l),timestamp:a,description:r,label:t})},t7=i.memo(e=>(0,n.jsx)(t8,{...e})),ae=()=>{let e=tm(e=>e.timelineMessages),t=tm(e=>e.debugFilterText),a=e.filter(e=>t.split(" ").every(t=>""===t||0<=JSON.stringify(e).indexOf(t)));return(0,n.jsx)("div",{className:"debug-messages",children:a.map(e=>{let t="".concat(e.timestamp,"-").concat(e.type);return e.dataChannelLabel&&(t+="-".concat(e.dataChannelLabel)),(0,n.jsx)(t7,{...e},t)})})},at=()=>{let e=tm(e=>e.debug),t=tm(e=>e.debugType),a=tu();return e?(0,n.jsx)("div",{className:"col-debug col-6",children:(0,n.jsxs)(tg.Z,{id:"debug-tab",activeKey:t,defaultActiveKey:"timeline",onSelect:e=>{("log"===e||"notify"===e||"push"===e||"stats"===e||"timeline"===e||"signaling"===e||"messaging"===e||"codec"===e)&&a(ep(e))},children:[(0,n.jsxs)(th.Z,{eventKey:"timeline",title:"Timeline",children:[(0,n.jsx)(tM,{}),(0,n.jsx)(ae,{})]}),(0,n.jsxs)(th.Z,{eventKey:"signaling",title:"Signaling",children:[(0,n.jsx)(tM,{}),(0,n.jsx)(t$,{})]}),(0,n.jsxs)(th.Z,{eventKey:"notify",title:"Notfiy",children:[(0,n.jsx)(tM,{}),(0,n.jsx)(tB,{})]}),(0,n.jsxs)(th.Z,{eventKey:"push",title:"Push",children:[(0,n.jsx)(tM,{}),(0,n.jsx)(tJ,{})]}),(0,n.jsxs)(th.Z,{eventKey:"stats",title:"Stats",children:[(0,n.jsx)(tM,{}),(0,n.jsx)(t1,{})]}),(0,n.jsxs)(th.Z,{eventKey:"log",title:"Log",children:[(0,n.jsx)(tM,{}),(0,n.jsx)(tD,{})]}),(0,n.jsxs)(th.Z,{eventKey:"messaging",title:"Messaging",children:[(0,n.jsx)(tW,{}),(0,n.jsx)(tw,{})]}),(0,n.jsx)(th.Z,{eventKey:"codec",title:"Codec",children:(0,n.jsx)(ty,{})})]})}):null};var aa=a(6670),an=a(1358),ai=a(5925);let as=()=>{let e=tu(),t=tm(e=>e.soraContents.reconnectingTrials);return(0,i.useEffect)(()=>{e(H())},[e]),(0,n.jsxs)(ai.Z,{delay:2e4,onClose:()=>{e(e5(!1))},children:[(0,n.jsx)(ai.Z.Header,{className:"bg-warning text-white",children:(0,n.jsx)("strong",{className:"me-auto",children:"Reconnect"})}),(0,n.jsx)(ai.Z.Body,{className:"bg-light",children:(0,n.jsxs)("p",{className:"text-break font-weight-bold mb-0",children:["Reconnecting... (trials ",t,")"]})})]})},ao=e=>{let t=tu(),a="error"===e.type?"bg-danger":"bg-info";return(0,n.jsxs)(ai.Z,{autohide:!0,delay:2e4,onClose:()=>{t(q(e.timestamp))},children:[(0,n.jsxs)(ai.Z.Header,{className:"".concat(a," text-white"),children:[(0,n.jsx)("strong",{className:"me-auto",children:e.title}),(0,n.jsx)("span",{children:u(e.timestamp)})]}),(0,n.jsx)(ai.Z.Body,{className:"bg-light",children:(0,n.jsx)("p",{className:"text-break font-weight-bold mb-0",children:e.message})})]})},al=()=>{let e=tm(e=>e.alertMessages),t=tm(e=>e.soraContents.reconnecting);return(0,n.jsxs)("div",{className:"alert-messages",children:[t?(0,n.jsx)(as,{}):null,e.map(e=>(0,n.jsx)(ao,{...e},e.timestamp))]})};var ar=a(9564),ac=a(4785);let ad=e=>{let t=d.x$[e.kind];return t?(0,n.jsx)(ar.Z,{placement:"top",overlay:(0,n.jsx)(ac.Z,{id:"popover-basic",children:(0,n.jsx)(ac.Z.Body,{style:{whiteSpace:"pre-wrap"},children:t.description})}),children:(0,n.jsx)(tR.Z,{children:e.children})}):(console.warn('Could not load description "'.concat(e.kind,'"')),(0,n.jsx)(tR.Z,{children:e.children}))},au=e=>(0,n.jsxs)("div",{className:"d-flex align-items-center",children:[e.label?(0,n.jsx)("p",{children:e.label}):null,(0,n.jsxs)("div",{className:"d-flex align-items-center border border-secondary rounded mx-1",children:[(0,n.jsx)("p",{id:e.id,className:"mx-2 p-1",children:e.text}),(0,n.jsx)("div",{className:"border-left border-secondary",children:(0,n.jsx)("button",{type:"button",className:"btn btn-sm btn-light",onClick:t=>{m(e.text),t.currentTarget.blur()},children:(0,n.jsx)(tv,{})})})]})]}),am=e=>{let{localVideo:t,connectionId:a,clientId:i}=e;return(0,n.jsxs)(n.Fragment,{children:[a?(0,n.jsx)(au,{id:t?"local-video-connection-id":void 0,label:"connectionID:",text:a}):null,null!=i&&a!==i?(0,n.jsx)(au,{id:t?"local-video-client-id":void 0,label:"clientID:",text:i}):null]})},ag=e=>{let t=tm(e=>e.soraContents.statsReport),[a,n]=(0,i.useState)([]),[s,o]=(0,i.useState)(null);return(0,i.useEffect)(()=>{(async()=>{if(void 0===e.getVideoTracks().find(e=>e))return;let a=t.filter(e=>{if("outbound-rtp"===e.type&&"video"===e.kind)return!0});if(0===a.length)return;let i=a.map(e=>{let a=t.find(t=>{if("codec"===t.type)return t.id===e.codecId});return void 0===a?{outboundRtpStats:e}:{codec:a,outboundRtpStats:e}});if(n(i.sort((e,t)=>void 0===e.outboundRtpStats.rid?1:void 0===t.outboundRtpStats.rid?-1:e.outboundRtpStats.rid.localeCompare(t.outboundRtpStats.rid))),null===s){let e=i.filter(e=>void 0!==e.outboundRtpStats.frameWidth).sort((e,t)=>void 0===e.outboundRtpStats.frameWidth?1:void 0===t.outboundRtpStats.frameWidth?-1:t.outboundRtpStats.frameWidth-e.outboundRtpStats.frameWidth);e.length>0&&o(e[0])}else{let e=i.find(e=>e.outboundRtpStats.rid===s.outboundRtpStats.rid);void 0!==e&&o(e)}})()},[t,e,s]),{trackStats:a,selected:s,setSelected:o}},ah=e=>{var t,a,i;let{stream:s}=e,{trackStats:o,selected:l,setSelected:r}=ag(s);return(0,n.jsx)("div",{className:"video-overlay",children:0===o.length?(0,n.jsx)("p",{children:"loading..."}):(0,n.jsxs)(n.Fragment,{children:[o.length>1&&(0,n.jsx)("div",{className:"d-flex gap-2",children:o.map(e=>(0,n.jsxs)("div",{className:e.outboundRtpStats.rid===(null==l?void 0:l.outboundRtpStats.rid)?"rid-selected":"rid",onClick:()=>r(e),onKeyDown:()=>r(e),children:["[",e.outboundRtpStats.rid,"]"]},e.outboundRtpStats.rid))}),l&&(0,n.jsxs)("table",{className:"table-video-capabilities",children:[(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"mimeType"}),(0,n.jsx)("td",{children:null===(t=l.codec)||void 0===t?void 0:t.mimeType})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"payloadType"}),(0,n.jsx)("td",{children:null===(a=l.codec)||void 0===a?void 0:a.payloadType})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"sdpFmtpLine"}),(0,n.jsx)("td",{children:null===(i=l.codec)||void 0===i?void 0:i.sdpFmtpLine})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"resolution"}),(0,n.jsxs)("td",{children:[l.outboundRtpStats.frameWidth,"x",l.outboundRtpStats.frameHeight]})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"fps"}),(0,n.jsx)("td",{children:void 0!==l.outboundRtpStats.framesPerSecond?Math.floor(l.outboundRtpStats.framesPerSecond):void 0})]})]})]})})};async function ap(e,t,a,n){let i=window.location.protocol,s="".concat(i,"//").concat(window.location.hostname,":").concat("https:"===i?"443":"3000","/").concat("https:"===i?"api":"");null!==e&&(s=e);let o="Sora_".concat(t,".").concat(a),l=await fetch(s,{method:"POST",body:JSON.stringify(n),headers:{Accept:"application/json","Content-Type":"application/json","x-sora-target":o},mode:"cors"}),r=await l.json();if(!l.ok){let e="POST ".concat(s," ").concat(l.status," (").concat(l.statusText,") target:").concat(o);throw r.error_type&&(e+=" error_type: ".concat(r.error_type)),Error(e)}return r}function av(e,t,a,n,i){let s={channel_id:t,recv_connection_id:a,rid:n};return i&&(s.send_connection_id=i),ap(e,"20201005","RequestRtpStream",s)}function ax(e,t,a,n){let i={channel_id:t,recv_connection_id:a};return n&&(i.send_connection_id=n),ap(e,"20201005","ResetRtpStream",i)}function aj(e,t,a,n,i,s){let o={channel_id:t,recv_connection_id:a,spotlight_focus_rid:n,spotlight_unfocus_rid:i};return s&&(o.send_connection_id=s),ap(e,"20211215","RequestSpotlightRid",o)}function af(e,t,a,n){let i={channel_id:t,recv_connection_id:a};return n&&(i.send_connection_id=n),ap(e,"20211215","ResetSpotlightRid",i)}let aC=e=>{let t=tm(e=>e.soraContents.sora),a=tm(e=>e.apiUrl),i=tm(e=>e.channelId),s=tu(),o=async()=>{if(null==t?void 0:t.connectionId)try{let n=await av(a,i,t.connectionId,e.rid);s(X("POST successed. response: ".concat(JSON.stringify(n))))}catch(e){e instanceof Error&&s(Q(e.message))}};return(0,n.jsx)("div",{className:"mx-1",children:(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"requestSimulcastRidTo".concat(e.rid.charAt(0).toUpperCase()+e.rid.slice(1)),defaultValue:"".concat(e.rid," rid"),onClick:o})})},ab=()=>{let e=(0,i.useRef)(null),t=(0,i.useRef)(null),a=tm(e=>e.soraContents.sora),s=tm(e=>e.channelId),o=tm(e=>e.apiUrl),l=tu();if(!(null==a?void 0:a.connectionId))return null;let r=async()=>{if(!(null==a?void 0:a.connectionId)||null===e.current||null===t.current)return;let n=e.current.value,i=t.current.value;try{let e=await aj(o,s,a.connectionId,n,i);l(X("POST successed. response: ".concat(JSON.stringify(e))))}catch(e){e instanceof Error&&l(Q(e.message))}};return(0,n.jsx)("div",{className:"mx-1",children:(0,n.jsxs)(tI.Z,{className:"form-inline",children:[(0,n.jsx)(tz.Z,{ref:e,children:d.I7.map(e=>""===e?null:(0,n.jsxs)("option",{value:e,children:["SpotlightFocusRid: ",e]},e))}),(0,n.jsx)(tz.Z,{ref:t,children:d.I7.map(e=>""===e?null:(0,n.jsxs)("option",{value:e,children:["SpotlightUnfocusRid: ",e,"\xa0\xa0\xa0"]},e))}),(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"requestSpotlightRid",defaultValue:"requestSpotlightRid",onClick:r})]})})},aS=()=>{let e=tm(e=>e.soraContents.sora),t=tm(e=>e.channelId),a=tm(e=>e.apiUrl),i=tu(),s=async()=>{if(null==e?void 0:e.connectionId)try{let n=await ax(a,t,e.connectionId);i(X("POST successed. response: ".concat(JSON.stringify(n))))}catch(e){e instanceof Error&&i(Q(e.message))}};return(0,n.jsx)("div",{className:"mx-1",children:(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"resetAllSimulcastRid",defaultValue:"reset rid",onClick:s})})},ay=()=>{let e=tm(e=>e.soraContents.sora),t=tm(e=>e.channelId),a=tm(e=>e.apiUrl),i=tu(),s=async()=>{if(null==e?void 0:e.connectionId)try{let n=await af(a,t,e.connectionId);i(X("POST successed. response: ".concat(JSON.stringify(n))))}catch(e){e instanceof Error&&i(Q(e.message))}};return(0,n.jsx)("div",{className:"mx-1",children:(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"resetAllSpotlightRid",defaultValue:"resetSpotlightRid",onClick:s})})},aN=e=>(0,n.jsxs)("div",{className:"d-flex align-items-center",children:[(0,n.jsx)("p",{children:"sessionID:"}),(0,n.jsxs)("div",{className:"d-flex align-items-center border border-secondary rounded mx-1",children:[(0,n.jsx)("p",{id:e.id,className:"mx-2 p-1",children:e.text}),(0,n.jsx)("div",{className:"border-left border-secondary",children:(0,n.jsx)("button",{type:"button",className:"btn btn-sm btn-light",onClick:t=>{m(e.text),t.currentTarget.blur()},children:(0,n.jsx)(tv,{})})})]})]}),ak=e=>{let{sessionId:t}=e;return(0,n.jsx)(aN,{id:"session-id",text:t})},aT=e=>{var t;let{displayResolution:a,stream:s,mute:o,audioOutput:l,setHeight:r}=e,c=(0,i.useRef)(null),d=v(a);return(0,i.useEffect)(()=>{let e=new ResizeObserver(e=>{e.filter(e=>{r(e.contentRect.height)})});return c.current&&(l&&s&&s.getAudioTracks().length>0&&c.current.setSinkId(l),e.observe(c.current)),()=>{e.disconnect()}},[r,l,s]),(0,i.useEffect)(()=>{c.current&&o&&(c.current.muted=!0)},[o]),(0,i.useEffect)(()=>{if(c.current&&s){let e;s.getVideoTracks().filter(t=>{e=t.enabled,t.enabled=!1}),c.current.onloadedmetadata=t=>{s.getVideoTracks().filter(t=>{void 0!==e&&(t.enabled=e)})},c.current.srcObject=s,l&&s.getAudioTracks().length>0&&c.current.setSinkId(l)}else c.current&&null===s&&(c.current.srcObject=null)},[s,l]),l&&(null===(t=c.current)||void 0===t?void 0:t.setSinkId)&&s&&s.getAudioTracks().length>0&&c.current.setSinkId(l),(0,n.jsx)("video",{id:e.localVideo?"local-video":void 0,autoPlay:!0,playsInline:!0,controls:!0,muted:o,ref:c,width:0(0,n.jsx)(aT,{...e})),aI="#CCCCCC";function aR(e,t,a){e.beginPath(),e.fillStyle=t,e.fillRect(0,a,25,10),e.closePath()}function aZ(e,t){let a=Math.ceil(t/12.5),n=t-10;aR(e,aI,n);for(let t=0;t{let t=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(0===e.stream.getAudioTracks().length)return;let a=new(window.AudioContext||window.webkitAudioContext),n=a.createMediaStreamSource(e.stream),i=a.createAnalyser();i.fftSize=2048;let s=new Uint8Array(i.frequencyBinCount);n.connect(i);let o=null;return function e(){o=requestAnimationFrame(e),i.getByteTimeDomainData(s);let a=Array.from(s),n=Math.max.apply(null,a)-128,l=t.current;if(null===l)return;let r=l.getContext("2d");null!==r&&(r.clearRect(0,0,25,l.height),r.save(),aZ(r,l.height),function(e,t,a){let n=Math.ceil(t*a/12.5);for(let a=0;a{a&&a.close(),o&&cancelAnimationFrame(o)}},[e.stream]),(0,n.jsx)("canvas",{width:25,height:e.height,className:"volume-visualizer",ref:t})},aP=e=>{let t=(0,i.useRef)(null);return(0,i.useEffect)(()=>{let e=t.current;if(null===e)return;let a=e.getContext("2d");null!==a&&(a.clearRect(0,0,25,e.height),a.save(),aZ(a,e.height),a.restore())},[]),(0,n.jsx)("canvas",{width:25,height:e.height,className:"volume-visualizer",ref:t})},aV=i.memo(e=>e.micDevice&&0{let[e,t]=(0,i.useState)(0),a=tm(e=>e.audio),s=tm(e=>e.video),o=tm(e=>e.audioOutput),l=tm(e=>e.displayResolution),r=tm(e=>e.focusedSpotlightConnectionIds),c=tm(e=>e.soraContents.connectionId),d=tm(e=>e.soraContents.localMediaStream),u=tm(e=>e.micDevice),m=c&&r[c],g=tm(e=>e.mediaStats);return!1===a&&!1===s?null:(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("div",{className:"d-flex",children:(0,n.jsxs)("div",{className:"position-relative d-flex\xb7flex-nowrap\xb7align-items-start\xb7video-wrapper".concat(m?"\xb7spotlight-focused":""),children:[g&&d&&d.getVideoTracks().length>0&&(0,n.jsx)(ah,{stream:d}),(0,n.jsx)(aw,{stream:d,setHeight:t,audioOutput:o,displayResolution:l,localVideo:!0,mute:!0}),null!==d?(0,n.jsx)(aV,{micDevice:u,stream:d,height:e}):null]})})})},aA=()=>{let e=tm(e=>e.soraContents.connectionId),t=tm(e=>e.soraContents.clientId),a=tm(e=>e.soraContents.sessionId),i=tm(e=>e.simulcast),s=tm(e=>e.spotlight),o=tm(e=>e.role),l=tm(e=>e.soraContents.localMediaStream);return(0,n.jsx)("div",{className:"row my-1",children:(0,n.jsxs)("div",{className:"col-auto",children:[(0,n.jsxs)("div",{className:"video-status mb-1",children:[null!==a?(0,n.jsx)("div",{className:"d-flex align-items-center mb-1 video-status-inner",children:(0,n.jsx)(ak,{sessionId:a})}):null,null!==e||null!==t?(0,n.jsx)("div",{className:"d-flex align-items-center mb-1 video-status-inner",children:(0,n.jsx)(am,{connectionId:e,clientId:t,localVideo:!0})}):null,null!==e&&"true"!==s&&"true"===i&&"sendonly"!==o?(0,n.jsxs)("div",{className:"d-flex align-items-center mb-1 video-status-inner",children:[(0,n.jsx)(ad,{kind:"changeAllRecvStream",children:"change all:"}),(0,n.jsx)(aC,{rid:"r0"}),(0,n.jsx)(aC,{rid:"r1"}),(0,n.jsx)(aC,{rid:"r2"}),(0,n.jsx)(aS,{})]}):null,null!==e&&"true"===s?(0,n.jsxs)("div",{className:"d-flex align-items-center mb-1 video-status-inner",children:[(0,n.jsx)(ab,{}),(0,n.jsx)(ay,{})]}):null]}),null!==l&&"recvonly"!==o?(0,n.jsx)(aD,{}):null]})})};function aF(e,t,a){if(null===t)return;let n=[];return"video"===a?n=t.getVideoTracks().map(e=>e.id):"audio"===a&&(n=t.getAudioTracks().map(e=>e.id)),e.find(e=>"inbound-rtp"===e.type&&"kind"in e&&"trackIdentifier"in e&&!!(e.kind===a&&n.includes(e.trackIdentifier)))}let aO=e=>{let t=tm(e=>e.soraContents.statsReport),a=tm(e=>e.soraContents.prevStatsReport),i=aF(t,e.stream,e.type),s=aF(a,e.stream,e.type);if(void 0===i||void 0===i.jitterBufferDelay||void 0===i.jitterBufferEmittedCount)return null;let o=i.jitterBufferDelay,l=i.jitterBufferEmittedCount;void 0!==s&&void 0!==s.jitterBufferDelay&&void 0!==s.jitterBufferEmittedCount&&(o=i.jitterBufferDelay-s.jitterBufferDelay,l=i.jitterBufferEmittedCount-s.jitterBufferEmittedCount);let r=Math.floor(o/l*1e3),c="normal-jitter-buffer";return 500{let t=tm(e=>e.soraContents.statsReport),a=tm(e=>e.soraContents),[n,s]=(0,i.useState)(null);return(0,i.useEffect)(()=>{(async()=>{var n;let i,o;if(!(null===(n=a.sora)||void 0===n?void 0:n.pc))return;let l=e.getVideoTracks().find(e=>e);if(void 0===l)return;let r=await a.sora.pc.getReceivers().find(e=>e.track.id===l.id);if(void 0!==r){for(let e of(await r.getStats())){let[t,a]=e;if(a.codecId){i=a.codecId;break}}if(void 0!==i){for(let e of t)"codec"===e.type&&i===e.id&&(o=e);o&&s({codec:o,videoTrackStats:{width:l.getSettings().width,height:l.getSettings().height,frameRate:void 0!==l.getSettings().frameRate?Math.floor(l.getSettings().frameRate||0):void 0}})}}})()},[t,e,a]),{trackStats:n}},aB=e=>{let{stream:t}=e,{trackStats:a}=aH(t);return(0,n.jsx)("div",{className:"video-overlay",children:null===a?(0,n.jsx)("p",{children:"loading..."}):(0,n.jsxs)("table",{className:"table-video-capabilities",children:[(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"mimeType"}),(0,n.jsx)("td",{children:a.codec.mimeType})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"payloadType"}),(0,n.jsx)("td",{children:a.codec.payloadType})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"sdpFmtpLine"}),(0,n.jsx)("td",{children:a.codec.sdpFmtpLine})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"resolution"}),(0,n.jsx)("td",{children:void 0===a.videoTrackStats.width||void 0===a.videoTrackStats.height?"undefined":"".concat(a.videoTrackStats.width,"x").concat(a.videoTrackStats.height)})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"fps"}),(0,n.jsx)("td",{children:void 0===a.videoTrackStats.frameRate?"undefined":a.videoTrackStats.frameRate})]})]})})},aU=e=>{let t=tm(e=>e.soraContents.sora),a=tm(e=>e.apiUrl),i=tm(e=>e.channelId),s=tu(),o=async()=>{if(null==t?void 0:t.connectionId)try{let n=await av(a,i,t.connectionId,e.rid,e.sendConnectionId);s(X("POST successed. response: ".concat(JSON.stringify(n))))}catch(e){e instanceof Error&&s(Q(e.message))}};return(0,n.jsx)("input",{className:"btn btn-secondary btn-sm mx-1",type:"button",name:"requestSimulcastRidTo".concat(e.rid.charAt(0).toUpperCase()+e.rid.slice(1)),defaultValue:"".concat(e.rid," rid"),onClick:o})},aE=e=>{let t=(0,i.useRef)(null),a=(0,i.useRef)(null),s=tm(e=>e.soraContents.sora),o=tm(e=>e.channelId),l=tm(e=>e.apiUrl),r=tu();if(!(null==s?void 0:s.connectionId))return null;let c=async()=>{if(!(null==s?void 0:s.connectionId)||null===t.current||null===a.current)return;let n=t.current.value,i=a.current.value;try{let t=await aj(l,o,s.connectionId,n,i,e.sendConnectionId);r(X("POST successed. response: ".concat(JSON.stringify(t))))}catch(e){e instanceof Error&&r(Q(e.message))}};return(0,n.jsx)("div",{className:"mx-1",children:(0,n.jsxs)(tI.Z,{className:"form-inline",children:[(0,n.jsx)(tz.Z,{ref:t,children:d.I7.map(e=>""===e?null:(0,n.jsxs)("option",{value:e,children:["SpotlightFocusRid: ",e]},e))}),(0,n.jsx)(tz.Z,{ref:a,children:d.I7.map(e=>""===e?null:(0,n.jsxs)("option",{value:e,children:["SpotlightUnfocusRid: ",e,"\xa0\xa0\xa0"]},e))}),(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"requestSpotlightRidBySendConnectionId",defaultValue:"requestSpotlightRid",onClick:c})]})})},a_=e=>{let t=tm(e=>e.soraContents.sora),a=tm(e=>e.channelId),i=tm(e=>e.apiUrl),s=tu(),o=async()=>{if(null==t?void 0:t.connectionId)try{let n=await ax(i,a,t.connectionId,e.sendConnectionId);s(X("POST successed. response: ".concat(JSON.stringify(n))))}catch(e){e instanceof Error&&s(Q(e.message))}};return(0,n.jsx)("input",{className:"btn btn-secondary btn-sm mx-1",type:"button",name:"resetRtpStream",defaultValue:"reset rid",onClick:o})},aL=e=>{let t=tm(e=>e.soraContents.sora),a=tm(e=>e.channelId),i=tm(e=>e.apiUrl),s=tu(),o=async()=>{if(null==t?void 0:t.connectionId)try{let n=await af(i,a,t.connectionId,e.sendConnectionId);s(X("POST successed. response: ".concat(JSON.stringify(n))))}catch(e){e instanceof Error&&s(Q(e.message))}};return(0,n.jsx)("input",{className:"btn btn-secondary mx-1",type:"button",name:"resetSpotlightRid",defaultValue:"resetSpotlightRid",onClick:o})};function aJ(e,t){if(null===t)return[];let a=t.getTracks().map(e=>e.id),n=[];for(let t of e)(!t.id||t.id.match(/^RTCMediaStreamTrack/))&&"trackIdentifier"in t&&t.trackIdentifier&&a.includes(t.trackIdentifier)&&n.push(t);return n}let az=e=>{let t=tm(e=>e.showStats),a=tm(e=>e.soraContents.statsReport),i=tm(e=>e.soraContents.prevStatsReport);if(!t)return null;let s=aJ(a,e.stream),o=aJ(i,e.stream);return(0,n.jsx)(n.Fragment,{children:s.map(e=>{let t=0,a=0,i=o.find(t=>e.id===t.id);return i&&(t=e.jitterBufferDelay-i.jitterBufferDelay,a=e.jitterBufferEmittedCount-i.jitterBufferEmittedCount),(0,n.jsx)("div",{children:(0,n.jsxs)("ul",{className:"mediastream-stats-report",children:[Object.entries(e).map(e=>{let[t,a]=e;return(0,n.jsxs)("li",{children:[(0,n.jsxs)("strong",{children:[t,":"]})," ",a]},t)}),(0,n.jsxs)("li",{children:[(0,n.jsx)("strong",{children:"[jitterBufferDelay/jitterBufferEmittedCount_in_ms]"})," ",Math.floor(t/a*1e3)]})]})},e.id)})})},aG=e=>{let{client:t}=e,{mediaStream:a,connectionId:s,clientId:o}=t,[l,r]=(0,i.useState)(0),c=tm(e=>e.audioOutput),d=tm(e=>e.displayResolution),u=tm(e=>e.focusedSpotlightConnectionIds),m=tm(e=>e.multistream),g=tm(e=>e.mute),h=tm(e=>e.simulcast),p=tm(e=>e.spotlight),v=s&&u[s],x=tm(e=>e.mediaStats);return(0,n.jsxs)("div",{className:"col-auto",children:[(0,n.jsxs)("div",{className:"video-status",children:[(0,n.jsxs)("div",{className:"d-flex align-items-center mb-1 video-status-inner",children:[(0,n.jsx)(am,{connectionId:s,clientId:o}),(0,n.jsx)(aO,{type:"audio",stream:a}),(0,n.jsx)(aO,{type:"video",stream:a})]}),(0,n.jsxs)("div",{className:"d-flex align-items-center mb-1 video-status-inner",children:["true"!==p&&"true"===m&&"true"===h?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aU,{rid:"r0",sendConnectionId:s}),(0,n.jsx)(aU,{rid:"r1",sendConnectionId:s}),(0,n.jsx)(aU,{rid:"r2",sendConnectionId:s}),(0,n.jsx)(a_,{sendConnectionId:s})]}):null,"true"===p&&"true"===m&&"true"===h?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aE,{sendConnectionId:s}),(0,n.jsx)(aL,{sendConnectionId:s})]}):null]})]}),(0,n.jsxs)("div",{className:"d-flex flex-wrap align-items-start overflow-y-hidden",children:[(0,n.jsxs)("div",{className:"position-relative d-flex flex-nowrap align-items-start video-wrapper".concat(v?" spotlight-focused":""),children:[x&&a.getVideoTracks().length>0&&(0,n.jsx)(aB,{stream:a}),(0,n.jsx)(aw,{stream:a,setHeight:r,mute:g,audioOutput:c,displayResolution:d}),(0,n.jsx)(aV,{micDevice:!0,stream:a,height:l})]}),(0,n.jsx)(az,{stream:a})]})]})},aW=()=>{let e=tm(e=>e.soraContents.remoteClients);return(0,n.jsx)("div",{className:"row my-2",children:e.map(e=>(0,n.jsx)(aG,{client:e},e.connectionId))})},aK=()=>{let e=tm(e=>e.aspectRatio),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"aspectRatio",children:[(0,n.jsx)(ad,{kind:"aspectRatio",children:"aspectRatio:"}),(0,n.jsx)(tz.Z,{name:"aspectRatio",value:e,onChange:e=>{g(e.target.value,d.Ii)&&t($(e.target.value))},children:d.Ii.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},aq=()=>{let e=tm(e=>e.audioBitRate),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"audioBitRate",children:[(0,n.jsx)(ad,{kind:"audioBitRate",children:"audioBitRate:"}),(0,n.jsx)(tz.Z,{name:"audioBitRate",value:e,onChange:e=>{g(e.target.value,d.xR)&&a(ee(e.target.value))},disabled:t,children:d.xR.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},aQ=()=>{let e=tm(e=>e.audioCodecType),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"audioBitRate",children:[(0,n.jsx)(ad,{kind:"audioCodecType",children:"audioCodecType:"}),(0,n.jsx)(tz.Z,{name:"audioCodecType",value:e,onChange:e=>{g(e.target.value,d.o1)&&a(et(e.target.value))},disabled:t,children:d.o1.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},aX=()=>{let e=tm(e=>e.audioContentHint),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"audioContentHint",children:[(0,n.jsx)(ad,{kind:"audioContentHint",children:"audioContentHint:"}),(0,n.jsx)(tz.Z,{name:"audioContentHint",value:e,onChange:e=>{g(e.target.value,d.nT)&&t(ea(e.target.value))},children:d.nT.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})};var a$=a(1181);let aY=e=>{let{children:t,kind:a,checked:i,onChange:s,disabled:o}=e,l=d.x$[a];return l?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a$.Z,{type:"switch",checked:i,onChange:s,disabled:o}),(0,n.jsx)(ar.Z,{placement:"top",overlay:(0,n.jsx)(ac.Z,{id:"popover-basic",children:(0,n.jsx)(ac.Z.Body,{style:{whiteSpace:"pre-wrap"},children:l.description})}),children:(0,n.jsx)(tR.Z,{children:t})})]}):(console.warn('Could not load description "'.concat(a,'"')),(0,n.jsx)(tR.Z,{children:t}))},a0=()=>{let e=tm(e=>e.audio),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"audio",children:(0,n.jsx)(aY,{kind:"audio",checked:e,onChange:e=>{a(Y(e.target.checked))},disabled:t,children:"audio"})})},a1=()=>{let e=tm(e=>e.audioInput),t=tm(e=>e.audioInputDevices),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"audioInput",children:[(0,n.jsx)(ad,{kind:"audioInput",children:"audioInput:"}),(0,n.jsxs)(tz.Z,{name:"audioInput",value:e,onChange:e=>{a(en(e.target.value)),a(E())},disabled:0===t.length,children:[(0,n.jsx)("option",{value:"",children:"未指定"}),t.map(e=>(0,n.jsx)("option",{value:e.deviceId,children:e.label},e.deviceId))]})]})},a2=()=>{let e=tm(e=>e.audioOutput),t=tm(e=>e.audioOutputDevices),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"audioOutput",children:[(0,n.jsx)(ad,{kind:"audioOutput",children:"audioOutput:"}),(0,n.jsxs)(tz.Z,{name:"audioOutput",value:e,onChange:e=>{a(ei(e.target.value))},disabled:0===t.length,children:[(0,n.jsx)("option",{value:"",children:"未指定"}),t.map(e=>(0,n.jsx)("option",{value:e.deviceId,children:e.label},e.deviceId))]})]})},a5=()=>{let e=tm(e=>e.enabledAudioStreamingLanguageCode),t=tm(e=>e.audioStreamingLanguageCode),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledAudioStreamingLanguageCode",children:(0,n.jsx)(aY,{kind:"audioStreamingLanguageCode",checked:e,onChange:e=>{i(eP(e.target.checked))},disabled:a,children:"audioStreamingLanguageCode"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"audioStreamingLanguageCode",children:(0,n.jsx)(tZ.Z,{className:"flex-fill w-500",type:"text",placeholder:"audioStreamingLanguageCodeを指定",value:t,onChange:e=>{i(eM(e.target.value))},disabled:a})})})}):null]})},a4=()=>{let e=tm(e=>e.audioTrack),t=tu();return(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"audioTrack",children:(0,n.jsx)(aY,{kind:"audioTrack",checked:e,onChange:e=>{t(es(e.target.checked))},disabled:!1,children:"Enable audio track"})})},a6=()=>{let e=tm(e=>e.autoGainControl),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"autoGainControl",children:[(0,n.jsx)(ad,{kind:"autoGainControl",children:"autoGainControl:"}),(0,n.jsx)(tz.Z,{name:"autoGainControl",value:e,onChange:e=>{g(e.target.value,d.iN)&&t(eo(e.target.value))},children:d.iN.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},a9=()=>{let e=tm(e=>e.blurRadius),t=tm(e=>e.mediaType),a=tu(),i="getUserMedia"!==t;return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"blurRadius",children:[(0,n.jsx)(ad,{kind:"blurRadius",children:"blurRadius:"}),(0,n.jsx)(tz.Z,{value:e,onChange:e=>{g(e.target.value,d.G_)&&a(el(e.target.value))},disabled:i,children:d.G_.map(e=>(0,n.jsx)("option",{suppressHydrationWarning:!0,value:e,children:""===e||i?"未指定":e},e))})]})},a3=()=>{let e=tm(e=>e.enabledBundleId),t=tm(e=>e.bundleId),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledBundleId",children:(0,n.jsx)(aY,{kind:"bundleId",checked:e,onChange:e=>{i(ef(e.target.checked))},disabled:a,children:"bundleId"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"bundleId",children:(0,n.jsx)(tZ.Z,{className:"flex-fill w-500",type:"text",placeholder:"bundleIdを指定",value:t,onChange:e=>{i(er(e.target.value))},disabled:a})})})}):null]})},a8=()=>{let e=tm(e=>e.cameraDevice),t=tm(e=>e.soraContents.connectionStatus),a=tm(e=>e.soraContents.sora),i=tm(e=>e.video),s=!(a&&"connected"===t?a.video:i),o=tu();return(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"cameraDevice",children:(0,n.jsx)(aY,{kind:"cameraDevice",checked:e,onChange:e=>{o(J(e.target.checked))},disabled:s,children:"Enable camera device"})})},a7=()=>{let e=tm(e=>e.channelId),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"channelId",children:[(0,n.jsx)(ad,{kind:"channelId",children:"channelId:"}),(0,n.jsx)(tZ.Z,{type:"text",placeholder:"ChannelIdを指定",value:e,onChange:e=>{a(ec(e.target.value))},disabled:t})]})},ne=()=>{let e=tm(e=>e.enabledClientId),t=tm(e=>e.clientId),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledClientId",children:(0,n.jsx)(aY,{kind:"clientId",checked:e,onChange:e=>{i(eC(e.target.checked))},disabled:a,children:"clientId"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"clientId",children:(0,n.jsx)(tZ.Z,{className:"flex-fill w-500",type:"text",placeholder:"ClientIdを指定",value:t,onChange:e=>{i(ed(e.target.value))},disabled:a})})})}):null]})},nt=()=>{let e=tm(e=>e.soraContents.connectionStatus),t=tu();return(0,n.jsx)("div",{className:"col-auto mb-1",children:(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"connect",defaultValue:"connect",onClick:()=>{t(O())},disabled:"disconnecting"===e||"connecting"===e||"initializing"===e})})},na=e=>{let t=tm(e=>e.ignoreDisconnectWebSocket),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"ignoreDisconnectWebSocket",children:[(0,n.jsx)(ad,{kind:"ignoreDisconnectWebSocket",children:"ignoreDisconnectWebSocket:"}),(0,n.jsx)(tz.Z,{name:"ignoreDisconnectWebSocket",value:t,onChange:e=>{g(e.target.value,d.kt)&&a(eF(e.target.value))},disabled:e.disabled,children:d.kt.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nn=e=>{let t=tm(e=>e.dataChannelSignaling),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"dataChannelSignaling",children:[(0,n.jsx)(ad,{kind:"dataChannelSignaling",children:"dataChannelSignaling:"}),(0,n.jsx)(tz.Z,{name:"dataChannelSignaling",value:t,onChange:e=>{g(e.target.value,d.l9)&&a(em(e.target.value))},disabled:e.disabled,children:d.l9.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},ni=()=>{let e=tm(e=>e.enabledDataChannel),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledDataChannel",children:(0,n.jsx)(a$.Z,{type:"switch",name:"enabledDataChannel",label:"dataChannel",checked:e,onChange:e=>{a(eS(e.target.checked))},disabled:t})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsxs)(aa.Z,{xs:"auto",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(nn,{disabled:t})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(na,{disabled:t})})]})})}):null]})},ns=()=>{let e=tm(e=>e.enabledDataChannels),t=tm(e=>e.dataChannels),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu(),s=JSON.stringify([{label:"#devtools",maxPacketLifeTime:10,ordered:!0,compress:!1,direction:"sendrecv"}],null,2);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledDataChannels",children:(0,n.jsx)(aY,{kind:"dataChannels",checked:e,onChange:e=>{i(eb(e.target.checked))},disabled:a,children:"dataChannels"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsxs)(tI.Z,{className:"form-inline position-relative",controlId:"dataChannels",children:[(0,n.jsx)(tZ.Z,{className:"flex-fill",as:"textarea",placeholder:"dataChannelsを指定\n(例)\n".concat(s),value:t,onChange:e=>{i(eu(e.target.value))},rows:12,cols:100,disabled:a}),(0,n.jsx)(tG.Z,{className:"btn-load-template",type:"button",variant:"outline-secondary",size:"sm",onClick:()=>i(eu(s)),children:"load template"})]})})}):null]})},no=()=>{let e=tm(e=>e.soraContents.connectionStatus),t=tu();return(0,n.jsx)("div",{className:"col-auto mb-1",children:(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"disconnect",defaultValue:"disconnect",onClick:()=>{t(B())},disabled:"disconnecting"===e||"connecting"===e||"initializing"===e})})};var nl=a(9297),nr=a(1990),nc=a(9488),nd=a(3744);let nu=[{label:"未指定",value:""},{label:"144p",value:"256x144"},{label:"240p",value:"320x240"},{label:"360p",value:"640x360"},{label:"480p",value:"720x480"},{label:"540p",value:"960x540"},{label:"720p",value:"1280x720"},{label:"1080p",value:"1920x1080"},{label:"1440p",value:"2560x1440"},{label:"2160p",value:"3840x2160"}],nm=e=>{let{label:t,value:a}=e,i=tu();return(0,n.jsxs)(nl.Z.Item,{as:"button",onClick:()=>i(ev(a)),children:[t," ",""!==a&&"(".concat(a,")")]})},ng=()=>{let e=tm(e=>e.displayResolution),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"displayResolution",children:[(0,n.jsx)(ad,{kind:"displayResolution",children:"displayResolution:"}),(0,n.jsxs)(nr.Z,{children:[(0,n.jsx)(nc.Z.Control,{className:"form-display-resolution",type:"text",value:e,onChange:e=>{t(ev(e.target.value))},placeholder:"未指定"}),(0,n.jsx)(nd.Z,{variant:"outline-secondary form-template-dropdown",title:"",align:"end",children:nu.map(e=>{let{label:t,value:a}=e;return(0,n.jsx)(nm,{label:t,value:a},a)})})]})]})},nh=()=>{let e=tu(),t=tm(e=>e.soraContents.connectionStatus),a=tm(e=>e.soraContents.sora),i="recvonly"===tm(e=>e.role)||null!==a||y(t);return(0,n.jsx)("div",{className:"col-auto mb-1",children:(0,n.jsx)("input",{className:"btn btn-outline-secondary",type:"button",name:"media_access",defaultValue:"dispose media",onClick:()=>{e(F())},disabled:i})})};var np=a(1985);let nv=()=>{let[e,t]=(0,i.useState)(!1),a=tm(e=>e.e2ee),s=y(tm(e=>e.soraContents.connectionStatus)),o=tu();return(0,i.useEffect)(()=>{a&&t(!1)},[a]),(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"e2ee",children:[(0,n.jsx)(aY,{kind:"e2ee",checked:a,onChange:e=>{e.target.checked&&t(!0),o(_(e.target.checked))},disabled:s,children:"e2ee"}),e?(0,n.jsx)(np.Z,{className:"spinner-status",variant:"primary",animation:"border",role:"status"}):null]})})})},nx=()=>{let e=tm(e=>e.echoCancellation),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"echoCancellation",children:[(0,n.jsx)(ad,{kind:"echoCancellation",children:"echoCancellation:"}),(0,n.jsx)(tz.Z,{name:"echoCancellation",value:e,onChange:e=>{g(e.target.value,d.PS)&&t(ex(e.target.value))},children:d.PS.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nj=()=>{let e=tm(e=>e.echoCancellationType),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"echoCancellationType",children:[(0,n.jsx)(ad,{kind:"echoCancellationType",children:"echoCancellationType:"}),(0,n.jsx)(tz.Z,{name:"echoCancellationType",value:e,onChange:e=>{g(e.target.value,d.cJ)&&t(ej(e.target.value))},children:d.cJ.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nf=()=>{let e=tm(e=>e.facingMode),t=tm(e=>e.mediaType),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"facingMode",children:[(0,n.jsx)(ad,{kind:"facingMode",children:"facingMode:"}),(0,n.jsx)(tz.Z,{name:"facingMode",value:e,onChange:e=>{g(e.target.value,d.pT)&&a(eD(e.target.value))},disabled:"getUserMedia"!==t,children:d.pT.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nC=()=>{let e=tm(e=>e.mediaType),t=tm(e=>e.fakeVolume),a=tu();return"fakeMedia"!==e?null:(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"fakeVolume",children:[(0,n.jsx)(ad,{kind:"fakeVolume",children:"fakeVolume:"}),(0,n.jsx)(nc.Z.Range,{min:"0",max:"1",step:"0.25",value:t,onChange:e=>{a(eV(e.target.value))}})]})},nb=()=>{let e=tm(e=>e.enabledForwardingFilter),t=tm(e=>e.forwardingFilter),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledForwardingFilter",children:(0,n.jsx)(aY,{kind:"forwardingFilter",checked:e,onChange:e=>{i(ey(e.target.checked))},disabled:a,children:"forwardingFilter"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"forwardingFilter",children:(0,n.jsx)(tZ.Z,{className:"flex-fill",as:"textarea",placeholder:"forwardingFilterを指定",value:t,onChange:e=>{i(eY(e.target.value))},rows:10,cols:100,disabled:a})})})}):null]})},nS=[{label:"未指定",value:""},{label:"60",value:"60"},{label:"30",value:"30"},{label:"24",value:"24"},{label:"20",value:"20"},{label:"15",value:"15"},{label:"10",value:"10"},{label:"5",value:"5"}],ny=e=>{let{label:t,value:a}=e,i=tu();return(0,n.jsx)(nl.Z.Item,{as:"button",onClick:()=>i(eA(a)),children:t})},nN=()=>{let e=tm(e=>e.frameRate),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"frameRate",children:[(0,n.jsx)(ad,{kind:"frameRate",children:"frameRate:"}),(0,n.jsxs)(nr.Z,{children:[(0,n.jsx)(nc.Z.Control,{className:"form-frame-rate",type:"text",value:e,onChange:e=>{t(eA(e.target.value))},placeholder:"未指定"}),(0,n.jsx)(nd.Z,{variant:"outline-secondary form-template-dropdown",title:"",align:"end",children:nS.map(e=>{let{label:t,value:a}=e;return(0,n.jsx)(ny,{label:t,value:a},a)})})]})]})},nk=()=>{let e=tm(e=>e.lightAdjustment),t=tm(e=>e.mediaType),a=tu(),i="getUserMedia"!==t;return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"lightAdjustment",children:[(0,n.jsx)(ad,{kind:"lightAdjustment",children:"lightAdjustment:"}),(0,n.jsx)(tz.Z,{value:e,onChange:e=>{g(e.target.value,d.Xv)&&a(eO(e.target.value))},disabled:i,children:d.Xv.map(e=>(0,n.jsx)("option",{suppressHydrationWarning:!0,value:e,children:""===e||i?"未指定":e},e))})]})},nT=()=>{let e=tm(e=>e.mediaProcessorsNoiseSuppression),t=tm(e=>e.mediaType),a=tu();return(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"mediaProcessorsNoiseSuppression",children:(0,n.jsx)(aY,{kind:"mediaProcessorsNoiseSuppression",checked:e,onChange:e=>{a(eU(e.target.checked))},disabled:"getUserMedia"!==t,children:"mediaProcessorsNoiseSuppression"})})},nw=()=>{let e=tm(e=>e.mediaStats),t=tu();return(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"mediaStats",children:(0,n.jsx)(aY,{kind:"mediaStats",checked:e,onChange:e=>{t(eE(e.target.checked))},disabled:!1,children:"Show media stats"})})},nI=e=>{let{label:t,disabled:a,onChange:i,mediaType:s}=e;return(0,n.jsx)(a$.Z,{type:"radio",inline:!0,id:t,label:t,value:t,checked:s===t,onChange:i,disabled:a})},nR=()=>{let[e,t]=(0,i.useState)(!1),a=void 0!==window.CropTarget,s=tm(e=>e.soraContents.connectionStatus),o=tm(e=>e.soraContents.localMediaStream),l=tm(e=>e.mediaType),r=null!==o||y(s),c=tu(),u=e=>{g(e.target.value,d.w_)&&c(e_(e.target.value))};return(0,i.useEffect)(()=>{t(!0)},[]),(0,n.jsxs)(tI.Z,{className:"form-inline flex-wrap",children:[(0,n.jsx)(ad,{kind:"mediaType",children:"mediaType:"}),(0,n.jsx)(nI,{label:"getUserMedia",mediaType:l,disabled:r,onChange:u}),(0,n.jsx)(nI,{label:"getDisplayMedia",mediaType:l,disabled:r,onChange:u}),(0,n.jsx)(nI,{label:"fakeMedia",mediaType:l,disabled:r,onChange:u}),e&&(0,n.jsx)(nI,{label:"mediacaptureRegion",mediaType:l,disabled:r||!a,onChange:u})]})},nZ=()=>{let e=tm(e=>e.enabledMetadata),t=tm(e=>e.metadata),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledMetadata",children:(0,n.jsx)(aY,{kind:"metadata",checked:e,onChange:e=>{i(eN(e.target.checked))},disabled:a,children:"metadata"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"metadata",children:(0,n.jsx)(tZ.Z,{className:"flex-fill",as:"textarea",placeholder:"Metadataを指定",value:t,onChange:e=>{i(eL(e.target.value))},rows:10,cols:100,disabled:a})})})}):null]})},nM=()=>{let e=tm(e=>e.micDevice),t=tm(e=>e.soraContents.connectionStatus),a=tm(e=>e.soraContents.sora),i=tm(e=>e.audio),s=!(a&&"connected"===t?a.audio:i),o=tu();return(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"micDevice",children:(0,n.jsx)(aY,{kind:"micDevice",checked:e,onChange:e=>{o(L(e.target.checked))},disabled:s,children:"Enable mic device"})})},nP=()=>{let e=tm(e=>e.multistream),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"multistream",children:[(0,n.jsx)(ad,{kind:"multistream",children:"multistream:"}),(0,n.jsx)(tz.Z,{name:"multistream",value:e,onChange:e=>{g(e.target.value,d.u9)&&a(eJ(e.target.value))},disabled:t,children:d.u9.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nV=()=>{let e=tm(e=>e.noiseSuppression),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"noiseSuppression",children:[(0,n.jsx)(ad,{kind:"noiseSuppression",children:"noiseSuppression:"}),(0,n.jsx)(tz.Z,{name:"noiseSuppression",value:e,onChange:e=>{g(e.target.value,d.ad)&&t(ez(e.target.value))},children:d.ad.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nD=()=>{let e=tm(e=>e.reconnect),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"reconnect",children:(0,n.jsx)(aY,{kind:"reconnect",checked:e,onChange:e=>{a(eW(e.target.checked))},disabled:t,children:"reconnect"})})})})},nA=()=>{let e=tu();return(0,n.jsx)("div",{className:"col-auto mb-1",children:(0,n.jsx)("input",{className:"btn btn-outline-secondary",type:"button",name:"update-devices",defaultValue:"update-devices",onClick:()=>{e(U())}})})},nF=()=>{let e=tu(),t=tm(e=>e.soraContents.connectionStatus),a=tm(e=>e.soraContents.sora),i="recvonly"===tm(e=>e.role)||null!==a||y(t);return(0,n.jsx)("div",{className:"col-auto mb-1",children:(0,n.jsx)("input",{className:"btn btn-outline-secondary",type:"button",name:"media_access",defaultValue:"request media",onClick:()=>{e(A())},disabled:i})})},nO=()=>{let e=tm(e=>e.resizeMode),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"resizeMode",children:[(0,n.jsx)(ad,{kind:"resizeMode",children:"resizeMode:"}),(0,n.jsx)(tz.Z,{name:"resizeMode",value:e,onChange:e=>{g(e.target.value,d.L4)&&t(eK(e.target.value))},children:d.L4.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nH=[{label:"未指定",value:""},{label:"144p",value:"256x144"},{label:"240p",value:"320x240"},{label:"360p",value:"640x360"},{label:"480p",value:"720x480"},{label:"540p",value:"960x540"},{label:"720p",value:"1280x720"},{label:"1080p",value:"1920x1080"},{label:"1440p",value:"2560x1440"},{label:"2160p",value:"3840x2160"}],nB=e=>{let{label:t,value:a}=e,i=tu();return(0,n.jsxs)(nl.Z.Item,{as:"button",onClick:()=>i(eQ(a)),children:[t," ",""!==a&&"(".concat(a,")")]})},nU=()=>{let e=tm(e=>e.resolution),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"resolution",children:[(0,n.jsx)(ad,{kind:"resolution",children:"resolution:"}),(0,n.jsxs)(nr.Z,{children:[(0,n.jsx)(nc.Z.Control,{className:"form-resolution",type:"text",value:e,onChange:e=>{t(eQ(e.target.value))},placeholder:"未指定"}),(0,n.jsx)(nd.Z,{variant:"outline-secondary form-template-dropdown",title:"",align:"end",children:nH.map(e=>{let{label:t,value:a}=e;return(0,n.jsx)(nB,{label:t,value:a},a)})})]})]})},nE=()=>{let e=tm(e=>e.role),t=tm(e=>e.soraContents.connectionStatus),a=null!==tm(e=>e.soraContents.localMediaStream)||y(t),i=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"role",children:[(0,n.jsx)(ad,{kind:"role",children:"role:"}),(0,n.jsx)(tz.Z,{name:"role",value:e,onChange:e=>{g(e.target.value,d.K$)&&i(eq(e.target.value))},disabled:a,children:d.K$.map(e=>(0,n.jsx)("option",{value:e,children:e},e))})]})},n_=()=>{let e=tm(e=>e.enabledSignalingNotifyMetadata),t=tm(e=>e.signalingNotifyMetadata),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledSignalingNotifyMetadata",children:(0,n.jsx)(aY,{kind:"signalingNotifyMetadata",checked:e,onChange:e=>{i(ek(e.target.checked))},disabled:a,children:"signalingNotifyMetadata"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"signalingNotifyMetadata",children:(0,n.jsx)(tZ.Z,{className:"flex-fill",as:"textarea",placeholder:"signalingNotifyMetadataを指定",value:t,onChange:e=>{i(eX(e.target.value))},rows:10,cols:100,disabled:a})})})}):null]})},nL=()=>{let e=tm(e=>e.enabledSignalingUrlCandidates),t=tm(e=>e.signalingUrlCandidates),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",xs:"auto",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledSignalingUrlCandidates",children:(0,n.jsx)(aY,{kind:"signalingUrlCandidates",checked:e,onChange:e=>{i(eT(e.target.checked))},disabled:a,children:"signalingUrlCandidates"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",xs:"auto",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"signalingNotifyMetadata",children:(0,n.jsx)(tZ.Z,{className:"flex-fill",as:"textarea",placeholder:"signalingUrlCandidatesを指定\n(例)\nwss://sora0.example.com/signaling\nwss://sora1.example.com/signaling\n",value:t.join("\n"),onChange:e=>{i(e$(e.target.value.split("\n")))},rows:5,cols:100,disabled:a})})})}):null]})},nJ=()=>{let e=tm(e=>e.simulcast),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"simulcast",children:[(0,n.jsx)(ad,{kind:"simulcast",children:"simulcast:"}),(0,n.jsx)(tz.Z,{name:"simulcast",value:e,onChange:e=>{g(e.target.value,d.VE)&&a(e0(e.target.value))},disabled:t,children:d.VE.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nz=()=>{let e=tm(e=>e.simulcastRid),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"simulcastRid",children:[(0,n.jsx)(ad,{kind:"simulcastRid",children:"simulcastRid:"}),(0,n.jsx)(tz.Z,{name:"simulcastRid",value:e,onChange:e=>{g(e.target.value,d.WJ)&&a(e1(e.target.value))},disabled:t,children:d.WJ.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nG=()=>{let e=tm(e=>e.spotlightFocusRid),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"spotlightFocusRid",children:[(0,n.jsx)(ad,{kind:"spotlightFocusRid",children:"spotlightFocusRid:"}),(0,n.jsx)(tz.Z,{value:e,onChange:e=>{g(e.target.value,d.I7)&&a(e3(e.target.value))},disabled:t,children:d.I7.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nW=()=>{let e=tm(e=>e.spotlight),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"spotlight",children:[(0,n.jsx)(ad,{kind:"spotlight",children:"spotlight:"}),(0,n.jsx)(tz.Z,{name:"spotlight",value:e,onChange:e=>{g(e.target.value,d.VJ)&&a(e9(e.target.value))},disabled:t,children:d.VJ.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nK=()=>{let e=tm(e=>e.spotlightNumber),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"spotlightNumber",children:[(0,n.jsx)(ad,{kind:"spotlightNumber",children:"spotlightNumber:"}),(0,n.jsx)(tz.Z,{value:e,onChange:e=>{g(e.target.value,d.Xr)&&a(e8(e.target.value))},disabled:t,children:d.Xr.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nq=()=>{let e=tm(e=>e.spotlightUnfocusRid),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"spotlightUnfocusRid",children:[(0,n.jsx)(ad,{kind:"spotlightUnfocusRid",children:"spotlightUnfocusRid:"}),(0,n.jsx)(tz.Z,{value:e,onChange:e=>{g(e.target.value,d.I7)&&a(e7(e.target.value))},disabled:t,children:d.I7.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nQ=()=>{let e=tm(e=>e.channelId),t=tm(e=>e.soraContents.connectionStatus),a=tm(e=>e.apiUrl),i=tu(),s=async()=>{try{let t=await ap(a,"20231220","StartRecording",{channel_id:e,expire_time:3600});i(X("POST successed. response: ".concat(JSON.stringify(t))))}catch(e){e instanceof Error&&i(Q(e.message))}};return(0,n.jsx)("div",{className:"col-auto mb-1",children:(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"startRec",defaultValue:"start rec",onClick:s,disabled:"initializing"===t})})},nX=()=>{let e=tm(e=>e.channelId),t=tm(e=>e.soraContents.connectionStatus),a=tm(e=>e.apiUrl),i=tu(),s=async()=>{try{let t=await ap(a,"20231220","StopRecording",{channel_id:e});i(X("POST successed. response: ".concat(JSON.stringify(t))))}catch(e){e instanceof Error&&i(Q(e.message))}};return(0,n.jsx)("div",{className:"col-auto mb-1",children:(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"stopRec",defaultValue:"stop rec",onClick:s,disabled:"initializing"===t})})},n$=()=>{let e=tu();return(0,n.jsx)("div",{className:"col-auto mb-1",children:(0,n.jsx)("input",{className:"btn btn-outline-secondary",type:"button",name:"update-mediastream",defaultValue:"update-mediastream",onClick:()=>{e(E())}})})},nY=()=>{let e=tm(e=>e.enabledVideoAV1Params),t=tm(e=>e.videoAV1Params),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledVideoAV1Params",children:(0,n.jsx)(aY,{kind:"videoAV1Params",checked:e,onChange:e=>{i(eZ(e.target.checked))},disabled:a,children:"videoAV1Params"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"videoAV1Params",children:(0,n.jsx)(tZ.Z,{className:"flex-fill",as:"textarea",placeholder:"videoAV1Paramsを指定",value:t,onChange:e=>{i(tc(e.target.value))},rows:10,cols:100,disabled:a})})})}):null]})},n0=d.Q5.slice();n0.splice(d.Q5.indexOf("15000")+1,0,"support-message");let n1=()=>{let e=tm(e=>e.videoBitRate),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"videoBitRate",children:[(0,n.jsx)(ad,{kind:"videoBitRate",children:"videoBitRate:"}),(0,n.jsx)(tz.Z,{name:"videoBitRate",value:e,onChange:e=>{g(e.target.value,d.Q5)&&a(tt(e.target.value))},disabled:t,children:n0.map(e=>{let t=e;return""===e?t="未指定":"support-message"===e&&(t="以下はサポート外です"),(0,n.jsx)("option",{value:e,disabled:"support-message"===e,children:t},e)})})]})},n2=()=>{let e=tm(e=>e.videoCodecType),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"videoCodecType",children:[(0,n.jsx)(ad,{kind:"videoCodecType",children:"videoCodecType:"}),(0,n.jsx)(tz.Z,{name:"videoCodecType",value:e,onChange:e=>{g(e.target.value,d.Sh)&&a(ta(e.target.value))},disabled:t,children:d.Sh.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},n5=()=>{let e=tm(e=>e.videoContentHint),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"videoContentHint",children:[(0,n.jsx)(ad,{kind:"videoContentHint",children:"videoContentHint:"}),(0,n.jsx)(tz.Z,{name:"videoContentHint",value:e,onChange:e=>{g(e.target.value,d.QO)&&t(tn(e.target.value))},children:d.QO.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},n4=()=>{let e=tm(e=>e.video),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"video",children:(0,n.jsx)(aY,{kind:"video",checked:e,onChange:e=>{a(te(e.target.checked))},disabled:t,children:"video"})})},n6=()=>{let e=tm(e=>e.enabledVideoH264Params),t=tm(e=>e.videoH264Params),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledVideoH264Params",children:(0,n.jsx)(aY,{kind:"videoH264Params",checked:e,onChange:e=>{i(eI(e.target.checked))},disabled:a,children:"videoH264Params"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"videoH264Params",children:(0,n.jsx)(tZ.Z,{className:"flex-fill",as:"textarea",placeholder:"videoH264Paramsを指定",value:t,onChange:e=>{i(tl(e.target.value))},rows:10,cols:100,disabled:a})})})}):null]})},n9=()=>{let e=tm(e=>e.enabledVideoH265Params),t=tm(e=>e.videoH265Params),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledVideoH265Params",children:(0,n.jsx)(aY,{kind:"videoH265Params",checked:e,onChange:e=>{i(eR(e.target.checked))},disabled:a,children:"videoH265Params"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"videoH265Params",children:(0,n.jsx)(tZ.Z,{className:"flex-fill",as:"textarea",placeholder:"videoH265Paramsを指定",value:t,onChange:e=>{i(tr(e.target.value))},rows:10,cols:100,disabled:a})})})}):null]})},n3=()=>{let e=tm(e=>e.videoInput),t=tm(e=>e.videoInputDevices),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"videoInput",children:[(0,n.jsx)(ad,{kind:"videoInput",children:"videoInput:"}),(0,n.jsxs)(tz.Z,{name:"videoInput",value:e,onChange:e=>{a(ti(e.target.value)),a(E())},disabled:0===t.length,children:[(0,n.jsx)("option",{value:"",children:"未指定"}),t.map(e=>(0,n.jsx)("option",{value:e.deviceId,children:e.label},e.deviceId))]})]})},n8=()=>{let e=tm(e=>e.videoTrack),t=tu();return(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"videoTrack",children:(0,n.jsx)(aY,{kind:"videoTrack",checked:e,onChange:e=>{t(ts(e.target.checked))},disabled:!1,children:"Enable video track"})})},n7=()=>{let e=tm(e=>e.enabledVideoVP9Params),t=tm(e=>e.videoVP9Params),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledVideoVP9Params",children:(0,n.jsx)(aY,{kind:"videoVP9Params",checked:e,onChange:e=>{i(ew(e.target.checked))},disabled:a,children:"videoVP9Params"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"videoVP9Params",children:(0,n.jsx)(tZ.Z,{className:"flex-fill",as:"textarea",placeholder:"videoVP9Paramsを指定",value:t,onChange:e=>{i(to(e.target.value))},rows:10,cols:100,disabled:a})})})}):null]})},ie=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",xs:"auto",children:(0,n.jsx)(an.Z,{xs:"12",sm:"12",className:"form-channel-id",children:(0,n.jsx)(a7,{})})}),(0,n.jsxs)(aa.Z,{className:"form-row",xs:"auto",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(nE,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(nP,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(nJ,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(nW,{})})]})]}),it=()=>{let e=tm(e=>e.role),t=tm(e=>e.multistream),a=!("recvonly"===e&&("true"===t||""===t));return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(aa.Z,{className:"form-row",xs:"auto",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(a0,{})}),a&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(aQ,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(aq,{})})]})]}),(0,n.jsxs)(aa.Z,{className:"form-row",xs:"auto",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(n4,{})}),a&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(n2,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(n1,{})})]})]})]})},ia=()=>"true"!==tm(e=>e.simulcast)?null:(0,n.jsx)(aa.Z,{className:"form-row",xs:"auto",children:(0,n.jsx)(an.Z,{children:(0,n.jsx)(nz,{})})}),ii=()=>"true"!==tm(e=>e.spotlight)?null:(0,n.jsxs)(aa.Z,{className:"form-row",xs:"auto",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(nK,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(nG,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(nq,{})})]}),is=()=>{let[e,t]=(0,i.useState)(!0),a=tm(e=>e.e2ee),s=tm(e=>e.enabledBundleId),o=tm(e=>e.enabledClientId),l=tm(e=>e.enabledDataChannel),r=tm(e=>e.enabledDataChannels),c=tm(e=>e.enabledForwardingFilter),d=tm(e=>e.enabledMetadata),u=[a,s,o,l,r,c,d,tm(e=>e.enabledSignalingNotifyMetadata),tm(e=>e.enabledSignalingUrlCandidates),tm(e=>e.reconnect)].some(e=>e),m=["btn-collapse-options"];return e&&m.push("collapsed"),u&&m.push("fw-bold"),(0,n.jsxs)(aa.Z,{className:"form-row",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)("a",{href:"#",className:m.join(" "),onClick:a=>{a.preventDefault(),t(!e)},children:"Signaling options"})}),(0,n.jsx)(tp.Z,{in:!e,children:(0,n.jsxs)("div",{children:[(0,n.jsx)(nv,{}),(0,n.jsx)(nD,{}),(0,n.jsx)(ne,{}),(0,n.jsx)(nZ,{}),(0,n.jsx)(a3,{}),(0,n.jsx)(n_,{}),(0,n.jsx)(nL,{}),(0,n.jsx)(nb,{}),(0,n.jsx)(ns,{}),(0,n.jsx)(ni,{})]})})]})},io=()=>{let[e,t]=(0,i.useState)(!0),a=tm(e=>e.enabledAudioStreamingLanguageCode),s=tm(e=>e.enabledVideoVP9Params),o=[a,s,tm(e=>e.enabledVideoH264Params),tm(e=>e.enabledVideoH265Params),tm(e=>e.enabledVideoAV1Params)].some(e=>e),l=["btn-collapse-options"];return e&&l.push("collapsed"),o&&l.push("fw-bold"),(0,n.jsxs)(aa.Z,{className:"form-row",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)("a",{href:"#",className:l.join(" "),onClick:a=>{a.preventDefault(),t(!e)},children:"Advanced signaling options"})}),(0,n.jsx)(tp.Z,{in:!e,children:(0,n.jsxs)("div",{children:[(0,n.jsx)(a5,{}),(0,n.jsx)(n7,{}),(0,n.jsx)(nY,{}),(0,n.jsx)(n6,{}),(0,n.jsx)(n9,{})]})})]})},il=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{xs:"auto",className:"form-row",children:(0,n.jsx)(an.Z,{children:(0,n.jsx)(nR,{})})}),(0,n.jsx)(aa.Z,{xs:"auto",className:"form-row",children:(0,n.jsx)(an.Z,{children:(0,n.jsx)(nC,{})})})]}),ir=()=>{let[e,t]=(0,i.useState)(!0),a=tm(e=>e.audioContentHint),s=tm(e=>e.autoGainControl),o=tm(e=>e.noiseSuppression),l=tm(e=>e.echoCancellation),r=tm(e=>e.echoCancellationType),c=tm(e=>e.videoContentHint),d=tm(e=>e.resolution),u=tm(e=>e.frameRate),m=[""!==a,""!==s,""!==o,""!==l,""!==r,""!==c,""!==d,""!==u,""!==tm(e=>e.blurRadius),""!==tm(e=>e.lightAdjustment),tm(e=>e.mediaProcessorsNoiseSuppression)].some(e=>e),g=["btn-collapse-options"];return e&&g.push("collapsed"),m&&g.push("fw-bold"),(0,n.jsxs)(aa.Z,{className:"form-row",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)("a",{href:"#",className:g.join(" "),onClick:a=>{a.preventDefault(),t(!e)},children:"Media options"})}),(0,n.jsx)(tp.Z,{in:!e,children:(0,n.jsxs)("div",{children:[(0,n.jsxs)(aa.Z,{className:"form-row",children:[(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(aX,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(a6,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(nV,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(nx,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(nj,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(nT,{})})]}),(0,n.jsxs)(aa.Z,{className:"form-row",children:[(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(n5,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(nU,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(nN,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(aK,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(nO,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(a9,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(nk,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(nf,{})})]}),(0,n.jsx)(n$,{})]})})]})},ic=()=>{let e=tm(e=>e.role),t=tm(e=>e.mediaType);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",xs:"auto",children:"recvonly"!==e&&"getUserMedia"===t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(a1,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(n3,{})})]}):null}),(0,n.jsxs)(aa.Z,{className:"form-row",xs:"auto",children:["sendonly"!==e?(0,n.jsx)(an.Z,{children:(0,n.jsx)(a2,{})}):null,(0,n.jsx)(nA,{}),"recvonly"!==e?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(nF,{}),(0,n.jsx)(nh,{})]}):null]})]})},id=()=>{let e=tm(e=>e.role);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(aa.Z,{className:"form-row",xs:"auto",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(ng,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(nw,{})})]}),"recvonly"!==e&&(0,n.jsxs)(aa.Z,{className:"form-row",xs:"auto",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(nM,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(a8,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(a4,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(n8,{})})]})]})},iu=()=>{let e=tm(e=>e.debug),t=tm(e=>e.role),a=tm(e=>e.multistream);return(0,n.jsxs)("div",{className:e?"col-devtools col-6":"col-devtools col-12",children:[(0,n.jsx)(al,{}),(0,n.jsx)(ie,{}),(0,n.jsx)(ia,{}),(0,n.jsx)(ii,{}),(0,n.jsx)("hr",{className:"hr-form"}),(0,n.jsx)(it,{}),(0,n.jsx)(is,{}),!("recvonly"===t&&("true"===a||""===a))&&(0,n.jsx)(io,{}),(0,n.jsx)("hr",{className:"hr-form"}),"recvonly"!==t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(il,{}),(0,n.jsx)(ir,{}),(0,n.jsx)("hr",{className:"hr-form"})]}):null,(0,n.jsx)(ic,{}),(0,n.jsx)(id,{}),(0,n.jsx)("hr",{className:"hr-form"}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)(nt,{}),(0,n.jsx)(no,{}),(0,n.jsx)(nQ,{}),(0,n.jsx)(nX,{})]}),(0,n.jsx)("hr",{className:"hr-form"}),(0,n.jsx)(aA,{}),"recvonly"===t||"sendrecv"===t?(0,n.jsx)(aW,{}):null]})};var im=a(3892),ig=a(8287);let ih=()=>{let e=tm(e=>e.debug),t=tu();return(0,n.jsx)("div",{children:(0,n.jsx)("button",{type:"button",className:e?"btn btn-footer-debug-mode active":"btn btn-footer-debug-mode",onClick:()=>{t(eg(!e))},children:"debug"})})},ip=()=>{let e=tm(e=>e.version);return(0,n.jsxs)("footer",{children:[(0,n.jsxs)(im.Z,{variant:"dark",bg:"sora",expand:"md",fixed:"bottom",children:[(0,n.jsx)(ig.Z,{className:"me-auto"}),(0,n.jsx)(ig.Z,{children:(0,n.jsxs)(im.Z.Collapse,{id:"navbar-collapse",children:[(0,n.jsxs)("a",{href:"https://github.com/shiguredo/sora-devtools",className:"btn btn-outline-light m-1",children:["GitHub: shiguredo/sora-devtools: ",e]}),(0,n.jsxs)("a",{href:"https://github.com/shiguredo/sora-js-sdk",className:"btn btn-outline-light m-1",children:["GitHub: shiguredo/sora-js-sdk: ",r.Z.version()]})]})})]}),(0,n.jsx)(ih,{})]})};var iv=a(13),ix=a.n(iv);let ij=()=>(0,n.jsx)(ix(),{children:(0,n.jsx)("title",{children:"Sora DevTools"})});var iC=a(5987);let ib=()=>{let e=tu();return(0,n.jsx)("input",{className:"btn btn-light btn-sm ms-1",type:"button",name:"copyUrl",defaultValue:"copy URL",onClick:()=>{e(I())}})},iS=()=>{let e=tm(e=>e.debug),t=tu(),a=["btn","btn-header-debug-mode","btn-sm","ms-1"];return e&&a.push("active"),(0,n.jsx)("input",{className:a.join(" "),type:"button",name:"debug",defaultValue:"debug",onClick:()=>{t(eg(!e))}})};var iy=a(8154);let iN=()=>{let e=(0,i.useRef)(null);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("input",{className:"btn btn-light btn-sm ms-1",type:"button",name:"downloadReport",defaultValue:"Download report",onClick:()=>{let t=new Blob([JSON.stringify(function(){let e=iy.h.getState(),t={aspectRatio:e.aspectRatio,audio:e.audio,audioBitRate:e.audioBitRate,audioCodecType:e.audioCodecType,audioContentHint:e.audioContentHint,audioInput:e.audioInput,audioInputDevices:e.audioInputDevices,audioOutput:e.audioOutput,audioOutputDevices:e.audioOutputDevices,audioStreamingLanguageCode:e.audioStreamingLanguageCode,audioTrack:e.audioTrack,autoGainControl:e.autoGainControl,bundleId:e.bundleId,cameraDevice:e.cameraDevice,channelId:e.channelId,clientId:e.clientId,dataChannelSignaling:e.dataChannelSignaling,dataChannels:e.dataChannels,debug:e.debug,displayResolution:e.displayResolution,e2ee:e.e2ee,echoCancellation:e.echoCancellation,echoCancellationType:e.echoCancellationType,enabledAudioStreamingLanguageCode:e.enabledAudioStreamingLanguageCode,enabledBundleId:e.enabledBundleId,enabledClientId:e.enabledClientId,enabledDataChannel:e.enabledDataChannel,enabledDataChannels:e.enabledDataChannels,enabledForwardingFilter:e.enabledForwardingFilter,enabledMetadata:e.enabledMetadata,enabledSignalingNotifyMetadata:e.enabledSignalingNotifyMetadata,enabledSignalingUrlCandidates:e.enabledSignalingUrlCandidates,enabledVideoVP9Params:e.enabledVideoVP9Params,enabledVideoH264Params:e.enabledVideoH264Params,enabledVideoH265Params:e.enabledVideoH265Params,enabledVideoAV1Params:e.enabledVideoAV1Params,facingMode:e.facingMode,fakeVolume:e.fakeVolume,forwardingFilter:e.forwardingFilter,frameRate:e.frameRate,googCpuOveruseDetection:e.googCpuOveruseDetection,ignoreDisconnectWebSocket:e.ignoreDisconnectWebSocket,mediaType:e.mediaType,metadata:e.metadata,micDevice:e.micDevice,multistream:e.multistream,noiseSuppression:e.noiseSuppression,reconnect:e.reconnect,resizeMode:e.resizeMode,resolution:e.resolution,mediaStats:e.mediaStats,role:e.role,signalingNotifyMetadata:e.signalingNotifyMetadata,signalingUrlCandidates:e.signalingUrlCandidates,simulcast:e.simulcast,simulcastRid:e.simulcastRid,spotlight:e.spotlight,spotlightFocusRid:e.spotlightFocusRid,spotlightNumber:e.spotlightNumber,spotlightUnfocusRid:e.spotlightUnfocusRid,video:e.video,videoBitRate:e.videoBitRate,videoCodecType:e.videoCodecType,videoContentHint:e.videoContentHint,videoInput:e.videoInput,videoInputDevices:e.videoInputDevices,videoTrack:e.videoTrack,videoVP9Params:e.videoVP9Params,videoH264Params:e.videoH264Params,videoH265Params:e.videoH265Params,videoAV1Params:e.videoAV1Params};return{userAgent:navigator.userAgent,"sora-devtools":e.version,"sora-js-sdk":r.Z.version(),parameters:t,timeline:e.timelineMessages.map(e=>({timestamp:e.timestamp,message:e})),notify:e.notifyMessages,stats:e.soraContents.statsReport}}())],{type:"text/plain"});if(window.URL=window.URL||window.webkitURL,e.current){let a=new Date().toISOString().replaceAll(":","_").replaceAll(".","_");e.current.download="sora-devtools-report-".concat(a,".json"),e.current.href=window.URL.createObjectURL(t),e.current.click()}}}),(0,n.jsx)("a",{ref:e,style:{display:"none"}})]})},ik=()=>{let e=tm(e=>e.soraContents.connectionStatus),t=tm(e=>e.soraContents.turnUrl),a=tm(e=>e.soraContents.sora);return(0,n.jsx)("header",{children:(0,n.jsx)(im.Z,{variant:"dark",bg:"sora",expand:"lg",fixed:"top",children:(0,n.jsxs)(iC.Z,{children:[(0,n.jsx)(im.Z.Brand,{href:"/",children:"Sora DevTools"}),(0,n.jsx)(im.Z.Toggle,{"aria-controls":"navbar-collapse"}),(0,n.jsxs)(im.Z.Collapse,{id:"navbar-collapse",children:[(0,n.jsx)(ig.Z,{className:"me-auto"}),(0,n.jsxs)(ig.Z,{children:[(0,n.jsx)(im.Z.Text,{className:"py-0 my-1 mx-1",children:(0,n.jsx)("p",{className:"navbar-signaling-url border rounded",children:a&&"connected"===e?a.connectedSignalingUrl:"Signaling URL"})}),(0,n.jsx)(im.Z.Text,{className:"py-0 my-1 mx-1",children:(0,n.jsx)("p",{className:"navbar-turn-url border rounded",children:a&&"connected"===e?null!==t?t:"不明":"TURN URL"})}),(0,n.jsx)(im.Z.Text,{className:"py-0 my-1 mx-1",children:(0,n.jsx)(iS,{})}),(0,n.jsx)(im.Z.Text,{className:"py-0 my-1 mx-1",children:(0,n.jsx)(iN,{})}),(0,n.jsx)(im.Z.Text,{className:"py-0 my-1 ms-1",children:(0,n.jsx)(ib,{})})]})]})]})})})};var iT=a(4569),iw=a.n(iT);let iI=()=>{let e=tm(e=>e.mediaType),t={x:100,y:100},[a,s]=(0,i.useState)(t),[o,l]=(0,i.useState)(0);return((0,i.useEffect)(()=>{let e=()=>{if(void 0!==window){var e;l((e=window.innerWidth)<680?e-40:640)}};return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}},[]),"mediacaptureRegion"!==e)?null:(0,n.jsx)(iw(),{position:a,onDrag:(e,t)=>{s({x:t.x,y:t.y})},defaultPosition:t,children:(0,n.jsx)("div",{id:"cropArea",className:"cropArea",style:{width:"".concat(o,"px"),height:"".concat(Math.floor(o/4*3),"px")}})})};var iR=()=>{let e=tu();return(0,i.useEffect)(()=>(e(w()),e(U()),()=>{e(B())}),[e]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(iI,{}),(0,n.jsx)(ij,{}),(0,n.jsx)(ik,{}),(0,n.jsx)("main",{children:(0,n.jsx)("div",{className:"container",children:(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)(iu,{}),(0,n.jsx)(at,{})]})})}),(0,n.jsx)(ip,{})]})}}},function(e){e.O(0,[84,753,726,888,774,179],function(){return e(e.s=4047)}),_N_E=e.O()}]); \ No newline at end of file +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[893],{4047:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/devtools",function(){return a(7034)}])},7034:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return iR}});var n=a(2676),i=a(5271),s=a(7124),o=a(8426),l=a(4029),r=a(511),c=a(8039),d=a(983);function u(e){let t=new Date(e),a=t.getFullYear(),n=t.getMonth()+1,i=t.getDate(),s=t.getHours().toString().padStart(2,"0"),o=t.getMinutes().toString().padStart(2,"0"),l=t.getSeconds().toString().padStart(2,"0"),r=t.getMilliseconds().toString().padStart(3,"0");return"".concat(a,"-").concat(n,"-").concat(i," ").concat(s,":").concat(o,":").concat(l,".").concat(r)}function m(e){return navigator.clipboard?navigator.clipboard.writeText(e):Promise.resolve()}function g(e,t){return"string"==typeof e&&t.indexOf(e)>=0}function h(e,t){if(e)return t.filter(e=>""!==e);let a="https:"===window.location.protocol?"wss://":"ws://",n=window.location.port?":".concat(window.location.port):"";return"".concat(a+window.location.hostname+n,"/signaling")}let p=/^(\d+)x(\d+)$/;function v(e){if(p.test(e)){let t=e.match(p);if(t)return{width:Number.parseInt(t[1],10),height:Number.parseInt(t[2],10)}}return{width:0,height:0}}function x(e){switch(e){case"4:3":return 4/3;case"16:9":return 16/9;case"21:9":return 20/9;default:return Number.NaN}}function j(e){let{audio:t,autoGainControl:a,noiseSuppression:n,echoCancellation:i,echoCancellationType:s}=e;if(!t)return!1;if(!a&&!n&&!i&&!s)return!0;let o={},l=C(a);void 0!==l&&(o.autoGainControl=l);let r=C(n);void 0!==r&&(o.noiseSuppression=r);let c=C(i);return void 0!==c&&(o.echoCancellation=c),s&&(o.echoCancellationType=s),o}function f(e){let{aspectRatio:t,frameRate:a,resizeMode:n,resolution:i}=e;if(!a&&!i&&!t&&!n)return!0;let s={};if(a){let e=Number.parseInt(a,10);Number.isNaN(e)||(s.frameRate=e)}if(i){let{width:e,height:t}=v(i);0async(e,t)=>{e(T.slice.actions.resetState());let a=function(){let e;let t=e=>{if("string"==typeof e)return e},a=e=>{if("string"==typeof e)return C(e)},n=(e,t)=>{if(g(e,t))return e},i=c.Z.parse(location.search);if("string"==typeof i.signalingUrlCandidates)try{e=JSON.parse(i.signalingUrlCandidates)}catch(e){}let s={apiUrl:t(i.apiUrl),audio:a(i.audio),audioBitRate:n(i.audioBitRate,d.xR),audioCodecType:n(i.audioCodecType,d.o1),audioStreamingLanguageCode:t(i.audioStreamingLanguageCode),autoGainControl:n(i.autoGainControl,d.iN),bundleId:t(i.bundleId),channelId:t(i.channelId),clientId:t(i.clientId),googCpuOveruseDetection:a(i.googCpuOveruseDetection),debug:a(i.debug),debugType:n(i.debugType,d.aF),displayResolution:t(i.displayResolution),e2ee:a(i.e2ee),echoCancellation:n(i.echoCancellation,d.PS),echoCancellationType:n(i.echoCancellationType,d.cJ),noiseSuppression:n(i.noiseSuppression,d.ad),facingMode:n(i.facingMode,d.pT),fakeVolume:t(i.fakeVolume),frameRate:t(i.frameRate),mediaStats:a(i.mediaStats),mediaType:n(i.mediaType,d.w_),metadata:t(i.metadata),showStats:a(i.showStats),signalingNotifyMetadata:t(i.signalingNotifyMetadata),signalingUrlCandidates:Array.isArray(e)?e:void 0,forwardingFilter:t(i.forwardingFilter),simulcast:n(i.simulcast,d.VE),simulcastRid:n(i.simulcastRid,d.WJ),spotlight:n(i.spotlight,d.VJ),spotlightNumber:n(i.spotlightNumber,d.Xr),spotlightFocusRid:n(i.spotlightFocusRid,d.I7),spotlightUnfocusRid:n(i.spotlightUnfocusRid,d.I7),resolution:t(i.resolution),video:a(i.video),videoBitRate:n(i.videoBitRate,d.Q5),videoCodecType:n(i.videoCodecType,d.Sh),videoVP9Params:t(i.videoVP9Params),videoH264Params:t(i.videoH264Params),videoH265Params:t(i.videoH265Params),videoAV1Params:t(i.videoAV1Params),audioInput:t(i.audioInput),videoInput:t(i.videoInput),audioOutput:t(i.audioOutput),mute:a(i.mute),dataChannelSignaling:n(i.dataChannelSignaling,d.l9),ignoreDisconnectWebSocket:n(i.ignoreDisconnectWebSocket,d.kt),micDevice:a(i.micDevice),cameraDevice:a(i.cameraDevice),audioTrack:a(i.audioTrack),videoTrack:a(i.videoTrack),dataChannels:t(i.dataChannels),reconnect:a(i.reconnect),audioContentHint:n(i.audioContentHint,d.nT),videoContentHint:n(i.videoContentHint,d.QO),aspectRatio:n(i.aspectRatio,d.Ii),resizeMode:n(i.resizeMode,d.L4),blurRadius:n(i.blurRadius,d.G_),lightAdjustment:n(i.lightAdjustment,d.Xv),mediaProcessorsNoiseSuppression:a(i.mediaProcessorsNoiseSuppression),multistream:n(i.multistream,d.u9),role:n(i.role,d.K$)};return Object.keys(s).map(e=>{void 0===s[e]&&delete s[e]}),s}();void 0!==a.audio&&e(T.slice.actions.setAudio(a.audio)),void 0!==a.audioBitRate&&e(T.slice.actions.setAudioBitRate(a.audioBitRate)),void 0!==a.audioCodecType&&e(T.slice.actions.setAudioCodecType(a.audioCodecType));let n=await S(),i=n.find(e=>"audioinput"===e.kind&&e.deviceId===a.audioInput);void 0!==i&&e(T.slice.actions.setAudioInput(i.deviceId));let s=n.find(e=>"audiooutput"===e.kind&&e.deviceId===a.audioOutput);void 0!==s&&e(T.slice.actions.setAudioOutput(s.deviceId));let o=n.find(e=>"videoinput"===e.kind&&e.deviceId===a.videoInput);void 0!==o&&e(T.slice.actions.setVideoInput(o.deviceId)),void 0!==a.autoGainControl&&e(T.slice.actions.setAutoGainControl(a.autoGainControl)),void 0!==a.channelId&&e(T.slice.actions.setChannelId(a.channelId)),void 0!==a.displayResolution&&e(T.slice.actions.setDisplayResolution(a.displayResolution)),void 0!==a.e2ee&&e(T.slice.actions.setE2EE(a.e2ee)),void 0!==a.echoCancellation&&e(T.slice.actions.setEchoCancellation(a.echoCancellation)),void 0!==a.echoCancellationType&&e(T.slice.actions.setEchoCancellationType(a.echoCancellationType)),void 0!==a.mediaStats&&e(T.slice.actions.setMediaStats(a.mediaStats)),void 0!==a.mediaType&&e(T.slice.actions.setMediaType(a.mediaType)),void 0!==a.facingMode&&e(T.slice.actions.setFacingMode(a.facingMode)),void 0!==a.fakeVolume&&e(T.slice.actions.setFakeVolume(a.fakeVolume)),void 0!==a.frameRate&&e(T.slice.actions.setFrameRate(a.frameRate)),void 0!==a.multistream&&e(T.slice.actions.setMultistream(a.multistream)),void 0!==a.noiseSuppression&&e(T.slice.actions.setNoiseSuppression(a.noiseSuppression)),void 0!==a.resolution&&e(T.slice.actions.setResolution(a.resolution)),void 0!==a.showStats&&e(T.slice.actions.setShowStats(a.showStats)),void 0!==a.simulcast&&e(T.slice.actions.setSimulcast(a.simulcast)),void 0!==a.simulcastRid&&e(T.slice.actions.setSimulcastRid(a.simulcastRid)),void 0!==a.spotlight&&e(T.slice.actions.setSpotlight(a.spotlight)),void 0!==a.spotlightNumber&&e(T.slice.actions.setSpotlightNumber(a.spotlightNumber)),void 0!==a.spotlightFocusRid&&e(T.slice.actions.setSpotlightFocusRid(a.spotlightFocusRid)),void 0!==a.spotlightUnfocusRid&&e(T.slice.actions.setSpotlightUnfocusRid(a.spotlightUnfocusRid)),void 0!==a.video&&e(T.slice.actions.setVideo(a.video)),void 0!==a.videoBitRate&&e(T.slice.actions.setVideoBitRate(a.videoBitRate)),void 0!==a.videoCodecType&&e(T.slice.actions.setVideoCodecType(a.videoCodecType)),void 0!==a.videoVP9Params&&e(T.slice.actions.setVideoVP9Params(a.videoVP9Params)),void 0!==a.videoH264Params&&e(T.slice.actions.setVideoH264Params(a.videoH264Params)),void 0!==a.videoH265Params&&e(T.slice.actions.setVideoH265Params(a.videoH265Params)),void 0!==a.videoAV1Params&&e(T.slice.actions.setVideoAV1Params(a.videoAV1Params)),void 0!==a.debug&&e(T.slice.actions.setDebug(a.debug)),void 0!==a.debugType&&e(T.slice.actions.setDebugType(a.debugType)),void 0!==a.mute&&e(T.slice.actions.setMute(a.mute)),void 0!==a.dataChannelSignaling&&e(T.slice.actions.setDataChannelSignaling(a.dataChannelSignaling)),void 0!==a.ignoreDisconnectWebSocket&&e(T.slice.actions.setIgnoreDisconnectWebSocket(a.ignoreDisconnectWebSocket)),void 0!==a.micDevice&&e(T.slice.actions.setMicDevice(a.micDevice)),void 0!==a.cameraDevice&&e(T.slice.actions.setCameraDevice(a.cameraDevice)),void 0!==a.audioTrack&&e(T.slice.actions.setAudioTrack(a.audioTrack)),void 0!==a.videoTrack&&e(T.slice.actions.setVideoTrack(a.videoTrack)),void 0!==a.googCpuOveruseDetection&&null!==a.googCpuOveruseDetection&&e(T.slice.actions.setGoogCpuOveruseDetection(a.googCpuOveruseDetection)),void 0!==a.bundleId&&e(T.slice.actions.setBundleId(a.bundleId)),void 0!==a.clientId&&e(T.slice.actions.setClientId(a.clientId)),void 0!==a.metadata&&e(T.slice.actions.setMetadata(a.metadata)),void 0!==a.signalingNotifyMetadata&&e(T.slice.actions.setSignalingNotifyMetadata(a.signalingNotifyMetadata)),void 0!==a.signalingUrlCandidates&&e(T.slice.actions.setSignalingUrlCandidates(a.signalingUrlCandidates)),void 0!==a.forwardingFilter&&e(T.slice.actions.setForwardingFilter(a.forwardingFilter)),void 0!==a.dataChannels&&e(T.slice.actions.setDataChannels(a.dataChannels)),void 0!==a.audioContentHint&&e(T.slice.actions.setAudioContentHint(a.audioContentHint)),void 0!==a.videoContentHint&&e(T.slice.actions.setVideoContentHint(a.videoContentHint)),void 0!==a.reconnect&&e(T.slice.actions.setReconnect(a.reconnect)),void 0!==a.aspectRatio&&e(T.slice.actions.setAspectRatio(a.aspectRatio)),void 0!==a.resizeMode&&e(T.slice.actions.setResizeMode(a.resizeMode)),void 0!==a.blurRadius&&e(T.slice.actions.setBlurRadius(a.blurRadius)),void 0!==a.lightAdjustment&&e(T.slice.actions.setLightAdjustment(a.lightAdjustment)),void 0!==a.mediaProcessorsNoiseSuppression&&e(T.slice.actions.setMediaProcessorsNoiseSuppression(a.mediaProcessorsNoiseSuppression)),void 0!==a.apiUrl&&null!==a.apiUrl&&e(T.slice.actions.setApiUrl(a.apiUrl)),void 0!==a.role&&e(T.slice.actions.setRole(a.role)),void 0!==a.audioStreamingLanguageCode&&e(T.slice.actions.setAudioStreamingLanguageCode(a.audioStreamingLanguageCode)),e(T.slice.actions.setInitialFakeContents());let{audioStreamingLanguageCode:l,bundleId:u,clientId:m,dataChannelSignaling:h,dataChannels:p,e2ee:v,ignoreDisconnectWebSocket:x,metadata:j,signalingNotifyMetadata:f,signalingUrlCandidates:b,forwardingFilter:y,videoVP9Params:N,videoH264Params:k,videoH265Params:w,videoAV1Params:I}=t();if(v)try{await r.Z.initE2EE("https://sora-e2ee-wasm.shiguredo.app/2020.2/wasm.wasm")}catch(t){e(T.slice.actions.setSoraErrorAlertMessage("Faild to execute WebAssembly '".concat("https://sora-e2ee-wasm.shiguredo.app/2020.2/wasm.wasm","'.")));return}""!==u&&e(T.slice.actions.setEnabledBundleId(!0)),""!==m&&e(T.slice.actions.setEnabledClientId(!0)),""!==j&&e(T.slice.actions.setEnabledMetadata(!0)),""!==f&&e(T.slice.actions.setEnabledSignalingNotifyMetadata(!0)),0(e,t)=>{let a=t(),n=!("recvonly"===a.role&&("true"===a.multistream||""===a.multistream)),i={channelId:a.channelId,role:a.role,audio:a.audio,video:a.video,debug:a.debug,mediaType:"getUserMedia"!==a.mediaType?a.mediaType:void 0,audioBitRate:n&&""!==a.audioBitRate?a.audioBitRate:void 0,audioCodecType:n&&""!==a.audioCodecType?a.audioCodecType:void 0,videoBitRate:n&&""!==a.videoBitRate?a.videoBitRate:void 0,videoCodecType:n&&""!==a.videoCodecType?a.videoCodecType:void 0,videoVP9Params:n&&""!==a.videoVP9Params&&a.enabledVideoVP9Params?a.videoVP9Params:void 0,videoH264Params:n&&""!==a.videoH264Params&&a.enabledVideoH264Params?a.videoH264Params:void 0,videoH265Params:n&&""!==a.videoH265Params&&a.enabledVideoH265Params?a.videoH265Params:void 0,videoAV1Params:n&&""!==a.videoAV1Params&&a.enabledVideoAV1Params?a.videoAV1Params:void 0,audioContentHint:""!==a.audioContentHint?a.audioContentHint:void 0,autoGainControl:""!==a.autoGainControl?a.autoGainControl:void 0,noiseSuppression:""!==a.noiseSuppression?a.noiseSuppression:void 0,echoCancellation:""!==a.echoCancellation?a.echoCancellation:void 0,echoCancellationType:""!==a.echoCancellationType?a.echoCancellationType:void 0,videoContentHint:""!==a.videoContentHint?a.videoContentHint:void 0,resolution:""!==a.resolution?a.resolution:void 0,facingMode:""!==a.facingMode?a.facingMode:void 0,frameRate:""!==a.frameRate?a.frameRate:void 0,aspectRatio:""!==a.aspectRatio?a.aspectRatio:void 0,resizeMode:""!==a.resizeMode?a.resizeMode:void 0,blurRadius:""!==a.blurRadius?a.blurRadius:void 0,lightAdjustment:""!==a.lightAdjustment?a.lightAdjustment:void 0,multistream:""!==a.multistream?a.multistream:void 0,simulcast:""!==a.simulcast?a.simulcast:void 0,simulcastRid:""!==a.simulcastRid?a.simulcastRid:void 0,spotlight:""!==a.spotlight?a.spotlight:void 0,spotlightNumber:""!==a.spotlightNumber?a.spotlightNumber:void 0,spotlightFocusRid:""!==a.spotlightFocusRid?a.spotlightFocusRid:void 0,spotlightUnfocusRid:""!==a.spotlightUnfocusRid?a.spotlightUnfocusRid:void 0,audioInput:"getUserMedia"===a.mediaType&&""!==a.audioInput?a.audioInput:void 0,audioOutput:""!==a.audioOutput?a.audioOutput:void 0,videoInput:"getUserMedia"===a.mediaType&&""!==a.videoInput?a.videoInput:void 0,displayResolution:""!==a.displayResolution?a.displayResolution:void 0,mediaStats:!0===a.mediaStats||void 0,bundleId:""!==a.bundleId&&a.enabledBundleId?a.bundleId:void 0,clientId:""!==a.clientId&&a.enabledClientId?a.clientId:void 0,metadata:""!==a.metadata&&a.enabledMetadata?a.metadata:void 0,signalingNotifyMetadata:""!==a.signalingNotifyMetadata&&a.enabledSignalingNotifyMetadata?a.signalingNotifyMetadata:void 0,forwardingFilter:""!==a.forwardingFilter&&a.enabledForwardingFilter?a.forwardingFilter:void 0,dataChannelSignaling:""!==a.dataChannelSignaling&&a.enabledDataChannel?a.dataChannelSignaling:void 0,ignoreDisconnectWebSocket:""!==a.ignoreDisconnectWebSocket&&a.enabledDataChannel?a.ignoreDisconnectWebSocket:void 0,dataChannels:""!==a.dataChannels&&a.enabledDataChannels?a.dataChannels:void 0,reconnect:!0===a.reconnect||void 0,e2ee:!0===a.e2ee||void 0,mediaProcessorsNoiseSuppression:!0===a.mediaProcessorsNoiseSuppression||void 0,micDevice:!1!==a.micDevice&&void 0,cameraDevice:!1!==a.cameraDevice&&void 0,audioTrack:!1!==a.audioTrack&&void 0,videoTrack:!1!==a.videoTrack&&void 0,signalingUrlCandidates:0{let t=i[e];return void 0===t?void 0:"signalingUrlCandidates"===e?"".concat(e,"=").concat(encodeURIComponent(JSON.stringify(t))):"".concat(e,"=").concat(encodeURIComponent(t))}).filter(e=>void 0!==e);m("".concat(location.origin).concat(location.pathname,"?").concat(s.join("&"))),window.history.replaceState(null,"","".concat(location.pathname,"?").concat(s.join("&")))};async function R(e,t){let a="MEDIA_CONSTRAINTS";if("getDisplayMedia"===t.mediaType){if(!t.video||!t.cameraDevice)return[new MediaStream,null];if(void 0===navigator.mediaDevices)throw Error("Failed to call getUserMedia. Make sure domain is secure");let n={audio:j({audio:t.audio,autoGainControl:t.autoGainControl,noiseSuppression:t.noiseSuppression,echoCancellation:t.echoCancellation,echoCancellationType:t.echoCancellationType}),video:f({frameRate:t.frameRate,resolution:t.resolution,aspectRatio:t.aspectRatio,resizeMode:t.resizeMode})};e(T.slice.actions.setLogMessages({title:a,description:JSON.stringify(n)})),e(T.slice.actions.setTimelineMessage(P("media-constraints",n)));let i=await navigator.mediaDevices.getDisplayMedia(n);for(let a of(e(T.slice.actions.setTimelineMessage(P("succeed-get-display-media"))),i.getVideoTracks()))void 0!==a.contentHint&&(a.contentHint=t.videoContentHint),a.enabled=t.videoTrack,e(T.slice.actions.setTimelineMessage(V("start",a)));return[i,null]}if("mediacaptureRegion"===t.mediaType){if(!t.video||!t.cameraDevice)return[new MediaStream,null];if(void 0===window.CropTarget)throw Error("Failed to call CropTarget");if(void 0===navigator.mediaDevices)throw Error("Failed to call getDisplayMedia. Make sure domain is secure");let n={audio:j({audio:t.audio,autoGainControl:t.autoGainControl,noiseSuppression:t.noiseSuppression,echoCancellation:t.echoCancellation,echoCancellationType:t.echoCancellationType}),video:f({frameRate:t.frameRate,resolution:t.resolution,aspectRatio:t.aspectRatio,resizeMode:t.resizeMode})};n.preferCurrentTab=!0,e(T.slice.actions.setLogMessages({title:a,description:JSON.stringify(n)})),e(T.slice.actions.setTimelineMessage(P("media-constraints",n)));let i=await navigator.mediaDevices.getDisplayMedia(n),s=document.querySelector("#cropArea");if(null===s)throw Error("Failed to get CropTraget Element");let o=await window.CropTarget.fromElement(s);for(let a of(e(T.slice.actions.setTimelineMessage(P("succeed-get-display-media"))),i.getVideoTracks()))void 0!==a.contentHint&&(a.contentHint=t.videoContentHint),a.enabled=t.videoTrack,await a.cropTo(o),e(T.slice.actions.setTimelineMessage(V("start",a)));return[i,null]}if("fakeMedia"===t.mediaType&&t.fakeContents.worker){let n=function(e){let{audio:t,video:a,frameRate:n,resolution:i,volume:s,aspectRatio:o,resizeMode:l}=e,r=Number.parseInt(n,10),c=Number.isNaN(r)?30:r,d=v(i),u=d.width||240,m={audio:t,video:a,frameRate:c,width:u,height:d.height||160,fontSize:Math.floor(u/5),volume:Number.parseFloat(s)};return a&&(o||l)&&(m.videoTrackConstraints={},o&&(m.videoTrackConstraints.aspectRatio=x(o)),l&&(m.videoTrackConstraints.resizeMode=l)),m}({audio:t.audio&&t.micDevice,video:t.video&&t.cameraDevice,frameRate:t.frameRate,resolution:t.resolution,volume:t.fakeVolume,aspectRatio:t.aspectRatio,resizeMode:t.resizeMode});e(T.slice.actions.setLogMessages({title:a,description:JSON.stringify(n)})),e(T.slice.actions.setTimelineMessage(P("media-constraints",n)));let{canvas:i,mediaStream:s,gainNode:o}=function(e){let t=new MediaStream,a=null;if(e.video){(a=document.createElement("canvas")).getContext("2d"),a.width=e.width,a.height=e.height;let n=a.captureStream(e.frameRate).getTracks()[0];e.videoTrackConstraints&&n.applyConstraints(e.videoTrackConstraints),t.addTrack(n)}let n=null;if(e.audio){let a=new(window.AudioContext||window.webkitAudioContext),i=a.createOscillator();i.type="sine",n=a.createGain(),i.connect(n),i.start(0);let s=a.createMediaStreamDestination();n.connect(s);let o=s.stream.getTracks();t.addTrack(o[0]),n.gain.setValueAtTime(e.volume,0)}return{canvas:a,mediaStream:t,gainNode:n}}(n);for(let a of(null!==i&&(t.fakeContents.worker.onmessage=e=>{let a=e.data;"update"===a.type&&function(e,t,a,n){if(null===e)return;let i=e.getContext("2d");if(!i)return;i.globalCompositeOperation="source-over",i.clearRect(0,0,e.width,e.height),i.fillStyle="#".concat(("0".repeat(6)+t.toString(16)).slice(-6)),i.fillRect(0,0,e.width,e.height),i.fillStyle="#".concat(("0".repeat(6)+(16777215-t).toString(16)).slice(-6)),i.font="".concat(a,"px Arial");let s=e.width/2-a/2,o=a/4*(n.length-1),l=e.height/2+a/2.5;i.fillText(n,s-o,l)}(i,t.fakeContents.colorCode,n.fontSize,a.counter.toString())},t.fakeContents.worker.postMessage({type:"stop"}),t.fakeContents.worker.postMessage({type:"start",interval:1e3/n.frameRate})),s.getVideoTracks()))void 0!==a.contentHint&&(a.contentHint=t.videoContentHint),a.enabled=t.videoTrack,e(T.slice.actions.setTimelineMessage(V("start",a)));for(let a of s.getAudioTracks())void 0!==a.contentHint&&(a.contentHint=t.audioContentHint),a.enabled=t.audioTrack,e(T.slice.actions.setTimelineMessage(V("start",a)));return e(T.slice.actions.setTimelineMessage(P("succeed-create-fake-media"))),[s,o]}if(void 0===navigator.mediaDevices)throw Error("Failed to call getUserMedia. Make sure domain is secure");let n=new MediaStream,i=function(e){let{audio:t,autoGainControl:a,noiseSuppression:n,echoCancellation:i,echoCancellationType:s,audioInput:o}=e;if(!t)return!1;if(!a&&!n&&!i&&!s&&!o)return t;let l={};o&&(l.deviceId={exact:o});let r=C(a);void 0!==r&&(l.autoGainControl=r);let c=C(n);void 0!==c&&(l.noiseSuppression=c);let d=C(i);return void 0!==d&&(l.echoCancellation=d),s&&(l.echoCancellationType=s),l}({audio:t.audio&&t.micDevice,autoGainControl:t.autoGainControl,noiseSuppression:t.noiseSuppression,echoCancellation:t.echoCancellation,echoCancellationType:t.echoCancellationType,audioInput:t.audioInput}),r=function(e){let{video:t,frameRate:a,resolution:n,videoInput:i,aspectRatio:s,resizeMode:o,facingMode:l}=e;if(!t)return!1;if(!a&&!n&&!i&&!s&&!o&&!l)return t;let r={};if(a){let e=Number.parseInt(a,10);Number.isNaN(e)||(r.frameRate={min:e,max:e})}if(n){let{width:e,height:t}=v(n);0{throw n.getTracks().filter(e=>{e.stop()}),e});if(i){let a=d.getAudioTracks()[0];if(e(T.slice.actions.setTimelineMessage(V("start",a))),t.mediaProcessorsNoiseSuppression&&o.b.isSupported()){if(null===t.noiseSuppressionProcessor)throw Error("Failed to start NoiseSuppressionProcessor. NoiseSuppressionProcessor is 'null'");t.noiseSuppressionProcessor.stopProcessing(),a=await t.noiseSuppressionProcessor.startProcessing(a)}e(T.slice.actions.setTimelineMessage(P("succeed-audio-get-user-media"))),n.addTrack(a)}if(r){let a=d.getVideoTracks()[0];if(e(T.slice.actions.setTimelineMessage(V("start",a))),""!==t.lightAdjustment&&s.jA.isSupported()){if(null===t.lightAdjustmentProcessor)throw Error("Failed to start LightAdjustmentProcessor. LightAdjustmentProcessor is 'null'");let e=function(e){switch(e){case"weak":return{adjustmentLevel:30,sharpnessLevel:0};case"medium":return{adjustmentLevel:50,sharpnessLevel:10,focusMask:new s.MH("https://cdn.jsdelivr.net/npm/@shiguredo/light-adjustment@latest/dist")};case"strong":return{adjustmentLevel:70,sharpnessLevel:20,minIntensity:10,focusMask:new s.MH("https://cdn.jsdelivr.net/npm/@shiguredo/light-adjustment@latest/dist")};default:return{}}}(t.lightAdjustment);t.lightAdjustmentProcessor.stopProcessing(),a=await t.lightAdjustmentProcessor.startProcessing(a,e)}if(""!==t.blurRadius&&l.sz.isSupported()){if(null===t.virtualBackgroundProcessor)throw Error("Failed to start VirtualBackgroundProcessor. VirtualBackgroundProcessor is 'null'");let e={blurRadius:function(e){switch(e){case"weak":return 5;case"medium":return 10;case"strong":return 15;default:return 0}}(t.blurRadius)};t.virtualBackgroundProcessor.stopProcessing(),a=await t.virtualBackgroundProcessor.startProcessing(a,e)}e(T.slice.actions.setTimelineMessage(P("succeed-video-get-user-media"))),n.addTrack(a)}}for(let e of n.getVideoTracks())void 0!==e.contentHint&&(e.contentHint=t.videoContentHint),e.enabled=t.videoTrack;for(let e of n.getAudioTracks())void 0!==e.contentHint&&(e.contentHint=t.audioContentHint),e.enabled=t.audioTrack;return[n,null]}function Z(e,t,a){a.on("log",(t,a)=>{e(T.slice.actions.setLogMessages({title:t,description:JSON.stringify(a)}))}),a.on("notify",(a,n)=>{var i;"spotlight.focused"===a.event_type&&"string"==typeof a.connection_id&&e(T.slice.actions.setFocusedSpotlightConnectionId(a.connection_id)),"spotlight.unfocused"===a.event_type&&"string"==typeof a.connection_id&&e(T.slice.actions.setUnFocusedSpotlightConnectionId(a.connection_id)),"connection.destroyed"===a.event_type&&"string"==typeof a.connection_id&&e(T.slice.actions.deleteFocusedSpotlightConnectionId(a.connection_id));let{soraContents:s}=t();if("connection.created"===a.event_type&&"string"==typeof a.connection_id&&a.connection_id===(null===(i=s.sora)||void 0===i?void 0:i.connectionId)){if("string"==typeof a.session_id&&e(T.slice.actions.setSoraSessionId(a.session_id)),"string"==typeof a.connection_id&&e(T.slice.actions.setSoraConnectionId(a.connection_id)),"string"==typeof a.client_id&&e(T.slice.actions.setSoraClientId(a.client_id)),Array.isArray(a.data))for(let t of a.data)"string"==typeof t.connection_id&&"string"==typeof t.client_id&&e(T.slice.actions.setSoraRemoteClientId({connectionId:t.connection_id,clientId:t.client_id}))}else"connection.created"===a.event_type&&"string"==typeof a.connection_id&&"string"==typeof a.client_id&&e(T.slice.actions.setSoraRemoteClientId({connectionId:a.connection_id,clientId:a.client_id}));e(T.slice.actions.setNotifyMessages({timestamp:new Date().getTime(),message:a,transportType:n}))}),a.on("push",(t,a)=>{e(T.slice.actions.setPushMessages({timestamp:new Date().getTime(),message:t,transportType:a}))}),a.on("track",a=>{e(T.slice.actions.setTimelineMessage(P("event-on-track")));let{soraContents:n}=t();if(!n.remoteClients.find(e=>e.connectionId===a.streams[0].id)){for(let t of a.streams[0].getTracks())e(T.slice.actions.setTimelineMessage(P("remote-".concat(t.kind,"-mediastream-track"),N(t))));e(T.slice.actions.setRemoteClient({mediaStream:a.streams[0],connectionId:a.streams[0].id,clientId:null}))}}),a.on("removetrack",a=>{e(T.slice.actions.setTimelineMessage(P("event-on-removetrack")));let{soraContents:n}=t(),i=n.remoteClients.find(e=>{if(null==a?void 0:a.target)return e.connectionId===a.target.id});i&&e(T.slice.actions.removeRemoteClient(i.connectionId))}),a.on("disconnect",a=>{let n={type:a.type,title:a.title};void 0!==a.code&&(n.code=a.code),void 0!==a.reason&&(n.reason=a.reason),void 0!==a.params&&(n.params=a.params),e(T.slice.actions.setTimelineMessage(P("event-on-disconnect",n)));let{fakeContents:i,soraContents:s,reconnect:o,lightAdjustmentProcessor:l,virtualBackgroundProcessor:r,noiseSuppressionProcessor:c}=t(),{localMediaStream:d,remoteClients:u}=s,m=z(l,r);(async()=>{await G(e,d,m)})(),W(e,d,c),u.filter(e=>{e.mediaStream.getTracks().filter(e=>{e.stop()})}),i.worker&&i.worker.postMessage({type:"stop"}),e(T.slice.actions.setSora(null)),e(T.slice.actions.setSoraSessionId(null)),e(T.slice.actions.setSoraConnectionId(null)),e(T.slice.actions.setSoraClientId(null)),e(T.slice.actions.setSoraTurnUrl(null)),e(T.slice.actions.setSoraConnectionStatus("disconnected")),e(T.slice.actions.setLocalMediaStream(null)),e(T.slice.actions.removeAllRemoteClients()),e(T.slice.actions.setSoraInfoAlertMessage("Disconnect Sora.")),e(T.slice.actions.setTimelineMessage(P("disconnected"))),"abend"===a.type&&o&&e(T.slice.actions.setSoraReconnecting(!0))}),a.on("timeline",t=>{let a={timestamp:new Date().getTime(),type:t.type,data:t.data,dataChannelId:t.dataChannelId,dataChannelLabel:t.dataChannelLabel,logType:t.logType};e(T.slice.actions.setTimelineMessage(a)),t.data&&"object"==typeof t.data&&"sdp"in t.data&&e(T.slice.actions.setTimelineMessage(P("".concat(t.type,"-sdp"),t.data.sdp)))}),a.on("signaling",t=>{let a={timestamp:new Date().getTime(),transportType:t.transportType,type:t.type,data:t.data};e(T.slice.actions.setSignalingMessage(a))}),a.on("message",t=>{e(T.slice.actions.setDataChannelMessage({timestamp:new Date().getTime(),label:t.label,data:t.data}))}),a.on("datachannel",t=>{e(T.slice.actions.setSoraDataChannels(t.datachannel))})}function M(e){return{audio:e.audio,audioBitRate:e.audioBitRate,audioCodecType:e.audioCodecType,audioStreamingLanguageCode:e.audioStreamingLanguageCode,bundleId:e.bundleId,clientId:e.clientId,dataChannelSignaling:e.dataChannelSignaling,dataChannels:e.enabledDataChannels?e.dataChannels:"",e2ee:e.e2ee,enabledAudioStreamingLanguageCode:e.enabledAudioStreamingLanguageCode,enabledBundleId:e.enabledBundleId,enabledClientId:e.enabledClientId,enabledDataChannel:e.enabledDataChannel,enabledSignalingNotifyMetadata:e.enabledSignalingNotifyMetadata,enabledForwardingFilter:e.enabledForwardingFilter,enabledVideoVP9Params:e.enabledVideoVP9Params,enabledVideoH264Params:e.enabledVideoH264Params,enabledVideoH265Params:e.enabledVideoH265Params,enabledVideoAV1Params:e.enabledVideoAV1Params,ignoreDisconnectWebSocket:e.ignoreDisconnectWebSocket,multistream:e.multistream,signalingNotifyMetadata:e.signalingNotifyMetadata,forwardingFilter:e.forwardingFilter,simulcast:e.simulcast,simulcastRid:e.simulcastRid,spotlight:e.spotlight,spotlightFocusRid:e.spotlightFocusRid,spotlightNumber:e.spotlightNumber,spotlightUnfocusRid:e.spotlightUnfocusRid,video:e.video,videoBitRate:e.videoBitRate,videoCodecType:e.videoCodecType,videoVP9Params:e.videoVP9Params,videoH264Params:e.videoH264Params,videoH265Params:e.videoH265Params,videoAV1Params:e.videoAV1Params,role:e.role}}function P(e,t){return{type:e,logType:"sora-devtools",timestamp:new Date().getTime(),data:t}}function V(e,t){let a=N(t);return P("".concat(e,"-").concat(t.kind,"-mediastream-track"),a)}async function D(e,t){var a;if(t.pc&&(null===(a=t.pc)||void 0===a?void 0:a.iceConnectionState)!=="closed"){let a=await t.pc.getStats(),n=[],i=[];for(let t of(a.forEach(e=>{n.push(e),"local-candidate"===e.type&&i.push(e)}),e(T.slice.actions.setStatsReport(n)),i))if(void 0!==t.url){e(T.slice.actions.setSoraTurnUrl(t.url));break}}}let A=()=>async(e,t)=>{let a,n;let i=t();try{[a,n]=await R(e,i).catch(e=>{throw e})}catch(n){var s,o,l;let t;if(n instanceof Error&&(e(T.slice.actions.setLogMessages({title:"REQUEST_MEDIA",description:JSON.stringify(n.message)})),e(T.slice.actions.setAPIErrorAlertMessage("Failed to get user devices. ".concat(n.message)))),(null===(s=i.lightAdjustmentProcessor)||void 0===s?void 0:s.isProcessing())&&(t=i.lightAdjustmentProcessor.getOriginalTrack(),i.lightAdjustmentProcessor.stopProcessing()),(null===(o=i.virtualBackgroundProcessor)||void 0===o?void 0:o.isProcessing())&&(void 0===t&&(t=i.virtualBackgroundProcessor.getOriginalTrack()),i.virtualBackgroundProcessor.stopProcessing()),t?(t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))):a&&a.getVideoTracks().filter(t=>{t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))}),null===(l=i.noiseSuppressionProcessor)||void 0===l?void 0:l.isProcessing()){let t=i.noiseSuppressionProcessor.getOriginalTrack();t&&(t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))),i.noiseSuppressionProcessor.stopProcessing()}else a&&a.getAudioTracks().filter(t=>{t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))});throw n}n&&e(T.slice.actions.setFakeContentsGainNode(n)),e(T.slice.actions.setLocalMediaStream(a))},F=()=>async(e,t)=>{let a;let{fakeContents:n,soraContents:i,lightAdjustmentProcessor:s,noiseSuppressionProcessor:o,virtualBackgroundProcessor:l}=t(),{localMediaStream:r}=i;if((null==s?void 0:s.isProcessing())&&(a=s.getOriginalTrack(),s.stopProcessing()),(null==l?void 0:l.isProcessing())&&(void 0===a&&(a=l.getOriginalTrack()),l.stopProcessing()),void 0!==a?(a.stop(),null==r||r.removeTrack(a),e(T.slice.actions.setTimelineMessage(V("stop",a)))):r&&r.getVideoTracks().filter(t=>{t.stop(),r.removeTrack(t),e(T.slice.actions.setTimelineMessage(V("stop",t)))}),null==o?void 0:o.isProcessing()){let t=o.getOriginalTrack();t&&(t.stop(),null==r||r.removeTrack(t),e(T.slice.actions.setTimelineMessage(V("stop",t)))),o.stopProcessing()}else r&&r.getAudioTracks().filter(t=>{t.stop(),r.removeTrack(t),e(T.slice.actions.setTimelineMessage(V("stop",t)))});n.worker&&n.worker.postMessage({type:"stop"}),e(T.slice.actions.setLocalMediaStream(null))},O=()=>async(e,t)=>{let a,n,i;e(T.slice.actions.setTimelineMessage(P("start-connection"))),e(T.slice.actions.setSoraConnectionStatus("preparing"));let s=t(),o=!1;s.soraContents.sora&&(await s.soraContents.sora.disconnect(),o=!0);let l=h(s.enabledSignalingUrlCandidates,s.signalingUrlCandidates);e(T.slice.actions.setLogMessages({title:"SIGNALING_URL",description:JSON.stringify(l)}));let c=r.Z.connection(l,s.debug),d=k(M(s)),u=b(s.enabledMetadata,s.metadata);try{"sendonly"===s.role?((a=c.sendonly(s.channelId,null,d)).metadata=u,"boolean"==typeof s.googCpuOveruseDetection&&(a.constraints={optional:[{googCpuOveruseDetection:s.googCpuOveruseDetection}]}),Z(e,t,a),!o&&s.soraContents.localMediaStream?n=s.soraContents.localMediaStream:[n,i]=await R(e,s).catch(t=>{throw e(T.slice.actions.setSoraErrorAlertMessage(t.toString())),e(T.slice.actions.setSoraConnectionStatus("disconnected")),t}),e(T.slice.actions.setSoraConnectionStatus("connecting")),e(T.slice.actions.setSora(a)),await a.connect(n)):"sendrecv"===s.role?((a=c.sendrecv(s.channelId,null,d)).metadata=u,"boolean"==typeof s.googCpuOveruseDetection&&(a.constraints={optional:[{googCpuOveruseDetection:s.googCpuOveruseDetection}]}),Z(e,t,a),!o&&s.soraContents.localMediaStream?n=s.soraContents.localMediaStream:[n,i]=await R(e,s).catch(t=>{throw e(T.slice.actions.setSoraErrorAlertMessage(t.toString())),e(T.slice.actions.setSoraConnectionStatus("disconnected")),t}),e(T.slice.actions.setSora(a)),await a.connect(n)):"recvonly"===s.role&&((a=c.recvonly(s.channelId,null,d)).metadata=u,Z(e,t,a),e(T.slice.actions.setSoraConnectionStatus("connecting")),e(T.slice.actions.setSora(a)),await a.connect())}catch(a){var m,g,p;let t;if(e(T.slice.actions.setSora(null)),a instanceof Error&&e(T.slice.actions.setSoraErrorAlertMessage("Failed to connect Sora. ".concat(a.message))),(null===(m=s.lightAdjustmentProcessor)||void 0===m?void 0:m.isProcessing())&&(t=s.lightAdjustmentProcessor.getOriginalTrack(),s.lightAdjustmentProcessor.stopProcessing()),(null===(g=s.virtualBackgroundProcessor)||void 0===g?void 0:g.isProcessing())&&(void 0===t&&(t=s.virtualBackgroundProcessor.getOriginalTrack()),s.virtualBackgroundProcessor.stopProcessing()),t?(t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))):n&&n.getVideoTracks().filter(t=>{t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))}),null===(p=s.noiseSuppressionProcessor)||void 0===p?void 0:p.isProcessing()){let t=s.noiseSuppressionProcessor.getOriginalTrack();t&&(t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))),s.noiseSuppressionProcessor.stopProcessing()}else n&&n.getAudioTracks().filter(t=>{t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))});throw e(T.slice.actions.setSoraConnectionStatus("disconnected")),a}if(void 0===a)throw Error("Failed to connect Sora. Connection object is 'undefined'");e(T.slice.actions.setSoraInfoAlertMessage("Succeeded to connect Sora.")),await D(e,a);let v=setInterval(async()=>{let{soraContents:a}=t();a.sora?await D(e,a.sora):clearInterval(v)},1e3);a.stream=null,n&&(null===s.soraContents.localMediaStream||o)&&e(T.slice.actions.setLocalMediaStream(n)),i&&e(T.slice.actions.setFakeContentsGainNode(i)),e(T.slice.actions.setSoraConnectionStatus("connected")),e(T.slice.actions.setTimelineMessage(P("connected")))},H=()=>async(e,t)=>{let a,n,i;e(T.slice.actions.setTimelineMessage(P("start-reconnect"))),e(T.slice.actions.setSoraConnectionStatus("connecting"));let s=t();s.soraContents.sora&&"connected"===s.soraContents.connectionStatus&&await s.soraContents.sora.disconnect();let o=h(s.enabledSignalingUrlCandidates,s.signalingUrlCandidates);e(T.slice.actions.setLogMessages({title:"SIGNALING_URL",description:JSON.stringify(o)}));let l=r.Z.connection(o,s.debug),c=k(M(s)),d=b(s.enabledMetadata,s.metadata);("sendonly"===s.role||"sendrecv"===s.role)&&([n,i]=await R(e,s).catch(t=>{throw e(T.slice.actions.setSoraErrorAlertMessage(t.toString())),e(T.slice.actions.setSoraConnectionStatus("disconnected")),t}));for(let i=1;i<=10;i++){let{soraContents:o}=t();if(!1===o.reconnecting)break;e(T.slice.actions.setSoraReconnectingTrials(i));try{"sendonly"===s.role?((a=l.sendonly(s.channelId,null,c)).metadata=d,"boolean"==typeof s.googCpuOveruseDetection&&(a.constraints={optional:[{googCpuOveruseDetection:s.googCpuOveruseDetection}]}),Z(e,t,a),n&&await a.connect(n)):"sendrecv"===s.role?((a=l.sendrecv(s.channelId,null,c)).metadata=d,"boolean"==typeof s.googCpuOveruseDetection&&(a.constraints={optional:[{googCpuOveruseDetection:s.googCpuOveruseDetection}]}),Z(e,t,a),n&&await a.connect(n)):"recvonly"===s.role&&((a=l.recvonly(s.channelId,null,c)).metadata=d,Z(e,t,a),await a.connect())}catch(t){t instanceof Error&&e(T.slice.actions.setSoraErrorAlertMessage("(trials ".concat(i,") Failed to connect Sora. ").concat(t.message))),a=void 0}if(void 0!==a)break;await new Promise(e=>setTimeout(e,500*i+500))}if(void 0===a){e(T.slice.actions.setSoraErrorAlertMessage("Failed to reconnect Sora.")),e(T.slice.actions.setSoraConnectionStatus("disconnected")),e(T.slice.actions.setSoraReconnecting(!1));return}e(T.slice.actions.setSoraInfoAlertMessage("Succeeded to reconnect Sora.")),await D(e,a);let u=setInterval(async()=>{let{soraContents:a}=t();a.sora?await D(e,a.sora):clearInterval(u)},1e3);e(T.slice.actions.setSora(a)),n&&e(T.slice.actions.setLocalMediaStream(n)),i&&e(T.slice.actions.setFakeContentsGainNode(i)),e(T.slice.actions.setSoraConnectionStatus("connected")),e(T.slice.actions.setTimelineMessage(P("connected"))),e(T.slice.actions.setSoraReconnecting(!1))},B=()=>async(e,t)=>{let{soraContents:a}=t();a.sora&&"connected"===a.connectionStatus&&(e(T.slice.actions.setSoraConnectionStatus("disconnecting")),await a.sora.disconnect(),e(T.slice.actions.setSoraConnectionStatus("disconnected")))},U=()=>async(e,t)=>{let a=await S(),n=[],i=[],s=[];a.filter(e=>{""!==e.deviceId&&("audioinput"===e.kind?n.push(e.toJSON()):"audiooutput"===e.kind?s.push(e.toJSON()):"videoinput"===e.kind&&i.push(e.toJSON()))}),e(T.slice.actions.setAudioInputDevices(n)),e(T.slice.actions.setVideoInputDevices(i)),e(T.slice.actions.setAudioOutputDevices(s))},E=()=>async(e,t)=>{var a,n;let i=t();if(!i.soraContents.localMediaStream)return;if(null===(a=i.virtualBackgroundProcessor)||void 0===a?void 0:a.isProcessing()){let t=i.virtualBackgroundProcessor.getOriginalTrack();t&&(t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))),i.virtualBackgroundProcessor.stopProcessing()}else i.soraContents.localMediaStream&&i.soraContents.localMediaStream.getVideoTracks().filter(t=>{t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))});if(null===(n=i.noiseSuppressionProcessor)||void 0===n?void 0:n.isProcessing()){let t=i.noiseSuppressionProcessor.getOriginalTrack();t&&(t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))),i.noiseSuppressionProcessor.stopProcessing()}else i.soraContents.localMediaStream&&i.soraContents.localMediaStream.getAudioTracks().filter(t=>{t.stop(),e(T.slice.actions.setTimelineMessage(V("stop",t)))});let[s,o]=await R(e,i).catch(t=>{throw e(T.slice.actions.setSoraErrorAlertMessage(t.toString())),e(T.slice.actions.setSoraConnectionStatus("disconnected")),t});s.getTracks().filter(e=>{if(!i.soraContents.sora||!i.soraContents.sora.pc)return;let t=i.soraContents.sora.pc.getSenders().find(t=>!!t.track&&t.track.kind===e.kind);t&&t.replaceTrack(e)}),e(T.slice.actions.setLocalMediaStream(s)),e(T.slice.actions.setFakeContentsGainNode(o))},_=e=>async(t,a)=>{if(e)try{await r.Z.initE2EE("https://sora-e2ee-wasm.shiguredo.app/2020.2/wasm.wasm")}catch(e){t(T.slice.actions.setSoraErrorAlertMessage("Faild to execute WebAssembly '".concat("https://sora-e2ee-wasm.shiguredo.app/2020.2/wasm.wasm","'.")));return}t(T.slice.actions.setE2EE(e))},L=e=>async(t,a)=>{let n=a();if(!n.soraContents.localMediaStream||!n.soraContents.sora){t(T.slice.actions.setMicDevice(e));return}if(e){let a={aspectRatio:n.aspectRatio,audio:n.audio,audioContentHint:n.audioContentHint,audioInput:n.audioInput,audioTrack:n.audioTrack,autoGainControl:n.autoGainControl,blurRadius:n.blurRadius,cameraDevice:n.cameraDevice,echoCancellation:n.echoCancellation,echoCancellationType:n.echoCancellationType,facingMode:n.facingMode,fakeContents:n.fakeContents,fakeVolume:n.fakeVolume,frameRate:n.frameRate,lightAdjustment:n.lightAdjustment,lightAdjustmentProcessor:n.lightAdjustmentProcessor,mediaProcessorsNoiseSuppression:n.mediaProcessorsNoiseSuppression,mediaType:n.mediaType,micDevice:e,noiseSuppression:n.noiseSuppression,noiseSuppressionProcessor:n.noiseSuppressionProcessor,resizeMode:n.resizeMode,resolution:n.resolution,video:!1,videoContentHint:n.videoContentHint,videoInput:n.videoInput,videoTrack:n.videoTrack,virtualBackgroundProcessor:n.virtualBackgroundProcessor},[i,s]=await R(t,a).catch(e=>{throw t(T.slice.actions.setSoraErrorAlertMessage(e.toString())),e});0{var t;e.enabled=!1,e.stop(),null===(t=n.soraContents.localMediaStream)||void 0===t||t.removeTrack(e)}),n.soraContents.localMediaStream.addTrack(i.getAudioTracks()[0])),t(T.slice.actions.setFakeContentsGainNode(s)))}else n.soraContents.sora&&"connected"===n.soraContents.connectionStatus&&n.soraContents.localMediaStream?(W(t,n.soraContents.localMediaStream,n.noiseSuppressionProcessor),n.soraContents.sora.stopAudioTrack(n.soraContents.localMediaStream)):n.soraContents.localMediaStream&&W(t,n.soraContents.localMediaStream,n.noiseSuppressionProcessor);t(T.slice.actions.setMicDevice(e))},J=e=>async(t,a)=>{let n=a();if(!n.soraContents.localMediaStream&&!n.soraContents.sora&&"connected"!==n.soraContents.connectionStatus){t(T.slice.actions.setCameraDevice(e));return}if(e){let a={aspectRatio:n.aspectRatio,audio:!1,audioContentHint:n.audioContentHint,audioInput:n.audioInput,audioTrack:n.audioTrack,autoGainControl:n.autoGainControl,blurRadius:n.blurRadius,cameraDevice:e,echoCancellation:n.echoCancellation,echoCancellationType:n.echoCancellationType,facingMode:n.facingMode,fakeContents:n.fakeContents,fakeVolume:n.fakeVolume,frameRate:n.frameRate,lightAdjustment:n.lightAdjustment,lightAdjustmentProcessor:n.lightAdjustmentProcessor,mediaProcessorsNoiseSuppression:n.mediaProcessorsNoiseSuppression,mediaType:n.mediaType,micDevice:n.micDevice,noiseSuppression:n.noiseSuppression,noiseSuppressionProcessor:n.noiseSuppressionProcessor,resizeMode:n.resizeMode,resolution:n.resolution,video:n.video,videoContentHint:n.videoContentHint,videoInput:n.videoInput,videoTrack:n.videoTrack,virtualBackgroundProcessor:n.virtualBackgroundProcessor},[i,s]=await R(t,a).catch(e=>{throw t(T.slice.actions.setSoraErrorAlertMessage(e.toString())),e});0{var t;e.enabled=!1,e.stop(),null===(t=n.soraContents.localMediaStream)||void 0===t||t.removeTrack(e)}),n.soraContents.localMediaStream.addTrack(i.getVideoTracks()[0])),t(T.slice.actions.setFakeContentsGainNode(s)))}else if(n.soraContents.sora&&"connected"===n.soraContents.connectionStatus&&n.soraContents.localMediaStream){let e=z(n.lightAdjustmentProcessor,n.virtualBackgroundProcessor);await G(t,n.soraContents.localMediaStream,e),n.soraContents.sora.stopVideoTrack(n.soraContents.localMediaStream)}else if(n.soraContents.localMediaStream){let e=z(n.lightAdjustmentProcessor,n.virtualBackgroundProcessor);await G(t,n.soraContents.localMediaStream,e)}t(T.slice.actions.setCameraDevice(e))},z=(e,t)=>{let a;return(null==e?void 0:e.isProcessing())&&(a=e.getOriginalTrack(),e.stopProcessing()),(null==t?void 0:t.isProcessing())&&(void 0===a&&(a=t.getOriginalTrack()),t.stopProcessing()),a},G=async(e,t,a)=>{if(void 0!==a)a.enabled=!1,await new Promise(e=>setTimeout(e,100)),a.stop(),null==t||t.removeTrack(a),e(T.slice.actions.setTimelineMessage(V("stop",a)));else{if(!t)return;t.getVideoTracks().filter(e=>{e.enabled=!1}),await new Promise(e=>setTimeout(e,100)),t.getVideoTracks().filter(a=>{a.stop(),t.removeTrack(a),e(T.slice.actions.setTimelineMessage(V("stop",a)))})}},W=(e,t,a)=>{if(null==a?void 0:a.isProcessing()){let n=a.getOriginalTrack();n&&(n.stop(),null==t||t.removeTrack(n),e(T.slice.actions.setTimelineMessage(V("stop",n)))),a.stopProcessing()}else t&&t.getAudioTracks().filter(a=>{a.stop(),t.removeTrack(a),e(T.slice.actions.setTimelineMessage(V("stop",a)))})},{clearDataChannelMessages:K,deleteAlertMessage:q,setAPIErrorAlertMessage:Q,setAPIInfoAlertMessage:X,setAspectRatio:$,setAudio:Y,setAudioBitRate:ee,setAudioCodecType:et,setAudioContentHint:ea,setAudioInput:en,setAudioOutput:ei,setAudioTrack:es,setAutoGainControl:eo,setBlurRadius:el,setBundleId:er,setChannelId:ec,setClientId:ed,setDataChannels:eu,setDataChannelSignaling:em,setDebug:eg,setDebugFilterText:eh,setDebugType:ep,setDisplayResolution:ev,setEchoCancellation:ex,setEchoCancellationType:ej,setEnabledBundleId:ef,setEnabledClientId:eC,setEnabledDataChannels:eb,setEnabledDataChannel:eS,setEnabledForwardingFilter:ey,setEnabledMetadata:eN,setEnabledSignalingNotifyMetadata:ek,setEnabledSignalingUrlCandidates:eT,setEnabledVideoVP9Params:ew,setEnabledVideoH264Params:eI,setEnabledVideoH265Params:eR,setEnabledVideoAV1Params:eZ,setAudioStreamingLanguageCode:eM,setEnabledAudioStreamingLanguageCode:eP,setFakeVolume:eV,setFacingMode:eD,setFrameRate:eA,setIgnoreDisconnectWebSocket:eF,setLightAdjustment:eO,setLocalMediaStream:eH,setLogMessages:eB,setMediaProcessorsNoiseSuppression:eU,setMediaStats:eE,setMediaType:e_,setMetadata:eL,setMultistream:eJ,setNoiseSuppression:ez,setNotifyMessages:eG,setReconnect:eW,setResizeMode:eK,setRole:eq,setResolution:eQ,setSignalingNotifyMetadata:eX,setSignalingUrlCandidates:e$,setForwardingFilter:eY,setSimulcast:e0,setSimulcastRid:e1,setSora:e2,setSoraReconnecting:e5,setSoraErrorAlertMessage:e4,setSoraInfoAlertMessage:e6,setSpotlight:e9,setSpotlightFocusRid:e3,setSpotlightNumber:e8,setSpotlightUnfocusRid:e7,setVideo:te,setVideoBitRate:tt,setVideoCodecType:ta,setVideoContentHint:tn,setVideoInput:ti,setVideoTrack:ts,setVideoVP9Params:to,setVideoH264Params:tl,setVideoH265Params:tr,setVideoAV1Params:tc}=T.slice.actions;var td=a(4690);let tu=()=>(0,td.I0)(),tm=td.v9;var tg=a(4754),th=a(7006),tp=a(5544);let tv=()=>(0,n.jsxs)("svg",{width:"1em",height:"1em",viewBox:"0 0 16 16",className:"bi bi-clipboard",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",children:[(0,n.jsx)("title",{children:"ClipboardIcon"}),(0,n.jsx)("path",{fillRule:"evenodd",d:"M4 1.5H3a2 2 0 0 0-2 2V14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V3.5a2 2 0 0 0-2-2h-1v1h1a1 1 0 0 1 1 1V14a1 1 0 0 1-1 1H3a1 1 0 0 1-1-1V3.5a1 1 0 0 1 1-1h1v-1z"}),(0,n.jsx)("path",{fillRule:"evenodd",d:"M9.5 1h-3a.5.5 0 0 0-.5.5v1a.5.5 0 0 0 .5.5h3a.5.5 0 0 0 .5-.5v-1a.5.5 0 0 0-.5-.5zm-3-1A1.5 1.5 0 0 0 5 1.5v1A1.5 1.5 0 0 0 6.5 4h3A1.5 1.5 0 0 0 11 2.5v-1A1.5 1.5 0 0 0 9.5 0h-3z"})]}),tx=e=>e.disabled?(0,n.jsx)("div",{style:{height:"31px"}}):(0,n.jsx)("button",{type:"button",className:"btn btn-sm btn-dark",onClick:t=>{m(e.text),t.currentTarget.blur()},children:(0,n.jsx)(tv,{})}),tj=e=>{let{description:t}=e;return void 0===t?null:"object"!=typeof t?(0,n.jsx)("div",{className:"debug-message",children:(0,n.jsx)("div",{className:"col-sm-12",children:(0,n.jsx)("pre",{className:e.wordBreak?"word-break":"",children:t})})}):(0,n.jsx)("div",{className:"debug-message",children:(0,n.jsx)("div",{className:"col-sm-12",children:(0,n.jsx)("pre",{className:e.wordBreak?"word-break":"",children:JSON.stringify(t,null,2)})})})},tf=e=>{let{defaultShow:t,description:a,title:s,timestamp:o,label:l}=e,[r,c]=(0,i.useState)(void 0!==t&&t),d=o?s+o:s,m=void 0===a;return(0,n.jsxs)("div",{className:"border border-light rounded mb-1 bg-dark","data-title":s,children:[(0,n.jsxs)("div",{className:"d-flex justify-content-between align-items-center text-break",children:[(0,n.jsxs)("a",{className:"debug-title ".concat(m?"disabled":""),onClick:()=>c(!r),"aria-controls":d,"aria-expanded":r,children:[(0,n.jsx)("i",{className:"".concat(r?"arrow-bottom":"arrow-right"," ").concat(m?"disabled":"")})," ",o?(0,n.jsxs)("span",{className:"text-white-50 me-1",children:["[",u(o),"]"]}):null,l,(0,n.jsx)("span",{children:s})]}),(0,n.jsx)("div",{className:"border-left",children:(0,n.jsx)(tx,{text:"string"==typeof a?a:JSON.stringify(a,null,2),disabled:m})})]}),(0,n.jsx)(tp.Z,{in:r,children:(0,n.jsx)("div",{className:"border-top",children:(0,n.jsx)(tj,{description:a,wordBreak:e.wordBreak})})})]})},tC=e=>{let{title:t,codecs:a}=e;return(0,n.jsx)(tf,{title:t,timestamp:null,description:JSON.stringify(a,null,2)})},tb=i.memo(e=>(0,n.jsx)(tC,{...e})),tS=(e,t)=>{if(!e)return[];let a=e(t);return a&&a.codecs?a.codecs:[]},ty=()=>{let e=tS(RTCRtpSender.getCapabilities,"audio"),t=tS(RTCRtpSender.getCapabilities,"video"),a=tS(RTCRtpReceiver.getCapabilities,"audio"),i=tS(RTCRtpReceiver.getCapabilities,"video");return(0,n.jsxs)("div",{className:"capabilities-codec",children:[(0,n.jsx)(tb,{title:"Audio RTCRtpSender CapabilitiesCodec",codecs:e}),(0,n.jsx)(tb,{title:"Video RTCRtpSender CapabilitiesCodec",codecs:t}),(0,n.jsx)(tb,{title:"Audio RTCRtpReceiver CapabilitiesCodec",codecs:a}),(0,n.jsx)(tb,{title:"Video RTCRtpReceiver CapabilitiesCodec",codecs:i})]})},tN=()=>{let e=tu();return(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"clear",defaultValue:"clear",onClick:()=>{e(K())}})},tk=e=>{let{data:t,label:a,timestamp:i}=e;if("ZAKURO"===new TextDecoder().decode(t.slice(0,6))){let e=new TextDecoder().decode(t.slice(22,48)),s=new DataView(t),o=s.getBigInt64(6),l=s.getBigInt64(14),r=t.byteLength,c="connectionId: ".concat(e,"\nUnixTimeMicro: ").concat(o,"\nCounter: ").concat(l,"\nByteLength: ").concat(r);return(0,n.jsx)(tf,{title:"".concat(a," ZAKURO"),timestamp:i,description:c,defaultShow:!0,wordBreak:!0})}let s=new Uint8Array(t),o="".concat(s.toString(),"\n(").concat(new TextDecoder().decode(t),")");return(0,n.jsx)(tf,{title:a,timestamp:i,description:o,defaultShow:!0,wordBreak:!0})},tT=i.memo(e=>(0,n.jsx)(tk,{...e})),tw=()=>{let e=tm(e=>e.dataChannelMessages);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"py-1",children:(0,n.jsx)(tN,{})}),(0,n.jsx)("div",{className:"debug-messages",children:e.map(e=>{let t=e.label+e.timestamp;return(0,n.jsx)(tT,{...e},t)})})]})};var tI=a(4408),tR=a(6862),tZ=a(7058);let tM=()=>{let e=tm(e=>e.debugFilterText),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline debug-filter",controlId:"channelId",children:[(0,n.jsx)(tR.Z,{className:"text-white",children:"Filter:"}),(0,n.jsx)(tZ.Z,{type:"text",placeholder:"Filter",value:e,onChange:e=>{t(eh(e.target.value))},autoComplete:"off"})]})},tP=e=>{let{message:t,timestamp:a}=e;return(0,n.jsx)(tf,{title:t.title,timestamp:a,description:JSON.parse(t.description)})},tV=i.memo(e=>(0,n.jsx)(tP,{...e})),tD=()=>{let e=tm(e=>e.logMessages),t=tm(e=>e.debugFilterText),a=e.filter(e=>t.split(" ").every(t=>""===t||0<=JSON.stringify(e).indexOf(t)));return(0,n.jsx)("div",{className:"debug-messages",children:a.map((e,t)=>(0,n.jsx)(tV,{...e},e.message.title+String(t)+e.timestamp))})},tA={websocket:"#00ff00",datachannel:"#ff00ff"},tF=e=>{let{text:t}=e,a=Object.keys(tA).includes(t)?tA[t]:void 0;return(0,n.jsxs)("span",{className:"me-1",style:a?{color:a}:{},children:["[",t,"]"]})},tO=e=>{let{notify:t}=e,a=t.transportType?(0,n.jsx)(tF,{text:t.transportType}):null;return(0,n.jsx)(tf,{title:t.message.event_type,timestamp:t.timestamp,description:t.message,label:a})},tH=i.memo(e=>(0,n.jsx)(tO,{...e})),tB=()=>{let e=tm(e=>e.notifyMessages),t=tm(e=>e.debugFilterText),a=e.filter(e=>t.split(" ").every(t=>""===t||0<=JSON.stringify(e).indexOf(t)));return(0,n.jsx)("div",{className:"debug-messages",children:a.map(e=>(0,n.jsx)(tH,{notify:e},e.message.type+e.timestamp))})},tU={websocket:"#00ff00",datachannel:"#ff00ff"},tE=e=>{let{text:t}=e,a=Object.keys(tU).includes(t)?tU[t]:void 0;return(0,n.jsxs)("span",{style:a?{color:a}:{},children:["[",t,"]"]})},t_=e=>{let{push:t}=e,a=t.transportType?(0,n.jsx)(tE,{text:t.transportType}):null;return(0,n.jsx)(tf,{title:t.message.type,timestamp:t.timestamp,description:t.message,label:a})},tL=i.memo(e=>(0,n.jsx)(t_,{...e})),tJ=()=>{let e=tm(e=>e.pushMessages),t=tm(e=>e.debugFilterText),a=e.filter(e=>t.split(" ").every(t=>""===t||0<=JSON.stringify(e).indexOf(t)));return(0,n.jsx)("div",{className:"debug-messages",children:a.map((e,t)=>{let a="".concat(e.timestamp,"-").concat(t);return(0,n.jsx)(tL,{ariaControls:a,push:e},a)})})};var tz=a(3124),tG=a(2765);let tW=()=>{let e=(0,i.useRef)(null),t=(0,i.useRef)(null),a=tm(e=>e.soraContents.sora),s=tm(e=>e.soraContents.connectionStatus),o=tm(e=>e.soraContents.datachannels);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"d-flex mt-2",children:[(0,n.jsx)(tI.Z,{className:"me-1",controlId:"sendDataChannelMessageLabel",children:(0,n.jsx)(tz.Z,{name:"sendDataChannelMessageLabel",ref:e,children:o.map(e=>(0,n.jsx)("option",{value:e.label,children:e.label},e.label))})}),(0,n.jsx)(tI.Z,{className:"flex-grow-1 me-1",controlId:"sendDataChannelMessage",children:(0,n.jsx)(tZ.Z,{className:"flex-fill",placeholder:"sendDataChannelMessageを指定",type:"text",ref:t})}),(0,n.jsx)(tG.Z,{variant:"secondary",onClick:()=>{if(null===e.current||null===t.current)return;let n=e.current.value;a&&"connected"===s&&a.sendMessage(n,new TextEncoder().encode(t.current.value))},disabled:0===o.length,children:"send"})]}),0{let{text:t}=e,a=Object.keys(tK).includes(t)?tK[t]:void 0;return(0,n.jsxs)("span",{className:"me-1",style:a?{color:a}:{},children:["[",t,"]"]})},tQ=e=>{let{data:t,type:a,timestamp:i,transportType:s}=e,o=s?(0,n.jsx)(tq,{text:s}):null;return(0,n.jsx)(tf,{title:a,timestamp:i,description:t,label:o})},tX=i.memo(e=>(0,n.jsx)(tQ,{...e})),t$=()=>{let e=tm(e=>e.signalingMessages),t=tm(e=>e.debugFilterText),a=e.filter(e=>t.split(" ").every(t=>""===t||0<=JSON.stringify(e).indexOf(t)));return(0,n.jsx)("div",{className:"debug-messages",children:a.map(e=>{let t=e.type+e.timestamp;return(0,n.jsx)(tX,{...e},t)})})},tY=e=>(0,n.jsx)(tf,{title:"".concat(e.id,"(").concat(e.type,")"),timestamp:null,description:e}),t0=i.memo(e=>(0,n.jsx)(tY,{...e})),t1=()=>{let e=tm(e=>e.soraContents.statsReport),t=tm(e=>e.debugFilterText),a=e.filter(e=>t.split(" ").every(t=>""===t||0<=JSON.stringify(e).indexOf(t)));return(0,n.jsx)("div",{className:"debug-messages",children:a.map(e=>(0,n.jsx)(t0,{...e},e.id))})},t2={signaling:"#ff00ff",notify:"#ffff00",push:"#98fb98",e2ee:"#00ffff",stats:"#ffc0cb"},t5=()=>(0,n.jsx)("span",{className:"me-1",style:{color:"#00ff00"},children:"[websocket]"}),t4=()=>(0,n.jsx)("span",{className:"me-1",style:{color:"#ff8c00"},children:"[peerconnection]"}),t6=()=>(0,n.jsx)("span",{className:"me-1",style:{color:"#bce2e8"},children:"[sora]"}),t9=()=>(0,n.jsx)("span",{className:"me-1",style:{color:"#73b8e2"},children:"[sora-devtools]"}),t3=e=>{let{label:t,id:a}=e,i=t&&Object.keys(t2).includes(t)?t2[t]:void 0;return(0,n.jsxs)("span",{className:"me-1",style:i?{color:i}:{},children:["[datachannel]",t?"[".concat(t,"]"):"","number"==typeof a?"[".concat(a,"]"):""]})},t8=e=>{let t;let{timestamp:a,logType:i,dataChannelId:s,dataChannelLabel:o,type:l,data:r}=e;return"websocket"===i?t=(0,n.jsx)(t5,{}):"datachannel"===i?t=(0,n.jsx)(t3,{id:s,label:o}):"peerconnection"===i?t=(0,n.jsx)(t4,{}):"sora"===i?t=(0,n.jsx)(t6,{}):"sora-devtools"===i&&(t=(0,n.jsx)(t9,{})),(0,n.jsx)(tf,{title:"".concat(l),timestamp:a,description:r,label:t})},t7=i.memo(e=>(0,n.jsx)(t8,{...e})),ae=()=>{let e=tm(e=>e.timelineMessages),t=tm(e=>e.debugFilterText),a=e.filter(e=>t.split(" ").every(t=>""===t||0<=JSON.stringify(e).indexOf(t)));return(0,n.jsx)("div",{className:"debug-messages",children:a.map(e=>{let t="".concat(e.timestamp,"-").concat(e.type);return e.dataChannelLabel&&(t+="-".concat(e.dataChannelLabel)),(0,n.jsx)(t7,{...e},t)})})},at=()=>{let e=tm(e=>e.debug),t=tm(e=>e.debugType),a=tu();return e?(0,n.jsx)("div",{className:"col-debug col-6",children:(0,n.jsxs)(tg.Z,{id:"debug-tab",activeKey:t,defaultActiveKey:"timeline",onSelect:e=>{("log"===e||"notify"===e||"push"===e||"stats"===e||"timeline"===e||"signaling"===e||"messaging"===e||"codec"===e)&&a(ep(e))},children:[(0,n.jsxs)(th.Z,{eventKey:"timeline",title:"Timeline",children:[(0,n.jsx)(tM,{}),(0,n.jsx)(ae,{})]}),(0,n.jsxs)(th.Z,{eventKey:"signaling",title:"Signaling",children:[(0,n.jsx)(tM,{}),(0,n.jsx)(t$,{})]}),(0,n.jsxs)(th.Z,{eventKey:"notify",title:"Notfiy",children:[(0,n.jsx)(tM,{}),(0,n.jsx)(tB,{})]}),(0,n.jsxs)(th.Z,{eventKey:"push",title:"Push",children:[(0,n.jsx)(tM,{}),(0,n.jsx)(tJ,{})]}),(0,n.jsxs)(th.Z,{eventKey:"stats",title:"Stats",children:[(0,n.jsx)(tM,{}),(0,n.jsx)(t1,{})]}),(0,n.jsxs)(th.Z,{eventKey:"log",title:"Log",children:[(0,n.jsx)(tM,{}),(0,n.jsx)(tD,{})]}),(0,n.jsxs)(th.Z,{eventKey:"messaging",title:"Messaging",children:[(0,n.jsx)(tW,{}),(0,n.jsx)(tw,{})]}),(0,n.jsx)(th.Z,{eventKey:"codec",title:"Codec",children:(0,n.jsx)(ty,{})})]})}):null};var aa=a(6670),an=a(1358),ai=a(5925);let as=()=>{let e=tu(),t=tm(e=>e.soraContents.reconnectingTrials);return(0,i.useEffect)(()=>{e(H())},[e]),(0,n.jsxs)(ai.Z,{delay:2e4,onClose:()=>{e(e5(!1))},children:[(0,n.jsx)(ai.Z.Header,{className:"bg-warning text-white",children:(0,n.jsx)("strong",{className:"me-auto",children:"Reconnect"})}),(0,n.jsx)(ai.Z.Body,{className:"bg-light",children:(0,n.jsxs)("p",{className:"text-break font-weight-bold mb-0",children:["Reconnecting... (trials ",t,")"]})})]})},ao=e=>{let t=tu(),a="error"===e.type?"bg-danger":"bg-info";return(0,n.jsxs)(ai.Z,{autohide:!0,delay:2e4,onClose:()=>{t(q(e.timestamp))},children:[(0,n.jsxs)(ai.Z.Header,{className:"".concat(a," text-white"),children:[(0,n.jsx)("strong",{className:"me-auto",children:e.title}),(0,n.jsx)("span",{children:u(e.timestamp)})]}),(0,n.jsx)(ai.Z.Body,{className:"bg-light",children:(0,n.jsx)("p",{className:"text-break font-weight-bold mb-0",children:e.message})})]})},al=()=>{let e=tm(e=>e.alertMessages),t=tm(e=>e.soraContents.reconnecting);return(0,n.jsxs)("div",{className:"alert-messages",children:[t?(0,n.jsx)(as,{}):null,e.map(e=>(0,n.jsx)(ao,{...e},e.timestamp))]})};var ar=a(9564),ac=a(4785);let ad=e=>{let t=d.x$[e.kind];return t?(0,n.jsx)(ar.Z,{placement:"top",overlay:(0,n.jsx)(ac.Z,{id:"popover-basic",children:(0,n.jsx)(ac.Z.Body,{style:{whiteSpace:"pre-wrap"},children:t.description})}),children:(0,n.jsx)(tR.Z,{children:e.children})}):(console.warn('Could not load description "'.concat(e.kind,'"')),(0,n.jsx)(tR.Z,{children:e.children}))},au=e=>(0,n.jsxs)("div",{className:"d-flex align-items-center",children:[e.label?(0,n.jsx)("p",{children:e.label}):null,(0,n.jsxs)("div",{className:"d-flex align-items-center border border-secondary rounded mx-1",children:[(0,n.jsx)("p",{id:e.id,className:"mx-2 p-1",children:e.text}),(0,n.jsx)("div",{className:"border-left border-secondary",children:(0,n.jsx)("button",{type:"button",className:"btn btn-sm btn-light",onClick:t=>{m(e.text),t.currentTarget.blur()},children:(0,n.jsx)(tv,{})})})]})]}),am=e=>{let{localVideo:t,connectionId:a,clientId:i}=e;return(0,n.jsxs)(n.Fragment,{children:[a?(0,n.jsx)(au,{id:t?"local-video-connection-id":void 0,label:"connectionID:",text:a}):null,null!=i&&a!==i?(0,n.jsx)(au,{id:t?"local-video-client-id":void 0,label:"clientID:",text:i}):null]})},ag=e=>{let t=tm(e=>e.soraContents.statsReport),[a,n]=(0,i.useState)([]),[s,o]=(0,i.useState)(null);return(0,i.useEffect)(()=>{(async()=>{if(void 0===e.getVideoTracks().find(e=>e))return;let a=t.filter(e=>{if("outbound-rtp"===e.type&&"video"===e.kind)return!0});if(0===a.length)return;let i=a.map(e=>{let a=t.find(t=>{if("codec"===t.type)return t.id===e.codecId});return void 0===a?{outboundRtpStats:e}:{codec:a,outboundRtpStats:e}});if(n(i.sort((e,t)=>void 0===e.outboundRtpStats.rid?1:void 0===t.outboundRtpStats.rid?-1:e.outboundRtpStats.rid.localeCompare(t.outboundRtpStats.rid))),null===s){let e=i.filter(e=>void 0!==e.outboundRtpStats.frameWidth).sort((e,t)=>void 0===e.outboundRtpStats.frameWidth?1:void 0===t.outboundRtpStats.frameWidth?-1:t.outboundRtpStats.frameWidth-e.outboundRtpStats.frameWidth);e.length>0&&o(e[0])}else{let e=i.find(e=>e.outboundRtpStats.rid===s.outboundRtpStats.rid);void 0!==e&&o(e)}})()},[t,e,s]),{trackStats:a,selected:s,setSelected:o}},ah=e=>{var t,a,i;let{stream:s}=e,{trackStats:o,selected:l,setSelected:r}=ag(s);return(0,n.jsx)("div",{className:"video-overlay",children:0===o.length?(0,n.jsx)("p",{children:"loading..."}):(0,n.jsxs)(n.Fragment,{children:[o.length>1&&(0,n.jsx)("div",{className:"d-flex gap-2",children:o.map(e=>(0,n.jsxs)("div",{className:e.outboundRtpStats.rid===(null==l?void 0:l.outboundRtpStats.rid)?"rid-selected":"rid",onClick:()=>r(e),onKeyDown:()=>r(e),children:["[",e.outboundRtpStats.rid,"]"]},e.outboundRtpStats.rid))}),l&&(0,n.jsxs)("table",{className:"table-video-capabilities",children:[(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"mimeType"}),(0,n.jsx)("td",{children:null===(t=l.codec)||void 0===t?void 0:t.mimeType})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"payloadType"}),(0,n.jsx)("td",{children:null===(a=l.codec)||void 0===a?void 0:a.payloadType})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"sdpFmtpLine"}),(0,n.jsx)("td",{children:null===(i=l.codec)||void 0===i?void 0:i.sdpFmtpLine})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"resolution"}),(0,n.jsxs)("td",{children:[l.outboundRtpStats.frameWidth,"x",l.outboundRtpStats.frameHeight]})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"fps"}),(0,n.jsx)("td",{children:void 0!==l.outboundRtpStats.framesPerSecond?Math.floor(l.outboundRtpStats.framesPerSecond):void 0})]})]})]})})};async function ap(e,t,a,n){let i=window.location.protocol,s="".concat(i,"//").concat(window.location.hostname,":").concat("https:"===i?"443":"3000","/").concat("https:"===i?"api":"");null!==e&&(s=e);let o="Sora_".concat(t,".").concat(a),l=await fetch(s,{method:"POST",body:JSON.stringify(n),headers:{Accept:"application/json","Content-Type":"application/json","x-sora-target":o},mode:"cors"}),r=await l.json();if(!l.ok){let e="POST ".concat(s," ").concat(l.status," (").concat(l.statusText,") target:").concat(o);throw r.error_type&&(e+=" error_type: ".concat(r.error_type)),Error(e)}return r}function av(e,t,a,n,i){let s={channel_id:t,recv_connection_id:a,rid:n};return i&&(s.send_connection_id=i),ap(e,"20201005","RequestRtpStream",s)}function ax(e,t,a,n){let i={channel_id:t,recv_connection_id:a};return n&&(i.send_connection_id=n),ap(e,"20201005","ResetRtpStream",i)}function aj(e,t,a,n,i,s){let o={channel_id:t,recv_connection_id:a,spotlight_focus_rid:n,spotlight_unfocus_rid:i};return s&&(o.send_connection_id=s),ap(e,"20211215","RequestSpotlightRid",o)}function af(e,t,a,n){let i={channel_id:t,recv_connection_id:a};return n&&(i.send_connection_id=n),ap(e,"20211215","ResetSpotlightRid",i)}let aC=e=>{let t=tm(e=>e.soraContents.sora),a=tm(e=>e.apiUrl),i=tm(e=>e.channelId),s=tu(),o=async()=>{if(null==t?void 0:t.connectionId)try{let n=await av(a,i,t.connectionId,e.rid);s(X("POST successed. response: ".concat(JSON.stringify(n))))}catch(e){e instanceof Error&&s(Q(e.message))}};return(0,n.jsx)("div",{className:"mx-1",children:(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"requestSimulcastRidTo".concat(e.rid.charAt(0).toUpperCase()+e.rid.slice(1)),defaultValue:"".concat(e.rid," rid"),onClick:o})})},ab=()=>{let e=(0,i.useRef)(null),t=(0,i.useRef)(null),a=tm(e=>e.soraContents.sora),s=tm(e=>e.channelId),o=tm(e=>e.apiUrl),l=tu();if(!(null==a?void 0:a.connectionId))return null;let r=async()=>{if(!(null==a?void 0:a.connectionId)||null===e.current||null===t.current)return;let n=e.current.value,i=t.current.value;try{let e=await aj(o,s,a.connectionId,n,i);l(X("POST successed. response: ".concat(JSON.stringify(e))))}catch(e){e instanceof Error&&l(Q(e.message))}};return(0,n.jsx)("div",{className:"mx-1",children:(0,n.jsxs)(tI.Z,{className:"form-inline",children:[(0,n.jsx)(tz.Z,{ref:e,children:d.I7.map(e=>""===e?null:(0,n.jsxs)("option",{value:e,children:["SpotlightFocusRid: ",e]},e))}),(0,n.jsx)(tz.Z,{ref:t,children:d.I7.map(e=>""===e?null:(0,n.jsxs)("option",{value:e,children:["SpotlightUnfocusRid: ",e,"\xa0\xa0\xa0"]},e))}),(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"requestSpotlightRid",defaultValue:"requestSpotlightRid",onClick:r})]})})},aS=()=>{let e=tm(e=>e.soraContents.sora),t=tm(e=>e.channelId),a=tm(e=>e.apiUrl),i=tu(),s=async()=>{if(null==e?void 0:e.connectionId)try{let n=await ax(a,t,e.connectionId);i(X("POST successed. response: ".concat(JSON.stringify(n))))}catch(e){e instanceof Error&&i(Q(e.message))}};return(0,n.jsx)("div",{className:"mx-1",children:(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"resetAllSimulcastRid",defaultValue:"reset rid",onClick:s})})},ay=()=>{let e=tm(e=>e.soraContents.sora),t=tm(e=>e.channelId),a=tm(e=>e.apiUrl),i=tu(),s=async()=>{if(null==e?void 0:e.connectionId)try{let n=await af(a,t,e.connectionId);i(X("POST successed. response: ".concat(JSON.stringify(n))))}catch(e){e instanceof Error&&i(Q(e.message))}};return(0,n.jsx)("div",{className:"mx-1",children:(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"resetAllSpotlightRid",defaultValue:"resetSpotlightRid",onClick:s})})},aN=e=>(0,n.jsxs)("div",{className:"d-flex align-items-center",children:[(0,n.jsx)("p",{children:"sessionID:"}),(0,n.jsxs)("div",{className:"d-flex align-items-center border border-secondary rounded mx-1",children:[(0,n.jsx)("p",{id:e.id,className:"mx-2 p-1",children:e.text}),(0,n.jsx)("div",{className:"border-left border-secondary",children:(0,n.jsx)("button",{type:"button",className:"btn btn-sm btn-light",onClick:t=>{m(e.text),t.currentTarget.blur()},children:(0,n.jsx)(tv,{})})})]})]}),ak=e=>{let{sessionId:t}=e;return(0,n.jsx)(aN,{id:"session-id",text:t})},aT=e=>{var t;let{displayResolution:a,stream:s,mute:o,audioOutput:l,setHeight:r}=e,c=(0,i.useRef)(null),d=v(a);return(0,i.useEffect)(()=>{let e=new ResizeObserver(e=>{e.filter(e=>{r(e.contentRect.height)})});return c.current&&(l&&s&&s.getAudioTracks().length>0&&c.current.setSinkId(l),e.observe(c.current)),()=>{e.disconnect()}},[r,l,s]),(0,i.useEffect)(()=>{c.current&&o&&(c.current.muted=!0)},[o]),(0,i.useEffect)(()=>{if(c.current&&s){let e;s.getVideoTracks().filter(t=>{e=t.enabled,t.enabled=!1}),c.current.onloadedmetadata=t=>{s.getVideoTracks().filter(t=>{void 0!==e&&(t.enabled=e)})},c.current.srcObject=s,l&&s.getAudioTracks().length>0&&c.current.setSinkId(l)}else c.current&&null===s&&(c.current.srcObject=null)},[s,l]),l&&(null===(t=c.current)||void 0===t?void 0:t.setSinkId)&&s&&s.getAudioTracks().length>0&&c.current.setSinkId(l),(0,n.jsx)("video",{id:e.localVideo?"local-video":void 0,autoPlay:!0,playsInline:!0,controls:!0,muted:o,ref:c,width:0(0,n.jsx)(aT,{...e})),aI="#CCCCCC";function aR(e,t,a){e.beginPath(),e.fillStyle=t,e.fillRect(0,a,25,10),e.closePath()}function aZ(e,t){let a=Math.ceil(t/12.5),n=t-10;aR(e,aI,n);for(let t=0;t{let t=(0,i.useRef)(null);return(0,i.useEffect)(()=>{if(0===e.stream.getAudioTracks().length)return;let a=new(window.AudioContext||window.webkitAudioContext),n=a.createMediaStreamSource(e.stream),i=a.createAnalyser();i.fftSize=2048;let s=new Uint8Array(i.frequencyBinCount);n.connect(i);let o=null;return function e(){o=requestAnimationFrame(e),i.getByteTimeDomainData(s);let a=Array.from(s),n=Math.max.apply(null,a)-128,l=t.current;if(null===l)return;let r=l.getContext("2d");null!==r&&(r.clearRect(0,0,25,l.height),r.save(),aZ(r,l.height),function(e,t,a){let n=Math.ceil(t*a/12.5);for(let a=0;a{a&&a.close(),o&&cancelAnimationFrame(o)}},[e.stream]),(0,n.jsx)("canvas",{width:25,height:e.height,className:"volume-visualizer",ref:t})},aP=e=>{let t=(0,i.useRef)(null);return(0,i.useEffect)(()=>{let e=t.current;if(null===e)return;let a=e.getContext("2d");null!==a&&(a.clearRect(0,0,25,e.height),a.save(),aZ(a,e.height),a.restore())},[]),(0,n.jsx)("canvas",{width:25,height:e.height,className:"volume-visualizer",ref:t})},aV=i.memo(e=>e.micDevice&&0{let[e,t]=(0,i.useState)(0),a=tm(e=>e.audio),s=tm(e=>e.video),o=tm(e=>e.audioOutput),l=tm(e=>e.displayResolution),r=tm(e=>e.focusedSpotlightConnectionIds),c=tm(e=>e.soraContents.connectionId),d=tm(e=>e.soraContents.localMediaStream),u=tm(e=>e.micDevice),m=c&&r[c],g=tm(e=>e.mediaStats);return!1===a&&!1===s?null:(0,n.jsx)(n.Fragment,{children:(0,n.jsx)("div",{className:"d-flex",children:(0,n.jsxs)("div",{className:"position-relative d-flex flex-nowrap align-items-start video-wrapper".concat(m?" spotlight-focused":""),children:[g&&d&&d.getVideoTracks().length>0&&(0,n.jsx)(ah,{stream:d}),(0,n.jsx)(aw,{stream:d,setHeight:t,audioOutput:o,displayResolution:l,localVideo:!0,mute:!0}),null!==d?(0,n.jsx)(aV,{micDevice:u,stream:d,height:e}):null]})})})},aA=()=>{let e=tm(e=>e.soraContents.connectionId),t=tm(e=>e.soraContents.clientId),a=tm(e=>e.soraContents.sessionId),i=tm(e=>e.simulcast),s=tm(e=>e.spotlight),o=tm(e=>e.role),l=tm(e=>e.soraContents.localMediaStream);return(0,n.jsx)("div",{className:"row my-1",children:(0,n.jsxs)("div",{className:"col-auto",children:[(0,n.jsxs)("div",{className:"video-status mb-1",children:[null!==a?(0,n.jsx)("div",{className:"d-flex align-items-center mb-1 video-status-inner",children:(0,n.jsx)(ak,{sessionId:a})}):null,null!==e||null!==t?(0,n.jsx)("div",{className:"d-flex align-items-center mb-1 video-status-inner",children:(0,n.jsx)(am,{connectionId:e,clientId:t,localVideo:!0})}):null,null!==e&&"true"!==s&&"true"===i&&"sendonly"!==o?(0,n.jsxs)("div",{className:"d-flex align-items-center mb-1 video-status-inner",children:[(0,n.jsx)(ad,{kind:"changeAllRecvStream",children:"change all:"}),(0,n.jsx)(aC,{rid:"r0"}),(0,n.jsx)(aC,{rid:"r1"}),(0,n.jsx)(aC,{rid:"r2"}),(0,n.jsx)(aS,{})]}):null,null!==e&&"true"===s?(0,n.jsxs)("div",{className:"d-flex align-items-center mb-1 video-status-inner",children:[(0,n.jsx)(ab,{}),(0,n.jsx)(ay,{})]}):null]}),null!==l&&"recvonly"!==o?(0,n.jsx)(aD,{}):null]})})};function aF(e,t,a){if(null===t)return;let n=[];return"video"===a?n=t.getVideoTracks().map(e=>e.id):"audio"===a&&(n=t.getAudioTracks().map(e=>e.id)),e.find(e=>"inbound-rtp"===e.type&&"kind"in e&&"trackIdentifier"in e&&!!(e.kind===a&&n.includes(e.trackIdentifier)))}let aO=e=>{let t=tm(e=>e.soraContents.statsReport),a=tm(e=>e.soraContents.prevStatsReport),i=aF(t,e.stream,e.type),s=aF(a,e.stream,e.type);if(void 0===i||void 0===i.jitterBufferDelay||void 0===i.jitterBufferEmittedCount)return null;let o=i.jitterBufferDelay,l=i.jitterBufferEmittedCount;void 0!==s&&void 0!==s.jitterBufferDelay&&void 0!==s.jitterBufferEmittedCount&&(o=i.jitterBufferDelay-s.jitterBufferDelay,l=i.jitterBufferEmittedCount-s.jitterBufferEmittedCount);let r=Math.floor(o/l*1e3),c="normal-jitter-buffer";return 500{let t=tm(e=>e.soraContents.statsReport),a=tm(e=>e.soraContents),[n,s]=(0,i.useState)(null);return(0,i.useEffect)(()=>{(async()=>{var n;let i,o;if(!(null===(n=a.sora)||void 0===n?void 0:n.pc))return;let l=e.getVideoTracks().find(e=>e);if(void 0===l)return;let r=await a.sora.pc.getReceivers().find(e=>e.track.id===l.id);if(void 0!==r){for(let e of(await r.getStats())){let[t,a]=e;if(a.codecId){i=a.codecId;break}}if(void 0!==i){for(let e of t)"codec"===e.type&&i===e.id&&(o=e);o&&s({codec:o,videoTrackStats:{width:l.getSettings().width,height:l.getSettings().height,frameRate:void 0!==l.getSettings().frameRate?Math.floor(l.getSettings().frameRate||0):void 0}})}}})()},[t,e,a]),{trackStats:n}},aB=e=>{let{stream:t}=e,{trackStats:a}=aH(t);return(0,n.jsx)("div",{className:"video-overlay",children:null===a?(0,n.jsx)("p",{children:"loading..."}):(0,n.jsxs)("table",{className:"table-video-capabilities",children:[(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"mimeType"}),(0,n.jsx)("td",{children:a.codec.mimeType})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"payloadType"}),(0,n.jsx)("td",{children:a.codec.payloadType})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"sdpFmtpLine"}),(0,n.jsx)("td",{children:a.codec.sdpFmtpLine})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"resolution"}),(0,n.jsx)("td",{children:void 0===a.videoTrackStats.width||void 0===a.videoTrackStats.height?"undefined":"".concat(a.videoTrackStats.width,"x").concat(a.videoTrackStats.height)})]}),(0,n.jsxs)("tr",{children:[(0,n.jsx)("th",{children:"fps"}),(0,n.jsx)("td",{children:void 0===a.videoTrackStats.frameRate?"undefined":a.videoTrackStats.frameRate})]})]})})},aU=e=>{let t=tm(e=>e.soraContents.sora),a=tm(e=>e.apiUrl),i=tm(e=>e.channelId),s=tu(),o=async()=>{if(null==t?void 0:t.connectionId)try{let n=await av(a,i,t.connectionId,e.rid,e.sendConnectionId);s(X("POST successed. response: ".concat(JSON.stringify(n))))}catch(e){e instanceof Error&&s(Q(e.message))}};return(0,n.jsx)("input",{className:"btn btn-secondary btn-sm mx-1",type:"button",name:"requestSimulcastRidTo".concat(e.rid.charAt(0).toUpperCase()+e.rid.slice(1)),defaultValue:"".concat(e.rid," rid"),onClick:o})},aE=e=>{let t=(0,i.useRef)(null),a=(0,i.useRef)(null),s=tm(e=>e.soraContents.sora),o=tm(e=>e.channelId),l=tm(e=>e.apiUrl),r=tu();if(!(null==s?void 0:s.connectionId))return null;let c=async()=>{if(!(null==s?void 0:s.connectionId)||null===t.current||null===a.current)return;let n=t.current.value,i=a.current.value;try{let t=await aj(l,o,s.connectionId,n,i,e.sendConnectionId);r(X("POST successed. response: ".concat(JSON.stringify(t))))}catch(e){e instanceof Error&&r(Q(e.message))}};return(0,n.jsx)("div",{className:"mx-1",children:(0,n.jsxs)(tI.Z,{className:"form-inline",children:[(0,n.jsx)(tz.Z,{ref:t,children:d.I7.map(e=>""===e?null:(0,n.jsxs)("option",{value:e,children:["SpotlightFocusRid: ",e]},e))}),(0,n.jsx)(tz.Z,{ref:a,children:d.I7.map(e=>""===e?null:(0,n.jsxs)("option",{value:e,children:["SpotlightUnfocusRid: ",e,"\xa0\xa0\xa0"]},e))}),(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"requestSpotlightRidBySendConnectionId",defaultValue:"requestSpotlightRid",onClick:c})]})})},a_=e=>{let t=tm(e=>e.soraContents.sora),a=tm(e=>e.channelId),i=tm(e=>e.apiUrl),s=tu(),o=async()=>{if(null==t?void 0:t.connectionId)try{let n=await ax(i,a,t.connectionId,e.sendConnectionId);s(X("POST successed. response: ".concat(JSON.stringify(n))))}catch(e){e instanceof Error&&s(Q(e.message))}};return(0,n.jsx)("input",{className:"btn btn-secondary btn-sm mx-1",type:"button",name:"resetRtpStream",defaultValue:"reset rid",onClick:o})},aL=e=>{let t=tm(e=>e.soraContents.sora),a=tm(e=>e.channelId),i=tm(e=>e.apiUrl),s=tu(),o=async()=>{if(null==t?void 0:t.connectionId)try{let n=await af(i,a,t.connectionId,e.sendConnectionId);s(X("POST successed. response: ".concat(JSON.stringify(n))))}catch(e){e instanceof Error&&s(Q(e.message))}};return(0,n.jsx)("input",{className:"btn btn-secondary mx-1",type:"button",name:"resetSpotlightRid",defaultValue:"resetSpotlightRid",onClick:o})};function aJ(e,t){if(null===t)return[];let a=t.getTracks().map(e=>e.id),n=[];for(let t of e)(!t.id||t.id.match(/^RTCMediaStreamTrack/))&&"trackIdentifier"in t&&t.trackIdentifier&&a.includes(t.trackIdentifier)&&n.push(t);return n}let az=e=>{let t=tm(e=>e.showStats),a=tm(e=>e.soraContents.statsReport),i=tm(e=>e.soraContents.prevStatsReport);if(!t)return null;let s=aJ(a,e.stream),o=aJ(i,e.stream);return(0,n.jsx)(n.Fragment,{children:s.map(e=>{let t=0,a=0,i=o.find(t=>e.id===t.id);return i&&(t=e.jitterBufferDelay-i.jitterBufferDelay,a=e.jitterBufferEmittedCount-i.jitterBufferEmittedCount),(0,n.jsx)("div",{children:(0,n.jsxs)("ul",{className:"mediastream-stats-report",children:[Object.entries(e).map(e=>{let[t,a]=e;return(0,n.jsxs)("li",{children:[(0,n.jsxs)("strong",{children:[t,":"]})," ",a]},t)}),(0,n.jsxs)("li",{children:[(0,n.jsx)("strong",{children:"[jitterBufferDelay/jitterBufferEmittedCount_in_ms]"})," ",Math.floor(t/a*1e3)]})]})},e.id)})})},aG=e=>{let{client:t}=e,{mediaStream:a,connectionId:s,clientId:o}=t,[l,r]=(0,i.useState)(0),c=tm(e=>e.audioOutput),d=tm(e=>e.displayResolution),u=tm(e=>e.focusedSpotlightConnectionIds),m=tm(e=>e.multistream),g=tm(e=>e.mute),h=tm(e=>e.simulcast),p=tm(e=>e.spotlight),v=s&&u[s],x=tm(e=>e.mediaStats);return(0,n.jsxs)("div",{className:"col-auto",children:[(0,n.jsxs)("div",{className:"video-status",children:[(0,n.jsxs)("div",{className:"d-flex align-items-center mb-1 video-status-inner",children:[(0,n.jsx)(am,{connectionId:s,clientId:o}),(0,n.jsx)(aO,{type:"audio",stream:a}),(0,n.jsx)(aO,{type:"video",stream:a})]}),(0,n.jsxs)("div",{className:"d-flex align-items-center mb-1 video-status-inner",children:["true"!==p&&"true"===m&&"true"===h?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aU,{rid:"r0",sendConnectionId:s}),(0,n.jsx)(aU,{rid:"r1",sendConnectionId:s}),(0,n.jsx)(aU,{rid:"r2",sendConnectionId:s}),(0,n.jsx)(a_,{sendConnectionId:s})]}):null,"true"===p&&"true"===m&&"true"===h?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aE,{sendConnectionId:s}),(0,n.jsx)(aL,{sendConnectionId:s})]}):null]})]}),(0,n.jsxs)("div",{className:"d-flex flex-wrap align-items-start overflow-y-hidden",children:[(0,n.jsxs)("div",{className:"position-relative d-flex flex-nowrap align-items-start video-wrapper".concat(v?" spotlight-focused":""),children:[x&&a.getVideoTracks().length>0&&(0,n.jsx)(aB,{stream:a}),(0,n.jsx)(aw,{stream:a,setHeight:r,mute:g,audioOutput:c,displayResolution:d}),(0,n.jsx)(aV,{micDevice:!0,stream:a,height:l})]}),(0,n.jsx)(az,{stream:a})]})]})},aW=()=>{let e=tm(e=>e.soraContents.remoteClients);return(0,n.jsx)("div",{className:"row my-2",children:e.map(e=>(0,n.jsx)(aG,{client:e},e.connectionId))})},aK=()=>{let e=tm(e=>e.aspectRatio),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"aspectRatio",children:[(0,n.jsx)(ad,{kind:"aspectRatio",children:"aspectRatio:"}),(0,n.jsx)(tz.Z,{name:"aspectRatio",value:e,onChange:e=>{g(e.target.value,d.Ii)&&t($(e.target.value))},children:d.Ii.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},aq=()=>{let e=tm(e=>e.audioBitRate),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"audioBitRate",children:[(0,n.jsx)(ad,{kind:"audioBitRate",children:"audioBitRate:"}),(0,n.jsx)(tz.Z,{name:"audioBitRate",value:e,onChange:e=>{g(e.target.value,d.xR)&&a(ee(e.target.value))},disabled:t,children:d.xR.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},aQ=()=>{let e=tm(e=>e.audioCodecType),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"audioBitRate",children:[(0,n.jsx)(ad,{kind:"audioCodecType",children:"audioCodecType:"}),(0,n.jsx)(tz.Z,{name:"audioCodecType",value:e,onChange:e=>{g(e.target.value,d.o1)&&a(et(e.target.value))},disabled:t,children:d.o1.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},aX=()=>{let e=tm(e=>e.audioContentHint),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"audioContentHint",children:[(0,n.jsx)(ad,{kind:"audioContentHint",children:"audioContentHint:"}),(0,n.jsx)(tz.Z,{name:"audioContentHint",value:e,onChange:e=>{g(e.target.value,d.nT)&&t(ea(e.target.value))},children:d.nT.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})};var a$=a(1181);let aY=e=>{let{children:t,kind:a,checked:i,onChange:s,disabled:o}=e,l=d.x$[a];return l?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(a$.Z,{type:"switch",checked:i,onChange:s,disabled:o}),(0,n.jsx)(ar.Z,{placement:"top",overlay:(0,n.jsx)(ac.Z,{id:"popover-basic",children:(0,n.jsx)(ac.Z.Body,{style:{whiteSpace:"pre-wrap"},children:l.description})}),children:(0,n.jsx)(tR.Z,{children:t})})]}):(console.warn('Could not load description "'.concat(a,'"')),(0,n.jsx)(tR.Z,{children:t}))},a0=()=>{let e=tm(e=>e.audio),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"audio",children:(0,n.jsx)(aY,{kind:"audio",checked:e,onChange:e=>{a(Y(e.target.checked))},disabled:t,children:"audio"})})},a1=()=>{let e=tm(e=>e.audioInput),t=tm(e=>e.audioInputDevices),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"audioInput",children:[(0,n.jsx)(ad,{kind:"audioInput",children:"audioInput:"}),(0,n.jsxs)(tz.Z,{name:"audioInput",value:e,onChange:e=>{a(en(e.target.value)),a(E())},disabled:0===t.length,children:[(0,n.jsx)("option",{value:"",children:"未指定"}),t.map(e=>(0,n.jsx)("option",{value:e.deviceId,children:e.label},e.deviceId))]})]})},a2=()=>{let e=tm(e=>e.audioOutput),t=tm(e=>e.audioOutputDevices),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"audioOutput",children:[(0,n.jsx)(ad,{kind:"audioOutput",children:"audioOutput:"}),(0,n.jsxs)(tz.Z,{name:"audioOutput",value:e,onChange:e=>{a(ei(e.target.value))},disabled:0===t.length,children:[(0,n.jsx)("option",{value:"",children:"未指定"}),t.map(e=>(0,n.jsx)("option",{value:e.deviceId,children:e.label},e.deviceId))]})]})},a5=()=>{let e=tm(e=>e.enabledAudioStreamingLanguageCode),t=tm(e=>e.audioStreamingLanguageCode),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledAudioStreamingLanguageCode",children:(0,n.jsx)(aY,{kind:"audioStreamingLanguageCode",checked:e,onChange:e=>{i(eP(e.target.checked))},disabled:a,children:"audioStreamingLanguageCode"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"audioStreamingLanguageCode",children:(0,n.jsx)(tZ.Z,{className:"flex-fill w-500",type:"text",placeholder:"audioStreamingLanguageCodeを指定",value:t,onChange:e=>{i(eM(e.target.value))},disabled:a})})})}):null]})},a4=()=>{let e=tm(e=>e.audioTrack),t=tu();return(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"audioTrack",children:(0,n.jsx)(aY,{kind:"audioTrack",checked:e,onChange:e=>{t(es(e.target.checked))},disabled:!1,children:"Enable audio track"})})},a6=()=>{let e=tm(e=>e.autoGainControl),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"autoGainControl",children:[(0,n.jsx)(ad,{kind:"autoGainControl",children:"autoGainControl:"}),(0,n.jsx)(tz.Z,{name:"autoGainControl",value:e,onChange:e=>{g(e.target.value,d.iN)&&t(eo(e.target.value))},children:d.iN.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},a9=()=>{let e=tm(e=>e.blurRadius),t=tm(e=>e.mediaType),a=tu(),i="getUserMedia"!==t;return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"blurRadius",children:[(0,n.jsx)(ad,{kind:"blurRadius",children:"blurRadius:"}),(0,n.jsx)(tz.Z,{value:e,onChange:e=>{g(e.target.value,d.G_)&&a(el(e.target.value))},disabled:i,children:d.G_.map(e=>(0,n.jsx)("option",{suppressHydrationWarning:!0,value:e,children:""===e||i?"未指定":e},e))})]})},a3=()=>{let e=tm(e=>e.enabledBundleId),t=tm(e=>e.bundleId),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledBundleId",children:(0,n.jsx)(aY,{kind:"bundleId",checked:e,onChange:e=>{i(ef(e.target.checked))},disabled:a,children:"bundleId"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"bundleId",children:(0,n.jsx)(tZ.Z,{className:"flex-fill w-500",type:"text",placeholder:"bundleIdを指定",value:t,onChange:e=>{i(er(e.target.value))},disabled:a})})})}):null]})},a8=()=>{let e=tm(e=>e.cameraDevice),t=tm(e=>e.soraContents.connectionStatus),a=tm(e=>e.soraContents.sora),i=tm(e=>e.video),s=!(a&&"connected"===t?a.video:i),o=tu();return(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"cameraDevice",children:(0,n.jsx)(aY,{kind:"cameraDevice",checked:e,onChange:e=>{o(J(e.target.checked))},disabled:s,children:"Enable camera device"})})},a7=()=>{let e=tm(e=>e.channelId),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"channelId",children:[(0,n.jsx)(ad,{kind:"channelId",children:"channelId:"}),(0,n.jsx)(tZ.Z,{type:"text",placeholder:"ChannelIdを指定",value:e,onChange:e=>{a(ec(e.target.value))},disabled:t})]})},ne=()=>{let e=tm(e=>e.enabledClientId),t=tm(e=>e.clientId),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledClientId",children:(0,n.jsx)(aY,{kind:"clientId",checked:e,onChange:e=>{i(eC(e.target.checked))},disabled:a,children:"clientId"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"clientId",children:(0,n.jsx)(tZ.Z,{className:"flex-fill w-500",type:"text",placeholder:"ClientIdを指定",value:t,onChange:e=>{i(ed(e.target.value))},disabled:a})})})}):null]})},nt=()=>{let e=tm(e=>e.soraContents.connectionStatus),t=tu();return(0,n.jsx)("div",{className:"col-auto mb-1",children:(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"connect",defaultValue:"connect",onClick:()=>{t(O())},disabled:"disconnecting"===e||"connecting"===e||"initializing"===e})})},na=e=>{let t=tm(e=>e.ignoreDisconnectWebSocket),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"ignoreDisconnectWebSocket",children:[(0,n.jsx)(ad,{kind:"ignoreDisconnectWebSocket",children:"ignoreDisconnectWebSocket:"}),(0,n.jsx)(tz.Z,{name:"ignoreDisconnectWebSocket",value:t,onChange:e=>{g(e.target.value,d.kt)&&a(eF(e.target.value))},disabled:e.disabled,children:d.kt.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nn=e=>{let t=tm(e=>e.dataChannelSignaling),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"dataChannelSignaling",children:[(0,n.jsx)(ad,{kind:"dataChannelSignaling",children:"dataChannelSignaling:"}),(0,n.jsx)(tz.Z,{name:"dataChannelSignaling",value:t,onChange:e=>{g(e.target.value,d.l9)&&a(em(e.target.value))},disabled:e.disabled,children:d.l9.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},ni=()=>{let e=tm(e=>e.enabledDataChannel),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledDataChannel",children:(0,n.jsx)(a$.Z,{type:"switch",name:"enabledDataChannel",label:"dataChannel",checked:e,onChange:e=>{a(eS(e.target.checked))},disabled:t})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsxs)(aa.Z,{xs:"auto",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(nn,{disabled:t})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(na,{disabled:t})})]})})}):null]})},ns=()=>{let e=tm(e=>e.enabledDataChannels),t=tm(e=>e.dataChannels),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu(),s=JSON.stringify([{label:"#devtools",maxPacketLifeTime:10,ordered:!0,compress:!1,direction:"sendrecv"}],null,2);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledDataChannels",children:(0,n.jsx)(aY,{kind:"dataChannels",checked:e,onChange:e=>{i(eb(e.target.checked))},disabled:a,children:"dataChannels"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsxs)(tI.Z,{className:"form-inline position-relative",controlId:"dataChannels",children:[(0,n.jsx)(tZ.Z,{className:"flex-fill",as:"textarea",placeholder:"dataChannelsを指定\n(例)\n".concat(s),value:t,onChange:e=>{i(eu(e.target.value))},rows:12,cols:100,disabled:a}),(0,n.jsx)(tG.Z,{className:"btn-load-template",type:"button",variant:"outline-secondary",size:"sm",onClick:()=>i(eu(s)),children:"load template"})]})})}):null]})},no=()=>{let e=tm(e=>e.soraContents.connectionStatus),t=tu();return(0,n.jsx)("div",{className:"col-auto mb-1",children:(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"disconnect",defaultValue:"disconnect",onClick:()=>{t(B())},disabled:"disconnecting"===e||"connecting"===e||"initializing"===e})})};var nl=a(9297),nr=a(1990),nc=a(9488),nd=a(3744);let nu=[{label:"未指定",value:""},{label:"144p",value:"256x144"},{label:"240p",value:"320x240"},{label:"360p",value:"640x360"},{label:"480p",value:"720x480"},{label:"540p",value:"960x540"},{label:"720p",value:"1280x720"},{label:"1080p",value:"1920x1080"},{label:"1440p",value:"2560x1440"},{label:"2160p",value:"3840x2160"}],nm=e=>{let{label:t,value:a}=e,i=tu();return(0,n.jsxs)(nl.Z.Item,{as:"button",onClick:()=>i(ev(a)),children:[t," ",""!==a&&"(".concat(a,")")]})},ng=()=>{let e=tm(e=>e.displayResolution),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"displayResolution",children:[(0,n.jsx)(ad,{kind:"displayResolution",children:"displayResolution:"}),(0,n.jsxs)(nr.Z,{children:[(0,n.jsx)(nc.Z.Control,{className:"form-display-resolution",type:"text",value:e,onChange:e=>{t(ev(e.target.value))},placeholder:"未指定"}),(0,n.jsx)(nd.Z,{variant:"outline-secondary form-template-dropdown",title:"",align:"end",children:nu.map(e=>{let{label:t,value:a}=e;return(0,n.jsx)(nm,{label:t,value:a},a)})})]})]})},nh=()=>{let e=tu(),t=tm(e=>e.soraContents.connectionStatus),a=tm(e=>e.soraContents.sora),i="recvonly"===tm(e=>e.role)||null!==a||y(t);return(0,n.jsx)("div",{className:"col-auto mb-1",children:(0,n.jsx)("input",{className:"btn btn-outline-secondary",type:"button",name:"media_access",defaultValue:"dispose media",onClick:()=>{e(F())},disabled:i})})};var np=a(1985);let nv=()=>{let[e,t]=(0,i.useState)(!1),a=tm(e=>e.e2ee),s=y(tm(e=>e.soraContents.connectionStatus)),o=tu();return(0,i.useEffect)(()=>{a&&t(!1)},[a]),(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"e2ee",children:[(0,n.jsx)(aY,{kind:"e2ee",checked:a,onChange:e=>{e.target.checked&&t(!0),o(_(e.target.checked))},disabled:s,children:"e2ee"}),e?(0,n.jsx)(np.Z,{className:"spinner-status",variant:"primary",animation:"border",role:"status"}):null]})})})},nx=()=>{let e=tm(e=>e.echoCancellation),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"echoCancellation",children:[(0,n.jsx)(ad,{kind:"echoCancellation",children:"echoCancellation:"}),(0,n.jsx)(tz.Z,{name:"echoCancellation",value:e,onChange:e=>{g(e.target.value,d.PS)&&t(ex(e.target.value))},children:d.PS.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nj=()=>{let e=tm(e=>e.echoCancellationType),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"echoCancellationType",children:[(0,n.jsx)(ad,{kind:"echoCancellationType",children:"echoCancellationType:"}),(0,n.jsx)(tz.Z,{name:"echoCancellationType",value:e,onChange:e=>{g(e.target.value,d.cJ)&&t(ej(e.target.value))},children:d.cJ.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nf=()=>{let e=tm(e=>e.facingMode),t=tm(e=>e.mediaType),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"facingMode",children:[(0,n.jsx)(ad,{kind:"facingMode",children:"facingMode:"}),(0,n.jsx)(tz.Z,{name:"facingMode",value:e,onChange:e=>{g(e.target.value,d.pT)&&a(eD(e.target.value))},disabled:"getUserMedia"!==t,children:d.pT.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nC=()=>{let e=tm(e=>e.mediaType),t=tm(e=>e.fakeVolume),a=tu();return"fakeMedia"!==e?null:(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"fakeVolume",children:[(0,n.jsx)(ad,{kind:"fakeVolume",children:"fakeVolume:"}),(0,n.jsx)(nc.Z.Range,{min:"0",max:"1",step:"0.25",value:t,onChange:e=>{a(eV(e.target.value))}})]})},nb=()=>{let e=tm(e=>e.enabledForwardingFilter),t=tm(e=>e.forwardingFilter),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledForwardingFilter",children:(0,n.jsx)(aY,{kind:"forwardingFilter",checked:e,onChange:e=>{i(ey(e.target.checked))},disabled:a,children:"forwardingFilter"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"forwardingFilter",children:(0,n.jsx)(tZ.Z,{className:"flex-fill",as:"textarea",placeholder:"forwardingFilterを指定",value:t,onChange:e=>{i(eY(e.target.value))},rows:10,cols:100,disabled:a})})})}):null]})},nS=[{label:"未指定",value:""},{label:"60",value:"60"},{label:"30",value:"30"},{label:"24",value:"24"},{label:"20",value:"20"},{label:"15",value:"15"},{label:"10",value:"10"},{label:"5",value:"5"}],ny=e=>{let{label:t,value:a}=e,i=tu();return(0,n.jsx)(nl.Z.Item,{as:"button",onClick:()=>i(eA(a)),children:t})},nN=()=>{let e=tm(e=>e.frameRate),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"frameRate",children:[(0,n.jsx)(ad,{kind:"frameRate",children:"frameRate:"}),(0,n.jsxs)(nr.Z,{children:[(0,n.jsx)(nc.Z.Control,{className:"form-frame-rate",type:"text",value:e,onChange:e=>{t(eA(e.target.value))},placeholder:"未指定"}),(0,n.jsx)(nd.Z,{variant:"outline-secondary form-template-dropdown",title:"",align:"end",children:nS.map(e=>{let{label:t,value:a}=e;return(0,n.jsx)(ny,{label:t,value:a},a)})})]})]})},nk=()=>{let e=tm(e=>e.lightAdjustment),t=tm(e=>e.mediaType),a=tu(),i="getUserMedia"!==t;return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"lightAdjustment",children:[(0,n.jsx)(ad,{kind:"lightAdjustment",children:"lightAdjustment:"}),(0,n.jsx)(tz.Z,{value:e,onChange:e=>{g(e.target.value,d.Xv)&&a(eO(e.target.value))},disabled:i,children:d.Xv.map(e=>(0,n.jsx)("option",{suppressHydrationWarning:!0,value:e,children:""===e||i?"未指定":e},e))})]})},nT=()=>{let e=tm(e=>e.mediaProcessorsNoiseSuppression),t=tm(e=>e.mediaType),a=tu();return(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"mediaProcessorsNoiseSuppression",children:(0,n.jsx)(aY,{kind:"mediaProcessorsNoiseSuppression",checked:e,onChange:e=>{a(eU(e.target.checked))},disabled:"getUserMedia"!==t,children:"mediaProcessorsNoiseSuppression"})})},nw=()=>{let e=tm(e=>e.mediaStats),t=tu();return(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"mediaStats",children:(0,n.jsx)(aY,{kind:"mediaStats",checked:e,onChange:e=>{t(eE(e.target.checked))},disabled:!1,children:"Show media stats"})})},nI=e=>{let{label:t,disabled:a,onChange:i,mediaType:s}=e;return(0,n.jsx)(a$.Z,{type:"radio",inline:!0,id:t,label:t,value:t,checked:s===t,onChange:i,disabled:a})},nR=()=>{let[e,t]=(0,i.useState)(!1),a=void 0!==window.CropTarget,s=tm(e=>e.soraContents.connectionStatus),o=tm(e=>e.soraContents.localMediaStream),l=tm(e=>e.mediaType),r=null!==o||y(s),c=tu(),u=e=>{g(e.target.value,d.w_)&&c(e_(e.target.value))};return(0,i.useEffect)(()=>{t(!0)},[]),(0,n.jsxs)(tI.Z,{className:"form-inline flex-wrap",children:[(0,n.jsx)(ad,{kind:"mediaType",children:"mediaType:"}),(0,n.jsx)(nI,{label:"getUserMedia",mediaType:l,disabled:r,onChange:u}),(0,n.jsx)(nI,{label:"getDisplayMedia",mediaType:l,disabled:r,onChange:u}),(0,n.jsx)(nI,{label:"fakeMedia",mediaType:l,disabled:r,onChange:u}),e&&(0,n.jsx)(nI,{label:"mediacaptureRegion",mediaType:l,disabled:r||!a,onChange:u})]})},nZ=()=>{let e=tm(e=>e.enabledMetadata),t=tm(e=>e.metadata),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledMetadata",children:(0,n.jsx)(aY,{kind:"metadata",checked:e,onChange:e=>{i(eN(e.target.checked))},disabled:a,children:"metadata"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"metadata",children:(0,n.jsx)(tZ.Z,{className:"flex-fill",as:"textarea",placeholder:"Metadataを指定",value:t,onChange:e=>{i(eL(e.target.value))},rows:10,cols:100,disabled:a})})})}):null]})},nM=()=>{let e=tm(e=>e.micDevice),t=tm(e=>e.soraContents.connectionStatus),a=tm(e=>e.soraContents.sora),i=tm(e=>e.audio),s=!(a&&"connected"===t?a.audio:i),o=tu();return(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"micDevice",children:(0,n.jsx)(aY,{kind:"micDevice",checked:e,onChange:e=>{o(L(e.target.checked))},disabled:s,children:"Enable mic device"})})},nP=()=>{let e=tm(e=>e.multistream),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"multistream",children:[(0,n.jsx)(ad,{kind:"multistream",children:"multistream:"}),(0,n.jsx)(tz.Z,{name:"multistream",value:e,onChange:e=>{g(e.target.value,d.u9)&&a(eJ(e.target.value))},disabled:t,children:d.u9.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nV=()=>{let e=tm(e=>e.noiseSuppression),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"noiseSuppression",children:[(0,n.jsx)(ad,{kind:"noiseSuppression",children:"noiseSuppression:"}),(0,n.jsx)(tz.Z,{name:"noiseSuppression",value:e,onChange:e=>{g(e.target.value,d.ad)&&t(ez(e.target.value))},children:d.ad.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nD=()=>{let e=tm(e=>e.reconnect),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"reconnect",children:(0,n.jsx)(aY,{kind:"reconnect",checked:e,onChange:e=>{a(eW(e.target.checked))},disabled:t,children:"reconnect"})})})})},nA=()=>{let e=tu();return(0,n.jsx)("div",{className:"col-auto mb-1",children:(0,n.jsx)("input",{className:"btn btn-outline-secondary",type:"button",name:"update-devices",defaultValue:"update-devices",onClick:()=>{e(U())}})})},nF=()=>{let e=tu(),t=tm(e=>e.soraContents.connectionStatus),a=tm(e=>e.soraContents.sora),i="recvonly"===tm(e=>e.role)||null!==a||y(t);return(0,n.jsx)("div",{className:"col-auto mb-1",children:(0,n.jsx)("input",{className:"btn btn-outline-secondary",type:"button",name:"media_access",defaultValue:"request media",onClick:()=>{e(A())},disabled:i})})},nO=()=>{let e=tm(e=>e.resizeMode),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"resizeMode",children:[(0,n.jsx)(ad,{kind:"resizeMode",children:"resizeMode:"}),(0,n.jsx)(tz.Z,{name:"resizeMode",value:e,onChange:e=>{g(e.target.value,d.L4)&&t(eK(e.target.value))},children:d.L4.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nH=[{label:"未指定",value:""},{label:"144p",value:"256x144"},{label:"240p",value:"320x240"},{label:"360p",value:"640x360"},{label:"480p",value:"720x480"},{label:"540p",value:"960x540"},{label:"720p",value:"1280x720"},{label:"1080p",value:"1920x1080"},{label:"1440p",value:"2560x1440"},{label:"2160p",value:"3840x2160"}],nB=e=>{let{label:t,value:a}=e,i=tu();return(0,n.jsxs)(nl.Z.Item,{as:"button",onClick:()=>i(eQ(a)),children:[t," ",""!==a&&"(".concat(a,")")]})},nU=()=>{let e=tm(e=>e.resolution),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"resolution",children:[(0,n.jsx)(ad,{kind:"resolution",children:"resolution:"}),(0,n.jsxs)(nr.Z,{children:[(0,n.jsx)(nc.Z.Control,{className:"form-resolution",type:"text",value:e,onChange:e=>{t(eQ(e.target.value))},placeholder:"未指定"}),(0,n.jsx)(nd.Z,{variant:"outline-secondary form-template-dropdown",title:"",align:"end",children:nH.map(e=>{let{label:t,value:a}=e;return(0,n.jsx)(nB,{label:t,value:a},a)})})]})]})},nE=()=>{let e=tm(e=>e.role),t=tm(e=>e.soraContents.connectionStatus),a=null!==tm(e=>e.soraContents.localMediaStream)||y(t),i=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"role",children:[(0,n.jsx)(ad,{kind:"role",children:"role:"}),(0,n.jsx)(tz.Z,{name:"role",value:e,onChange:e=>{g(e.target.value,d.K$)&&i(eq(e.target.value))},disabled:a,children:d.K$.map(e=>(0,n.jsx)("option",{value:e,children:e},e))})]})},n_=()=>{let e=tm(e=>e.enabledSignalingNotifyMetadata),t=tm(e=>e.signalingNotifyMetadata),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledSignalingNotifyMetadata",children:(0,n.jsx)(aY,{kind:"signalingNotifyMetadata",checked:e,onChange:e=>{i(ek(e.target.checked))},disabled:a,children:"signalingNotifyMetadata"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"signalingNotifyMetadata",children:(0,n.jsx)(tZ.Z,{className:"flex-fill",as:"textarea",placeholder:"signalingNotifyMetadataを指定",value:t,onChange:e=>{i(eX(e.target.value))},rows:10,cols:100,disabled:a})})})}):null]})},nL=()=>{let e=tm(e=>e.enabledSignalingUrlCandidates),t=tm(e=>e.signalingUrlCandidates),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",xs:"auto",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledSignalingUrlCandidates",children:(0,n.jsx)(aY,{kind:"signalingUrlCandidates",checked:e,onChange:e=>{i(eT(e.target.checked))},disabled:a,children:"signalingUrlCandidates"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",xs:"auto",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"signalingNotifyMetadata",children:(0,n.jsx)(tZ.Z,{className:"flex-fill",as:"textarea",placeholder:"signalingUrlCandidatesを指定\n(例)\nwss://sora0.example.com/signaling\nwss://sora1.example.com/signaling\n",value:t.join("\n"),onChange:e=>{i(e$(e.target.value.split("\n")))},rows:5,cols:100,disabled:a})})})}):null]})},nJ=()=>{let e=tm(e=>e.simulcast),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"simulcast",children:[(0,n.jsx)(ad,{kind:"simulcast",children:"simulcast:"}),(0,n.jsx)(tz.Z,{name:"simulcast",value:e,onChange:e=>{g(e.target.value,d.VE)&&a(e0(e.target.value))},disabled:t,children:d.VE.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nz=()=>{let e=tm(e=>e.simulcastRid),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"simulcastRid",children:[(0,n.jsx)(ad,{kind:"simulcastRid",children:"simulcastRid:"}),(0,n.jsx)(tz.Z,{name:"simulcastRid",value:e,onChange:e=>{g(e.target.value,d.WJ)&&a(e1(e.target.value))},disabled:t,children:d.WJ.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nG=()=>{let e=tm(e=>e.spotlightFocusRid),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"spotlightFocusRid",children:[(0,n.jsx)(ad,{kind:"spotlightFocusRid",children:"spotlightFocusRid:"}),(0,n.jsx)(tz.Z,{value:e,onChange:e=>{g(e.target.value,d.I7)&&a(e3(e.target.value))},disabled:t,children:d.I7.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nW=()=>{let e=tm(e=>e.spotlight),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"spotlight",children:[(0,n.jsx)(ad,{kind:"spotlight",children:"spotlight:"}),(0,n.jsx)(tz.Z,{name:"spotlight",value:e,onChange:e=>{g(e.target.value,d.VJ)&&a(e9(e.target.value))},disabled:t,children:d.VJ.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nK=()=>{let e=tm(e=>e.spotlightNumber),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"spotlightNumber",children:[(0,n.jsx)(ad,{kind:"spotlightNumber",children:"spotlightNumber:"}),(0,n.jsx)(tz.Z,{value:e,onChange:e=>{g(e.target.value,d.Xr)&&a(e8(e.target.value))},disabled:t,children:d.Xr.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nq=()=>{let e=tm(e=>e.spotlightUnfocusRid),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"spotlightUnfocusRid",children:[(0,n.jsx)(ad,{kind:"spotlightUnfocusRid",children:"spotlightUnfocusRid:"}),(0,n.jsx)(tz.Z,{value:e,onChange:e=>{g(e.target.value,d.I7)&&a(e7(e.target.value))},disabled:t,children:d.I7.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},nQ=()=>{let e=tm(e=>e.channelId),t=tm(e=>e.soraContents.connectionStatus),a=tm(e=>e.apiUrl),i=tu(),s=async()=>{try{let t=await ap(a,"20231220","StartRecording",{channel_id:e,expire_time:3600});i(X("POST successed. response: ".concat(JSON.stringify(t))))}catch(e){e instanceof Error&&i(Q(e.message))}};return(0,n.jsx)("div",{className:"col-auto mb-1",children:(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"startRec",defaultValue:"start rec",onClick:s,disabled:"initializing"===t})})},nX=()=>{let e=tm(e=>e.channelId),t=tm(e=>e.soraContents.connectionStatus),a=tm(e=>e.apiUrl),i=tu(),s=async()=>{try{let t=await ap(a,"20231220","StopRecording",{channel_id:e});i(X("POST successed. response: ".concat(JSON.stringify(t))))}catch(e){e instanceof Error&&i(Q(e.message))}};return(0,n.jsx)("div",{className:"col-auto mb-1",children:(0,n.jsx)("input",{className:"btn btn-secondary",type:"button",name:"stopRec",defaultValue:"stop rec",onClick:s,disabled:"initializing"===t})})},n$=()=>{let e=tu();return(0,n.jsx)("div",{className:"col-auto mb-1",children:(0,n.jsx)("input",{className:"btn btn-outline-secondary",type:"button",name:"update-mediastream",defaultValue:"update-mediastream",onClick:()=>{e(E())}})})},nY=()=>{let e=tm(e=>e.enabledVideoAV1Params),t=tm(e=>e.videoAV1Params),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledVideoAV1Params",children:(0,n.jsx)(aY,{kind:"videoAV1Params",checked:e,onChange:e=>{i(eZ(e.target.checked))},disabled:a,children:"videoAV1Params"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"videoAV1Params",children:(0,n.jsx)(tZ.Z,{className:"flex-fill",as:"textarea",placeholder:"videoAV1Paramsを指定",value:t,onChange:e=>{i(tc(e.target.value))},rows:10,cols:100,disabled:a})})})}):null]})},n0=d.Q5.slice();n0.splice(d.Q5.indexOf("15000")+1,0,"support-message");let n1=()=>{let e=tm(e=>e.videoBitRate),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"videoBitRate",children:[(0,n.jsx)(ad,{kind:"videoBitRate",children:"videoBitRate:"}),(0,n.jsx)(tz.Z,{name:"videoBitRate",value:e,onChange:e=>{g(e.target.value,d.Q5)&&a(tt(e.target.value))},disabled:t,children:n0.map(e=>{let t=e;return""===e?t="未指定":"support-message"===e&&(t="以下はサポート外です"),(0,n.jsx)("option",{value:e,disabled:"support-message"===e,children:t},e)})})]})},n2=()=>{let e=tm(e=>e.videoCodecType),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"videoCodecType",children:[(0,n.jsx)(ad,{kind:"videoCodecType",children:"videoCodecType:"}),(0,n.jsx)(tz.Z,{name:"videoCodecType",value:e,onChange:e=>{g(e.target.value,d.Sh)&&a(ta(e.target.value))},disabled:t,children:d.Sh.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},n5=()=>{let e=tm(e=>e.videoContentHint),t=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"videoContentHint",children:[(0,n.jsx)(ad,{kind:"videoContentHint",children:"videoContentHint:"}),(0,n.jsx)(tz.Z,{name:"videoContentHint",value:e,onChange:e=>{g(e.target.value,d.QO)&&t(tn(e.target.value))},children:d.QO.map(e=>(0,n.jsx)("option",{value:e,children:""===e?"未指定":e},e))})]})},n4=()=>{let e=tm(e=>e.video),t=y(tm(e=>e.soraContents.connectionStatus)),a=tu();return(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"video",children:(0,n.jsx)(aY,{kind:"video",checked:e,onChange:e=>{a(te(e.target.checked))},disabled:t,children:"video"})})},n6=()=>{let e=tm(e=>e.enabledVideoH264Params),t=tm(e=>e.videoH264Params),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledVideoH264Params",children:(0,n.jsx)(aY,{kind:"videoH264Params",checked:e,onChange:e=>{i(eI(e.target.checked))},disabled:a,children:"videoH264Params"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"videoH264Params",children:(0,n.jsx)(tZ.Z,{className:"flex-fill",as:"textarea",placeholder:"videoH264Paramsを指定",value:t,onChange:e=>{i(tl(e.target.value))},rows:10,cols:100,disabled:a})})})}):null]})},n9=()=>{let e=tm(e=>e.enabledVideoH265Params),t=tm(e=>e.videoH265Params),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledVideoH265Params",children:(0,n.jsx)(aY,{kind:"videoH265Params",checked:e,onChange:e=>{i(eR(e.target.checked))},disabled:a,children:"videoH265Params"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"videoH265Params",children:(0,n.jsx)(tZ.Z,{className:"flex-fill",as:"textarea",placeholder:"videoH265Paramsを指定",value:t,onChange:e=>{i(tr(e.target.value))},rows:10,cols:100,disabled:a})})})}):null]})},n3=()=>{let e=tm(e=>e.videoInput),t=tm(e=>e.videoInputDevices),a=tu();return(0,n.jsxs)(tI.Z,{className:"form-inline",controlId:"videoInput",children:[(0,n.jsx)(ad,{kind:"videoInput",children:"videoInput:"}),(0,n.jsxs)(tz.Z,{name:"videoInput",value:e,onChange:e=>{a(ti(e.target.value)),a(E())},disabled:0===t.length,children:[(0,n.jsx)("option",{value:"",children:"未指定"}),t.map(e=>(0,n.jsx)("option",{value:e.deviceId,children:e.label},e.deviceId))]})]})},n8=()=>{let e=tm(e=>e.videoTrack),t=tu();return(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"videoTrack",children:(0,n.jsx)(aY,{kind:"videoTrack",checked:e,onChange:e=>{t(ts(e.target.checked))},disabled:!1,children:"Enable video track"})})},n7=()=>{let e=tm(e=>e.enabledVideoVP9Params),t=tm(e=>e.videoVP9Params),a=y(tm(e=>e.soraContents.connectionStatus)),i=tu();return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"enabledVideoVP9Params",children:(0,n.jsx)(aY,{kind:"videoVP9Params",checked:e,onChange:e=>{i(ew(e.target.checked))},disabled:a,children:"videoVP9Params"})})})}),e?(0,n.jsx)(aa.Z,{className:"form-row",children:(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(tI.Z,{className:"form-inline",controlId:"videoVP9Params",children:(0,n.jsx)(tZ.Z,{className:"flex-fill",as:"textarea",placeholder:"videoVP9Paramsを指定",value:t,onChange:e=>{i(to(e.target.value))},rows:10,cols:100,disabled:a})})})}):null]})},ie=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",xs:"auto",children:(0,n.jsx)(an.Z,{xs:"12",sm:"12",className:"form-channel-id",children:(0,n.jsx)(a7,{})})}),(0,n.jsxs)(aa.Z,{className:"form-row",xs:"auto",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(nE,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(nP,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(nJ,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(nW,{})})]})]}),it=()=>{let e=tm(e=>e.role),t=tm(e=>e.multistream),a=!("recvonly"===e&&("true"===t||""===t));return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(aa.Z,{className:"form-row",xs:"auto",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(a0,{})}),a&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(aQ,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(aq,{})})]})]}),(0,n.jsxs)(aa.Z,{className:"form-row",xs:"auto",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(n4,{})}),a&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(n2,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(n1,{})})]})]})]})},ia=()=>"true"!==tm(e=>e.simulcast)?null:(0,n.jsx)(aa.Z,{className:"form-row",xs:"auto",children:(0,n.jsx)(an.Z,{children:(0,n.jsx)(nz,{})})}),ii=()=>"true"!==tm(e=>e.spotlight)?null:(0,n.jsxs)(aa.Z,{className:"form-row",xs:"auto",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(nK,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(nG,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(nq,{})})]}),is=()=>{let[e,t]=(0,i.useState)(!0),a=tm(e=>e.e2ee),s=tm(e=>e.enabledBundleId),o=tm(e=>e.enabledClientId),l=tm(e=>e.enabledDataChannel),r=tm(e=>e.enabledDataChannels),c=tm(e=>e.enabledForwardingFilter),d=tm(e=>e.enabledMetadata),u=[a,s,o,l,r,c,d,tm(e=>e.enabledSignalingNotifyMetadata),tm(e=>e.enabledSignalingUrlCandidates),tm(e=>e.reconnect)].some(e=>e),m=["btn-collapse-options"];return e&&m.push("collapsed"),u&&m.push("fw-bold"),(0,n.jsxs)(aa.Z,{className:"form-row",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)("a",{href:"#",className:m.join(" "),onClick:a=>{a.preventDefault(),t(!e)},children:"Signaling options"})}),(0,n.jsx)(tp.Z,{in:!e,children:(0,n.jsxs)("div",{children:[(0,n.jsx)(nv,{}),(0,n.jsx)(nD,{}),(0,n.jsx)(ne,{}),(0,n.jsx)(nZ,{}),(0,n.jsx)(a3,{}),(0,n.jsx)(n_,{}),(0,n.jsx)(nL,{}),(0,n.jsx)(nb,{}),(0,n.jsx)(ns,{}),(0,n.jsx)(ni,{})]})})]})},io=()=>{let[e,t]=(0,i.useState)(!0),a=tm(e=>e.enabledAudioStreamingLanguageCode),s=tm(e=>e.enabledVideoVP9Params),o=[a,s,tm(e=>e.enabledVideoH264Params),tm(e=>e.enabledVideoH265Params),tm(e=>e.enabledVideoAV1Params)].some(e=>e),l=["btn-collapse-options"];return e&&l.push("collapsed"),o&&l.push("fw-bold"),(0,n.jsxs)(aa.Z,{className:"form-row",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)("a",{href:"#",className:l.join(" "),onClick:a=>{a.preventDefault(),t(!e)},children:"Advanced signaling options"})}),(0,n.jsx)(tp.Z,{in:!e,children:(0,n.jsxs)("div",{children:[(0,n.jsx)(a5,{}),(0,n.jsx)(n7,{}),(0,n.jsx)(nY,{}),(0,n.jsx)(n6,{}),(0,n.jsx)(n9,{})]})})]})},il=()=>(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{xs:"auto",className:"form-row",children:(0,n.jsx)(an.Z,{children:(0,n.jsx)(nR,{})})}),(0,n.jsx)(aa.Z,{xs:"auto",className:"form-row",children:(0,n.jsx)(an.Z,{children:(0,n.jsx)(nC,{})})})]}),ir=()=>{let[e,t]=(0,i.useState)(!0),a=tm(e=>e.audioContentHint),s=tm(e=>e.autoGainControl),o=tm(e=>e.noiseSuppression),l=tm(e=>e.echoCancellation),r=tm(e=>e.echoCancellationType),c=tm(e=>e.videoContentHint),d=tm(e=>e.resolution),u=tm(e=>e.frameRate),m=[""!==a,""!==s,""!==o,""!==l,""!==r,""!==c,""!==d,""!==u,""!==tm(e=>e.blurRadius),""!==tm(e=>e.lightAdjustment),tm(e=>e.mediaProcessorsNoiseSuppression)].some(e=>e),g=["btn-collapse-options"];return e&&g.push("collapsed"),m&&g.push("fw-bold"),(0,n.jsxs)(aa.Z,{className:"form-row",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)("a",{href:"#",className:g.join(" "),onClick:a=>{a.preventDefault(),t(!e)},children:"Media options"})}),(0,n.jsx)(tp.Z,{in:!e,children:(0,n.jsxs)("div",{children:[(0,n.jsxs)(aa.Z,{className:"form-row",children:[(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(aX,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(a6,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(nV,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(nx,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(nj,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(nT,{})})]}),(0,n.jsxs)(aa.Z,{className:"form-row",children:[(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(n5,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(nU,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(nN,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(aK,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(nO,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(a9,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(nk,{})}),(0,n.jsx)(an.Z,{className:"col-auto",children:(0,n.jsx)(nf,{})})]}),(0,n.jsx)(n$,{})]})})]})},ic=()=>{let e=tm(e=>e.role),t=tm(e=>e.mediaType);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(aa.Z,{className:"form-row",xs:"auto",children:"recvonly"!==e&&"getUserMedia"===t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(a1,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(n3,{})})]}):null}),(0,n.jsxs)(aa.Z,{className:"form-row",xs:"auto",children:["sendonly"!==e?(0,n.jsx)(an.Z,{children:(0,n.jsx)(a2,{})}):null,(0,n.jsx)(nA,{}),"recvonly"!==e?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(nF,{}),(0,n.jsx)(nh,{})]}):null]})]})},id=()=>{let e=tm(e=>e.role);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)(aa.Z,{className:"form-row",xs:"auto",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(ng,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(nw,{})})]}),"recvonly"!==e&&(0,n.jsxs)(aa.Z,{className:"form-row",xs:"auto",children:[(0,n.jsx)(an.Z,{children:(0,n.jsx)(nM,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(a8,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(a4,{})}),(0,n.jsx)(an.Z,{children:(0,n.jsx)(n8,{})})]})]})},iu=()=>{let e=tm(e=>e.debug),t=tm(e=>e.role),a=tm(e=>e.multistream);return(0,n.jsxs)("div",{className:e?"col-devtools col-6":"col-devtools col-12",children:[(0,n.jsx)(al,{}),(0,n.jsx)(ie,{}),(0,n.jsx)(ia,{}),(0,n.jsx)(ii,{}),(0,n.jsx)("hr",{className:"hr-form"}),(0,n.jsx)(it,{}),(0,n.jsx)(is,{}),!("recvonly"===t&&("true"===a||""===a))&&(0,n.jsx)(io,{}),(0,n.jsx)("hr",{className:"hr-form"}),"recvonly"!==t?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(il,{}),(0,n.jsx)(ir,{}),(0,n.jsx)("hr",{className:"hr-form"})]}):null,(0,n.jsx)(ic,{}),(0,n.jsx)(id,{}),(0,n.jsx)("hr",{className:"hr-form"}),(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)(nt,{}),(0,n.jsx)(no,{}),(0,n.jsx)(nQ,{}),(0,n.jsx)(nX,{})]}),(0,n.jsx)("hr",{className:"hr-form"}),(0,n.jsx)(aA,{}),"recvonly"===t||"sendrecv"===t?(0,n.jsx)(aW,{}):null]})};var im=a(3892),ig=a(8287);let ih=()=>{let e=tm(e=>e.debug),t=tu();return(0,n.jsx)("div",{children:(0,n.jsx)("button",{type:"button",className:e?"btn btn-footer-debug-mode active":"btn btn-footer-debug-mode",onClick:()=>{t(eg(!e))},children:"debug"})})},ip=()=>{let e=tm(e=>e.version);return(0,n.jsxs)("footer",{children:[(0,n.jsxs)(im.Z,{variant:"dark",bg:"sora",expand:"md",fixed:"bottom",children:[(0,n.jsx)(ig.Z,{className:"me-auto"}),(0,n.jsx)(ig.Z,{children:(0,n.jsxs)(im.Z.Collapse,{id:"navbar-collapse",children:[(0,n.jsxs)("a",{href:"https://github.com/shiguredo/sora-devtools",className:"btn btn-outline-light m-1",children:["GitHub: shiguredo/sora-devtools: ",e]}),(0,n.jsxs)("a",{href:"https://github.com/shiguredo/sora-js-sdk",className:"btn btn-outline-light m-1",children:["GitHub: shiguredo/sora-js-sdk: ",r.Z.version()]})]})})]}),(0,n.jsx)(ih,{})]})};var iv=a(13),ix=a.n(iv);let ij=()=>(0,n.jsx)(ix(),{children:(0,n.jsx)("title",{children:"Sora DevTools"})});var iC=a(5987);let ib=()=>{let e=tu();return(0,n.jsx)("input",{className:"btn btn-light btn-sm ms-1",type:"button",name:"copyUrl",defaultValue:"copy URL",onClick:()=>{e(I())}})},iS=()=>{let e=tm(e=>e.debug),t=tu(),a=["btn","btn-header-debug-mode","btn-sm","ms-1"];return e&&a.push("active"),(0,n.jsx)("input",{className:a.join(" "),type:"button",name:"debug",defaultValue:"debug",onClick:()=>{t(eg(!e))}})};var iy=a(8154);let iN=()=>{let e=(0,i.useRef)(null);return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("input",{className:"btn btn-light btn-sm ms-1",type:"button",name:"downloadReport",defaultValue:"Download report",onClick:()=>{let t=new Blob([JSON.stringify(function(){let e=iy.h.getState(),t={aspectRatio:e.aspectRatio,audio:e.audio,audioBitRate:e.audioBitRate,audioCodecType:e.audioCodecType,audioContentHint:e.audioContentHint,audioInput:e.audioInput,audioInputDevices:e.audioInputDevices,audioOutput:e.audioOutput,audioOutputDevices:e.audioOutputDevices,audioStreamingLanguageCode:e.audioStreamingLanguageCode,audioTrack:e.audioTrack,autoGainControl:e.autoGainControl,bundleId:e.bundleId,cameraDevice:e.cameraDevice,channelId:e.channelId,clientId:e.clientId,dataChannelSignaling:e.dataChannelSignaling,dataChannels:e.dataChannels,debug:e.debug,displayResolution:e.displayResolution,e2ee:e.e2ee,echoCancellation:e.echoCancellation,echoCancellationType:e.echoCancellationType,enabledAudioStreamingLanguageCode:e.enabledAudioStreamingLanguageCode,enabledBundleId:e.enabledBundleId,enabledClientId:e.enabledClientId,enabledDataChannel:e.enabledDataChannel,enabledDataChannels:e.enabledDataChannels,enabledForwardingFilter:e.enabledForwardingFilter,enabledMetadata:e.enabledMetadata,enabledSignalingNotifyMetadata:e.enabledSignalingNotifyMetadata,enabledSignalingUrlCandidates:e.enabledSignalingUrlCandidates,enabledVideoVP9Params:e.enabledVideoVP9Params,enabledVideoH264Params:e.enabledVideoH264Params,enabledVideoH265Params:e.enabledVideoH265Params,enabledVideoAV1Params:e.enabledVideoAV1Params,facingMode:e.facingMode,fakeVolume:e.fakeVolume,forwardingFilter:e.forwardingFilter,frameRate:e.frameRate,googCpuOveruseDetection:e.googCpuOveruseDetection,ignoreDisconnectWebSocket:e.ignoreDisconnectWebSocket,mediaType:e.mediaType,metadata:e.metadata,micDevice:e.micDevice,multistream:e.multistream,noiseSuppression:e.noiseSuppression,reconnect:e.reconnect,resizeMode:e.resizeMode,resolution:e.resolution,mediaStats:e.mediaStats,role:e.role,signalingNotifyMetadata:e.signalingNotifyMetadata,signalingUrlCandidates:e.signalingUrlCandidates,simulcast:e.simulcast,simulcastRid:e.simulcastRid,spotlight:e.spotlight,spotlightFocusRid:e.spotlightFocusRid,spotlightNumber:e.spotlightNumber,spotlightUnfocusRid:e.spotlightUnfocusRid,video:e.video,videoBitRate:e.videoBitRate,videoCodecType:e.videoCodecType,videoContentHint:e.videoContentHint,videoInput:e.videoInput,videoInputDevices:e.videoInputDevices,videoTrack:e.videoTrack,videoVP9Params:e.videoVP9Params,videoH264Params:e.videoH264Params,videoH265Params:e.videoH265Params,videoAV1Params:e.videoAV1Params};return{userAgent:navigator.userAgent,"sora-devtools":e.version,"sora-js-sdk":r.Z.version(),parameters:t,timeline:e.timelineMessages.map(e=>({timestamp:e.timestamp,message:e})),notify:e.notifyMessages,stats:e.soraContents.statsReport}}())],{type:"text/plain"});if(window.URL=window.URL||window.webkitURL,e.current){let a=new Date().toISOString().replaceAll(":","_").replaceAll(".","_");e.current.download="sora-devtools-report-".concat(a,".json"),e.current.href=window.URL.createObjectURL(t),e.current.click()}}}),(0,n.jsx)("a",{ref:e,style:{display:"none"}})]})},ik=()=>{let e=tm(e=>e.soraContents.connectionStatus),t=tm(e=>e.soraContents.turnUrl),a=tm(e=>e.soraContents.sora);return(0,n.jsx)("header",{children:(0,n.jsx)(im.Z,{variant:"dark",bg:"sora",expand:"lg",fixed:"top",children:(0,n.jsxs)(iC.Z,{children:[(0,n.jsx)(im.Z.Brand,{href:"/",children:"Sora DevTools"}),(0,n.jsx)(im.Z.Toggle,{"aria-controls":"navbar-collapse"}),(0,n.jsxs)(im.Z.Collapse,{id:"navbar-collapse",children:[(0,n.jsx)(ig.Z,{className:"me-auto"}),(0,n.jsxs)(ig.Z,{children:[(0,n.jsx)(im.Z.Text,{className:"py-0 my-1 mx-1",children:(0,n.jsx)("p",{className:"navbar-signaling-url border rounded",children:a&&"connected"===e?a.connectedSignalingUrl:"Signaling URL"})}),(0,n.jsx)(im.Z.Text,{className:"py-0 my-1 mx-1",children:(0,n.jsx)("p",{className:"navbar-turn-url border rounded",children:a&&"connected"===e?null!==t?t:"不明":"TURN URL"})}),(0,n.jsx)(im.Z.Text,{className:"py-0 my-1 mx-1",children:(0,n.jsx)(iS,{})}),(0,n.jsx)(im.Z.Text,{className:"py-0 my-1 mx-1",children:(0,n.jsx)(iN,{})}),(0,n.jsx)(im.Z.Text,{className:"py-0 my-1 ms-1",children:(0,n.jsx)(ib,{})})]})]})]})})})};var iT=a(4569),iw=a.n(iT);let iI=()=>{let e=tm(e=>e.mediaType),t={x:100,y:100},[a,s]=(0,i.useState)(t),[o,l]=(0,i.useState)(0);return((0,i.useEffect)(()=>{let e=()=>{if(void 0!==window){var e;l((e=window.innerWidth)<680?e-40:640)}};return window.addEventListener("resize",e),e(),()=>{window.removeEventListener("resize",e)}},[]),"mediacaptureRegion"!==e)?null:(0,n.jsx)(iw(),{position:a,onDrag:(e,t)=>{s({x:t.x,y:t.y})},defaultPosition:t,children:(0,n.jsx)("div",{id:"cropArea",className:"cropArea",style:{width:"".concat(o,"px"),height:"".concat(Math.floor(o/4*3),"px")}})})};var iR=()=>{let e=tu();return(0,i.useEffect)(()=>(e(w()),e(U()),()=>{e(B())}),[e]),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(iI,{}),(0,n.jsx)(ij,{}),(0,n.jsx)(ik,{}),(0,n.jsx)("main",{children:(0,n.jsx)("div",{className:"container",children:(0,n.jsxs)("div",{className:"row",children:[(0,n.jsx)(iu,{}),(0,n.jsx)(at,{})]})})}),(0,n.jsx)(ip,{})]})}}},function(e){e.O(0,[84,753,726,888,774,179],function(){return e(e.s=4047)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/dist/_next/static/sora_devtools/_buildManifest.js b/dist/_next/static/sora_devtools/_buildManifest.js index ec94f3cc..5a1db473 100644 --- a/dist/_next/static/sora_devtools/_buildManifest.js +++ b/dist/_next/static/sora_devtools/_buildManifest.js @@ -1 +1 @@ -self.__BUILD_MANIFEST=function(s){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":[s,"static/chunks/pages/index-6ef1bf3c3fa748aa.js"],"/_error":["static/chunks/pages/_error-d2a2433779266cd3.js"],"/devtools":["static/chunks/bbf08e97-e92398dc34f2ada8.js",s,"static/chunks/726-d012f03df52831fe.js","static/chunks/pages/devtools-7bc173685e1c8bb6.js"],sortedPages:["/","/_app","/_error","/devtools"]}}("static/chunks/753-db4e263ce44c93e4.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file +self.__BUILD_MANIFEST=function(s){return{__rewrites:{afterFiles:[],beforeFiles:[],fallback:[]},"/":[s,"static/chunks/pages/index-6ef1bf3c3fa748aa.js"],"/_error":["static/chunks/pages/_error-d2a2433779266cd3.js"],"/devtools":["static/chunks/bbf08e97-e92398dc34f2ada8.js",s,"static/chunks/726-d012f03df52831fe.js","static/chunks/pages/devtools-e382fa421704869f.js"],sortedPages:["/","/_app","/_error","/devtools"]}}("static/chunks/753-db4e263ce44c93e4.js"),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); \ No newline at end of file diff --git a/dist/devtools.html b/dist/devtools.html index 91d09d9d..1cf8619f 100644 --- a/dist/devtools.html +++ b/dist/devtools.html @@ -1 +1 @@ -Sora DevTools





\ No newline at end of file +Sora DevTools





\ No newline at end of file diff --git a/dist/index.html b/dist/index.html index 560dd395..65dd22ed 100644 --- a/dist/index.html +++ b/dist/index.html @@ -1 +1 @@ -Sora DevTools \ No newline at end of file +Sora DevTools \ No newline at end of file