1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7834],{2726:function(e,t,a){a.d(t,{J5:function(){return u},KV:function(){return c},L:function(){return r},Rn:function(){return b},T2:function(){return o},UH:function(){return s},mj:function(){return i},q7:function(){return l}});let n=["+","x"],r=(e,t)=>"+"===t?"0"===e?1:2:"0"===e?3:4,o=(e,t)=>1===e&&"+"===t?"0":2===e&&"+"===t?"1":3===e&&"x"===t?"0":4===e&&"x"===t?"1":.5>Math.random()?"0":"1",s=e=>{let t=["0","1"],a=[];for(let n=0;n<e;n++)a.push(t[Math.floor(2*Math.random())]);return a},i=e=>{let t=[];for(let a=0;a<e;a++)t.push(n[Math.floor(2*Math.random())]);return t},l=(e,t)=>e.map((e,a)=>r(e,t[a])),c=e=>{let t=e.map(e=>n[Math.floor(2*Math.random())]),a=e.map((e,a)=>o(e,t[a]));return[t,a]},b=e=>{let t=e.map(e=>n[Math.floor(2*Math.random())]);return e.map((e,a)=>r(o(e,t[a]),t[a]))},u=(e,t,a)=>{let n=[];return e.forEach((e,r)=>{t[r]===a[r]&&n.push(e)}),n}},6188:function(e,t,a){a.d(t,{b:function(){return o}});var n=a(5614),r=a(8375);let o=e=>{let{prepared:t}=e,a=n.tZ.getState().pushLines;if("B"===r.Z.getState().playerRole){a(t?[{title:"component.exchange.welcome"},{content:"component.bobExchange.waiting"},{content:"component.bobExchange.photonsArrived"},{title:"component.game.step1",content:"component.bobExchange.choose"}]:[{title:"component.exchange.welcome"},{content:"component.bobExchange.waiting"}]);return}a([{title:"component.exchange.welcome"},{title:"component.game.step1",content:"component.aliceExchange.start"}])}},451:function(e,t,a){a.d(t,{QO:function(){return u},R3:function(){return b},gH:function(){return d},mh:function(){return c},pf:function(){return g},rO:function(){return m},x6:function(){return p}});var n=a(7480),r=a(8375),o=a(6188),s=a(2726);let i="bb84SoloEveRecord",l="bb84GameStartTime",c=e=>{localStorage.setItem(i,JSON.stringify({...e,detected:!1,rounds:1})),localStorage.setItem(l,JSON.stringify(Date.now()))},b=()=>{let e=m();e&&localStorage.setItem(i,JSON.stringify({...e,detected:!0}))},u=()=>{var e;let t=m();t&&localStorage.setItem(i,JSON.stringify({...t,rounds:(null!==(e=t.rounds)&&void 0!==e?e:1)+1}))},m=()=>{try{let e=localStorage.getItem(i);return e?JSON.parse(e):null}catch(e){return null}},p=()=>{try{let e=localStorage.getItem(l);return e?Number(JSON.parse(e)):null}catch(e){return null}},d=(e,t)=>{g(e,t),(0,o.b)({prepared:!0})},g=(e,t)=>{if(localStorage.removeItem("bb84BobBasisInputs"),"B"!==r.Z.getState().playerRole)return;let a=n.Z.getState(),o=(0,s.UH)(e),i=(0,s.mj)(e),l=(0,s.q7)(o,i);t&&(l=(0,s.Rn)(l)),a.setAliceBits(o),a.setAliceBases(i),a.setAlicePhotons(l)}},7834:function(e,t,a){a.d(t,{C:function(){return b}});var n=a(7480),r=a(1336),o=a(5614),s=a(451),i=a(6188),l=a(4108);let c=e=>{let t=localStorage.getItem(e);if(null!==t)try{return JSON.parse(t)}catch(e){return}},b={protocolId:"bb84",gameDataKey:"bb84GameData",playerDataKey:"bb84PlayerData",storageKeys:["bb84PlayerData","bb84PhotonNumber","bb84Step","bb84Tab","bb84GameData","bb84DisplayedLines","bb84ValidationBitsLength","bb84GameHasEve","bb84BobBasisInputs","bb84SoloEveRecord","bb84GameStartTime"],resetRoom:()=>n.Z.getState().resetRoom(),restoreRoom:e=>n.Z.getState().restoreGame(e),resetProgress:()=>o.tZ.getState().resetProgress(),hydrateProgress:o.Ph,hydrateConfig:()=>{let e=r.Z.getState(),t=c("bb84PhotonNumber"),a=c("bb84GameHasEve"),n=c("bb84ValidationBitsLength");"number"==typeof t&&e.setPhotonNumber(t),"boolean"==typeof a&&e.setGameHasEve(a),"number"==typeof n&&e.setValidationBitsLength(n)},getRoomSnapshot:()=>(0,l.m)(n.Z.getState()),round:{getEvePresent:()=>n.Z.getState().evePresent,setEvePresent:e=>n.Z.getState().setEvePresent(e),incrementRoundCount:s.QO,prepareRound:e=>{let{photonNumber:t}=r.Z.getState();(0,s.pf)(t,e)},openRoundTranscript:i.b}}},1336:function(e,t,a){let n=(0,a(9625).Ue)(e=>({gameCode:"",photonNumber:20,validationBitsLength:0,playerCount:0,players:[],gameHasEve:!1,setPhotonNumber:t=>e({photonNumber:t}),setGameCode:t=>e({gameCode:t}),setPlayerCount:t=>e({playerCount:t}),setPlayers:t=>e({players:t}),setGameHasEve:t=>e({gameHasEve:t}),setValidationBitsLength:t=>e({validationBitsLength:t})}));t.Z=n},5614:function(e,t,a){a.d(t,{Ph:function(){return m},tZ:function(){return u}});var n=a(4597),r=a(9625);let o={step:"bb84Step",bb84Tab:"bb84Tab",displayedLines:"bb84DisplayedLines"},s={step:n.G5.EXCHANGE,bb84Tab:"exchange",displayedLines:[]},i=()=>!0,l=(e,t)=>
1{if(!i())return;let a="bb84Tab"===e?String(t):JSON.stringify(t);localStorage.setItem(o[e],a)},c=e=>{i()&&localStorage.removeItem(o[e])},b=e=>{if(!i())return;let t=localStorage.getItem(o[e]);if(null!==t)try{return"bb84Tab"===e?t:JSON.parse(t)}catch(t){console.warn("[bb84-progress-store] Unable to parse localStorage value",{key:o[e],error:t}),c(e);return}},u=(0,r.Ue)((e,t)=>({...s,setStep:t=>{l("step",t),e({step:t})},setBb84Tab:t=>{l("bb84Tab",t),e({bb84Tab:t})},setDisplayedLines:t=>{l("displayedLines",t),e({displayedLines:t})},pushLines:a=>{if(0===a.length)return;let n=[...t().displayedLines,...a];l("displayedLines",n),e({displayedLines:n})},hydrateFromStorage:()=>{let t=b("step"),a=b("bb84Tab"),n=b("displayedLines"),r={};"number"==typeof t&&(r.step=t),"string"==typeof a&&(r.bb84Tab=a),Array.isArray(n)&&(r.displayedLines=n),Object.keys(r).length>0&&e(r)},resetProgress:()=>{Object.keys(o).forEach(c),e({...s})}})),m=()=>{i()&&u.getState().hydrateFromStorage()}},7480:function(e,t,a){var n=a(9625);let r={evePresent:!1,validationIndices:[],alicePhotons:[],bobBases:[],aliceBases:[],aliceBits:[],bobMeasurements:[],keyBits:[],partnerBits:[],aliceCipher:[],aliceCipherSolo:[],aliceCipherSent:!1,gameSuccess:!1,validated:!1,validatedByPartner:!1,crypto:[],message:[],eveUndetected:!1},o=()=>!0,s=(e,t,a)=>{if(a({[e]:t}),!o())return;let n=localStorage.getItem("bb84GameData"),r={};if(n)try{r=JSON.parse(n)}catch(e){localStorage.removeItem("bb84GameData")}let s={...r,[e]:t};localStorage.setItem("bb84GameData",JSON.stringify(s))},i=(0,n.Ue)(e=>({...r,setAlicePhotons:t=>s("alicePhotons",t,e),setBobBases:t=>s("bobBases",t,e),setAliceBases:t=>s("aliceBases",t,e),setAliceBits:t=>s("aliceBits",t,e),setBobMeasurements:t=>s("bobMeasurements",t,e),setKeyBits:t=>s("keyBits",t,e),setPartnerBits:t=>s("partnerBits",t,e),setAliceCipher:t=>s("aliceCipher",t,e),setAliceCipherSolo:t=>s("aliceCipherSolo",t,e),setAliceCipherSent:t=>s("aliceCipherSent",t,e),setGameSuccess:t=>s("gameSuccess",t,e),setValidatedByPartner:t=>s("validatedByPartner",t,e),setValidated:t=>s("validated",t,e),setCrypto:t=>s("crypto",t,e),setMessage:t=>s("message",t,e),setEvePresent:t=>s("evePresent",t,e),setValidationIndices:t=>s("validationIndices",t,e),setEveUndetected:t=>s("eveUndetected",t,e),resetRoom:()=>{o()&&localStorage.removeItem("bb84GameData"),e(r)},restoreGame:t=>{let a={};for(let e in t)e in r&&(a[e]=t[e]);e(a)}}));t.Z=i}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.