Bliss Board for C.A.R.E
++ This is the unofficial site for C.A.R.E. to speed up bliss board conversations. Type the code and see the corresponding words. +
+diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e400c8f --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024 Samq64 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..4c1a9fa --- /dev/null +++ b/README.md @@ -0,0 +1,17 @@ +# Bliss Board for CARE + +A webpage for [CARE](https://www.carecentre.org/) that converts 4-digit codes to words. + +## Setup + +Simply clone the repository and start an HTTP server. + +```bash +git clone https://github.com/samq64/blissboard +cd blissboard +python -m http.server +``` + +## Scratch version + +The Scratch version is still available in the `scratch` directory but it will not load in the official editor since it relies on SheepTester's utilities extension. The project is packaged using the [TurboWarp Packager](https://packager.turbowarp.org/). diff --git a/assets/project.json b/assets/project.json deleted file mode 100644 index 3e06191..0000000 --- a/assets/project.json +++ /dev/null @@ -1 +0,0 @@ -{"targets":[{"isStage":true,"name":"Stage","variables":{"d":["Words",""]},"lists":{"a":["Code",[]]},"broadcasts":{"e":"Typing","f":"Enter"},"blocks":{"c":{"opcode":"event_whenflagclicked","next":"b","parent":null,"inputs":{},"fields":{},"topLevel":true},"b":{"opcode":"data_deletealloflist","next":"a","parent":"c","inputs":{},"fields":{"LIST":["Code","a"]}},"a":{"opcode":"data_setvariableto","next":"d","parent":"b","inputs":{"VALUE":[3,"e",[10,"0"]]},"fields":{"VARIABLE":["Words","d"]}},"e":{"opcode":"Fetch_fetchURL","next":null,"parent":"a","inputs":{"url":[1,[10,"https://samq64.github.io/blissboard/words.json"]]},"fields":{}},"d":{"opcode":"event_broadcast","next":null,"parent":"a","inputs":{"BROADCAST_INPUT":[1,[11,"Typing","e"]]},"fields":{}}},"comments":{},"currentCostume":0,"costumes":[{"assetId":"3430681f583c6c695f0ea34d094bbc7d","name":"backdrop1","bitmapResolution":2,"md5ext":"3430681f583c6c695f0ea34d094bbc7d.png","dataFormat":"png","rotationCenterX":216,"rotationCenterY":360}],"sounds":[],"volume":100,"layerOrder":0,"tempo":60,"videoTransparency":50,"videoState":"on","textToSpeechLanguage":null},{"isStage":false,"name":"character","variables":{"c":["word",""]},"lists":{},"broadcasts":{},"blocks":{"f":{"opcode":"event_whenbroadcastreceived","next":"a","parent":null,"inputs":{},"fields":{"BROADCAST_OPTION":["Typing","e"]},"topLevel":true},"a":{"opcode":"control_if_else","next":null,"parent":"f","inputs":{"CONDITION":[2,"d"],"SUBSTACK":[2,"g"],"SUBSTACK2":[2,"h"]},"fields":{}},"d":{"opcode":"operator_equals","next":null,"parent":"a","inputs":{"OPERAND1":[3,"i",[10,""]],"OPERAND2":[1,[10,"0"]]},"fields":{}},"i":{"opcode":"data_lengthoflist","next":null,"parent":"d","inputs":{},"fields":{"LIST":["Code","a"]}},"g":{"opcode":"looks_say","next":null,"parent":"a","inputs":{"MESSAGE":[1,[10,"Please enter a number."]]},"fields":{}},"h":{"opcode":"looks_think","next":null,"parent":"a","inputs":{"MESSAGE":[3,[13,"Code","a"],[10,"Hello!"]]},"fields":{}},"j":{"opcode":"event_whenflagclicked","next":"e","parent":null,"inputs":{},"fields":{},"topLevel":true},"e":{"opcode":"motion_gotoxy","next":"k","parent":"j","inputs":{"X":[1,[4,"0"]],"Y":[1,[4,"50"]]},"fields":{}},"k":{"opcode":"looks_show","next":null,"parent":"e","inputs":{},"fields":{}},"l":{"opcode":"event_whenbroadcastreceived","next":"c","parent":null,"inputs":{},"fields":{"BROADCAST_OPTION":["Enter","f"]},"topLevel":true},"c":{"opcode":"data_setvariableto","next":"b","parent":"l","inputs":{"VALUE":[3,"m",[10,"0"]]},"fields":{"VARIABLE":["word","c"]}},"m":{"opcode":"Fetch_jsonExtract","next":null,"parent":"c","inputs":{"name":[3,[13,"Code","a"],[10,"temperature"]],"data":[3,[12,"Words","d"],[10,"{\"temperature\": 12.3}"]]},"fields":{}},"b":{"opcode":"control_if_else","next":null,"parent":"c","inputs":{"CONDITION":[2,"n"],"SUBSTACK":[2,"o"],"SUBSTACK2":[2,"p"]},"fields":{}},"n":{"opcode":"operator_equals","next":null,"parent":"b","inputs":{"OPERAND1":[3,[12,"word","c"],[10,""]],"OPERAND2":[1,[10,""]]},"fields":{}},"o":{"opcode":"looks_say","next":null,"parent":"b","inputs":{"MESSAGE":[1,[10,"That is an invalid number."]]},"fields":{}},"p":{"opcode":"looks_say","next":null,"parent":"b","inputs":{"MESSAGE":[3,[12,"word","c"],[10,"Hello!"]]},"fields":{}}},"comments":{},"currentCostume":0,"costumes":[{"assetId":"12289178afab355a045335229994786f","name":"costume1","bitmapResolution":1,"md5ext":"12289178afab355a045335229994786f.svg","dataFormat":"svg","rotationCenterX":51.10216000000001,"rotationCenterY":73.6255124295749}],"sounds":[],"volume":100,"layerOrder":2,"visible":true,"x":0,"y":50,"size":100,"direction":90,"draggable":false,"rotationStyle":"all around"},{"isStage":false,"name":"keypad","variables":{"b":["clone id",""]},"lists":{},"broadcasts":{},"blocks":{"0":{"opcode":"control_create_clone_of_menu","next":null,"parent":"k","inputs":{},"fields":{"CLONE_OPTION":["_myself_",null]},"shadow":true},"1":{"opcode":"motion_changexby","next":null,"parent":"l","inputs":{"DX":[1,[4,"-59"]]},"fields":{}},"2":{"opcode":"control_create_clone_of_menu","next":null,"parent":"l","inputs":{},"fields":{"CLONE_OPTION":["_myself_",null]},"shadow":true},"3":{"opcode":"event_whenthisspriteclicked","next":"m","parent":null,"inputs":{},"fields":{},"topLevel":true},"4":{"opcode":"operator_equals","next":null,"parent":"D","inputs":{"OPERAND1":[3,[12,"clone id","b"],[10,""]],"OPERAND2":[1,[10,""]]},"fields":{}},"5":{"opcode":"looks_cleargraphiceffects","next":null,"parent":"n","inputs":{},"fields":{}},"6":{"opcode":"sensing_mousedown","next":null,"parent":"F","inputs":{},"fields":{}},"7":{"opcode":"event_whenthisspriteclicked","next":"o","parent":null,"inputs":{},"fields":{},"topLevel":true},"8":{"opcode":"operator_equals","next":null,"parent":"G","inputs":{"OPERAND1":[3,[12,"clone id","b"],[10,""]],"OPERAND2":[1,[10,""]]},"fields":{}},"9":{"opcode":"operator_equals","next":null,"parent":"a","inputs":{"OPERAND1":[3,[12,"clone id","b"],[10,""]],"OPERAND2":[1,[10,"back"]]},"fields":{}},"N":{"opcode":"event_whenflagclicked","next":"q","parent":null,"inputs":{},"fields":{},"topLevel":true},"q":{"opcode":"looks_hide","next":"r","parent":"N","inputs":{},"fields":{}},"r":{"opcode":"data_setvariableto","next":"O","parent":"q","inputs":{"VALUE":[1,[10,""]]},"fields":{"VARIABLE":["clone id","b"]}},"O":{"opcode":"procedures_call","next":null,"parent":"r","inputs":{},"fields":{},"mutation":{"tagName":"mutation","children":[],"proccode":"Make clones","argumentids":"[]","warp":"true"}},"P":{"opcode":"control_start_as_clone","next":"c","parent":null,"inputs":{},"fields":{},"topLevel":true},"Q":{"opcode":"looks_show","next":null,"parent":"c","inputs":{},"fields":{}},"c":{"opcode":"data_setvariableto","next":"Q","parent":"P","inputs":{"VALUE":[3,"R",[10,"0"]]},"fields":{"VARIABLE":["clone id","b"]}},"R":{"opcode":"looks_costumenumbername","next":null,"parent":"c","inputs":{},"fields":{"NUMBER_NAME":["name",null]}},"s":{"opcode":"procedures_definition","next":"d","parent":null,"inputs":{"custom_block":[1,"S"]},"fields":{},"topLevel":true},"S":{"opcode":"procedures_prototype","next":null,"parent":"s","inputs":{},"fields":{},"shadow":true,"mutation":{"tagName":"mutation","children":[],"proccode":"Make clones","argumentids":"[]","argumentnames":"[]","argumentdefaults":"[]","warp":"true"}},"d":{"opcode":"looks_switchcostumeto","next":"t","parent":"s","inputs":{"COSTUME":[1,"T"]},"fields":{}},"T":{"opcode":"looks_costume","next":null,"parent":"d","inputs":{},"fields":{"COSTUME":["0",null]},"shadow":true},"t":{"opcode":"motion_gotoxy","next":"e","parent":"d","inputs":{"X":[1,[4,"66"]],"Y":[1,[4,"-65"]]},"fields":{}},"e":{"opcode":"control_repeat","next":"u","parent":"t","inputs":{"TIMES":[1,[6,"4"]],"SUBSTACK":[2,"f"]},"fields":{}},"f":{"opcode":"control_create_clone_of","next":"v","parent":"e","inputs":{"CLONE_OPTION":[1,"U"]},"fields":{}},"U":{"opcode":"control_create_clone_of_menu","next":null,"parent":"f","inputs":{},"fields":{"CLONE_OPTION":["_myself_",null]},"shadow":true},"v":{"opcode":"looks_nextcostume","next":"V","parent":"f","inputs":{},"fields":{}},"V":{"opcode":"motion_changexby","next":null,"parent":"v","inputs":{"DX":[1,[4,"-44"]]},"fields":{}},"u":{"opcode":"motion_changeyby","next":"w","parent":"e","inputs":{"DY":[1,[4,"-44"]]},"fields":{}},"w":{"opcode":"motion_setx","next":"g","parent":"u","inputs":{"X":[1,[4,"66"]]},"fields":{}},"g":{"opcode":"control_create_clone_of","next":"h","parent":"w","inputs":{"CLONE_OPTION":[1,"W"]},"fields":{}},"W":{"opcode":"control_create_clone_of_menu","next":null,"parent":"g","inputs":{},"fields":{"CLONE_OPTION":["_myself_",null]},"shadow":true},"h":{"opcode":"looks_switchcostumeto","next":"x","parent":"g","inputs":{"COSTUME":[1,"X"]},"fields":{}},"X":{"opcode":"looks_costume","next":null,"parent":"h","inputs":{},"fields":{"COSTUME":["back",null]},"shadow":true},"x":{"opcode":"motion_setx","next":"i","parent":"h","inputs":{"X":[1,[4,"0"]]},"fields":{}},"i":{"opcode":"control_create_clone_of","next":"y","parent":"x","inputs":{"CLONE_OPTION":[1,"Y"]},"fields":{}},"Y":{"opcode":"control_create_clone_of_menu","next":null,"parent":"i","inputs":{},"fields":{"CLONE_OPTION":["_myself_",null]},"shadow":true},"y":{"opcode":"motion_setx","next":"j","parent":"i","inputs":{"X":[1,[4,"-66"]]},"fields":{}},"j":{"opcode":"looks_switchcostumeto","next":"k","parent":"y","inputs":{"COSTUME":[1,"Z"]},"fields":{}},"Z":{"opcode":"looks_costume","next":null,"parent":"j","inputs":{},"fields":{"COSTUME":["5",null]},"shadow":true},"k":{"opcode":"control_create_clone_of","next":"z","parent":"j","inputs":{"CLONE_OPTION":[1,"0"]},"fields":{}},"z":{"opcode":"motion_changeyby","next":"A","parent":"k","inputs":{"DY":[1,[4,"-44"]]},"fields":{}},"A":{"opcode":"motion_setx","next":"B","parent":"z","inputs":{"X":[1,[4,"59"]]},"fields":{}},"B":{"opcode":"control_repeat","next":null,"parent":"A","inputs":{"TIMES":[1,[6,"3"]],"SUBSTACK":[2,"C"]},"fields":{}},"C":{"opcode":"looks_nextcostume","next":"l","parent":"B","inputs":{},"fields":{}},"l":{"opcode":"control_create_clone_of","next":"1","parent":"C","inputs":{"CLONE_OPTION":[1,"2"]},"fields":{}},"m":{"opcode":"control_if","next":null,"parent":"3","inputs":{"CONDITION":[2,"D"],"SUBSTACK":[2,"E"]},"fields":{}},"D":{"opcode":"operator_not","next":null,"parent":"m","inputs":{"OPERAND":[2,"4"]},"fields":{}},"E":{"opcode":"looks_seteffectto","next":"n","parent":"m","inputs":{"VALUE":[1,[4,"-30"]]},"fields":{"EFFECT":["BRIGHTNESS",null]}},"n":{"opcode":"control_wait_until","next":"5","parent":"E","inputs":{"CONDITION":[2,"F"]},"fields":{}},"F":{"opcode":"operator_not","next":null,"parent":"n","inputs":{"OPERAND":[2,"6"]},"fields":{}},"o":{"opcode":"control_if","next":null,"parent":"7","inputs":{"CONDITION":[2,"G"],"SUBSTACK":[2,"a"]},"fields":{}},"G":{"opcode":"operator_not","next":null,"parent":"o","inputs":{"OPERAND":[2,"8"]},"fields":{}},"a":{"opcode":"control_if_else","next":"H","parent":"o","inputs":{"CONDITION":[2,"9"],"SUBSTACK":[2,"I"],"SUBSTACK2":[2,"b"]},"fields":{}},"I":{"opcode":"data_deleteoflist","next":null,"parent":"a","inputs":{"INDEX":[3,"!",[7,"1"]]},"fields":{"LIST":["Code","a"]}},"!":{"opcode":"data_lengthoflist","next":null,"parent":"I","inputs":{},"fields":{"LIST":["Code","a"]}},"b":{"opcode":"control_if","next":"#","parent":"a","inputs":{"CONDITION":[2,"J"],"SUBSTACK":[2,"%"]},"fields":{}},"J":{"opcode":"operator_equals","next":null,"parent":"b","inputs":{"OPERAND1":[3,"(",[10,""]],"OPERAND2":[1,[10,"4"]]},"fields":{}},"(":{"opcode":"data_lengthoflist","next":null,"parent":"J","inputs":{},"fields":{"LIST":["Code","a"]}},"%":{"opcode":"data_deletealloflist","next":null,"parent":"b","inputs":{},"fields":{"LIST":["Code","a"]}},"#":{"opcode":"data_addtolist","next":null,"parent":"b","inputs":{"ITEM":[3,[12,"clone id","b"],[10,"thing"]]},"fields":{"LIST":["Code","a"]}},"H":{"opcode":"event_broadcast","next":"p","parent":"a","inputs":{"BROADCAST_INPUT":[1,[11,"Typing","e"]]},"fields":{}},"p":{"opcode":"control_if","next":null,"parent":"H","inputs":{"CONDITION":[2,"K"],"SUBSTACK":[2,"L"]},"fields":{}},"K":{"opcode":"operator_not","next":null,"parent":"p","inputs":{"OPERAND":[2,"M"]},"fields":{}},"M":{"opcode":"operator_lt","next":null,"parent":"K","inputs":{"OPERAND1":[3,")",[10,""]],"OPERAND2":[1,[10,"4"]]},"fields":{}},")":{"opcode":"data_lengthoflist","next":null,"parent":"M","inputs":{},"fields":{"LIST":["Code","a"]}},"L":{"opcode":"control_wait","next":"*","parent":"p","inputs":{"DURATION":[1,[5,".2"]]},"fields":{}},"*":{"opcode":"event_broadcast","next":null,"parent":"L","inputs":{"BROADCAST_INPUT":[1,[11,"Enter","f"]]},"fields":{}}},"comments":{},"currentCostume":8,"costumes":[{"assetId":"005eb11d23ff40e32574e24a7cde4b01","name":"0","bitmapResolution":1,"md5ext":"005eb11d23ff40e32574e24a7cde4b01.svg","dataFormat":"svg","rotationCenterX":19.64476499999998,"rotationCenterY":19.51374499999997},{"assetId":"20452090e6a2a0c9b7dd1053d35c6abf","name":"1","bitmapResolution":1,"md5ext":"20452090e6a2a0c9b7dd1053d35c6abf.svg","dataFormat":"svg","rotationCenterX":19.64476499999998,"rotationCenterY":19.513734999999997},{"assetId":"b32058efe248af71718ff2e5ecaf417b","name":"2","bitmapResolution":1,"md5ext":"b32058efe248af71718ff2e5ecaf417b.svg","dataFormat":"svg","rotationCenterX":19.64476499999998,"rotationCenterY":19.763744999999943},{"assetId":"733a29b0b6b8b1a26738d25f555a5a56","name":"3","bitmapResolution":1,"md5ext":"733a29b0b6b8b1a26738d25f555a5a56.svg","dataFormat":"svg","rotationCenterX":19.64476499999998,"rotationCenterY":19.51374499999997},{"assetId":"c4ca28771493732b7646dacba0702e45","name":"4","bitmapResolution":1,"md5ext":"c4ca28771493732b7646dacba0702e45.svg","dataFormat":"svg","rotationCenterX":19.64476499999998,"rotationCenterY":19.701224999999994},{"assetId":"f4829d6604c4497961de7bbec5210db3","name":"5","bitmapResolution":1,"md5ext":"f4829d6604c4497961de7bbec5210db3.svg","dataFormat":"svg","rotationCenterX":19.64476499999998,"rotationCenterY":19.638734999999997},{"assetId":"82409cc740b81aa9514022c7c12ae5e3","name":"6","bitmapResolution":1,"md5ext":"82409cc740b81aa9514022c7c12ae5e3.svg","dataFormat":"svg","rotationCenterX":27.20727000000005,"rotationCenterY":19.513724999999994},{"assetId":"978741fdc172215a97e103559f3dafc8","name":"7","bitmapResolution":1,"md5ext":"978741fdc172215a97e103559f3dafc8.svg","dataFormat":"svg","rotationCenterX":27.082269999999994,"rotationCenterY":19.82623499999997},{"assetId":"12eac2ca2c9f6345774f06ffe8053726","name":"8","bitmapResolution":1,"md5ext":"12eac2ca2c9f6345774f06ffe8053726.svg","dataFormat":"svg","rotationCenterX":27.457279999999997,"rotationCenterY":19.57621499999999},{"assetId":"e97814fe59c4e089cf534280d2dc9f0c","name":"back","bitmapResolution":1,"md5ext":"e97814fe59c4e089cf534280d2dc9f0c.svg","dataFormat":"svg","rotationCenterX":41.644774999999996,"rotationCenterY":19.576234999999997}],"sounds":[],"volume":100,"layerOrder":1,"visible":false,"x":-118,"y":-153,"size":100,"direction":90,"draggable":false,"rotationStyle":"all around"}],"monitors":[{"id":"d","mode":"default","opcode":"data_variable","params":{"VARIABLE":"Words"},"spriteName":null,"value":0,"width":0,"height":0,"x":132,"y":0,"visible":false,"sliderMin":0,"sliderMax":100,"isDiscrete":true},{"id":"c","mode":"default","opcode":"data_variable","params":{"VARIABLE":"word"},"spriteName":"character","value":0,"width":0,"height":0,"x":132,"y":98,"visible":false,"sliderMin":0,"sliderMax":100,"isDiscrete":true},{"id":"b","mode":"default","opcode":"data_variable","params":{"VARIABLE":"clone id"},"spriteName":"keypad","value":0,"width":0,"height":0,"x":132,"y":5,"visible":false,"sliderMin":0,"sliderMax":100,"isDiscrete":true},{"id":"a","mode":"list","opcode":"data_listcontents","params":{"LIST":"Code"},"spriteName":null,"value":[],"width":0,"height":0,"x":132,"y":0,"visible":false}],"extensions":["Fetch"],"meta":{"semver":"3.0.0"}} \ No newline at end of file diff --git a/images/eyes-dark.svg b/images/eyes-dark.svg new file mode 100644 index 0000000..e2513c8 --- /dev/null +++ b/images/eyes-dark.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/images/eyes.svg b/images/eyes.svg new file mode 100644 index 0000000..9a22a76 --- /dev/null +++ b/images/eyes.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/index.html b/index.html index 092efb9..3fe8aec 100644 --- a/index.html +++ b/index.html @@ -1,335 +1,43 @@ - - -
- - - - -+ This is the unofficial site for C.A.R.E. to speed up bliss board conversations. Type the code and see the corresponding words. +
+>6:64,c=2
>4,n=(15&o)<<4|(a=s.indexOf(e.charAt(c++)))>>2,r=(3&a)<<6|(l=s.indexOf(e.charAt(c++))),h[u++]=t,64!==a&&(h[u++]=n),64!==l&&(h[u++]=r);return h}},{"./support":30,"./utils":32}],2:[function(e,t,n){"use strict";var r=e("./external"),i=e("./stream/DataWorker"),s=e("./stream/Crc32Probe"),o=e("./stream/DataLengthProbe");function a(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}a.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},a.createWorkerFrom=function(e,t,n){return e.pipe(new s).pipe(new o("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new o("compressedSize")).withStreamInfo("compression",t)},t.exports=a},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){"use strict";var r=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){"use strict";var r=e("./utils"),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==r.getTypeOf(e)?function(e,t,n,r){var s=i,o=r+n;e^=-1;for(var a=r;a >=7;r>>=S,m-=S),m<15&&(p+=E[r++]<>>=S,m-=S,(S=s-o)g;y-=g){var v=d>>>y&b;f=f.array[v]=zt(f.array[v],r)}f.array[d>>>g&b]=p}if(a=h)o-=h,a-=h,l=g,c=null,m=m&&m.removeBefore(r,0,o);else if(o>i||he/200%1,shapeChanges:!1},fisheye:{uniformName:"u_fisheye",mask:2,converter:e=>Math.max(0,(e+100)/100),shapeChanges:!0},whirl:{uniformName:"u_whirl",mask:4,converter:e=>-e*Math.PI/180,shapeChanges:!0},pixelate:{uniformName:"u_pixelate",mask:8,converter:e=>Math.abs(e)/10,shapeChanges:!0},mosaic:{uniformName:"u_mosaic",mask:16,converter:e=>(e=Math.round((Math.abs(e)+10)/10),Math.max(1,Math.min(e,512))),shapeChanges:!0},brightness:{uniformName:"u_brightness",mask:32,converter:e=>Math.max(-100,Math.min(e,100))/100,shapeChanges:!1},ghost:{uniformName:"u_ghost",mask:64,converter:e=>1-Math.max(0,Math.min(e,100))/100,shapeChanges:!1}},i.EFFECTS=Object.keys(i.EFFECT_INFO),i.DRAW_MODE={default:"default",straightAlpha:"straightAlpha",silhouette:"silhouette",colorMask:"colorMask",line:"line",background:"background"},e.exports=i},function(e,t,n){const r=n(71);e.exports=class extends r{constructor(e,t,n,r){let i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;super(),this._socket=e.getScratchLinkSocket("BLE"),this._socket.setOnOpen(this.requestPeripheral.bind(this)),this._socket.setOnClose(this.handleDisconnectError.bind(this)),this._socket.setOnError(this._handleRequestError.bind(this)),this._socket.setHandleMessage(this._handleMessage.bind(this)),this._sendMessage=this._socket.sendMessage.bind(this._socket),this._availablePeripherals={},this._connectCallback=r,this._connected=!1,this._characteristicDidChangeCallback=null,this._resetCallback=i,this._discoverTimeoutID=null,this._extensionId=t,this._peripheralOptions=n,this._runtime=e,this._socket.open()}requestPeripheral(){this._availablePeripherals={},this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID),this._discoverTimeoutID=window.setTimeout(this._handleDiscoverTimeout.bind(this),15e3),this.sendRemoteRequest("discover",this._peripheralOptions).catch((e=>{this._handleRequestError(e)}))}connectPeripheral(e){this.sendRemoteRequest("connect",{peripheralId:e}).then((()=>{this._connected=!0,this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTED),this._connectCallback()})).catch((e=>{this._handleRequestError(e)}))}disconnect(){this._connected&&(this._connected=!1),this._socket.isOpen()&&this._socket.close(),this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID),this._runtime.emit(this._runtime.constructor.PERIPHERAL_DISCONNECTED)}isConnected(){return this._connected}startNotifications(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r={serviceId:e,characteristicId:t};return this._characteristicDidChangeCallback=n,this.sendRemoteRequest("startNotifications",r).catch((e=>{this.handleDisconnectError(e)}))}read(e,t){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;const r={serviceId:e,characteristicId:t};return arguments.length>2&&void 0!==arguments[2]&&arguments[2]&&(r.startNotifications=!0),n&&(this._characteristicDidChangeCallback=n),this.sendRemoteRequest("read",r).catch((e=>{this.handleDisconnectError(e)}))}write(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:null;const s={serviceId:e,characteristicId:t,message:n};return r&&(s.encoding=r),null!==i&&(s.withResponse=i),this.sendRemoteRequest("write",s).catch((e=>{this.handleDisconnectError(e)}))}didReceiveCall(e,t){switch(e){case"didDiscoverPeripheral":this._availablePeripherals[t.peripheralId]=t,this._runtime.emit(this._runtime.constructor.PERIPHERAL_LIST_UPDATE,this._availablePeripherals),this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID);break;case"userDidPickPeripheral":this._availablePeripherals[t.peripheralId]=t,this._runtime.emit(this._runtime.constructor.USER_PICKED_PERIPHERAL,this._availablePeripherals),this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID);break;case"userDidNotPickPeripheral":this._runtime.emit(this._runtime.constructor.PERIPHERAL_SCAN_TIMEOUT),this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID);break;case"characteristicDidChange":this._characteristicDidChangeCallback&&this._characteristicDidChangeCallback(t.message);break;case"ping":return 42}}handleDisconnectError(){this._connected&&(this.disconnect(),this._resetCallback&&this._resetCallback(),this._runtime.emit(this._runtime.constructor.PERIPHERAL_CONNECTION_LOST_ERROR,{message:"Scratch lost connection to",extensionId:this._extensionId}))}_handleRequestError(){this._runtime.emit(this._runtime.constructor.PERIPHERAL_REQUEST_ERROR,{message:"Scratch lost connection to",extensionId:this._extensionId})}_handleDiscoverTimeout(){this._discoverTimeoutID&&window.clearTimeout(this._discoverTimeoutID),this._runtime.emit(this._runtime.constructor.PERIPHERAL_SCAN_TIMEOUT)}}},function(e,t,n){const r=n(1);e.exports=function(e){if("string"!=typeof e){if(!Array.isArray(e))return r.error("Unexpected input recieved in replaceUnsafeChars"),e;e=String(e)}return e.replace(/[<>&'"]/g,(e=>{switch(e){case"<":return"<";case">":return">";case"&":return"&";case"'":return"'";case'"':return"""}}))}},function(e,t,n){const r=n(7),i=n(1),s=function(e,t,n,r){return e.assetId=t.assetId,n.audioEngine?n.audioEngine.decodeSoundPlayer(Object.assign({},e,{data:t.data})).then((t=>{e.soundId=t.id;const i=t.buffer;return e.rate=i.sampleRate,e.sampleCount=i.length,null!==r&&r.addSoundPlayer(t),n.isPackaged&&(e.asset=null),e})):(i.warn("No audio engine present; cannot load sound asset: ",e.md5),Promise.resolve(e))},o=function(e,t,n){const r=e.asset,i=e.assetId,o=e.sampleCount,a=e.rate,l=e.format,c=e.dataFormat;return e.assetId=t.storage.defaultAssetId.Sound,e.asset=t.storage.get(e.assetId),e.md5="".concat(e.assetId,".").concat(e.asset.dataFormat),s(e,e.asset,t,n).then((e=>(e.broken={},e.broken.assetId=i,e.broken.md5="".concat(i,".").concat(c),e.broken.asset=r,e.broken.sampleCount=o,e.broken.rate=a,e.broken.format=l,e.broken.dataFormat=c,e)))};e.exports={loadSound:function(e,t,n){if(!t.storage)return i.warn("No storage module present; cannot load sound asset: ",e.md5),Promise.resolve(e);const a=r.splitFirst(e.md5,"."),l=a[0],c=a[1].toLowerCase();return e.dataFormat=c,(e.asset&&Promise.resolve(e.asset)||t.storage.load(t.storage.AssetType.Sound,l,c)).then((r=>(e.asset=r,r?s(e,r,t,n):(i.warn("Failed to find sound data: ",e.md5),o(e,t,n))))).catch((r=>(i.warn("Failed to load sound: ".concat(e.md5," with error: ").concat(r)),o(e,t,n))))},loadSoundFromAsset:s}},function(e,t,n){const r=n(7),i=n(1),s=n(83),{loadSvgString:o,serializeSvgToString:a}=n(35),{parseVectorMetadata:l}=n(103),c=function(e,t,n,r){return new Promise((i=>{let s=e.asset.decodeText();if(void 0===n){const t=l(s);t&&(n=t,e.rotationCenterX=n[0],e.rotationCenterY=n[1])}if(r&&2===r){const n=a(o(s,!0));if(s!==n){s=n;const r=t.storage;e.asset.encodeTextData(n,r.DataFormat.SVG,!0),e.assetId=e.asset.assetId,e.md5="".concat(e.assetId,".").concat(e.dataFormat)}}e.skinId=t.renderer.createSVGSkin(s,n),e.size=t.renderer.getSkinSize(e.skinId),n||(n=t.renderer.getSkinRotationCenter(e.skinId),e.rotationCenterX=n[0],e.rotationCenterY=n[1],e.bitmapResolution=1),t.isPackaged&&(e.asset=null),i(e)}))},u=new class{constructor(){this.pool=[],this.clearSoon=null}clear(){this.clearSoon||(this.clearSoon=new Promise((e=>setTimeout(e,1e3))).then((()=>{this.pool.length=0,this.clearSoon=null})))}create(){return this.pool.pop()||document.createElement("canvas")}release(e){this.clear(),this.pool.push(e)}},d=e=>new Promise(((t,n)=>{const r=new Image;r.onload=function(){t(r),r.onload=null,r.onerror=null},r.onerror=function(){n(new Error("Costume load failed. Asset could not be read.")),r.onload=null,r.onerror=null},r.src=e})),h=new s((async e=>{let t;for(let n=0;n<3;n++)try{if("function"==typeof createImageBitmap){const t=await createImageBitmap(new Blob([e.data.buffer],{type:e.assetType.contentType}));if(!t)throw new Error("createImageBitmap resolved with ".concat(t));return t}return await d(e.encodeDataURI())}catch(e){t||(t=e),i.warn(e),await new Promise((e=>setTimeout(e,2e3*Math.random())))}throw t}),25),p=function(e,t,n){return function(e,t,n){return e&&e.asset?t.v2BitmapAdapter?Promise.all([e.asset,e.textLayerAsset].map((e=>e?h.do(e):null))).then((r=>{let[i,s]=r;if(!i)throw new Error("Loading bitmap costume base failed.");const o=1===e.bitmapResolution?2:1;let a,l;if(s){l=u.create(),l.width=i.width,l.height=i.height;const e=l.getContext("2d");e.drawImage(i,0,0),e.drawImage(s,0,0),a=l}else a=i;return 1!==o&&(a=t.v2BitmapAdapter.resize(a,a.width*o,a.height*o),l&&u.release(l)),a.reusable=!1,n&&(n[0]=n[0]*o,n[1]=n[1]*o,e.rotationCenterX=n[0],e.rotationCenterY=n[1]),e.bitmapResolution=2,delete e.textLayerMD5,delete e.textLayerAsset,{image:a,rotationCenter:n,assetMatchesBase:1===o&&!s}})).finally((()=>{delete e.textLayerMD5,delete e.textLayerAsset})):Promise.reject("No V2 Bitmap adapter present."):Promise.reject("Costume load failed. Assets were missing.")}(e,t,n).then((n=>(n.assetMatchesBase||function(n){if(!t.v2BitmapAdapter)return Promise.reject("No V2 Bitmap adapter present.");const r=t.storage;e.asset=r.createAsset(r.AssetType.ImageBitmap,r.DataFormat.PNG,t.v2BitmapAdapter.convertDataURIToBinary(n),null,!0),e.dataFormat=r.DataFormat.PNG,e.assetId=e.asset.assetId,e.md5="".concat(e.assetId,".").concat(e.dataFormat)}((e=>{if(e instanceof HTMLCanvasElement)return e.toDataURL();const t=u.create();t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0);const n=t.toDataURL();return u.release(t),n})(n.image)),n))).then((n=>{let r,{image:i,rotationCenter:s}=n;s&&(r=[s[0]/2,s[1]/2]),e.skinId=t.renderer.createBitmapSkin(i,e.bitmapResolution,r);const o=t.renderer.getSkinSize(e.skinId);return e.size=[2*o[0],2*o[1]],s||(s=t.renderer.getSkinRotationCenter(e.skinId),e.rotationCenterX=2*s[0],e.rotationCenterY=2*s[1],e.bitmapResolution=2),t.isPackaged&&(e.asset=null),e}))},m=function(e,t){const n=e.asset,r=e.assetId,i=e.rotationCenterX,s=e.rotationCenterY,o=e.bitmapResolution,a=e.dataFormat,l=t.storage.AssetType,u=e.dataFormat===l.ImageVector.runtimeFormat;e.assetId=u?t.storage.defaultAssetId.ImageVector:t.storage.defaultAssetId.ImageBitmap,e.asset=t.storage.get(e.assetId),e.md5="".concat(e.assetId,".").concat(e.asset.dataFormat);return(u?c(e,t):p(e,t)).then((e=>(e.broken={},e.broken.assetId=r,e.broken.md5="".concat(r,".").concat(a),e.broken.asset=n,e.broken.dataFormat=a,e.broken.rotationCenterX=i,e.broken.rotationCenterY=s,e.broken.bitmapResolution=o,e)))},f=function(e,t,n){e.assetId=e.asset.assetId;if(!t.renderer)return i.warn("No rendering module present; cannot load costume: ",e.name),Promise.resolve(e);const r=t.storage.AssetType;let s;return"number"!=typeof e.rotationCenterX||isNaN(e.rotationCenterX)||"number"!=typeof e.rotationCenterY||isNaN(e.rotationCenterY)||(s=[e.rotationCenterX,e.rotationCenterY]),e.asset.assetType.runtimeFormat===r.ImageVector.runtimeFormat?c(e,t,s,n).catch((n=>(i.warn("Error loading vector image: ".concat(n)),m(e,t)))):p(e,t,s).catch((n=>(i.warn("Error loading bitmap image: ".concat(n)),m(e,t))))};e.exports={loadCostume:function(e,t,n,s){const o=r.splitFirst(e,"."),a=o[0],l=o[1].toLowerCase();if(t.dataFormat=l,t.asset)return f(t,n,s);if(!n.storage)return i.warn("No storage module present; cannot load costume asset: ",e),Promise.resolve(t);if(!n.storage.defaultAssetId)return i.warn("No default assets found"),Promise.resolve(t);const c=n.storage.AssetType,u="svg"===l?c.ImageVector:c.ImageBitmap,d=n.storage.load(u,a,l);let h;return h=t.textLayerMD5?n.storage.load(c.ImageBitmap,t.textLayerMD5,"png"):Promise.resolve(null),Promise.all([d,h]).then((e=>e[0]?(t.asset=e[0],e[1]&&(t.textLayerAsset=e[1]),f(t,n,s)):m(t,n))).catch((e=>(i.warn("Error loading costume: ",e),m(t,n))))},loadCostumeFromAsset:f}},function(e,t,n){const r=n(255),i=n(277),s=n(91),o=n(85),a=n(279),l=n(90),c=n(55),u=n(87);e.exports={BitmapAdapter:i,convertFonts:u,inlineSvgFonts:s,loadSvgString:o,sanitizeSvg:a,serializeSvgToString:l,SvgElement:c,SVGRenderer:r}},function(e,t,n){var r=n(37),i=r.TYPE,s=r.NAME,o=n(27).cmpStr,a=i.EOF,l=i.WhiteSpace,c=i.Comment,u=16777215,d=24,h=function(){this.offsetAndType=null,this.balance=null,this.reset()};h.prototype={reset:function(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset},lookupType:function(e){return(e+=this.tokenIndex){e.isCompiled?e.executableHat&&(g.saveGlobalState(),g(e),g.restoreGlobalState()):(f(this.sequencer,e),e.goToNextBlock())})),r}dispose(){this.stopAll(),this.targets.forEach((e=>{e.isOriginal&&e.deleteMonitors()})),this.targets.map(this.disposeTarget,this),this.extensionStorage={};const e=o({});e.equals(this._monitorState)||(this._monitorState=e,this.emit(K.MONITORS_UPDATE,this._monitorState)),this.emit(K.RUNTIME_DISPOSED),this.ioDevices.clock.resetProjectTimer(),this.fontManager.clear(),this.hasCloudData()&&this.emit(K.HAS_CLOUD_DATA_UPDATE,!1),this.ioDevices.cloud.clear();const t=q(this.cloudOptions);this.hasCloudData=t.hasCloudVariables,this.canAddCloudVariable=t.canAddCloudVariable,this.getNumberOfCloudVariables=t.getNumberOfCloudVariables,this.addCloudVariable=this._initializeAddCloudVariable(t),this.removeCloudVariable=this._initializeRemoveCloudVariable(t),this.resetProgress()}addTarget(e){this.targets.push(e),this.executableTargets.push(e),e.isStage&&!this._stageTarget&&(this._stageTarget=e)}moveExecutable(e,t){const n=this.executableTargets.indexOf(e);this.executableTargets.splice(n,1);let r=n+t;return r>this.executableTargets.length&&(r=this.executableTargets.length),r<=0&&(r=this.executableTargets.length>0&&this.executableTargets[0].isStage?1:0),this.executableTargets.splice(r,0,e),r}setExecutablePosition(e,t){const n=this.executableTargets.indexOf(e);return this.moveExecutable(e,t-n)}removeExecutable(e){const t=this.executableTargets.indexOf(e);t>-1&&this.executableTargets.splice(t,1)}disposeTarget(e){this.targets=this.targets.filter((t=>e!==t||(t.dispose(),!1))),this._stageTarget===e&&(this._stageTarget=null)}stopForTarget(e,t){this.emit(K.STOP_FOR_TARGET,e,t);for(let n=0;n