From 78d4ef267176e77952b83797bb96d89f4bcada5e Mon Sep 17 00:00:00 2001 From: Kyutae Lee Date: Sat, 20 Jan 2024 15:13:38 +0900 Subject: [PATCH] Copy from dist --- main.bundle.js.map | 2 +- sw.js | 2 +- sw.js.map | 2 +- workbox-d5348a15.js => workbox-f065e1a2.js | 2 +- workbox-d5348a15.js.map => workbox-f065e1a2.js.map | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) rename workbox-d5348a15.js => workbox-f065e1a2.js (99%) rename workbox-d5348a15.js.map => workbox-f065e1a2.js.map (84%) diff --git a/main.bundle.js.map b/main.bundle.js.map index de96df6..f41a50c 100644 --- a/main.bundle.js.map +++ b/main.bundle.js.map @@ -1 +1 @@ -{"version":3,"file":"main.bundle.js","mappings":"uIAKO,MAAMA,EAAc,CACzBC,aAAc,+CACdC,SAAU,CAAC,EACXC,OAAQ,CAAC,GAGLD,EAAWF,EAAYE,SAC7BA,EAASE,QAAU,CAACC,EAAGC,IAAM,mBAAmBD,KAAKC,QACrDJ,EAASK,KAAQC,GAAM,aAAaA,QACpCN,EAASO,OAAUC,GAAM,iBAAiBA,QAE1CR,EAASS,SAAW,uBACpBT,EAASU,SAAW,uBACpBV,EAASW,WAAa,yBACtBX,EAASY,YAAc,0BACvBZ,EAASa,sBAAwB,mCACjCb,EAASc,uBAAyB,oCAClCd,EAASe,cAAgB,4BACzBf,EAASgB,eAAiB,6BAC1BhB,EAASiB,WAAa,yBACtBjB,EAASkB,OAAS,qBAClBlB,EAASmB,WAAa,sBACtBnB,EAASoB,WAAa,sBACtBpB,EAASqB,WAAa,sBACtBrB,EAASsB,MAAQ,oBACjBtB,EAASuB,KAAO,mBAChBvB,EAASwB,MAAQ,oBAEjBxB,EAASyB,UAAY,gCACrBzB,EAAS0B,MAAQ,4BACjB1B,EAAS2B,SAAW,+BAEpB3B,EAAS4B,KAAO,uBAChB5B,EAAS6B,QAAU,0BACnB7B,EAAS8B,mBAAqB,qCAC9B9B,EAAS+B,MAAQ,w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AAUE,IAAI,UACjB2D,EACGpC,uBAAuB,cAAc,GACrCzB,UAAUC,OAAO,UACpB4D,EAAc7D,UAAUC,OAAO,QAE/BmC,GAAO2C,KAAKvC,IACZgC,EAAWxE,UAAUC,OAAO,UAC5B8C,EAASvH,oBAAoB,QAASsJ,GACtCjB,EAAcrI,oBAAoB,QAASsJ,EAAc,EAE3D/B,EAASxH,iBAAiB,QAASuJ,GACnCjB,EAActI,iBAAiB,QAASuJ,EAC1C,CAhDAE,E,iCC1FO,MAAMC,EAAsB,CAMjCC,IAAMC,IACJ,IAAIvK,EAAQ,KACZ,IACEA,EAAQwK,aAAaC,QAAQF,EAG/B,CAFE,MAAOG,GACPC,QAAQC,MAAMF,EAChB,CACA,OAAO1K,CAAK,EAQd6K,IAAK,CAACN,EAAKvK,KACT,IACEwK,aAAaM,QAAQP,EAAKvK,EAG5B,CAFE,MAAO0K,GACPC,QAAQC,MAAMF,EAChB,G","sources":["webpack://pikachu-volleyball/./src/resources/js/assets_path.js","webpack://pikachu-volleyball/./src/resources/js/rand.js","webpack://pikachu-volleyball/./src/resources/js/physics.js","webpack://pikachu-volleyball/./src/resources/js/cloud_and_wave.js","webpack://pikachu-volleyball/./src/resources/js/view.js","webpack://pikachu-volleyball/./src/resources/js/keyboard.js","webpack://pikachu-volleyball/./src/resources/js/audio.js","webpack://pikachu-volleyball/./src/resources/js/pikavolley.js","webpack://pikachu-volleyball/./src/resources/js/ui.js","webpack://pikachu-volleyball/./src/resources/js/main.js","webpack://pikachu-volleyball/./src/resources/js/utils/local_storage_wrapper.js"],"sourcesContent":["/**\n * Manages the paths (file locations) of the game assets.\n */\n'use strict';\n\nexport const ASSETS_PATH = {\n SPRITE_SHEET: '../resources/assets/images/sprite_sheet.json',\n TEXTURES: {},\n SOUNDS: {},\n};\n\nconst TEXTURES = ASSETS_PATH.TEXTURES;\nTEXTURES.PIKACHU = (i, j) => `pikachu/pikachu_${i}_${j}.png`;\nTEXTURES.BALL = (s) => `ball/ball_${s}.png`;\nTEXTURES.NUMBER = (n) => `number/number_${n}.png`;\n\nTEXTURES.SKY_BLUE = 'objects/sky_blue.png';\nTEXTURES.MOUNTAIN = 'objects/mountain.png';\nTEXTURES.GROUND_RED = 'objects/ground_red.png';\nTEXTURES.GROUND_LINE = 'objects/ground_line.png';\nTEXTURES.GROUND_LINE_LEFT_MOST = 'objects/ground_line_leftmost.png';\nTEXTURES.GROUND_LINE_RIGHT_MOST = 'objects/ground_line_rightmost.png';\nTEXTURES.GROUND_YELLOW = 'objects/ground_yellow.png';\nTEXTURES.NET_PILLAR_TOP = 'objects/net_pillar_top.png';\nTEXTURES.NET_PILLAR = 'objects/net_pillar.png';\nTEXTURES.SHADOW = 'objects/shadow.png';\nTEXTURES.BALL_HYPER = 'ball/ball_hyper.png';\nTEXTURES.BALL_TRAIL = 'ball/ball_trail.png';\nTEXTURES.BALL_PUNCH = 'ball/ball_punch.png';\nTEXTURES.CLOUD = 'objects/cloud.png';\nTEXTURES.WAVE = 'objects/wave.png';\nTEXTURES.BLACK = 'objects/black.png';\n\nTEXTURES.SACHISOFT = 'messages/common/sachisoft.png';\nTEXTURES.READY = 'messages/common/ready.png';\nTEXTURES.GAME_END = 'messages/common/game_end.png';\n\nTEXTURES.MARK = 'messages/ja/mark.png';\nTEXTURES.POKEMON = 'messages/ja/pokemon.png';\nTEXTURES.PIKACHU_VOLLEYBALL = 'messages/ja/pikachu_volleyball.png';\nTEXTURES.FIGHT = 'messages/ja/fight.png';\nTEXTURES.WITH_COMPUTER = 'messages/ja/with_computer.png';\nTEXTURES.WITH_FRIEND = 'messages/ja/with_friend.png';\nTEXTURES.GAME_START = 'messages/ja/game_start.png';\n\nTEXTURES.SITTING_PIKACHU = 'sitting_pikachu.png';\n\nconst SOUNDS = ASSETS_PATH.SOUNDS;\nSOUNDS.BGM = '../resources/assets/sounds/bgm.mp3';\nSOUNDS.PIPIKACHU = '../resources/assets/sounds/WAVE140_1.wav';\nSOUNDS.PIKA = '../resources/assets/sounds/WAVE141_1.wav';\nSOUNDS.CHU = '../resources/assets/sounds/WAVE142_1.wav';\nSOUNDS.PI = '../resources/assets/sounds/WAVE143_1.wav';\nSOUNDS.PIKACHU = '../resources/assets/sounds/WAVE144_1.wav';\nSOUNDS.POWERHIT = '../resources/assets/sounds/WAVE145_1.wav';\nSOUNDS.BALLTOUCHESGROUND = '../resources/assets/sounds/WAVE146_1.wav';\n","/**\n * This module contains random number generator used for the game\n */\n'use strict';\n/** @typedef {function():number} RNG */\n\n/** @type {RNG} custom RNG (random number generator) function which generates a random number in [0, 1] */\nlet customRng = null;\n\n/**\n * Return random integer in [0, 32767]\n *\n * The machine code of the original game use \"_rand()\" function in Visual Studio 1988 Library.\n * I could't find out how this function works exactly.\n * But, anyhow, it should be a function that generate a random number.\n * I decided to use custom rand function which generates random integer in [0, 32767]\n * which follows rand() function in Visual Studio 2017 Library.\n *\n * By default, it uses the function \"Math.random\" for generating a random number.\n * A custom RNG function can used by setting the \"customRng\" as the custom RNG function.\n *\n * @return {number} random integer\n */\nexport function rand() {\n if (customRng === null) {\n return Math.floor(32768 * Math.random());\n }\n return Math.floor(32768 * customRng());\n}\n\n/**\n * Set custom RNG function\n * @param {RNG} rng\n */\nexport function setCustomRng(rng) {\n customRng = rng;\n}\n","/**\n * The Model part in the MVC pattern\n *\n * It is the core module which acts as a physics engine.\n * This physics engine calculates the movements of the ball and the players (Pikachus).\n *\n * It was gained by reverse engineering the original game.\n * The address of each function in the original machine code is specified at the comment above each function.\n * ex) FUN_00403dd0 means the original function at the address 00403dd0.\n *\n *\n * ** Some useful infos below **\n *\n * Ground width: 432 = 0x1B0\n * Ground height: 304 = 0x130\n *\n * X position coordinate: [0, 432], right-direction increasing\n * Y position coordinate: [0, 304], down-direction increasing\n *\n * Ball radius: 20 = 0x14\n * Ball diameter: 40 = 0x28\n *\n * Player half-width: 32 = 0x20\n * Player half-height: 32 = 0x20\n * Player width: 64 = 0x40\n * Player height: 64 = 0x40\n *\n */\n'use strict';\nimport { rand } from './rand.js';\n\n/** @constant @type {number} ground width */\nconst GROUND_WIDTH = 432;\n/** @constant @type {number} ground half-width, it is also the net pillar x coordinate */\nexport const GROUND_HALF_WIDTH = (GROUND_WIDTH / 2) | 0; // integer division\n/** @constant @type {number} player (Pikachu) length: width = height = 64 */\nconst PLAYER_LENGTH = 64;\n/** @constant @type {number} player half length */\nconst PLAYER_HALF_LENGTH = (PLAYER_LENGTH / 2) | 0; // integer division\n/** @constant @type {number} player's y coordinate when they are touching ground */\nconst PLAYER_TOUCHING_GROUND_Y_COORD = 244;\n/** @constant @type {number} ball's radius */\nconst BALL_RADIUS = 20;\n/** @constant @type {number} ball's y coordinate when it is touching ground */\nconst BALL_TOUCHING_GROUND_Y_COORD = 252;\n/** @constant @type {number} net pillar's half width (this value is on this physics engine only, not on the sprite pixel size) */\nconst NET_PILLAR_HALF_WIDTH = 25;\n/** @constant @type {number} net pillar top's top side y coordinate */\nconst NET_PILLAR_TOP_TOP_Y_COORD = 176;\n/** @constant @type {number} net pillar top's bottom side y coordinate (this value is on this physics engine only) */\nconst NET_PILLAR_TOP_BOTTOM_Y_COORD = 192;\n\n/**\n * It's for to limit the looping number of the infinite loops.\n * This constant is not in the original machine code. (The original machine code does not limit the looping number.)\n *\n * In the original ball x coord range setting (ball x coord in [20, 432]), the infinite loops in\n * {@link calculateExpectedLandingPointXFor} function and {@link expectedLandingPointXWhenPowerHit} function seems to be always terminated soon.\n * But if the ball x coord range is edited, for example, to [20, 432 - 20] for left-right symmetry,\n * it is observed that the infinite loop in {@link expectedLandingPointXWhenPowerHit} does not terminate.\n * So for safety, this infinite loop limit is included for the infinite loops mentioned above.\n * @constant @type {number}\n */\nconst INFINITE_LOOP_LIMIT = 1000;\n\n/**\n * Class representing a pack of physical objects i.e. players and ball\n * whose physical values are calculated and set by {@link physicsEngine} function\n */\nexport class PikaPhysics {\n /**\n * Create a physics pack\n * @param {boolean} isPlayer1Computer Is player on the left (player 1) controlled by computer?\n * @param {boolean} isPlayer2Computer Is player on the right (player 2) controlled by computer?\n */\n constructor(isPlayer1Computer, isPlayer2Computer) {\n this.player1 = new Player(false, isPlayer1Computer);\n this.player2 = new Player(true, isPlayer2Computer);\n this.ball = new Ball(false);\n }\n\n /**\n * run {@link physicsEngine} function with this physics object and user input\n *\n * @param {PikaUserInput[]} userInputArray userInputArray[0]: PikaUserInput object for player 1, userInputArray[1]: PikaUserInput object for player 2\n * @return {boolean} Is ball touching ground?\n */\n runEngineForNextFrame(userInputArray) {\n const isBallTouchingGround = physicsEngine(\n this.player1,\n this.player2,\n this.ball,\n userInputArray\n );\n return isBallTouchingGround;\n }\n}\n\n/**\n * Class (or precisely, Interface) representing user input (from keyboard or joystick, whatever)\n */\nexport class PikaUserInput {\n constructor() {\n /** @type {number} 0: no horizontal-direction input, -1: left-direction input, 1: right-direction input */\n this.xDirection = 0;\n /** @type {number} 0: no vertical-direction input, -1: up-direction input, 1: down-direction input */\n this.yDirection = 0;\n /** @type {number} 0: auto-repeated or no power hit input, 1: not auto-repeated power hit input */\n this.powerHit = 0;\n }\n}\n\n/**\n * Class representing a player\n *\n * Player 1 property address: 00411F28 -> +28 -> +10 -> +C -> ...\n * Player 2 property address: 00411F28 -> +28 -> +10 -> +10 -> ...\n * The \"...\" part is written on the line comment at the right side of each property.\n * e.g. address to player1.isPlayer: 00411F28 -> +28 -> +10 -> +C -> +A0\n * e.g. address to player2.isComputer: 00411F28 -> +28 -> +10 -> +10 -> +A4\n *\n * For initial values: refer to FUN_000403a90 && FUN_00401f40\n */\nclass Player {\n /**\n * create a player\n * @param {boolean} isPlayer2 Is this player on the right side?\n * @param {boolean} isComputer Is this player controlled by computer?\n */\n constructor(isPlayer2, isComputer) {\n /** @type {boolean} Is this player on the right side? */\n this.isPlayer2 = isPlayer2; // 0xA0\n /** @type {boolean} Is controlled by computer? */\n this.isComputer = isComputer; // 0xA4\n this.initializeForNewRound();\n\n /** @type {number} -1: left, 0: no diving, 1: right */\n this.divingDirection = 0; // 0xB4\n /** @type {number} */\n this.lyingDownDurationLeft = -1; // 0xB8\n /** @type {boolean} */\n this.isWinner = false; // 0xD0\n /** @type {boolean} */\n this.gameEnded = false; // 0xD4\n\n /**\n * It flips randomly to 0 or 1 by the {@link letComputerDecideUserInput} function (FUN_00402360)\n * when ball is hanging around on the other player's side.\n * If it is 0, computer player stands by around the middle point of their side.\n * If it is 1, computer player stands by adjacent to the net.\n * @type {number} 0 or 1\n */\n this.computerWhereToStandBy = 0; // 0xDC\n\n /**\n * This property is not in the player pointers of the original source code.\n * But for sound effect (especially for stereo sound),\n * it is convenient way to give sound property to a Player.\n * The original name is stereo sound.\n * @type {Object.}\n */\n this.sound = {\n pipikachu: false,\n pika: false,\n chu: false,\n };\n }\n\n /**\n * initialize for new round\n */\n initializeForNewRound() {\n /** @type {number} x coord */\n this.x = 36; // 0xA8 // initialized to 36 (player1) or 396 (player2)\n if (this.isPlayer2) {\n this.x = GROUND_WIDTH - 36;\n }\n /** @type {number} y coord */\n this.y = PLAYER_TOUCHING_GROUND_Y_COORD; // 0xAC // initialized to 244\n /** @type {number} y direction velocity */\n this.yVelocity = 0; // 0xB0 // initialized to 0\n /** @type {boolean} */\n this.isCollisionWithBallHappened = false; // 0xBC // initialized to 0 i.e false\n\n /**\n * Player's state\n * 0: normal, 1: jumping, 2: jumping_and_power_hitting, 3: diving\n * 4: lying_down_after_diving\n * 5: win!, 6: lost..\n * @type {number} 0, 1, 2, 3, 4, 5 or 6\n */\n this.state = 0; // 0xC0 // initialized to 0\n /** @type {number} */\n this.frameNumber = 0; // 0xC4 // initialized to 0\n /** @type {number} */\n this.normalStatusArmSwingDirection = 1; // 0xC8 // initialized to 1\n /** @type {number} */\n this.delayBeforeNextFrame = 0; // 0xCC // initialized to 0\n\n /**\n * This value is initialized to (_rand() % 5) before the start of every round.\n * The greater the number, the bolder the computer player.\n *\n * If computer has higher boldness,\n * judges more the ball is hanging around the other player's side,\n * has greater distance to the expected landing point of the ball,\n * jumps more,\n * and dives less.\n * See the source code of the {@link letComputerDecideUserInput} function (FUN_00402360).\n *\n * @type {number} 0, 1, 2, 3 or 4\n */\n this.computerBoldness = rand() % 5; // 0xD8 // initialized to (_rand() % 5)\n }\n}\n\n/**\n * Class representing a ball\n *\n * Ball property address: 00411F28 -> +28 -> +10 -> +14 -> ...\n * The \"...\" part is written on the line comment at the right side of each property.\n * e.g. address to ball.fineRotation: 00411F28 -> +28 -> +10 -> +14 -> +48\n *\n * For initial Values: refer to FUN_000403a90 && FUN_00402d60\n */\nclass Ball {\n /**\n * Create a ball\n * @param {boolean} isPlayer2Serve Will player 2 serve on this new round?\n */\n constructor(isPlayer2Serve) {\n this.initializeForNewRound(isPlayer2Serve);\n /** @type {number} x coord of expected lang point */\n this.expectedLandingPointX = 0; // 0x40\n /**\n * ball rotation frame number selector\n * During the period where it continues to be 5, hyper ball glitch occur.\n * @type {number} 0, 1, 2, 3, 4 or 5\n * */\n this.rotation = 0; // 0x44\n /** @type {number} */\n this.fineRotation = 0; // 0x48\n /** @type {number} x coord for punch effect */\n this.punchEffectX = 0; // 0x50\n /** @type {number} y coord for punch effect */\n this.punchEffectY = 0; // 0x54\n\n /**\n * Following previous values are for trailing effect for power hit\n * @type {number}\n */\n this.previousX = 0; // 0x58\n this.previousPreviousX = 0; // 0x5c\n this.previousY = 0; // 0x60\n this.previousPreviousY = 0; // 0x64\n\n /**\n * this property is not in the ball pointer of the original source code.\n * But for sound effect (especially for stereo sound),\n * it is convenient way to give sound property to a Ball.\n * The original name is stereo sound.\n */\n this.sound = {\n powerHit: false,\n ballTouchesGround: false,\n };\n }\n\n /**\n * Initialize for new round\n * @param {boolean} isPlayer2Serve will player on the right side serve on this new round?\n */\n initializeForNewRound(isPlayer2Serve) {\n /** @type {number} x coord */\n this.x = 56; // 0x30 // initialized to 56 or 376\n if (isPlayer2Serve === true) {\n this.x = GROUND_WIDTH - 56;\n }\n /** @type {number} y coord */\n this.y = 0; // 0x34 // initialized to 0\n /** @type {number} x direction velocity */\n this.xVelocity = 0; // 0x38 // initialized to 0\n /** @type {number} y direction velocity */\n this.yVelocity = 1; // 0x3C // initialized to 1\n /** @type {number} punch effect radius */\n this.punchEffectRadius = 0; // 0x4c // initialized to 0\n /** @type {boolean} is power hit */\n this.isPowerHit = false; // 0x68 // initialized to 0 i.e. false\n }\n}\n\n/**\n * FUN_00403dd0\n * This is the Pikachu Volleyball physics engine!\n * This physics engine calculates and set the physics values for the next frame.\n *\n * @param {Player} player1 player on the left side\n * @param {Player} player2 player on the right side\n * @param {Ball} ball ball\n * @param {PikaUserInput[]} userInputArray userInputArray[0]: user input for player 1, userInputArray[1]: user input for player 2\n * @return {boolean} Is ball touching ground?\n */\nfunction physicsEngine(player1, player2, ball, userInputArray) {\n const isBallTouchingGround =\n processCollisionBetweenBallAndWorldAndSetBallPosition(ball);\n\n let player;\n let theOtherPlayer;\n for (let i = 0; i < 2; i++) {\n if (i === 0) {\n player = player1;\n theOtherPlayer = player2;\n } else {\n player = player2;\n theOtherPlayer = player1;\n }\n\n // FUN_00402d90 omitted\n // FUN_00402810 omitted\n // this javascript code is refactored not to need above two function except for\n // a part of FUN_00402d90:\n // FUN_00402d90 include FUN_004031b0(calculateExpectedLandingPointXFor)\n calculateExpectedLandingPointXFor(ball); // calculate expected_X;\n\n processPlayerMovementAndSetPlayerPosition(\n player,\n userInputArray[i],\n theOtherPlayer,\n ball\n );\n\n // FUN_00402830 omitted\n // FUN_00406020 omitted\n // These two functions omitted above maybe participate in graphic drawing for a player\n }\n\n for (let i = 0; i < 2; i++) {\n if (i === 0) {\n player = player1;\n } else {\n player = player2;\n }\n\n // FUN_00402810 omitted: this javascript code is refactored not to need this function\n\n const isHappened = isCollisionBetweenBallAndPlayerHappened(\n ball,\n player.x,\n player.y\n );\n if (isHappened === true) {\n if (player.isCollisionWithBallHappened === false) {\n processCollisionBetweenBallAndPlayer(\n ball,\n player.x,\n userInputArray[i],\n player.state\n );\n player.isCollisionWithBallHappened = true;\n }\n } else {\n player.isCollisionWithBallHappened = false;\n }\n }\n\n // FUN_00403040\n // FUN_00406020\n // These two functions omitted above maybe participate in graphic drawing for a player\n\n return isBallTouchingGround;\n}\n\n/**\n * FUN_00403070\n * Is collision between ball and player happened?\n * @param {Ball} ball\n * @param {Player[\"x\"]} playerX player.x\n * @param {Player[\"y\"]} playerY player.y\n * @return {boolean}\n */\nfunction isCollisionBetweenBallAndPlayerHappened(ball, playerX, playerY) {\n let diff = ball.x - playerX;\n if (Math.abs(diff) <= PLAYER_HALF_LENGTH) {\n diff = ball.y - playerY;\n if (Math.abs(diff) <= PLAYER_HALF_LENGTH) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * FUN_00402dc0\n * Process collision between ball and world and set ball position\n * @param {Ball} ball\n * @return {boolean} Is ball touching ground?\n */\nfunction processCollisionBetweenBallAndWorldAndSetBallPosition(ball) {\n // This is not part of this function in the original assembly code.\n // In the original assembly code, it is processed in other function (FUN_00402ee0)\n // But it is proper to process here.\n ball.previousPreviousX = ball.previousX;\n ball.previousPreviousY = ball.previousY;\n ball.previousX = ball.x;\n ball.previousY = ball.y;\n\n // \"(ball.xVelocity / 2) | 0\" is integer division by 2\n let futureFineRotation = ball.fineRotation + ((ball.xVelocity / 2) | 0);\n // If futureFineRotation === 50, it skips next if statement finely.\n // Then ball.fineRotation = 50, and then ball.rotation = 5 (which designates hyper ball sprite!).\n // In this way, hyper ball glitch occur!\n // If this happen at the end of round,\n // since ball.xVelocity is 0-initialized at each start of round,\n // hyper ball sprite is rendered continuously until a collision happens.\n if (futureFineRotation < 0) {\n futureFineRotation += 50;\n } else if (futureFineRotation > 50) {\n futureFineRotation += -50;\n }\n ball.fineRotation = futureFineRotation;\n ball.rotation = (ball.fineRotation / 10) | 0; // integer division\n\n const futureBallX = ball.x + ball.xVelocity;\n /*\n If the center of ball would get out of left world bound or right world bound, bounce back.\n \n In this if statement, when considering left-right symmetry,\n \"futureBallX > GROUND_WIDTH\" should be changed to \"futureBallX > (GROUND_WIDTH - BALL_RADIUS)\",\n or \"futureBallX < BALL_RADIUS\" should be changed to \"futureBallX < 0\".\n Maybe the former one is more proper when seeing Pikachu player's x-direction boundary.\n Is this a mistake of the author of the original game?\n Or, was it set to this value to resolve infinite loop problem? (See comments on the constant INFINITE_LOOP_LIMIT.)\n If apply (futureBallX > (GROUND_WIDTH - BALL_RADIUS)), and if the maximum number of loop is not limited,\n it is observed that infinite loop in the function expectedLandingPointXWhenPowerHit does not terminate.\n */\n if (futureBallX < BALL_RADIUS || futureBallX > GROUND_WIDTH) {\n ball.xVelocity = -ball.xVelocity;\n }\n\n let futureBallY = ball.y + ball.yVelocity;\n // if the center of ball would get out of upper world bound\n if (futureBallY < 0) {\n ball.yVelocity = 1;\n }\n\n // If ball touches net\n if (\n Math.abs(ball.x - GROUND_HALF_WIDTH) < NET_PILLAR_HALF_WIDTH &&\n ball.y > NET_PILLAR_TOP_TOP_Y_COORD\n ) {\n if (ball.y <= NET_PILLAR_TOP_BOTTOM_Y_COORD) {\n if (ball.yVelocity > 0) {\n ball.yVelocity = -ball.yVelocity;\n }\n } else {\n if (ball.x < GROUND_HALF_WIDTH) {\n ball.xVelocity = -Math.abs(ball.xVelocity);\n } else {\n ball.xVelocity = Math.abs(ball.xVelocity);\n }\n }\n }\n\n futureBallY = ball.y + ball.yVelocity;\n // if ball would touch ground\n if (futureBallY > BALL_TOUCHING_GROUND_Y_COORD) {\n // FUN_00408470 omitted\n // the function omitted above receives 100 * (ball.x - 216),\n // i.e. horizontal displacement from net maybe for stereo sound?\n // code function (ballpointer + 0x28 + 0x10)? omitted\n // the omitted two functions maybe do a part of sound playback role.\n ball.sound.ballTouchesGround = true;\n\n ball.yVelocity = -ball.yVelocity;\n ball.punchEffectX = ball.x;\n ball.y = BALL_TOUCHING_GROUND_Y_COORD;\n ball.punchEffectRadius = BALL_RADIUS;\n ball.punchEffectY = BALL_TOUCHING_GROUND_Y_COORD + BALL_RADIUS;\n return true;\n }\n ball.y = futureBallY;\n ball.x = ball.x + ball.xVelocity;\n ball.yVelocity += 1;\n\n return false;\n}\n\n/**\n * FUN_00401fc0\n * Process player movement according to user input and set player position\n * @param {Player} player\n * @param {PikaUserInput} userInput\n * @param {Player} theOtherPlayer\n * @param {Ball} ball\n */\nfunction processPlayerMovementAndSetPlayerPosition(\n player,\n userInput,\n theOtherPlayer,\n ball\n) {\n if (player.isComputer === true) {\n letComputerDecideUserInput(player, ball, theOtherPlayer, userInput);\n }\n\n // if player is lying down.. don't move\n if (player.state === 4) {\n player.lyingDownDurationLeft += -1;\n if (player.lyingDownDurationLeft < -1) {\n player.state = 0;\n }\n return;\n }\n\n // process x-direction movement\n let playerVelocityX = 0;\n if (player.state < 5) {\n if (player.state < 3) {\n playerVelocityX = userInput.xDirection * 6;\n } else {\n // player.state === 3 i.e. player is diving..\n playerVelocityX = player.divingDirection * 8;\n }\n }\n\n const futurePlayerX = player.x + playerVelocityX;\n player.x = futurePlayerX;\n\n // process player's x-direction world boundary\n if (player.isPlayer2 === false) {\n // if player is player1\n if (futurePlayerX < PLAYER_HALF_LENGTH) {\n player.x = PLAYER_HALF_LENGTH;\n } else if (futurePlayerX > GROUND_HALF_WIDTH - PLAYER_HALF_LENGTH) {\n player.x = GROUND_HALF_WIDTH - PLAYER_HALF_LENGTH;\n }\n } else {\n // if player is player2\n if (futurePlayerX < GROUND_HALF_WIDTH + PLAYER_HALF_LENGTH) {\n player.x = GROUND_HALF_WIDTH + PLAYER_HALF_LENGTH;\n } else if (futurePlayerX > GROUND_WIDTH - PLAYER_HALF_LENGTH) {\n player.x = GROUND_WIDTH - PLAYER_HALF_LENGTH;\n }\n }\n\n // jump\n if (\n player.state < 3 &&\n userInput.yDirection === -1 && // up-direction input\n player.y === PLAYER_TOUCHING_GROUND_Y_COORD // player is touching on the ground\n ) {\n player.yVelocity = -16;\n player.state = 1;\n player.frameNumber = 0;\n // maybe-stereo-sound function FUN_00408470 (0x90) omitted:\n // refer to a detailed comment above about this function\n // maybe-sound code function (playerpointer + 0x90 + 0x10)? omitted\n player.sound.chu = true;\n }\n\n // gravity\n const futurePlayerY = player.y + player.yVelocity;\n player.y = futurePlayerY;\n if (futurePlayerY < PLAYER_TOUCHING_GROUND_Y_COORD) {\n player.yVelocity += 1;\n } else if (futurePlayerY > PLAYER_TOUCHING_GROUND_Y_COORD) {\n // if player is landing..\n player.yVelocity = 0;\n player.y = PLAYER_TOUCHING_GROUND_Y_COORD;\n player.frameNumber = 0;\n if (player.state === 3) {\n // if player is diving..\n player.state = 4;\n player.frameNumber = 0;\n player.lyingDownDurationLeft = 3;\n } else {\n player.state = 0;\n }\n }\n\n if (userInput.powerHit === 1) {\n if (player.state === 1) {\n // if player is jumping..\n // then player do power hit!\n player.delayBeforeNextFrame = 5;\n player.frameNumber = 0;\n player.state = 2;\n // maybe-sound function (playerpointer + 0x90 + 0x18)? omitted\n // maybe-stereo-sound function FUN_00408470 (0x90) omitted:\n // refer to a detailed comment above about this function\n // maybe-sound function (playerpointer + 0x90 + 0x14)? omitted\n player.sound.pika = true;\n } else if (player.state === 0 && userInput.xDirection !== 0) {\n // then player do diving!\n player.state = 3;\n player.frameNumber = 0;\n player.divingDirection = userInput.xDirection;\n player.yVelocity = -5;\n // maybe-stereo-sound function FUN_00408470 (0x90) omitted:\n // refer to a detailed comment above about this function\n // maybe-sound code function (playerpointer + 0x90 + 0x10)? omitted\n player.sound.chu = true;\n }\n }\n\n if (player.state === 1) {\n player.frameNumber = (player.frameNumber + 1) % 3;\n } else if (player.state === 2) {\n if (player.delayBeforeNextFrame < 1) {\n player.frameNumber += 1;\n if (player.frameNumber > 4) {\n player.frameNumber = 0;\n player.state = 1;\n }\n } else {\n player.delayBeforeNextFrame -= 1;\n }\n } else if (player.state === 0) {\n player.delayBeforeNextFrame += 1;\n if (player.delayBeforeNextFrame > 3) {\n player.delayBeforeNextFrame = 0;\n const futureFrameNumber =\n player.frameNumber + player.normalStatusArmSwingDirection;\n if (futureFrameNumber < 0 || futureFrameNumber > 4) {\n player.normalStatusArmSwingDirection =\n -player.normalStatusArmSwingDirection;\n }\n player.frameNumber =\n player.frameNumber + player.normalStatusArmSwingDirection;\n }\n }\n\n if (player.gameEnded === true) {\n if (player.state === 0) {\n if (player.isWinner === true) {\n player.state = 5;\n // maybe-stereo-sound function FUN_00408470 (0x90) omitted:\n // refer to a detailed comment above about this function\n // maybe-sound code function (0x98 + 0x10) omitted\n player.sound.pipikachu = true;\n } else {\n player.state = 6;\n }\n player.delayBeforeNextFrame = 0;\n player.frameNumber = 0;\n }\n processGameEndFrameFor(player);\n }\n}\n\n/**\n * FUN_004025e0\n * Process game end frame (for winner and loser motions) for the given player\n * @param {Player} player\n */\nfunction processGameEndFrameFor(player) {\n if (player.gameEnded === true && player.frameNumber < 4) {\n player.delayBeforeNextFrame += 1;\n if (player.delayBeforeNextFrame > 4) {\n player.delayBeforeNextFrame = 0;\n player.frameNumber += 1;\n }\n }\n}\n\n/**\n * FUN_004030a0\n * Process collision between ball and player.\n * This function only sets velocity of ball and expected landing point x of ball.\n * This function does not set position of ball.\n * The ball position is set by {@link processCollisionBetweenBallAndWorldAndSetBallPosition} function\n *\n * @param {Ball} ball\n * @param {Player[\"x\"]} playerX\n * @param {PikaUserInput} userInput\n * @param {Player[\"state\"]} playerState\n */\nfunction processCollisionBetweenBallAndPlayer(\n ball,\n playerX,\n userInput,\n playerState\n) {\n // playerX is maybe pika's x position\n // if collision occur,\n // greater the x position difference between pika and ball,\n // greater the x velocity of the ball.\n if (ball.x < playerX) {\n // Since javascript division is float division by default,\n // Here we use \"| 0\" to do integer division (refer to: https://stackoverflow.com/a/17218003/8581025)\n ball.xVelocity = -((Math.abs(ball.x - playerX) / 3) | 0);\n } else if (ball.x > playerX) {\n ball.xVelocity = (Math.abs(ball.x - playerX) / 3) | 0;\n }\n\n // If ball velocity x is 0, randomly choose one of -1, 0, 1.\n if (ball.xVelocity === 0) {\n ball.xVelocity = (rand() % 3) - 1;\n }\n\n const ballAbsYVelocity = Math.abs(ball.yVelocity);\n ball.yVelocity = -ballAbsYVelocity;\n\n if (ballAbsYVelocity < 15) {\n ball.yVelocity = -15;\n }\n\n // player is jumping and power hitting\n if (playerState === 2) {\n if (ball.x < GROUND_HALF_WIDTH) {\n ball.xVelocity = (Math.abs(userInput.xDirection) + 1) * 10;\n } else {\n ball.xVelocity = -(Math.abs(userInput.xDirection) + 1) * 10;\n }\n ball.punchEffectX = ball.x;\n ball.punchEffectY = ball.y;\n\n ball.yVelocity = Math.abs(ball.yVelocity) * userInput.yDirection * 2;\n ball.punchEffectRadius = BALL_RADIUS;\n // maybe-stereo-sound function FUN_00408470 (0x90) omitted:\n // refer to a detailed comment above about this function\n // maybe-soundcode function (ballpointer + 0x24 + 0x10) omitted:\n ball.sound.powerHit = true;\n\n ball.isPowerHit = true;\n } else {\n ball.isPowerHit = false;\n }\n\n calculateExpectedLandingPointXFor(ball);\n}\n\n/**\n * FUN_004031b0\n * Calculate x coordinate of expected landing point of the ball\n * @param {Ball} ball\n */\nfunction calculateExpectedLandingPointXFor(ball) {\n const copyBall = {\n x: ball.x,\n y: ball.y,\n xVelocity: ball.xVelocity,\n yVelocity: ball.yVelocity,\n };\n let loopCounter = 0;\n while (true) {\n loopCounter++;\n\n const futureCopyBallX = copyBall.xVelocity + copyBall.x;\n if (futureCopyBallX < BALL_RADIUS || futureCopyBallX > GROUND_WIDTH) {\n copyBall.xVelocity = -copyBall.xVelocity;\n }\n if (copyBall.y + copyBall.yVelocity < 0) {\n copyBall.yVelocity = 1;\n }\n\n // If copy ball touches net\n if (\n Math.abs(copyBall.x - GROUND_HALF_WIDTH) < NET_PILLAR_HALF_WIDTH &&\n copyBall.y > NET_PILLAR_TOP_TOP_Y_COORD\n ) {\n // It maybe should be <= NET_PILLAR_TOP_BOTTOM_Y_COORD as in FUN_00402dc0, is it the original game author's mistake?\n if (copyBall.y < NET_PILLAR_TOP_BOTTOM_Y_COORD) {\n if (copyBall.yVelocity > 0) {\n copyBall.yVelocity = -copyBall.yVelocity;\n }\n } else {\n if (copyBall.x < GROUND_HALF_WIDTH) {\n copyBall.xVelocity = -Math.abs(copyBall.xVelocity);\n } else {\n copyBall.xVelocity = Math.abs(copyBall.xVelocity);\n }\n }\n }\n\n copyBall.y = copyBall.y + copyBall.yVelocity;\n // if copyBall would touch ground\n if (\n copyBall.y > BALL_TOUCHING_GROUND_Y_COORD ||\n loopCounter >= INFINITE_LOOP_LIMIT\n ) {\n break;\n }\n copyBall.x = copyBall.x + copyBall.xVelocity;\n copyBall.yVelocity += 1;\n }\n ball.expectedLandingPointX = copyBall.x;\n}\n\n/**\n * FUN_00402360\n * Computer controls its player by this function.\n * Computer decides the user input for the player it controls,\n * according to the game situation it figures out\n * by the given parameters (player, ball and theOtherPlayer),\n * and reflects these to the given user input object.\n *\n * @param {Player} player The player whom computer controls\n * @param {Ball} ball ball\n * @param {Player} theOtherPlayer The other player\n * @param {PikaUserInput} userInput user input of the player whom computer controls\n */\nfunction letComputerDecideUserInput(player, ball, theOtherPlayer, userInput) {\n userInput.xDirection = 0;\n userInput.yDirection = 0;\n userInput.powerHit = 0;\n\n let virtualExpectedLandingPointX = ball.expectedLandingPointX;\n if (\n Math.abs(ball.x - player.x) > 100 &&\n Math.abs(ball.xVelocity) < player.computerBoldness + 5\n ) {\n const leftBoundary = Number(player.isPlayer2) * GROUND_HALF_WIDTH;\n if (\n (ball.expectedLandingPointX <= leftBoundary ||\n ball.expectedLandingPointX >=\n Number(player.isPlayer2) * GROUND_WIDTH + GROUND_HALF_WIDTH) &&\n player.computerWhereToStandBy === 0\n ) {\n // If conditions above met, the computer estimates the proper location to stay as the middle point of their side\n virtualExpectedLandingPointX =\n leftBoundary + ((GROUND_HALF_WIDTH / 2) | 0);\n }\n }\n\n if (\n Math.abs(virtualExpectedLandingPointX - player.x) >\n player.computerBoldness + 8\n ) {\n if (player.x < virtualExpectedLandingPointX) {\n userInput.xDirection = 1;\n } else {\n userInput.xDirection = -1;\n }\n } else if (rand() % 20 === 0) {\n player.computerWhereToStandBy = rand() % 2;\n }\n\n if (player.state === 0) {\n if (\n Math.abs(ball.xVelocity) < player.computerBoldness + 3 &&\n Math.abs(ball.x - player.x) < PLAYER_HALF_LENGTH &&\n ball.y > -36 &&\n ball.y < 10 * player.computerBoldness + 84 &&\n ball.yVelocity > 0\n ) {\n userInput.yDirection = -1;\n }\n\n const leftBoundary = Number(player.isPlayer2) * GROUND_HALF_WIDTH;\n const rightBoundary = (Number(player.isPlayer2) + 1) * GROUND_HALF_WIDTH;\n if (\n ball.expectedLandingPointX > leftBoundary &&\n ball.expectedLandingPointX < rightBoundary &&\n Math.abs(ball.x - player.x) >\n player.computerBoldness * 5 + PLAYER_LENGTH &&\n ball.x > leftBoundary &&\n ball.x < rightBoundary &&\n ball.y > 174\n ) {\n // If conditions above met, the computer decides to dive!\n userInput.powerHit = 1;\n if (player.x < ball.x) {\n userInput.xDirection = 1;\n } else {\n userInput.xDirection = -1;\n }\n }\n } else if (player.state === 1 || player.state === 2) {\n if (Math.abs(ball.x - player.x) > 8) {\n if (player.x < ball.x) {\n userInput.xDirection = 1;\n } else {\n userInput.xDirection = -1;\n }\n }\n if (Math.abs(ball.x - player.x) < 48 && Math.abs(ball.y - player.y) < 48) {\n const willInputPowerHit = decideWhetherInputPowerHit(\n player,\n ball,\n theOtherPlayer,\n userInput\n );\n if (willInputPowerHit === true) {\n userInput.powerHit = 1;\n if (\n Math.abs(theOtherPlayer.x - player.x) < 80 &&\n userInput.yDirection !== -1\n ) {\n userInput.yDirection = -1;\n }\n }\n }\n }\n}\n\n/**\n * FUN_00402630\n * This function is called by {@link letComputerDecideUserInput},\n * and also sets x and y direction user input so that it participate in\n * the decision of the direction of power hit.\n * @param {Player} player the player whom computer controls\n * @param {Ball} ball ball\n * @param {Player} theOtherPlayer The other player\n * @param {PikaUserInput} userInput user input for the player whom computer controls\n * @return {boolean} Will input power hit?\n */\nfunction decideWhetherInputPowerHit(player, ball, theOtherPlayer, userInput) {\n if (rand() % 2 === 0) {\n for (let xDirection = 1; xDirection > -1; xDirection--) {\n for (let yDirection = -1; yDirection < 2; yDirection++) {\n const expectedLandingPointX = expectedLandingPointXWhenPowerHit(\n xDirection,\n yDirection,\n ball\n );\n if (\n (expectedLandingPointX <=\n Number(player.isPlayer2) * GROUND_HALF_WIDTH ||\n expectedLandingPointX >=\n Number(player.isPlayer2) * GROUND_WIDTH + GROUND_HALF_WIDTH) &&\n Math.abs(expectedLandingPointX - theOtherPlayer.x) > PLAYER_LENGTH\n ) {\n userInput.xDirection = xDirection;\n userInput.yDirection = yDirection;\n return true;\n }\n }\n }\n } else {\n for (let xDirection = 1; xDirection > -1; xDirection--) {\n for (let yDirection = 1; yDirection > -2; yDirection--) {\n const expectedLandingPointX = expectedLandingPointXWhenPowerHit(\n xDirection,\n yDirection,\n ball\n );\n if (\n (expectedLandingPointX <=\n Number(player.isPlayer2) * GROUND_HALF_WIDTH ||\n expectedLandingPointX >=\n Number(player.isPlayer2) * GROUND_WIDTH + GROUND_HALF_WIDTH) &&\n Math.abs(expectedLandingPointX - theOtherPlayer.x) > PLAYER_LENGTH\n ) {\n userInput.xDirection = xDirection;\n userInput.yDirection = yDirection;\n return true;\n }\n }\n }\n }\n return false;\n}\n\n/**\n * FUN_00402870\n * This function is called by {@link decideWhetherInputPowerHit},\n * and calculates the expected x coordinate of the landing point of the ball\n * when power hit\n * @param {PikaUserInput[\"xDirection\"]} userInputXDirection\n * @param {PikaUserInput[\"yDirection\"]} userInputYDirection\n * @param {Ball} ball\n * @return {number} x coord of expected landing point when power hit the ball\n */\nfunction expectedLandingPointXWhenPowerHit(\n userInputXDirection,\n userInputYDirection,\n ball\n) {\n const copyBall = {\n x: ball.x,\n y: ball.y,\n xVelocity: ball.xVelocity,\n yVelocity: ball.yVelocity,\n };\n if (copyBall.x < GROUND_HALF_WIDTH) {\n copyBall.xVelocity = (Math.abs(userInputXDirection) + 1) * 10;\n } else {\n copyBall.xVelocity = -(Math.abs(userInputXDirection) + 1) * 10;\n }\n copyBall.yVelocity = Math.abs(copyBall.yVelocity) * userInputYDirection * 2;\n\n let loopCounter = 0;\n while (true) {\n loopCounter++;\n\n const futureCopyBallX = copyBall.x + copyBall.xVelocity;\n if (futureCopyBallX < BALL_RADIUS || futureCopyBallX > GROUND_WIDTH) {\n copyBall.xVelocity = -copyBall.xVelocity;\n }\n if (copyBall.y + copyBall.yVelocity < 0) {\n copyBall.yVelocity = 1;\n }\n if (\n Math.abs(copyBall.x - GROUND_HALF_WIDTH) < NET_PILLAR_HALF_WIDTH &&\n copyBall.y > NET_PILLAR_TOP_TOP_Y_COORD\n ) {\n /*\n The code below maybe is intended to make computer do mistakes.\n The player controlled by computer occasionally power hit ball that is bounced back by the net pillar,\n since code below do not anticipate the bounce back.\n */\n if (copyBall.yVelocity > 0) {\n copyBall.yVelocity = -copyBall.yVelocity;\n }\n /*\n An alternative code for making the computer not do those mistakes is as below.\n\n if (copyBall.y <= NET_PILLAR_TOP_BOTTOM_Y_COORD) {\n if (copyBall.yVelocity > 0) {\n copyBall.yVelocity = -copyBall.yVelocity;\n }\n } else {\n if (copyBall.x < GROUND_HALF_WIDTH) {\n copyBall.xVelocity = -Math.abs(copyBall.xVelocity);\n } else {\n copyBall.xVelocity = Math.abs(copyBall.xVelocity);\n }\n }\n */\n }\n copyBall.y = copyBall.y + copyBall.yVelocity;\n if (\n copyBall.y > BALL_TOUCHING_GROUND_Y_COORD ||\n loopCounter >= INFINITE_LOOP_LIMIT\n ) {\n return copyBall.x;\n }\n copyBall.x = copyBall.x + copyBall.xVelocity;\n copyBall.yVelocity += 1;\n }\n}\n","/**\n * This module takes charge of the physical motion of clouds (on the sky) and wave (on the bottom of game screen) in the game.\n * It is also a Model in MVC pattern and also rendered by \"view.js\".\n *\n * It is gained by reverse engineering the original game.\n * The address of the original function is in the comment.\n * ex) FUN_00404770 means the function at the address 00404770 in the machine code.\n */\n'use strict';\nimport { rand } from './rand.js';\n\n/**\n * Class represents a cloud\n */\nexport class Cloud {\n constructor() {\n this.topLeftPointX = -68 + (rand() % (432 + 68));\n this.topLeftPointY = rand() % 152;\n this.topLeftPointXVelocity = 1 + (rand() % 2);\n this.sizeDiffTurnNumber = rand() % 11;\n }\n\n get sizeDiff() {\n // this same as return [0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0][this.sizeDiffTurnNumber]\n return 5 - Math.abs(this.sizeDiffTurnNumber - 5);\n }\n\n get spriteTopLeftPointX() {\n return this.topLeftPointX - this.sizeDiff;\n }\n\n get spriteTopLeftPointY() {\n return this.topLeftPointY - this.sizeDiff;\n }\n\n get spriteWidth() {\n return 48 + 2 * this.sizeDiff;\n }\n\n get spriteHeight() {\n return 24 + 2 * this.sizeDiff;\n }\n}\n\n/**\n * Class representing wave\n */\nexport class Wave {\n constructor() {\n this.verticalCoord = 0;\n this.verticalCoordVelocity = 2;\n this.yCoords = [];\n for (let i = 0; i < 432 / 16; i++) {\n this.yCoords.push(314);\n }\n }\n}\n\n/**\n * FUN_00404770\n * Move clouds and wave\n * @param {Cloud[]} cloudArray\n * @param {Wave} wave\n */\nexport function cloudAndWaveEngine(cloudArray, wave) {\n for (let i = 0; i < 10; i++) {\n cloudArray[i].topLeftPointX += cloudArray[i].topLeftPointXVelocity;\n if (cloudArray[i].topLeftPointX > 432) {\n cloudArray[i].topLeftPointX = -68;\n cloudArray[i].topLeftPointY = rand() % 152;\n cloudArray[i].topLeftPointXVelocity = 1 + (rand() % 2);\n }\n cloudArray[i].sizeDiffTurnNumber =\n (cloudArray[i].sizeDiffTurnNumber + 1) % 11;\n }\n\n wave.verticalCoord += wave.verticalCoordVelocity;\n if (wave.verticalCoord > 32) {\n wave.verticalCoord = 32;\n wave.verticalCoordVelocity = -1;\n } else if (wave.verticalCoord < 0 && wave.verticalCoordVelocity < 0) {\n wave.verticalCoordVelocity = 2;\n wave.verticalCoord = -(rand() % 40);\n }\n\n for (let i = 0; i < 432 / 16; i++) {\n wave.yCoords[i] = 314 - wave.verticalCoord + (rand() % 3);\n }\n}\n","/**\n * The View part in the MVC pattern\n *\n * Some codes in this module were gained by reverse engineering the original machine code.\n * The codes gained by reverse engineering are commented by the address of the function referred to in the machine code.\n * ex) FUN_00405d50 means the function at the address 00405d50 in the machine code.\n */\n'use strict';\nimport { AnimatedSprite } from '@pixi/sprite-animated';\nimport { Sprite } from '@pixi/sprite';\nimport { Container } from '@pixi/display';\nimport { Cloud, Wave, cloudAndWaveEngine } from './cloud_and_wave.js';\nimport { ASSETS_PATH } from './assets_path.js';\n\n/** @typedef {import('@pixi/loaders').LoaderResource} LoaderResource */\n/** @typedef {import('@pixi/core').Texture} Texture */\n\nconst TEXTURES = ASSETS_PATH.TEXTURES;\n\n/** @constant @type {number} number of clouds to be rendered */\nconst NUM_OF_CLOUDS = 10;\n\n/**\n * Class representing intro view where the man with a briefcase mark appears\n */\nexport class IntroView {\n /**\n * Create an IntroView object\n * @param {Object.} resources loader.resources\n */\n constructor(resources) {\n const textures = resources[ASSETS_PATH.SPRITE_SHEET].textures;\n\n this.mark = makeSpriteWithAnchorXY(textures, TEXTURES.MARK, 0.5, 0.5);\n this.mark.x = 432 / 2;\n this.mark.y = 304 / 2;\n\n this.container = new Container();\n this.container.addChild(this.mark);\n }\n\n /** @return {boolean} Is visible? */\n get visible() {\n return this.container.visible;\n }\n\n /** @param {boolean} bool Is visible? */\n set visible(bool) {\n this.container.visible = bool;\n }\n\n /**\n * draw \"a man with a briefcase\" mark\n * @param {number} frameCounter\n */\n drawMark(frameCounter) {\n const mark = this.mark;\n if (frameCounter === 0) {\n mark.alpha = 0;\n return;\n }\n if (frameCounter < 100) {\n mark.alpha = Math.min(1, mark.alpha + 1 / 25);\n } else if (frameCounter >= 100) {\n mark.alpha = Math.max(0, mark.alpha - 1 / 25);\n }\n }\n}\n\n/**\n * Class representing menu view where you can select \"play with computer\" or \"play with friend\"\n */\nexport class MenuView {\n /**\n * Create a MenuView object\n * @param {Object.} resources loader.resources\n */\n constructor(resources) {\n const textures = resources[ASSETS_PATH.SPRITE_SHEET].textures;\n\n this.messages = {\n pokemon: makeSpriteWithAnchorXY(textures, TEXTURES.POKEMON, 0, 0),\n pikachuVolleyball: makeSpriteWithAnchorXY(\n textures,\n TEXTURES.PIKACHU_VOLLEYBALL,\n 0,\n 0\n ),\n withWho: [\n makeSpriteWithAnchorXY(textures, TEXTURES.WITH_COMPUTER, 0, 0),\n makeSpriteWithAnchorXY(textures, TEXTURES.WITH_FRIEND, 0, 0),\n ],\n sachisoft: makeSpriteWithAnchorXY(textures, TEXTURES.SACHISOFT, 0, 0),\n fight: makeSpriteWithAnchorXY(textures, TEXTURES.FIGHT, 0, 0),\n };\n this.sittingPikachuTilesContainer =\n makeSittingPikachuTilesContainer(textures);\n\n // referred to FUN_004059f0\n this.messages.sachisoft.x = 216 - this.messages.sachisoft.texture.width / 2;\n this.messages.sachisoft.y = 264;\n\n // referred to FUN_00405b70\n this.messages.pikachuVolleyball.x = 140;\n this.messages.pikachuVolleyball.y = 80;\n this.messages.pokemon.x = 170;\n this.messages.pokemon.y = 40;\n\n this.container = new Container();\n this.container.addChild(this.sittingPikachuTilesContainer);\n this.container.addChild(this.messages.pokemon);\n this.container.addChild(this.messages.pikachuVolleyball);\n this.container.addChild(this.messages.withWho[0]);\n this.container.addChild(this.messages.withWho[1]);\n this.container.addChild(this.messages.sachisoft);\n this.container.addChild(this.messages.fight);\n this.initializeVisibles();\n\n this.sittingPikachuTilesDisplacement = 0;\n this.selectedWithWho = -1; // 0: with computer, 1: with friend, -1: not selected\n this.selectedWithWhoMessageSizeIncrement = 2;\n }\n\n /** @return {boolean} Is visible? */\n get visible() {\n return this.container.visible;\n }\n\n /** @param {boolean} bool Is visible? */\n set visible(bool) {\n this.container.visible = bool;\n\n // when turn off view, initialize visibilities of sprites in this view\n if (bool === false) {\n this.initializeVisibles();\n }\n }\n\n initializeVisibles() {\n for (const prop in this.messages) {\n this.messages[prop].visible = false;\n }\n }\n\n /**\n * referred to FUN_00405d50\n * Draw \"fight!\" message which get bigger and smaller as frame goes\n * @param {number} frameCounter\n */\n drawFightMessage(frameCounter) {\n const sizeArray = [20, 22, 25, 27, 30, 27, 25, 22, 20];\n const fightMessage = this.messages.fight;\n const w = fightMessage.texture.width;\n const h = fightMessage.texture.height;\n\n if (frameCounter === 0) {\n fightMessage.visible = true;\n }\n\n if (frameCounter < 30) {\n const halfWidth = Math.floor(Math.floor((frameCounter * w) / 30) / 2);\n const halfHeight = Math.floor(Math.floor((frameCounter * h) / 30) / 2);\n fightMessage.width = halfWidth * 2; // width\n fightMessage.height = halfHeight * 2; // height\n fightMessage.x = 100 - halfWidth; // x coord\n fightMessage.y = 70 - halfHeight; // y coord\n } else {\n const index = (frameCounter + 1) % 9;\n // code ...\n const halfWidth = Math.floor(Math.floor((sizeArray[index] * w) / 30) / 2);\n const halfHeight = Math.floor(\n Math.floor((sizeArray[index] * h) / 30) / 2\n );\n fightMessage.width = halfWidth * 2; // width\n fightMessage.height = halfHeight * 2; // height\n fightMessage.y = 70 - halfHeight; // y coord\n fightMessage.x = 100 - halfWidth; // x coord\n }\n }\n\n /**\n * Draw sachisoft message as frame goes\n * @param {number} frameCounter\n */\n drawSachisoft(frameCounter) {\n if (frameCounter === 0) {\n this.messages.sachisoft.visible = true;\n this.messages.sachisoft.alpha = 0;\n }\n this.messages.sachisoft.alpha = Math.min(\n 1,\n this.messages.sachisoft.alpha + 0.04\n );\n\n if (frameCounter > 70) {\n this.messages.sachisoft.alpha = 1;\n }\n }\n\n /**\n * referred to FUN_00405ca0\n * Draw sitting pikachu tiles as frame goes\n * @param {number} frameCounter\n */\n drawSittingPikachuTiles(frameCounter) {\n if (frameCounter === 0) {\n this.sittingPikachuTilesContainer.visible = true;\n this.sittingPikachuTilesContainer.alpha = 0;\n }\n\n // movement\n // @ts-ignore\n const h = this.sittingPikachuTilesContainer.getChildAt(0).texture.height;\n this.sittingPikachuTilesDisplacement =\n (this.sittingPikachuTilesDisplacement + 2) % h;\n this.sittingPikachuTilesContainer.x = -this.sittingPikachuTilesDisplacement;\n this.sittingPikachuTilesContainer.y = -this.sittingPikachuTilesDisplacement;\n\n if (frameCounter > 30) {\n // alpha\n this.sittingPikachuTilesContainer.alpha = Math.min(\n 1,\n this.sittingPikachuTilesContainer.alpha + 0.04\n );\n }\n\n if (frameCounter > 70) {\n this.sittingPikachuTilesContainer.alpha = 1;\n }\n }\n\n /**\n * referred to FUN_00405b70\n * Draw pikachu volleyball message as frame goes\n * @param {number} frameCounter\n */\n drawPikachuVolleyballMessage(frameCounter) {\n if (frameCounter === 0) {\n this.messages.pikachuVolleyball.visible = false;\n return;\n }\n\n if (frameCounter > 30) {\n this.messages.pikachuVolleyball.visible = true;\n }\n\n if (frameCounter > 30 && frameCounter <= 44) {\n const xDiff = 195 - 15 * (frameCounter - 30);\n this.messages.pikachuVolleyball.x = 140 + xDiff;\n } else if (frameCounter > 44 && frameCounter <= 55) {\n this.messages.pikachuVolleyball.x = 140;\n this.messages.pikachuVolleyball.width = 200 - 15 * (frameCounter - 44);\n } else if (frameCounter > 55 && frameCounter <= 71) {\n this.messages.pikachuVolleyball.x = 140;\n this.messages.pikachuVolleyball.width = 40 + 15 * (frameCounter - 55);\n } else if (frameCounter > 71) {\n this.messages.pikachuVolleyball.x = 140;\n this.messages.pikachuVolleyball.width =\n this.messages.pikachuVolleyball.texture.width;\n }\n }\n\n /**\n * referred to FUN_00405b70\n * Draw pokemon message as frame goes\n * @param {number} frameCounter\n */\n drawPokemonMessage(frameCounter) {\n if (frameCounter === 0) {\n this.messages.pokemon.visible = false;\n return;\n }\n\n if (frameCounter > 71) {\n this.messages.pokemon.visible = true;\n }\n }\n\n /**\n * referred to FUN_00405ec0\n * Draw with who messages (with computer or with friend) as frame goes\n * @param {number} frameCounter\n */\n drawWithWhoMessages(frameCounter) {\n const withWho = this.messages.withWho;\n const w = withWho[0].texture.width;\n const h = withWho[0].texture.height;\n\n if (frameCounter === 0) {\n for (let i = 0; i < 2; i++) {\n withWho[i].visible = false;\n }\n return;\n }\n\n if (frameCounter > 70) {\n if (this.selectedWithWhoMessageSizeIncrement < 10) {\n this.selectedWithWhoMessageSizeIncrement += 1;\n }\n for (let i = 0; i < 2; i++) {\n const selected = Number(this.selectedWithWho === i); // 1 if selected, 0 otherwise\n const halfWidthIncrement =\n selected * (this.selectedWithWhoMessageSizeIncrement + 2);\n const halfHeightIncrement =\n selected * this.selectedWithWhoMessageSizeIncrement;\n\n withWho[i].visible = true;\n withWho[i].x = 216 - w / 2 - halfWidthIncrement;\n withWho[i].y = 184 + 30 * i - halfHeightIncrement;\n withWho[i].width = w + 2 * halfWidthIncrement;\n withWho[i].height = h + 2 * halfHeightIncrement;\n }\n }\n }\n\n /**\n * Select with who for the effect that selected option gets bigger\n * @param {number} i 0: with computer, 1: with friend\n */\n selectWithWho(i) {\n this.selectedWithWho = i;\n this.selectedWithWhoMessageSizeIncrement = 2;\n }\n}\n\n/**\n * Class represent a game view where pikachus, ball, clouds, waves, and backgrounds are\n */\nexport class GameView {\n /**\n * Create a GameView object\n * @param {Object.} resources\n */\n constructor(resources) {\n const textures = resources[ASSETS_PATH.SPRITE_SHEET].textures;\n\n // Display objects below\n this.bgContainer = makeBGContainer(textures);\n const playerSprites = makePlayerAnimatedSprites(textures);\n this.player1 = playerSprites[0];\n this.player2 = playerSprites[1];\n this.ball = makeBallAnimatedSprites(textures);\n this.ballHyper = makeSpriteWithAnchorXY(\n textures,\n TEXTURES.BALL_HYPER,\n 0.5,\n 0.5\n );\n this.ballTrail = makeSpriteWithAnchorXY(\n textures,\n TEXTURES.BALL_TRAIL,\n 0.5,\n 0.5\n );\n this.punch = makeSpriteWithAnchorXY(\n textures,\n TEXTURES.BALL_PUNCH,\n 0.5,\n 0.5\n );\n\n // this.scoreBoards[0] for player1, this.scoreBoards[1] for player2\n this.scoreBoards = [\n makeScoreBoardSprite(textures),\n makeScoreBoardSprite(textures),\n ];\n\n this.shadows = {\n forPlayer1: makeSpriteWithAnchorXY(textures, TEXTURES.SHADOW, 0.5, 0.5),\n forPlayer2: makeSpriteWithAnchorXY(textures, TEXTURES.SHADOW, 0.5, 0.5),\n forBall: makeSpriteWithAnchorXY(textures, TEXTURES.SHADOW, 0.5, 0.5),\n };\n\n this.messages = {\n gameStart: makeSpriteWithAnchorXY(textures, TEXTURES.GAME_START, 0, 0),\n ready: makeSpriteWithAnchorXY(textures, TEXTURES.READY, 0, 0),\n gameEnd: makeSpriteWithAnchorXY(textures, TEXTURES.GAME_END, 0, 0),\n };\n\n this.cloudContainer = makeCloudContainer(textures);\n this.waveContainer = makeWaveContainer(textures);\n\n // container which include whole display objects\n // Should be careful on addChild order\n // The later added, the more front(z-index) on screen\n this.container = new Container();\n this.container.addChild(this.bgContainer);\n this.container.addChild(this.cloudContainer);\n this.container.addChild(this.waveContainer);\n this.container.addChild(this.shadows.forPlayer1);\n this.container.addChild(this.shadows.forPlayer2);\n this.container.addChild(this.shadows.forBall);\n this.container.addChild(this.player1);\n this.container.addChild(this.player2);\n this.container.addChild(this.ballTrail);\n this.container.addChild(this.ballHyper);\n this.container.addChild(this.ball);\n this.container.addChild(this.punch);\n this.container.addChild(this.scoreBoards[0]);\n this.container.addChild(this.scoreBoards[1]);\n this.container.addChild(this.messages.gameStart);\n this.container.addChild(this.messages.ready);\n this.container.addChild(this.messages.gameEnd);\n\n // location and visibility setting\n this.bgContainer.x = 0;\n this.bgContainer.y = 0;\n this.cloudContainer.x = 0;\n this.cloudContainer.y = 0;\n this.waveContainer.x = 0;\n this.waveContainer.y = 0;\n\n this.messages.ready.x = 176;\n this.messages.ready.y = 38;\n this.scoreBoards[0].x = 14; // score board is 14 pixel distant from boundary\n this.scoreBoards[0].y = 10;\n this.scoreBoards[1].x = 432 - 32 - 32 - 14; // 32 pixel is for number (32x32px) width; one score board has tow numbers\n this.scoreBoards[1].y = 10;\n\n this.shadows.forPlayer1.y = 273;\n this.shadows.forPlayer2.y = 273;\n this.shadows.forBall.y = 273;\n\n this.initializeVisibles();\n\n // clouds and wave model.\n // This model is included in this view object, not on controller object\n // since it is not dependent on user input, and only used for rendering.\n this.cloudArray = [];\n for (let i = 0; i < NUM_OF_CLOUDS; i++) {\n this.cloudArray.push(new Cloud());\n }\n this.wave = new Wave();\n }\n\n /** @return {boolean} Is visible? */\n get visible() {\n return this.container.visible;\n }\n\n /** @param {boolean} bool Is visible? */\n set visible(bool) {\n this.container.visible = bool;\n\n // when turn off view\n if (bool === false) {\n this.initializeVisibles();\n }\n }\n\n initializeVisibles() {\n for (const prop in this.messages) {\n this.messages[prop].visible = false;\n }\n }\n\n /** @typedef {import(\"./physics\").PikaPhysics} PikaPhysics */\n /**\n * Draw players and ball in the given physics object\n * @param {PikaPhysics} physics PikaPhysics object to draw\n */\n drawPlayersAndBall(physics) {\n const player1 = physics.player1;\n const player2 = physics.player2;\n const ball = physics.ball;\n\n this.player1.x = player1.x;\n this.player1.y = player1.y;\n if (player1.state === 3 || player1.state === 4) {\n this.player1.scale.x = player1.divingDirection === -1 ? -1 : 1;\n } else {\n this.player1.scale.x = 1;\n }\n this.shadows.forPlayer1.x = player1.x;\n\n this.player2.x = player2.x;\n this.player2.y = player2.y;\n if (player2.state === 3 || player2.state === 4) {\n this.player2.scale.x = player2.divingDirection === 1 ? 1 : -1;\n } else {\n this.player2.scale.x = -1;\n }\n this.shadows.forPlayer2.x = player2.x;\n\n const frameNumber1 = getFrameNumberForPlayerAnimatedSprite(\n player1.state,\n player1.frameNumber\n );\n const frameNumber2 = getFrameNumberForPlayerAnimatedSprite(\n player2.state,\n player2.frameNumber\n );\n this.player1.gotoAndStop(frameNumber1);\n this.player2.gotoAndStop(frameNumber2);\n\n this.ball.x = ball.x;\n this.ball.y = ball.y;\n this.shadows.forBall.x = ball.x;\n this.ball.gotoAndStop(ball.rotation);\n\n // For punch effect, refer FUN_00402ee0\n if (ball.punchEffectRadius > 0) {\n ball.punchEffectRadius -= 2;\n this.punch.width = 2 * ball.punchEffectRadius;\n this.punch.height = 2 * ball.punchEffectRadius;\n this.punch.x = ball.punchEffectX;\n this.punch.y = ball.punchEffectY;\n this.punch.visible = true;\n } else {\n this.punch.visible = false;\n }\n\n if (ball.isPowerHit === true) {\n this.ballHyper.x = ball.previousX;\n this.ballHyper.y = ball.previousY;\n this.ballTrail.x = ball.previousPreviousX;\n this.ballTrail.y = ball.previousPreviousY;\n\n this.ballHyper.visible = true;\n this.ballTrail.visible = true;\n } else {\n this.ballHyper.visible = false;\n this.ballTrail.visible = false;\n }\n }\n\n /**\n * Draw scores to each score board\n * @param {number[]} scores [0] for player1 score, [1] for player2 score\n */\n drawScoresToScoreBoards(scores) {\n for (let i = 0; i < 2; i++) {\n const scoreBoard = this.scoreBoards[i];\n const score = scores[i];\n const unitsAnimatedSprite = scoreBoard.getChildAt(0);\n const tensAnimatedSprite = scoreBoard.getChildAt(1);\n // @ts-ignore\n unitsAnimatedSprite.gotoAndStop(score % 10);\n // @ts-ignore\n tensAnimatedSprite.gotoAndStop(Math.floor(score / 10) % 10);\n if (score >= 10) {\n tensAnimatedSprite.visible = true;\n } else {\n tensAnimatedSprite.visible = false;\n }\n }\n }\n\n /**\n * Draw clouds and wave\n */\n drawCloudsAndWave() {\n const cloudArray = this.cloudArray;\n const wave = this.wave;\n\n cloudAndWaveEngine(cloudArray, wave);\n\n for (let i = 0; i < NUM_OF_CLOUDS; i++) {\n const cloud = cloudArray[i];\n const cloudSprite = this.cloudContainer.getChildAt(i);\n cloudSprite.x = cloud.spriteTopLeftPointX;\n cloudSprite.y = cloud.spriteTopLeftPointY;\n // @ts-ignore\n cloudSprite.width = cloud.spriteWidth;\n // @ts-ignore\n cloudSprite.height = cloud.spriteHeight;\n }\n\n for (let i = 0; i < 432 / 16; i++) {\n const waveSprite = this.waveContainer.getChildAt(i);\n waveSprite.y = wave.yCoords[i];\n }\n }\n\n /**\n * refered FUN_00403f20\n * Draw game start message as frame goes\n * @param {number} frameCounter current frame number\n * @param {number} frameTotal total frame number for game start message\n */\n drawGameStartMessage(frameCounter, frameTotal) {\n if (frameCounter === 0) {\n this.messages.gameStart.visible = true;\n } else if (frameCounter >= frameTotal - 1) {\n this.messages.gameStart.visible = false;\n return;\n }\n\n const gameStartMessage = this.messages.gameStart;\n // game start message rendering\n const w = gameStartMessage.texture.width; // game start message texture width\n const h = gameStartMessage.texture.height; // game start message texture height\n const halfWidth = Math.floor((w * frameCounter) / 50);\n const halfHeight = Math.floor((h * frameCounter) / 50);\n gameStartMessage.x = 216 - halfWidth;\n gameStartMessage.y = 50 + 2 * halfHeight;\n gameStartMessage.width = 2 * halfWidth;\n gameStartMessage.height = 2 * halfHeight;\n }\n\n /**\n * Draw ready message\n * @param {boolean} bool turn on?\n */\n drawReadyMessage(bool) {\n this.messages.ready.visible = bool;\n }\n\n /**\n * Togle ready message.\n * Turn off if it's on, turn on if it's off.\n */\n toggleReadyMessage() {\n this.messages.ready.visible = !this.messages.ready.visible;\n }\n\n /**\n * refered FUN_00404070\n * Draw game end message as frame goes\n * @param {number} frameCounter\n */\n drawGameEndMessage(frameCounter) {\n const gameEndMessage = this.messages.gameEnd;\n const w = gameEndMessage.texture.width; // game end message texture width;\n const h = gameEndMessage.texture.height; // game end message texture height;\n\n if (frameCounter === 0) {\n gameEndMessage.visible = true;\n }\n if (frameCounter < 50) {\n const halfWidthIncrement = 2 * Math.floor(((50 - frameCounter) * w) / 50);\n const halfHeightIncrement =\n 2 * Math.floor(((50 - frameCounter) * h) / 50);\n\n gameEndMessage.x = 216 - w / 2 - halfWidthIncrement;\n gameEndMessage.y = 50 - halfHeightIncrement;\n gameEndMessage.width = w + 2 * halfWidthIncrement;\n gameEndMessage.height = h + 2 * halfHeightIncrement;\n } else {\n gameEndMessage.x = 216 - w / 2;\n gameEndMessage.y = 50;\n gameEndMessage.width = w;\n gameEndMessage.height = h;\n }\n }\n}\n\n/**\n * Class representing fade in out effect\n */\nexport class FadeInOut {\n constructor(resources) {\n const textures = resources[ASSETS_PATH.SPRITE_SHEET].textures;\n this.black = makeSpriteWithAnchorXY(textures, TEXTURES.BLACK, 0, 0);\n this.black.width = 432;\n this.black.height = 304;\n this.black.x = 0;\n this.black.y = 0;\n this.black.alpha = 1;\n }\n\n /** @return {boolean} Is visible? */\n get visible() {\n return this.black.visible;\n }\n\n /** @param {boolean} bool Is visible? */\n set visible(bool) {\n this.black.visible = bool;\n }\n\n /**\n * Set black alpha for fade in out\n * @param {number} alpha number in [0, 1]\n */\n setBlackAlphaTo(alpha) {\n this.black.alpha = alpha;\n if (this.black.alpha === 0) {\n this.black.visible = false;\n } else {\n this.black.visible = true;\n }\n }\n\n /**\n * Increase black alpha for fade in out\n * @param {number} alphaIncrement if alphaIncrement > 0: fade out, else fade in\n */\n changeBlackAlphaBy(alphaIncrement) {\n if (alphaIncrement >= 0) {\n this.black.alpha = Math.min(1, this.black.alpha + alphaIncrement);\n } else {\n this.black.alpha = Math.max(0, this.black.alpha + alphaIncrement);\n }\n if (this.black.alpha === 0) {\n this.black.visible = false;\n } else {\n this.black.visible = true;\n }\n }\n}\n\n/**\n * Make sitting pikachu tiles\n * @param {Object.} textures\n * @return {Container}\n */\nfunction makeSittingPikachuTilesContainer(textures) {\n const container = new Container();\n const texture = textures[TEXTURES.SITTING_PIKACHU];\n const w = texture.width;\n const h = texture.height;\n\n let tile;\n for (let j = 0; j < Math.floor(304 / h) + 2; j++) {\n for (let i = 0; i < Math.floor(432 / w) + 2; i++) {\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(container, tile, w * i, h * j);\n }\n }\n\n return container;\n}\n\n/**\n * Make background\n * @param {Object.} textures\n * @return {Container}\n */\nfunction makeBGContainer(textures) {\n const bgContainer = new Container();\n\n // sky\n let tile;\n let texture = textures[TEXTURES.SKY_BLUE];\n for (let j = 0; j < 12; j++) {\n for (let i = 0; i < 432 / 16; i++) {\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 16 * i, 16 * j);\n }\n }\n\n // mountain\n texture = textures[TEXTURES.MOUNTAIN];\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 0, 188);\n\n // ground_red\n texture = textures[TEXTURES.GROUND_RED];\n for (let i = 0; i < 432 / 16; i++) {\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 16 * i, 248);\n }\n\n // ground_line\n texture = textures[TEXTURES.GROUND_LINE];\n for (let i = 1; i < 432 / 16 - 1; i++) {\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 16 * i, 264);\n }\n texture = textures[TEXTURES.GROUND_LINE_LEFT_MOST];\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 0, 264);\n texture = textures[TEXTURES.GROUND_LINE_RIGHT_MOST];\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 432 - 16, 264);\n\n // ground_yellow\n texture = textures[TEXTURES.GROUND_YELLOW];\n for (let j = 0; j < 2; j++) {\n for (let i = 0; i < 432 / 16; i++) {\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(\n bgContainer,\n tile,\n 16 * i,\n 280 + 16 * j\n );\n }\n }\n\n // net pillar\n texture = textures[TEXTURES.NET_PILLAR_TOP];\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 213, 176);\n texture = textures[TEXTURES.NET_PILLAR];\n for (let j = 0; j < 12; j++) {\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 213, 184 + 8 * j);\n }\n\n return bgContainer;\n}\n\n/**\n * Make animated sprites for both players\n * @param {Object.} textures\n * @return {AnimatedSprite[]} [0] for player 1, [1] for player2\n */\nfunction makePlayerAnimatedSprites(textures) {\n const getPlayerTexture = (i, j) => textures[TEXTURES.PIKACHU(i, j)];\n const playerTextureArray = [];\n for (let i = 0; i < 7; i++) {\n if (i === 3) {\n playerTextureArray.push(getPlayerTexture(i, 0));\n playerTextureArray.push(getPlayerTexture(i, 1));\n } else if (i === 4) {\n playerTextureArray.push(getPlayerTexture(i, 0));\n } else {\n for (let j = 0; j < 5; j++) {\n playerTextureArray.push(getPlayerTexture(i, j));\n }\n }\n }\n const player1AnimatedSprite = new AnimatedSprite(playerTextureArray, false);\n const player2AnimatedSprite = new AnimatedSprite(playerTextureArray, false);\n\n player1AnimatedSprite.anchor.x = 0.5;\n player1AnimatedSprite.anchor.y = 0.5;\n player2AnimatedSprite.anchor.x = 0.5;\n player2AnimatedSprite.anchor.y = 0.5;\n\n return [player1AnimatedSprite, player2AnimatedSprite];\n}\n\n/**\n * Make animated sprite of ball\n * @param {Object.} textures\n * @return {AnimatedSprite}\n */\nfunction makeBallAnimatedSprites(textures) {\n const getBallTexture = (s) => textures[TEXTURES.BALL(s)];\n const ballTextureArray = [\n getBallTexture(0),\n getBallTexture(1),\n getBallTexture(2),\n getBallTexture(3),\n getBallTexture(4),\n getBallTexture('hyper'),\n ];\n const ballAnimatedSprite = new AnimatedSprite(ballTextureArray, false);\n\n ballAnimatedSprite.anchor.x = 0.5;\n ballAnimatedSprite.anchor.y = 0.5;\n\n return ballAnimatedSprite;\n}\n\n/**\n * Make sprite with the texture on the path and with the given anchor x, y\n * @param {Object.} textures\n * @param {string} path\n * @param {number} anchorX anchor.x, number in [0, 1]\n * @param {number} anchorY anchor.y, number in [0, 1]\n * @return {Sprite}\n */\nfunction makeSpriteWithAnchorXY(textures, path, anchorX, anchorY) {\n const sprite = new Sprite(textures[path]);\n sprite.anchor.x = anchorX;\n sprite.anchor.y = anchorY;\n return sprite;\n}\n\n/**\n * Make score boards\n * @param {Object.} textures\n * @return {Container} child with index 0 for player 1 score board, child with index 1 for player2 score board\n */\nfunction makeScoreBoardSprite(textures) {\n const getNumberTexture = (n) => textures[TEXTURES.NUMBER(n)];\n const numberTextureArray = [];\n for (let i = 0; i < 10; i++) {\n numberTextureArray.push(getNumberTexture(i));\n }\n const numberAnimatedSprites = [null, null];\n numberAnimatedSprites[0] = new AnimatedSprite(numberTextureArray, false);\n numberAnimatedSprites[1] = new AnimatedSprite(numberTextureArray, false);\n\n const scoreBoard = new Container();\n addChildToParentAndSetLocalPosition(\n scoreBoard,\n numberAnimatedSprites[0],\n 32,\n 0\n ); // for units\n addChildToParentAndSetLocalPosition(\n scoreBoard,\n numberAnimatedSprites[1],\n 0,\n 0\n ); // for tens\n\n scoreBoard.setChildIndex(numberAnimatedSprites[0], 0); // for units\n scoreBoard.setChildIndex(numberAnimatedSprites[1], 1); // for tens\n\n return scoreBoard;\n}\n\n/**\n * Make a container with cloud sprites\n * @param {Object.} textures\n * @return {Container}\n */\nfunction makeCloudContainer(textures) {\n const cloudContainer = new Container();\n const texture = textures[TEXTURES.CLOUD];\n for (let i = 0; i < NUM_OF_CLOUDS; i++) {\n const cloud = new Sprite(texture);\n cloud.anchor.x = 0;\n cloud.anchor.y = 0;\n cloudContainer.addChild(cloud);\n }\n\n return cloudContainer;\n}\n\n/**\n * Make a container with wave sprites\n * @param {Object.} textures\n * @return {Container}\n */\nfunction makeWaveContainer(textures) {\n const waveContainer = new Container();\n const texture = textures[TEXTURES.WAVE];\n for (let i = 0; i < 432 / 16; i++) {\n const tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(waveContainer, tile, 16 * i, 0);\n }\n\n return waveContainer;\n}\n\n/**\n * Add child to parent and set local position\n * @param {Container} parent\n * @param {Sprite} child\n * @param {number} x local x\n * @param {number} y local y\n */\nfunction addChildToParentAndSetLocalPosition(parent, child, x, y) {\n parent.addChild(child);\n child.anchor.x = 0;\n child.anchor.y = 0;\n child.x = x;\n child.y = y;\n}\n\n/**\n * Get frame number for player animated sprite corresponds to the player state\n *\n * number of frames for state 0, state 1 and state 2 is 5 for each.\n * number of frames for state 3 is 2.\n * number of frames for state 4 is 1.\n * number of frames for state 5, state 6 is 5 for each.\n * @param {number} state player state\n * @param {number} frameNumber\n */\nfunction getFrameNumberForPlayerAnimatedSprite(state, frameNumber) {\n if (state < 4) {\n return 5 * state + frameNumber;\n } else if (state === 4) {\n return 17 + frameNumber;\n } else if (state > 4) {\n return 18 + 5 * (state - 5) + frameNumber;\n }\n}\n","/**\n * This module takes charge of the user input via keyboard\n */\n'use strict';\nimport { PikaUserInput } from './physics.js';\n\n/**\n * Class representing a keyboard used to control a player\n */\nexport class PikaKeyboard extends PikaUserInput {\n /**\n * Create a keyboard used for game controller\n * left, right, up, down, powerHit: KeyboardEvent.code value for each\n * Refer {@link https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values}\n * @param {string} left KeyboardEvent.code value of the key to use for left\n * @param {string} right KeyboardEvent.code value of the key to use for right\n * @param {string} up KeyboardEvent.code value of the key to use for up\n * @param {string} down KeyboardEvent.code value of the key to use for down\n * @param {string} powerHit KeyboardEvent.code value of the key to use for power hit or selection\n * @param {string} downRight KeyboardEvent.code value of the key to use for having the same effect\n * when pressing down key and right key at the same time (Only player 1\n * has this key)\n */\n constructor(left, right, up, down, powerHit, downRight = null) {\n super();\n\n /** @type {boolean} */\n this.powerHitKeyIsDownPrevious = false;\n\n /** @type {Key} */\n this.leftKey = new Key(left);\n /** @type {Key} */\n this.rightKey = new Key(right);\n /** @type {Key} */\n this.upKey = new Key(up);\n /** @type {Key} */\n this.downKey = new Key(down);\n /** @type {Key} */\n this.powerHitKey = new Key(powerHit);\n /** @type {Key} */\n this.downRightKey = new Key(downRight);\n }\n\n /**\n * Get xDirection, yDirection, powerHit input from the keyboard.\n * This method is for freezing the keyboard input during the process of one game frame.\n */\n getInput() {\n if (this.leftKey.isDown) {\n this.xDirection = -1;\n } else if (\n this.rightKey.isDown ||\n (this.downRightKey && this.downRightKey.isDown)\n ) {\n this.xDirection = 1;\n } else {\n this.xDirection = 0;\n }\n\n if (this.upKey.isDown) {\n this.yDirection = -1;\n } else if (\n this.downKey.isDown ||\n (this.downRightKey && this.downRightKey.isDown)\n ) {\n this.yDirection = 1;\n } else {\n this.yDirection = 0;\n }\n\n const isDown = this.powerHitKey.isDown;\n if (!this.powerHitKeyIsDownPrevious && isDown) {\n this.powerHit = 1;\n } else {\n this.powerHit = 0;\n }\n this.powerHitKeyIsDownPrevious = isDown;\n }\n\n /**\n * Subscribe keydown, keyup event listeners for the keys of this keyboard\n */\n subscribe() {\n this.leftKey.subscribe();\n this.rightKey.subscribe();\n this.upKey.subscribe();\n this.downKey.subscribe();\n this.powerHitKey.subscribe();\n this.downRightKey.subscribe();\n }\n\n /**\n * Unsubscribe keydown, keyup event listeners for the keys of this keyboard\n */\n unsubscribe() {\n this.leftKey.unsubscribe();\n this.rightKey.unsubscribe();\n this.upKey.unsubscribe();\n this.downKey.unsubscribe();\n this.powerHitKey.unsubscribe();\n this.downRightKey.unsubscribe();\n }\n}\n\n/**\n * Class representing a key on a keyboard\n * referred to: https://github.com/kittykatattack/learningPixi\n */\nclass Key {\n /**\n * Create a key\n * Refer {@link https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values}\n * @param {string} value KeyboardEvent.code value of this key\n */\n constructor(value) {\n this.value = value;\n this.isDown = false;\n this.isUp = true;\n\n this.downListener = this.downHandler.bind(this);\n this.upListener = this.upHandler.bind(this);\n this.subscribe();\n }\n\n /**\n * When key downed\n * @param {KeyboardEvent} event\n */\n downHandler(event) {\n if (event.code === this.value) {\n this.isDown = true;\n this.isUp = false;\n event.preventDefault();\n }\n }\n\n /**\n * When key upped\n * @param {KeyboardEvent} event\n */\n upHandler(event) {\n if (event.code === this.value) {\n this.isDown = false;\n this.isUp = true;\n event.preventDefault();\n }\n }\n\n /**\n * Subscribe event listeners\n */\n subscribe() {\n // I think an event listener for keyup should be attached\n // before the one for keydown to prevent a buggy behavior.\n // If keydown event listener were attached first and\n // a key was downed and upped before keyup event listener were attached,\n // I think the value of this.isDown would be true (and the value of this.isUp would be false)\n // for a while before the user press this key again.\n window.addEventListener('keyup', this.upListener);\n window.addEventListener('keydown', this.downListener);\n }\n\n /**\n * Unsubscribe event listeners\n */\n unsubscribe() {\n window.removeEventListener('keydown', this.downListener);\n window.removeEventListener('keyup', this.upListener);\n this.isDown = false;\n this.isUp = true;\n }\n}\n","/**\n * This module takes charge of the game audio (or sounds)\n */\n'use strict';\nimport { sound, Sound, filters } from '@pixi/sound';\nimport { ASSETS_PATH } from './assets_path.js';\n\nconst SOUNDS = ASSETS_PATH.SOUNDS;\n\n/** @typedef {import('@pixi/loaders').LoaderResource} LoaderResource */\n\n/**\n * Class representing audio\n */\nexport class PikaAudio {\n /**\n * Create a PikaAudio object\n * @param {Object.} resources loader.resources\n */\n constructor(resources) {\n /** @type {Object.} sounds pack */\n this.sounds = {\n bgm: new PikaStereoSound(resources[SOUNDS.BGM].sound),\n pipikachu: new PikaStereoSound(resources[SOUNDS.PIPIKACHU].sound),\n pika: new PikaStereoSound(resources[SOUNDS.PIKA].sound),\n chu: new PikaStereoSound(resources[SOUNDS.CHU].sound),\n pi: new PikaStereoSound(resources[SOUNDS.PI].sound),\n pikachu: new PikaStereoSound(resources[SOUNDS.PIKACHU].sound),\n powerHit: new PikaStereoSound(resources[SOUNDS.POWERHIT].sound),\n ballTouchesGround: new PikaStereoSound(\n resources[SOUNDS.BALLTOUCHESGROUND].sound\n ),\n };\n\n this.sounds.bgm.loop = true;\n /** @constant @type {number} proper bgm volume */\n this.properBGMVolume = 0.2;\n /** @constant @type {number} proper sfx volume */\n this.properSFXVolume = 0.35;\n this.adjustVolume();\n }\n\n /**\n * Adjust audio volume\n */\n adjustVolume() {\n for (const prop in this.sounds) {\n if (prop === 'bgm') {\n this.sounds[prop].volume = this.properBGMVolume;\n } else {\n this.sounds[prop].volume = this.properSFXVolume;\n }\n }\n }\n\n /**\n * turn BGM volume\n * @param {boolean} turnOn turnOn? turnOff\n */\n turnBGMVolume(turnOn) {\n let volume;\n if (turnOn) {\n volume = this.properBGMVolume;\n } else {\n volume = 0;\n }\n this.sounds.bgm.volume = volume;\n }\n\n /**\n * turn SFX volume\n * @param {boolean} turnOn turnOn? turnOff\n */\n turnSFXVolume(turnOn) {\n let volume;\n if (turnOn) {\n volume = this.properSFXVolume;\n } else {\n volume = 0;\n }\n for (const prop in this.sounds) {\n if (prop !== 'bgm') {\n this.sounds[prop].volume = volume;\n }\n }\n }\n\n muteAll() {\n sound.muteAll();\n }\n\n unmuteAll() {\n sound.unmuteAll();\n }\n}\n\n/**\n * Class representing a stereo sound\n */\nclass PikaStereoSound {\n /**\n * create a PikaStereoSound object\n * @param {Sound} sound\n */\n constructor(sound) {\n this.center = sound;\n this.left = Sound.from(sound.url);\n this.right = Sound.from(sound.url);\n\n const centerPanning = new filters.StereoFilter(0);\n const leftPanning = new filters.StereoFilter(-0.75);\n const rightPanning = new filters.StereoFilter(0.75);\n this.center.filters = [centerPanning];\n this.left.filters = [leftPanning];\n this.right.filters = [rightPanning];\n }\n\n /**\n * @param {number} v volume: number in [0, 1]\n */\n set volume(v) {\n this.center.volume = v;\n this.left.volume = v;\n this.right.volume = v;\n }\n\n /**\n * @param {boolean} bool\n */\n set loop(bool) {\n this.center.loop = bool;\n this.left.loop = bool;\n this.right.loop = bool;\n }\n\n /**\n * play this stereo sound\n * @param {number} leftOrCenterOrRight -1: left, 0: center, 1: right\n */\n play(leftOrCenterOrRight = 0) {\n if (leftOrCenterOrRight === 0) {\n this.center.play();\n } else if (leftOrCenterOrRight === -1) {\n this.left.play();\n } else if (leftOrCenterOrRight === 1) {\n this.right.play();\n }\n }\n\n /**\n * stop this stereo sound\n */\n stop() {\n this.center.stop();\n this.left.stop();\n this.right.stop();\n }\n}\n","/**\n * The Controller part in MVC pattern\n */\n'use strict';\nimport { GROUND_HALF_WIDTH, PikaPhysics } from './physics.js';\nimport { MenuView, GameView, FadeInOut, IntroView } from './view.js';\nimport { PikaKeyboard } from './keyboard.js';\nimport { PikaAudio } from './audio.js';\n\n/** @typedef {import('@pixi/display').Container} Container */\n/** @typedef {import('@pixi/loaders').LoaderResource} LoaderResource */\n\n/** @typedef GameState @type {function():void} */\n\n/**\n * Class representing Pikachu Volleyball game\n */\nexport class PikachuVolleyball {\n /**\n * Create a Pikachu Volleyball game which includes physics, view, audio\n * @param {Container} stage container which is rendered by PIXI.Renderer or PIXI.CanvasRenderer\n * @param {Object.} resources resources property of the PIXI.Loader object which is used for loading the game resources\n */\n constructor(stage, resources) {\n this.view = {\n intro: new IntroView(resources),\n menu: new MenuView(resources),\n game: new GameView(resources),\n fadeInOut: new FadeInOut(resources),\n };\n stage.addChild(this.view.intro.container);\n stage.addChild(this.view.menu.container);\n stage.addChild(this.view.game.container);\n stage.addChild(this.view.fadeInOut.black);\n this.view.intro.visible = false;\n this.view.menu.visible = false;\n this.view.game.visible = false;\n this.view.fadeInOut.visible = false;\n\n this.audio = new PikaAudio(resources);\n this.physics = new PikaPhysics(true, true);\n this.keyboardArray = [\n new PikaKeyboard('KeyD', 'KeyG', 'KeyR', 'KeyV', 'KeyZ', 'KeyF'), // for player1\n new PikaKeyboard( // for player2\n 'ArrowLeft',\n 'ArrowRight',\n 'ArrowUp',\n 'ArrowDown',\n 'Enter'\n ),\n ];\n\n /** @type {number} game fps */\n this.normalFPS = 25;\n /** @type {number} fps for slow motion */\n this.slowMotionFPS = 5;\n\n /** @constant @type {number} number of frames for slow motion */\n this.SLOW_MOTION_FRAMES_NUM = 6;\n /** @type {number} number of frames left for slow motion */\n this.slowMotionFramesLeft = 0;\n /** @type {number} number of elapsed normal fps frames for rendering slow motion */\n this.slowMotionNumOfSkippedFrames = 0;\n\n /** @type {number} 0: with computer, 1: with friend */\n this.selectedWithWho = 0;\n\n /** @type {number[]} [0] for player 1 score, [1] for player 2 score */\n this.scores = [0, 0];\n /** @type {number} winning score: if either one of the players reaches this score, game ends */\n this.winningScore = 15;\n\n /** @type {boolean} Is the game ended? */\n this.gameEnded = false;\n /** @type {boolean} Is the round ended? */\n this.roundEnded = false;\n /** @type {boolean} Will player 2 serve? */\n this.isPlayer2Serve = false;\n\n /** @type {number} frame counter */\n this.frameCounter = 0;\n /** @type {Object.} total number of frames for each game state */\n this.frameTotal = {\n intro: 165,\n afterMenuSelection: 15,\n beforeStartOfNewGame: 15,\n startOfNewGame: 71,\n afterEndOfRound: 5,\n beforeStartOfNextRound: 30,\n gameEnd: 211,\n };\n\n /** @type {number} counter for frames while there is no input from keyboard */\n this.noInputFrameCounter = 0;\n /** @type {Object.} total number of frames to be rendered while there is no input */\n this.noInputFrameTotal = {\n menu: 225,\n };\n\n /** @type {boolean} true: paused, false: not paused */\n this.paused = false;\n\n /** @type {boolean} true: stereo, false: mono */\n this.isStereoSound = true;\n\n /** @type {boolean} true: practice mode on, false: practice mode off */\n this._isPracticeMode = false;\n\n /**\n * The game state which is being rendered now\n * @type {GameState}\n */\n this.state = this.intro;\n }\n\n /**\n * Game loop\n * This function should be called at regular intervals ( interval = (1 / FPS) second )\n */\n gameLoop() {\n if (this.paused === true) {\n return;\n }\n if (this.slowMotionFramesLeft > 0) {\n this.slowMotionNumOfSkippedFrames++;\n if (\n this.slowMotionNumOfSkippedFrames %\n Math.round(this.normalFPS / this.slowMotionFPS) !==\n 0\n ) {\n return;\n }\n this.slowMotionFramesLeft--;\n this.slowMotionNumOfSkippedFrames = 0;\n }\n // catch keyboard input and freeze it\n this.keyboardArray[0].getInput();\n this.keyboardArray[1].getInput();\n this.state();\n }\n\n /**\n * Intro: a man with a brief case\n * @type {GameState}\n */\n intro() {\n if (this.frameCounter === 0) {\n this.view.intro.visible = true;\n this.view.fadeInOut.setBlackAlphaTo(0);\n this.audio.sounds.bgm.stop();\n }\n this.view.intro.drawMark(this.frameCounter);\n this.frameCounter++;\n\n if (\n this.keyboardArray[0].powerHit === 1 ||\n this.keyboardArray[1].powerHit === 1\n ) {\n this.frameCounter = 0;\n this.view.intro.visible = false;\n this.state = this.menu;\n }\n\n if (this.frameCounter >= this.frameTotal.intro) {\n this.frameCounter = 0;\n this.view.intro.visible = false;\n this.state = this.menu;\n }\n }\n\n /**\n * Menu: select who do you want to play. With computer? With friend?\n * @type {GameState}\n */\n menu() {\n if (this.frameCounter === 0) {\n this.view.menu.visible = true;\n this.view.fadeInOut.setBlackAlphaTo(0);\n this.selectedWithWho = 0;\n this.view.menu.selectWithWho(this.selectedWithWho);\n }\n this.view.menu.drawFightMessage(this.frameCounter);\n this.view.menu.drawSachisoft(this.frameCounter);\n this.view.menu.drawSittingPikachuTiles(this.frameCounter);\n this.view.menu.drawPikachuVolleyballMessage(this.frameCounter);\n this.view.menu.drawPokemonMessage(this.frameCounter);\n this.view.menu.drawWithWhoMessages(this.frameCounter);\n this.frameCounter++;\n\n if (\n this.frameCounter < 71 &&\n (this.keyboardArray[0].powerHit === 1 ||\n this.keyboardArray[1].powerHit === 1)\n ) {\n this.frameCounter = 71;\n return;\n }\n\n if (this.frameCounter <= 71) {\n return;\n }\n\n if (\n (this.keyboardArray[0].yDirection === -1 ||\n this.keyboardArray[1].yDirection === -1) &&\n this.selectedWithWho === 1\n ) {\n this.noInputFrameCounter = 0;\n this.selectedWithWho = 0;\n this.view.menu.selectWithWho(this.selectedWithWho);\n this.audio.sounds.pi.play();\n } else if (\n (this.keyboardArray[0].yDirection === 1 ||\n this.keyboardArray[1].yDirection === 1) &&\n this.selectedWithWho === 0\n ) {\n this.noInputFrameCounter = 0;\n this.selectedWithWho = 1;\n this.view.menu.selectWithWho(this.selectedWithWho);\n this.audio.sounds.pi.play();\n } else {\n this.noInputFrameCounter++;\n }\n\n if (\n this.keyboardArray[0].powerHit === 1 ||\n this.keyboardArray[1].powerHit === 1\n ) {\n if (this.selectedWithWho === 1) {\n this.physics.player1.isComputer = false;\n this.physics.player2.isComputer = false;\n } else {\n if (this.keyboardArray[0].powerHit === 1) {\n this.physics.player1.isComputer = false;\n this.physics.player2.isComputer = true;\n } else if (this.keyboardArray[1].powerHit === 1) {\n this.physics.player1.isComputer = true;\n this.physics.player2.isComputer = false;\n }\n }\n this.audio.sounds.pikachu.play();\n this.frameCounter = 0;\n this.noInputFrameCounter = 0;\n this.state = this.afterMenuSelection;\n return;\n }\n\n if (this.noInputFrameCounter >= this.noInputFrameTotal.menu) {\n this.physics.player1.isComputer = true;\n this.physics.player2.isComputer = true;\n this.frameCounter = 0;\n this.noInputFrameCounter = 0;\n this.state = this.afterMenuSelection;\n }\n }\n\n /**\n * Fade out after menu selection\n * @type {GameState}\n */\n afterMenuSelection() {\n this.view.fadeInOut.changeBlackAlphaBy(1 / 16);\n this.frameCounter++;\n if (this.frameCounter >= this.frameTotal.afterMenuSelection) {\n this.frameCounter = 0;\n this.state = this.beforeStartOfNewGame;\n }\n }\n\n /**\n * Delay before start of new game (This is for the delay that exist in the original game)\n * @type {GameState}\n */\n beforeStartOfNewGame() {\n this.frameCounter++;\n if (this.frameCounter >= this.frameTotal.beforeStartOfNewGame) {\n this.frameCounter = 0;\n this.view.menu.visible = false;\n this.state = this.startOfNewGame;\n }\n }\n\n /**\n * Start of new game: Initialize ball and players and print game start message\n * @type {GameState}\n */\n startOfNewGame() {\n if (this.frameCounter === 0) {\n this.view.game.visible = true;\n this.gameEnded = false;\n this.roundEnded = false;\n this.isPlayer2Serve = false;\n this.physics.player1.gameEnded = false;\n this.physics.player1.isWinner = false;\n this.physics.player2.gameEnded = false;\n this.physics.player2.isWinner = false;\n\n this.scores[0] = 0;\n this.scores[1] = 0;\n this.view.game.drawScoresToScoreBoards(this.scores);\n\n this.physics.player1.initializeForNewRound();\n this.physics.player2.initializeForNewRound();\n this.physics.ball.initializeForNewRound(this.isPlayer2Serve);\n this.view.game.drawPlayersAndBall(this.physics);\n\n this.view.fadeInOut.setBlackAlphaTo(1); // set black screen\n this.audio.sounds.bgm.play();\n }\n\n this.view.game.drawGameStartMessage(\n this.frameCounter,\n this.frameTotal.startOfNewGame\n );\n this.view.game.drawCloudsAndWave();\n this.view.fadeInOut.changeBlackAlphaBy(-(1 / 17)); // fade in\n this.frameCounter++;\n\n if (this.frameCounter >= this.frameTotal.startOfNewGame) {\n this.frameCounter = 0;\n this.view.fadeInOut.setBlackAlphaTo(0);\n this.state = this.round;\n }\n }\n\n /**\n * Round: the players play volleyball in this game state\n * @type {GameState}\n */\n round() {\n const pressedPowerHit =\n this.keyboardArray[0].powerHit === 1 ||\n this.keyboardArray[1].powerHit === 1;\n\n if (\n this.physics.player1.isComputer === true &&\n this.physics.player2.isComputer === true &&\n pressedPowerHit\n ) {\n this.frameCounter = 0;\n this.view.game.visible = false;\n this.state = this.intro;\n return;\n }\n\n const isBallTouchingGround = this.physics.runEngineForNextFrame(\n this.keyboardArray\n );\n\n this.playSoundEffect();\n this.view.game.drawPlayersAndBall(this.physics);\n this.view.game.drawCloudsAndWave();\n\n if (this.gameEnded === true) {\n this.view.game.drawGameEndMessage(this.frameCounter);\n this.frameCounter++;\n if (\n this.frameCounter >= this.frameTotal.gameEnd ||\n (this.frameCounter >= 70 && pressedPowerHit)\n ) {\n this.frameCounter = 0;\n this.view.game.visible = false;\n this.state = this.intro;\n }\n return;\n }\n\n if (\n isBallTouchingGround &&\n this._isPracticeMode === false &&\n this.roundEnded === false &&\n this.gameEnded === false\n ) {\n if (this.physics.ball.punchEffectX < GROUND_HALF_WIDTH) {\n this.isPlayer2Serve = true;\n this.scores[1] += 1;\n if (this.scores[1] >= this.winningScore) {\n this.gameEnded = true;\n this.physics.player1.isWinner = false;\n this.physics.player2.isWinner = true;\n this.physics.player1.gameEnded = true;\n this.physics.player2.gameEnded = true;\n }\n } else {\n this.isPlayer2Serve = false;\n this.scores[0] += 1;\n if (this.scores[0] >= this.winningScore) {\n this.gameEnded = true;\n this.physics.player1.isWinner = true;\n this.physics.player2.isWinner = false;\n this.physics.player1.gameEnded = true;\n this.physics.player2.gameEnded = true;\n }\n }\n this.view.game.drawScoresToScoreBoards(this.scores);\n if (this.roundEnded === false && this.gameEnded === false) {\n this.slowMotionFramesLeft = this.SLOW_MOTION_FRAMES_NUM;\n }\n this.roundEnded = true;\n }\n\n if (this.roundEnded === true && this.gameEnded === false) {\n // if this is the last frame of this round, begin fade out\n if (this.slowMotionFramesLeft === 0) {\n this.view.fadeInOut.changeBlackAlphaBy(1 / 16); // fade out\n this.state = this.afterEndOfRound;\n }\n }\n }\n\n /**\n * Fade out after end of round\n * @type {GameState}\n */\n afterEndOfRound() {\n this.view.fadeInOut.changeBlackAlphaBy(1 / 16);\n this.frameCounter++;\n if (this.frameCounter >= this.frameTotal.afterEndOfRound) {\n this.frameCounter = 0;\n this.state = this.beforeStartOfNextRound;\n }\n }\n\n /**\n * Before start of next round, initialize ball and players, and print ready message\n * @type {GameState}\n */\n beforeStartOfNextRound() {\n if (this.frameCounter === 0) {\n this.view.fadeInOut.setBlackAlphaTo(1);\n this.view.game.drawReadyMessage(false);\n\n this.physics.player1.initializeForNewRound();\n this.physics.player2.initializeForNewRound();\n this.physics.ball.initializeForNewRound(this.isPlayer2Serve);\n this.view.game.drawPlayersAndBall(this.physics);\n }\n\n this.view.game.drawCloudsAndWave();\n this.view.fadeInOut.changeBlackAlphaBy(-(1 / 16));\n\n this.frameCounter++;\n if (this.frameCounter % 5 === 0) {\n this.view.game.toggleReadyMessage();\n }\n\n if (this.frameCounter >= this.frameTotal.beforeStartOfNextRound) {\n this.frameCounter = 0;\n this.view.game.drawReadyMessage(false);\n this.view.fadeInOut.setBlackAlphaTo(0);\n this.roundEnded = false;\n this.state = this.round;\n }\n }\n\n /**\n * Play sound effect on {@link round}\n */\n playSoundEffect() {\n const audio = this.audio;\n for (let i = 0; i < 2; i++) {\n const player = this.physics[`player${i + 1}`];\n const sound = player.sound;\n let leftOrCenterOrRight = 0;\n if (this.isStereoSound) {\n leftOrCenterOrRight = i === 0 ? -1 : 1;\n }\n if (sound.pipikachu === true) {\n audio.sounds.pipikachu.play(leftOrCenterOrRight);\n sound.pipikachu = false;\n }\n if (sound.pika === true) {\n audio.sounds.pika.play(leftOrCenterOrRight);\n sound.pika = false;\n }\n if (sound.chu === true) {\n audio.sounds.chu.play(leftOrCenterOrRight);\n sound.chu = false;\n }\n }\n const ball = this.physics.ball;\n const sound = ball.sound;\n let leftOrCenterOrRight = 0;\n if (this.isStereoSound) {\n if (ball.punchEffectX < GROUND_HALF_WIDTH) {\n leftOrCenterOrRight = -1;\n } else if (ball.punchEffectX > GROUND_HALF_WIDTH) {\n leftOrCenterOrRight = 1;\n }\n }\n if (sound.powerHit === true) {\n audio.sounds.powerHit.play(leftOrCenterOrRight);\n sound.powerHit = false;\n }\n if (sound.ballTouchesGround === true) {\n audio.sounds.ballTouchesGround.play(leftOrCenterOrRight);\n sound.ballTouchesGround = false;\n }\n }\n\n /**\n * Called if restart button clicked\n */\n restart() {\n this.frameCounter = 0;\n this.noInputFrameCounter = 0;\n this.slowMotionFramesLeft = 0;\n this.slowMotionNumOfSkippedFrames = 0;\n this.view.menu.visible = false;\n this.view.game.visible = false;\n this.state = this.intro;\n }\n\n /** @return {boolean} */\n get isPracticeMode() {\n return this._isPracticeMode;\n }\n\n /**\n * @param {boolean} bool true: turn on practice mode, false: turn off practice mode\n */\n set isPracticeMode(bool) {\n this._isPracticeMode = bool;\n this.view.game.scoreBoards[0].visible = !bool;\n this.view.game.scoreBoards[1].visible = !bool;\n }\n}\n","/**\n * Manages event listeners relevant to the UI (menu bar, buttons, etc.) of the web page\n */\n'use strict';\n\nimport { localStorageWrapper } from './utils/local_storage_wrapper.js';\n\n/** @typedef {import('./pikavolley.js').PikachuVolleyball} PikachuVolleyball */\n/** @typedef {import('@pixi/ticker').Ticker} Ticker */\n/** @typedef {{graphic?: string, bgm?: string, sfx?: string, speed?: string, winningScore?: string}} Options */\n\n/**\n * Enum for \"game paused by what?\".\n * The greater the number, the higher the precedence.\n *\n * @readonly\n * @enum {number}\n */\nconst PauseResumePrecedence = {\n pauseBtn: 3,\n messageBox: 2,\n dropdown: 1,\n notPaused: 0,\n};\n\n/**\n * Manages pausing and resuming of the game\n */\nconst pauseResumeManager = {\n /** @type {number} PauseResumePrecedence enum */\n _precedence: PauseResumePrecedence.notPaused,\n /**\n * Pause game\n * @param {PikachuVolleyball} pikaVolley\n * @param {number} precedence PauseResumePrecedence enum\n */\n pause: function (pikaVolley, precedence) {\n // @ts-ignore\n if (precedence > this._precedence) {\n pikaVolley.paused = true;\n this._precedence = precedence;\n }\n },\n /**\n * Resume game\n * @param {PikachuVolleyball} pikaVolley\n * @param {number} precedence PauseResumePrecedence enum\n */\n resume: function (pikaVolley, precedence) {\n if (precedence === this._precedence) {\n pikaVolley.paused = false;\n this._precedence = PauseResumePrecedence.notPaused;\n }\n },\n};\n\n/**\n * Set up the user interface: menu bar, buttons, dropdowns, submenus, etc.\n * @param {PikachuVolleyball} pikaVolley\n * @param {Ticker} ticker\n */\nexport function setUpUI(pikaVolley, ticker) {\n /**\n * Apply options\n * @param {Options} options\n */\n const applyOptions = (options) => {\n setSelectedOptionsBtn(options);\n switch (options.graphic) {\n case 'sharp':\n document.getElementById('game-canvas').classList.remove('graphic-soft');\n break;\n case 'soft':\n document.getElementById('game-canvas').classList.add('graphic-soft');\n break;\n }\n switch (options.bgm) {\n case 'on':\n pikaVolley.audio.turnBGMVolume(true);\n break;\n case 'off':\n pikaVolley.audio.turnBGMVolume(false);\n break;\n }\n switch (options.sfx) {\n case 'stereo':\n pikaVolley.audio.turnSFXVolume(true);\n pikaVolley.isStereoSound = true;\n break;\n case 'mono':\n pikaVolley.audio.turnSFXVolume(true);\n pikaVolley.isStereoSound = false;\n break;\n case 'off':\n pikaVolley.audio.turnSFXVolume(false);\n break;\n }\n switch (options.speed) {\n case 'slow':\n pikaVolley.normalFPS = 20;\n ticker.maxFPS = pikaVolley.normalFPS;\n break;\n case 'medium':\n pikaVolley.normalFPS = 25;\n ticker.maxFPS = pikaVolley.normalFPS;\n break;\n case 'fast':\n pikaVolley.normalFPS = 30;\n ticker.maxFPS = pikaVolley.normalFPS;\n break;\n }\n switch (options.winningScore) {\n case '5':\n pikaVolley.winningScore = 5;\n break;\n case '10':\n pikaVolley.winningScore = 10;\n break;\n case '15':\n pikaVolley.winningScore = 15;\n break;\n }\n };\n\n /**\n * Save options\n * @param {Options} options\n */\n const saveOptions = (options) => {\n setSelectedOptionsBtn(options);\n if (options.graphic) {\n localStorageWrapper.set('pv-offline-graphic', options.graphic);\n }\n if (options.bgm) {\n localStorageWrapper.set('pv-offline-bgm', options.bgm);\n }\n if (options.sfx) {\n localStorageWrapper.set('pv-offline-sfx', options.sfx);\n }\n if (options.speed) {\n localStorageWrapper.set('pv-offline-speed', options.speed);\n }\n if (options.winningScore) {\n localStorageWrapper.set('pv-offline-winningScore', options.winningScore);\n }\n };\n\n /**\n * Load options\n * @returns {Options}\n */\n const loadOptions = () => ({\n graphic: localStorageWrapper.get('pv-offline-graphic'),\n bgm: localStorageWrapper.get('pv-offline-bgm'),\n sfx: localStorageWrapper.get('pv-offline-sfx'),\n speed: localStorageWrapper.get('pv-offline-speed'),\n winningScore: localStorageWrapper.get('pv-offline-winningScore'),\n });\n\n /**\n * Apply and save options\n * @param {Options} options\n */\n const applyAndSaveOptions = (options) => {\n applyOptions(options);\n saveOptions(options);\n };\n\n // Load and apply saved options\n applyOptions(loadOptions());\n\n setUpBtns(pikaVolley, applyAndSaveOptions);\n setUpToShowDropdownsAndSubmenus(pikaVolley);\n\n // hide or show menubar if the user presses the \"esc\" key\n window.addEventListener('keydown', (event) => {\n if (event.code === 'Escape') {\n const menuBar = document.getElementById('menu-bar');\n if (menuBar.classList.contains('hidden')) {\n menuBar.classList.remove('hidden');\n } else {\n menuBar.classList.add('hidden');\n }\n event.preventDefault();\n } else if (event.code === 'Space') {\n const aboutBox = document.getElementById('about-box');\n if (aboutBox.classList.contains('hidden')) {\n event.preventDefault();\n }\n }\n });\n\n document.addEventListener('visibilitychange', function () {\n if (document.visibilityState === 'visible') {\n pikaVolley.audio.unmuteAll();\n } else {\n pikaVolley.audio.muteAll();\n }\n });\n}\n\n/**\n * Attach event listeners to the buttons\n * @param {PikachuVolleyball} pikaVolley\n * @param {(options: Options) => void} applyAndSaveOptions\n */\nfunction setUpBtns(pikaVolley, applyAndSaveOptions) {\n const gameDropdownBtn = document.getElementById('game-dropdown-btn');\n const optionsDropdownBtn = document.getElementById('options-dropdown-btn');\n const aboutBtn = document.getElementById('about-btn');\n // @ts-ignore\n gameDropdownBtn.disabled = false;\n // @ts-ignore\n optionsDropdownBtn.disabled = false;\n // @ts-ignore\n aboutBtn.disabled = false;\n\n const pauseBtn = document.getElementById('pause-btn');\n pauseBtn.addEventListener('click', () => {\n if (pauseBtn.classList.contains('selected')) {\n pauseBtn.classList.remove('selected');\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.pauseBtn);\n } else {\n pauseBtn.classList.add('selected');\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.pauseBtn);\n }\n });\n\n const restartBtn = document.getElementById('restart-btn');\n restartBtn.addEventListener('click', () => {\n if (pauseBtn.classList.contains('selected')) {\n pauseBtn.classList.remove('selected');\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.pauseBtn);\n }\n pikaVolley.restart();\n });\n\n const graphicSharpBtn = document.getElementById('graphic-sharp-btn');\n const graphicSoftBtn = document.getElementById('graphic-soft-btn');\n graphicSharpBtn.addEventListener('click', () => {\n applyAndSaveOptions({ graphic: 'sharp' });\n });\n graphicSoftBtn.addEventListener('click', () => {\n applyAndSaveOptions({ graphic: 'soft' });\n });\n\n const bgmOnBtn = document.getElementById('bgm-on-btn');\n const bgmOffBtn = document.getElementById('bgm-off-btn');\n bgmOnBtn.addEventListener('click', () => {\n applyAndSaveOptions({ bgm: 'on' });\n });\n bgmOffBtn.addEventListener('click', () => {\n applyAndSaveOptions({ bgm: 'off' });\n });\n\n const stereoBtn = document.getElementById('stereo-btn');\n const monoBtn = document.getElementById('mono-btn');\n const sfxOffBtn = document.getElementById('sfx-off-btn');\n stereoBtn.addEventListener('click', () => {\n applyAndSaveOptions({ sfx: 'stereo' });\n });\n monoBtn.addEventListener('click', () => {\n applyAndSaveOptions({ sfx: 'mono' });\n });\n sfxOffBtn.addEventListener('click', () => {\n applyAndSaveOptions({ sfx: 'off' });\n });\n\n // Game speed:\n // slow: 1 frame per 50ms = 20 FPS\n // medium: 1 frame per 40ms = 25 FPS\n // fast: 1 frame per 33ms = 30.303030... FPS\n const slowSpeedBtn = document.getElementById('slow-speed-btn');\n const mediumSpeedBtn = document.getElementById('medium-speed-btn');\n const fastSpeedBtn = document.getElementById('fast-speed-btn');\n slowSpeedBtn.addEventListener('click', () => {\n applyAndSaveOptions({ speed: 'slow' });\n });\n mediumSpeedBtn.addEventListener('click', () => {\n applyAndSaveOptions({ speed: 'medium' });\n });\n fastSpeedBtn.addEventListener('click', () => {\n applyAndSaveOptions({ speed: 'fast' });\n });\n\n const winningScore5Btn = document.getElementById('winning-score-5-btn');\n const winningScore10Btn = document.getElementById('winning-score-10-btn');\n const winningScore15Btn = document.getElementById('winning-score-15-btn');\n const noticeBox1 = document.getElementById('notice-box-1');\n const noticeOKBtn1 = document.getElementById('notice-ok-btn-1');\n const winningScoreInNoticeBox1 = document.getElementById(\n 'winning-score-in-notice-box-1'\n );\n function isWinningScoreAlreadyReached(winningScore) {\n const isGamePlaying =\n pikaVolley.state === pikaVolley.round ||\n pikaVolley.state === pikaVolley.afterEndOfRound ||\n pikaVolley.state === pikaVolley.beforeStartOfNextRound;\n if (\n isGamePlaying &&\n (pikaVolley.scores[0] >= winningScore ||\n pikaVolley.scores[1] >= winningScore)\n ) {\n return true;\n }\n return false;\n }\n const noticeBox2 = document.getElementById('notice-box-2');\n const noticeOKBtn2 = document.getElementById('notice-ok-btn-2');\n winningScore5Btn.addEventListener('click', () => {\n if (winningScore5Btn.classList.contains('selected')) {\n return;\n }\n if (pikaVolley.isPracticeMode === true) {\n noticeBox2.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n // @ts-ignore\n aboutBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n return;\n }\n if (isWinningScoreAlreadyReached(5)) {\n winningScoreInNoticeBox1.textContent = '5';\n noticeBox1.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n // @ts-ignore\n aboutBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n return;\n }\n applyAndSaveOptions({ winningScore: '5' });\n });\n winningScore10Btn.addEventListener('click', () => {\n if (winningScore10Btn.classList.contains('selected')) {\n return;\n }\n if (pikaVolley.isPracticeMode === true) {\n noticeBox2.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n // @ts-ignore\n aboutBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n return;\n }\n if (isWinningScoreAlreadyReached(10)) {\n winningScoreInNoticeBox1.textContent = '10';\n noticeBox1.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n // @ts-ignore\n aboutBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n return;\n }\n applyAndSaveOptions({ winningScore: '10' });\n });\n winningScore15Btn.addEventListener('click', () => {\n if (winningScore15Btn.classList.contains('selected')) {\n return;\n }\n if (pikaVolley.isPracticeMode === true) {\n noticeBox2.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n // @ts-ignore\n aboutBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n return;\n }\n if (isWinningScoreAlreadyReached(15)) {\n winningScoreInNoticeBox1.textContent = '15';\n noticeBox1.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n // @ts-ignore\n aboutBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n return;\n }\n applyAndSaveOptions({ winningScore: '15' });\n });\n noticeOKBtn1.addEventListener('click', () => {\n if (!noticeBox1.classList.contains('hidden')) {\n noticeBox1.classList.add('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = false;\n // @ts-ignore\n optionsDropdownBtn.disabled = false;\n // @ts-ignore\n aboutBtn.disabled = false;\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.messageBox);\n }\n });\n noticeOKBtn2.addEventListener('click', () => {\n if (!noticeBox2.classList.contains('hidden')) {\n noticeBox2.classList.add('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = false;\n // @ts-ignore\n optionsDropdownBtn.disabled = false;\n // @ts-ignore\n aboutBtn.disabled = false;\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.messageBox);\n }\n });\n\n const practiceModeOnBtn = document.getElementById('practice-mode-on-btn');\n const practiceModeOffBtn = document.getElementById('practice-mode-off-btn');\n practiceModeOnBtn.addEventListener('click', () => {\n practiceModeOffBtn.classList.remove('selected');\n practiceModeOnBtn.classList.add('selected');\n pikaVolley.isPracticeMode = true;\n });\n practiceModeOffBtn.addEventListener('click', () => {\n practiceModeOnBtn.classList.remove('selected');\n practiceModeOffBtn.classList.add('selected');\n pikaVolley.isPracticeMode = false;\n });\n\n const aboutBox = document.getElementById('about-box');\n const closeAboutBtn = document.getElementById('close-about-btn');\n aboutBtn.addEventListener('click', () => {\n if (aboutBox.classList.contains('hidden')) {\n aboutBox.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n } else {\n aboutBox.classList.add('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = false;\n // @ts-ignore\n optionsDropdownBtn.disabled = false;\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.messageBox);\n }\n });\n closeAboutBtn.addEventListener('click', () => {\n if (!aboutBox.classList.contains('hidden')) {\n aboutBox.classList.add('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = false;\n // @ts-ignore\n optionsDropdownBtn.disabled = false;\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.messageBox);\n }\n });\n\n const resetToDefaultBtn = document.getElementById('reset-to-default-btn');\n resetToDefaultBtn.addEventListener('click', () => {\n // turn off practice mode\n practiceModeOffBtn.click();\n\n // and restore the reset options to default\n const defaultOptions = {\n graphic: 'sharp',\n bgm: 'on',\n sfx: 'stereo',\n speed: 'medium',\n winningScore: '15',\n };\n applyAndSaveOptions(defaultOptions);\n });\n}\n\n/**\n * Set selected (checked) options btn fit to options\n * @param {Options} options\n */\nfunction setSelectedOptionsBtn(options) {\n if (options.graphic) {\n const graphicSharpBtn = document.getElementById('graphic-sharp-btn');\n const graphicSoftBtn = document.getElementById('graphic-soft-btn');\n switch (options.graphic) {\n case 'sharp':\n graphicSoftBtn.classList.remove('selected');\n graphicSharpBtn.classList.add('selected');\n break;\n case 'soft':\n graphicSharpBtn.classList.remove('selected');\n graphicSoftBtn.classList.add('selected');\n break;\n }\n }\n if (options.bgm) {\n const bgmOnBtn = document.getElementById('bgm-on-btn');\n const bgmOffBtn = document.getElementById('bgm-off-btn');\n switch (options.bgm) {\n case 'on':\n bgmOffBtn.classList.remove('selected');\n bgmOnBtn.classList.add('selected');\n break;\n case 'off':\n bgmOnBtn.classList.remove('selected');\n bgmOffBtn.classList.add('selected');\n break;\n }\n }\n if (options.sfx) {\n const stereoBtn = document.getElementById('stereo-btn');\n const monoBtn = document.getElementById('mono-btn');\n const sfxOffBtn = document.getElementById('sfx-off-btn');\n switch (options.sfx) {\n case 'stereo':\n monoBtn.classList.remove('selected');\n sfxOffBtn.classList.remove('selected');\n stereoBtn.classList.add('selected');\n break;\n case 'mono':\n sfxOffBtn.classList.remove('selected');\n stereoBtn.classList.remove('selected');\n monoBtn.classList.add('selected');\n break;\n case 'off':\n stereoBtn.classList.remove('selected');\n monoBtn.classList.remove('selected');\n sfxOffBtn.classList.add('selected');\n break;\n }\n }\n if (options.speed) {\n const slowSpeedBtn = document.getElementById('slow-speed-btn');\n const mediumSpeedBtn = document.getElementById('medium-speed-btn');\n const fastSpeedBtn = document.getElementById('fast-speed-btn');\n switch (options.speed) {\n case 'slow':\n mediumSpeedBtn.classList.remove('selected');\n fastSpeedBtn.classList.remove('selected');\n slowSpeedBtn.classList.add('selected');\n break;\n case 'medium':\n fastSpeedBtn.classList.remove('selected');\n slowSpeedBtn.classList.remove('selected');\n mediumSpeedBtn.classList.add('selected');\n break;\n case 'fast':\n slowSpeedBtn.classList.remove('selected');\n mediumSpeedBtn.classList.remove('selected');\n fastSpeedBtn.classList.add('selected');\n break;\n }\n }\n if (options.winningScore) {\n const winningScore5Btn = document.getElementById('winning-score-5-btn');\n const winningScore10Btn = document.getElementById('winning-score-10-btn');\n const winningScore15Btn = document.getElementById('winning-score-15-btn');\n switch (options.winningScore) {\n case '5':\n winningScore10Btn.classList.remove('selected');\n winningScore15Btn.classList.remove('selected');\n winningScore5Btn.classList.add('selected');\n break;\n case '10':\n winningScore15Btn.classList.remove('selected');\n winningScore5Btn.classList.remove('selected');\n winningScore10Btn.classList.add('selected');\n break;\n case '15':\n winningScore5Btn.classList.remove('selected');\n winningScore10Btn.classList.remove('selected');\n winningScore15Btn.classList.add('selected');\n break;\n }\n }\n}\n\n/**\n * Attach event listeners to show dropdowns and submenus properly\n * @param {PikachuVolleyball} pikaVolley\n */\nfunction setUpToShowDropdownsAndSubmenus(pikaVolley) {\n // hide dropdowns and submenus if the user clicks outside of these\n window.addEventListener('click', (event) => {\n // @ts-ignore\n if (!event.target.matches('.dropdown-btn, .submenu-btn')) {\n hideSubmenus();\n hideDropdownsExcept('');\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.dropdown);\n }\n });\n\n // set up to show dropdowns\n document.getElementById('game-dropdown-btn').addEventListener('click', () => {\n toggleDropdown('game-dropdown', pikaVolley);\n });\n document\n .getElementById('options-dropdown-btn')\n .addEventListener('click', () => {\n toggleDropdown('options-dropdown', pikaVolley);\n });\n\n // set up to show submenus on mouseover event\n document\n .getElementById('graphic-submenu-btn')\n .addEventListener('mouseover', () => {\n showSubmenu('graphic-submenu-btn', 'graphic-submenu');\n });\n document\n .getElementById('bgm-submenu-btn')\n .addEventListener('mouseover', () => {\n showSubmenu('bgm-submenu-btn', 'bgm-submenu');\n });\n document\n .getElementById('sfx-submenu-btn')\n .addEventListener('mouseover', () => {\n showSubmenu('sfx-submenu-btn', 'sfx-submenu');\n });\n document\n .getElementById('speed-submenu-btn')\n .addEventListener('mouseover', () => {\n showSubmenu('speed-submenu-btn', 'speed-submenu');\n });\n document\n .getElementById('winning-score-submenu-btn')\n .addEventListener('mouseover', () => {\n showSubmenu('winning-score-submenu-btn', 'winning-score-submenu');\n });\n document\n .getElementById('practice-mode-submenu-btn')\n .addEventListener('mouseover', () => {\n showSubmenu('practice-mode-submenu-btn', 'practice-mode-submenu');\n });\n document\n .getElementById('reset-to-default-btn')\n .addEventListener('mouseover', () => {\n hideSubmenus();\n });\n\n // set up to show submenus on click event\n // (it is for touch device equipped with physical keyboard)\n document.getElementById('bgm-submenu-btn').addEventListener('click', () => {\n showSubmenu('bgm-submenu-btn', 'bgm-submenu');\n });\n document.getElementById('sfx-submenu-btn').addEventListener('click', () => {\n showSubmenu('sfx-submenu-btn', 'sfx-submenu');\n });\n document.getElementById('speed-submenu-btn').addEventListener('click', () => {\n showSubmenu('speed-submenu-btn', 'speed-submenu');\n });\n document\n .getElementById('winning-score-submenu-btn')\n .addEventListener('click', () => {\n showSubmenu('winning-score-submenu-btn', 'winning-score-submenu');\n });\n document\n .getElementById('practice-mode-submenu-btn')\n .addEventListener('click', () => {\n showSubmenu('practice-mode-submenu-btn', 'practice-mode-submenu');\n });\n document\n .getElementById('reset-to-default-btn')\n .addEventListener('click', () => {\n hideSubmenus();\n });\n}\n\n/**\n * Toggle (show or hide) the dropdown menu\n * @param {string} dropdownID html element id of the dropdown to toggle\n * @param {PikachuVolleyball} pikaVolley\n */\nfunction toggleDropdown(dropdownID, pikaVolley) {\n hideSubmenus();\n hideDropdownsExcept(dropdownID);\n const willShow = document.getElementById(dropdownID).classList.toggle('show');\n if (willShow) {\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.dropdown);\n } else {\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.dropdown);\n }\n}\n\n/**\n * Show the submenu\n * @param {string} submenuBtnID html element id of the submenu button whose submenu to show\n * @param {string} subMenuID html element id of the submenu to show\n */\nfunction showSubmenu(submenuBtnID, subMenuID) {\n hideSubmenus();\n document.getElementById(submenuBtnID).classList.add('open');\n document.getElementById(subMenuID).classList.add('show');\n}\n\n/**\n * Hide all other dropdowns except the dropdown\n * @param {string} dropdownID html element id of the dropdown\n */\nfunction hideDropdownsExcept(dropdownID) {\n const dropdowns = document.getElementsByClassName('dropdown');\n for (let i = 0; i < dropdowns.length; i++) {\n if (dropdowns[i].id !== dropdownID) {\n dropdowns[i].classList.remove('show');\n }\n }\n}\n\n/**\n * Hide all submenus\n */\nfunction hideSubmenus() {\n const submenus = document.getElementsByClassName('submenu');\n for (let i = 0; i < submenus.length; i++) {\n submenus[i].classList.remove('show');\n }\n const submenuBtns = document.getElementsByClassName('submenu-btn');\n for (let i = 0; i < submenuBtns.length; i++) {\n submenuBtns[i].classList.remove('open');\n }\n}\n","/**\n * This is the main script which executes the game.\n * General explanations for the all source code files of the game are following.\n *\n ********************************************************************************************************************\n * This web version of the Pikachu Volleyball is made by\n * reverse engineering the core part of the original Pikachu Volleyball game\n * which is developed by \"1997 (C) SACHI SOFT / SAWAYAKAN Programmers\" & \"1997 (C) Satoshi Takenouchi\".\n *\n * \"physics.js\", \"cloud_and_wave.js\", and some codes in \"view.js\" are the results of this reverse engineering.\n * Refer to the comments in each file for the machine code addresses of the original functions.\n ********************************************************************************************************************\n *\n * This web version game is mainly composed of three parts which follows MVC pattern.\n * 1) \"physics.js\" (Model): The physics engine which takes charge of the dynamics of the ball and the players (Pikachus).\n * It is gained by reverse engineering the machine code of the original game.\n * 2) \"view.js\" (View): The rendering part of the game which depends on pixi.js (https://www.pixijs.com/, https://github.com/pixijs/pixi.js) library.\n * Some codes in this part is gained by reverse engineering the original machine code.\n * 3) \"pikavolley.js\" (Controller): Make the game work by controlling the Model and the View according to the user input.\n *\n * And explanations for other source files are below.\n * - \"cloud_and_wave.js\": This is also a Model part which takes charge of the clouds and wave motion in the game. Of course, it is also rendered by \"view.js\".\n * It is also gained by reverse engineering the original machine code.\n * - \"keyboard.js\": Support the Controller(\"pikavolley.js\") to get a user input via keyboard.\n * - \"audio.js\": The game audio or sounds. It depends on pixi-sound (https://github.com/pixijs/pixi-sound) library.\n * - \"rand.js\": For the random function used in the Models (\"physics.js\", \"cloud_and_wave.js\").\n * - \"assets_path.js\": For the assets (image files, sound files) locations.\n * - \"ui.js\": For the user interface (menu bar, buttons etc.) of the html page.\n */\n'use strict';\nimport { settings } from '@pixi/settings';\nimport { SCALE_MODES } from '@pixi/constants';\nimport { Renderer, BatchRenderer, autoDetectRenderer } from '@pixi/core';\nimport { Prepare } from '@pixi/prepare';\nimport { Container } from '@pixi/display';\nimport { Loader } from '@pixi/loaders';\nimport { SpritesheetLoader } from '@pixi/spritesheet';\nimport { Ticker } from '@pixi/ticker';\nimport { CanvasRenderer } from '@pixi/canvas-renderer';\nimport { CanvasSpriteRenderer } from '@pixi/canvas-sprite';\nimport { CanvasPrepare } from '@pixi/canvas-prepare';\nimport '@pixi/canvas-display';\nimport { PikachuVolleyball } from './pikavolley.js';\nimport { ASSETS_PATH } from './assets_path.js';\nimport { setUpUI } from './ui.js';\n\n// Reference for how to use Renderer.registerPlugin:\n// https://github.com/pixijs/pixijs/blob/af3c0c6bb15aeb1049178c972e4a14bb4cabfce4/bundles/pixi.js/src/index.ts#L27-L34\nRenderer.registerPlugin('prepare', Prepare);\nRenderer.registerPlugin('batch', BatchRenderer);\n// Reference for how to use CanvasRenderer.registerPlugin:\n// https://github.com/pixijs/pixijs/blob/af3c0c6bb15aeb1049178c972e4a14bb4cabfce4/bundles/pixi.js-legacy/src/index.ts#L13-L19\nCanvasRenderer.registerPlugin('prepare', CanvasPrepare);\nCanvasRenderer.registerPlugin('sprite', CanvasSpriteRenderer);\nLoader.registerPlugin(SpritesheetLoader);\n\n// Set settings.RESOLUTION to 2 instead of 1 to make the game screen do not look\n// much blurry in case of the image rendering mode of 'image-rendering: auto',\n// which is like bilinear interpolation, which is used in \"soft\" game graphic option.\nsettings.RESOLUTION = 2;\nsettings.SCALE_MODE = SCALE_MODES.NEAREST;\nsettings.ROUND_PIXELS = true;\n\nconst renderer = autoDetectRenderer({\n width: 432,\n height: 304,\n antialias: false,\n backgroundColor: 0x000000,\n backgroundAlpha: 1,\n // Decided to use only Canvas for compatibility reason. One player had reported that\n // on their browser, where pixi chooses to use WebGL renderer, the graphics are not fine.\n // And the issue had been fixed by using Canvas renderer. And also for the sake of testing,\n // it is more comfortable just to stick with Canvas renderer so that it is unnecessary to switch\n // between WebGL renderer and Canvas renderer.\n forceCanvas: true,\n});\n\nconst stage = new Container();\nconst ticker = new Ticker();\nconst loader = new Loader();\n\nrenderer.view.setAttribute('id', 'game-canvas');\ndocument.getElementById('game-canvas-container').appendChild(renderer.view);\nrenderer.render(stage); // To make the initial canvas painting stable in the Firefox browser.\n\nloader.add(ASSETS_PATH.SPRITE_SHEET);\nfor (const prop in ASSETS_PATH.SOUNDS) {\n loader.add(ASSETS_PATH.SOUNDS[prop]);\n}\n\nsetUpInitialUI();\n\n/**\n * Set up the initial UI.\n */\nfunction setUpInitialUI() {\n const loadingBox = document.getElementById('loading-box');\n const progressBar = document.getElementById('progress-bar');\n loader.onProgress.add(() => {\n progressBar.style.width = `${loader.progress}%`;\n });\n loader.onComplete.add(() => {\n loadingBox.classList.add('hidden');\n });\n\n const aboutBox = document.getElementById('about-box');\n const aboutBtn = document.getElementById('about-btn');\n const closeAboutBtn = document.getElementById('close-about-btn');\n const gameDropdownBtn = document.getElementById('game-dropdown-btn');\n const optionsDropdownBtn = document.getElementById('options-dropdown-btn');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n const closeAboutBox = () => {\n if (!aboutBox.classList.contains('hidden')) {\n aboutBox.classList.add('hidden');\n // @ts-ignore\n aboutBtn.disabled = true;\n }\n aboutBtn.getElementsByClassName('text-play')[0].classList.add('hidden');\n aboutBtn.getElementsByClassName('text-about')[0].classList.remove('hidden');\n aboutBtn.classList.remove('glow');\n closeAboutBtn\n .getElementsByClassName('text-play')[0]\n .classList.add('hidden');\n closeAboutBtn\n .getElementsByClassName('text-close')[0]\n .classList.remove('hidden');\n closeAboutBtn.classList.remove('glow');\n\n loader.load(setup); // setup is called after loader finishes loading\n loadingBox.classList.remove('hidden');\n aboutBtn.removeEventListener('click', closeAboutBox);\n closeAboutBtn.removeEventListener('click', closeAboutBox);\n };\n aboutBtn.addEventListener('click', closeAboutBox);\n closeAboutBtn.addEventListener('click', closeAboutBox);\n}\n\n/**\n * Set up the game and the full UI, and start the game.\n */\nfunction setup() {\n const pikaVolley = new PikachuVolleyball(stage, loader.resources);\n setUpUI(pikaVolley, ticker);\n start(pikaVolley);\n}\n\n/**\n * Start the game.\n * @param {PikachuVolleyball} pikaVolley\n */\nfunction start(pikaVolley) {\n ticker.maxFPS = pikaVolley.normalFPS;\n ticker.add(() => {\n pikaVolley.gameLoop();\n renderer.render(stage);\n });\n ticker.start();\n}\n","export const localStorageWrapper = {\n /**\n * Get value corresponding to the key from localStorage\n * @param {string} key\n * @returns {string|null}\n */\n get: (key) => {\n let value = null;\n try {\n value = localStorage.getItem(key);\n } catch (err) {\n console.error(err);\n }\n return value;\n },\n\n /*\n * Set key-value pair to the localStorage\n * @param {string} key\n * @param {string} value\n */\n set: (key, value) => {\n try {\n localStorage.setItem(key, value);\n } catch (err) {\n console.error(err);\n }\n },\n};\n"],"names":["ASSETS_PATH","SPRITE_SHEET","TEXTURES","SOUNDS","PIKACHU","i","j","BALL","s","NUMBER","n","SKY_BLUE","MOUNTAIN","GROUND_RED","GROUND_LINE","GROUND_LINE_LEFT_MOST","GROUND_LINE_RIGHT_MOST","GROUND_YELLOW","NET_PILLAR_TOP","NET_PILLAR","SHADOW","BALL_HYPER","BALL_TRAIL","BALL_PUNCH","CLOUD","WAVE","BLACK","SACHISOFT","READY","GAME_END","MARK","POKEMON","PIKACHU_VOLLEYBALL","FIGHT","WITH_COMPUTER","WITH_FRIEND","GAME_START","SITTING_PIKACHU","BGM","PIPIKACHU","PIKA","CHU","PI","POWERHIT","BALLTOUCHESGROUND","rand","Math","floor","random","GROUND_WIDTH","GROUND_HALF_WIDTH","PLAYER_TOUCHING_GROUND_Y_COORD","BALL_TOUCHING_GROUND_Y_COORD","PikaPhysics","constructor","isPlayer1Computer","isPlayer2Computer","this","player1","Player","player2","ball","Ball","runEngineForNextFrame","userInputArray","isBallTouchingGround","previousPreviousX","previousX","previousPreviousY","previousY","x","y","futureFineRotation","fineRotation","xVelocity","rotation","futureBallX","futureBallY","yVelocity","abs","sound","ballTouchesGround","punchEffectX","punchEffectRadius","punchEffectY","processCollisionBetweenBallAndWorldAndSetBallPosition","player","theOtherPlayer","calculateExpectedLandingPointXFor","processPlayerMovementAndSetPlayerPosition","isCollisionBetweenBallAndPlayerHappened","isCollisionWithBallHappened","processCollisionBetweenBallAndPlayer","state","physicsEngine","isPlayer2","isComputer","initializeForNewRound","divingDirection","lyingDownDurationLeft","isWinner","gameEnded","computerWhereToStandBy","pipikachu","pika","chu","frameNumber","normalStatusArmSwingDirection","delayBeforeNextFrame","computerBoldness","isPlayer2Serve","expectedLandingPointX","powerHit","isPowerHit","playerX","playerY","diff","userInput","xDirection","yDirection","virtualExpectedLandingPointX","leftBoundary","Number","rightBoundary","willInputPowerHit","expectedLandingPointXWhenPowerHit","decideWhetherInputPowerHit","letComputerDecideUserInput","playerVelocityX","futurePlayerX","futurePlayerY","futureFrameNumber","processGameEndFrameFor","playerState","ballAbsYVelocity","copyBall","loopCounter","futureCopyBallX","userInputXDirection","userInputYDirection","Cloud","topLeftPointX","topLeftPointY","topLeftPointXVelocity","sizeDiffTurnNumber","sizeDiff","spriteTopLeftPointX","spriteTopLeftPointY","spriteWidth","spriteHeight","Wave","verticalCoord","verticalCoordVelocity","yCoords","push","IntroView","resources","textures","mark","makeSpriteWithAnchorXY","container","addChild","visible","bool","drawMark","frameCounter","alpha","min","max","MenuView","messages","pokemon","pikachuVolleyball","withWho","sachisoft","fight","sittingPikachuTilesContainer","texture","w","width","h","height","tile","addChildToParentAndSetLocalPosition","makeSittingPikachuTilesContainer","initializeVisibles","sittingPikachuTilesDisplacement","selectedWithWho","selectedWithWhoMessageSizeIncrement","prop","drawFightMessage","sizeArray","fightMessage","halfWidth","halfHeight","index","drawSachisoft","drawSittingPikachuTiles","getChildAt","drawPikachuVolleyballMessage","xDiff","drawPokemonMessage","drawWithWhoMessages","selected","halfWidthIncrement","halfHeightIncrement","selectWithWho","GameView","bgContainer","makeBGContainer","playerSprites","getPlayerTexture","playerTextureArray","player1AnimatedSprite","player2AnimatedSprite","anchor","makePlayerAnimatedSprites","getBallTexture","ballTextureArray","ballAnimatedSprite","makeBallAnimatedSprites","ballHyper","ballTrail","punch","scoreBoards","makeScoreBoardSprite","shadows","forPlayer1","forPlayer2","forBall","gameStart","ready","gameEnd","cloudContainer","cloud","makeCloudContainer","waveContainer","makeWaveContainer","cloudArray","wave","drawPlayersAndBall","physics","scale","frameNumber1","getFrameNumberForPlayerAnimatedSprite","frameNumber2","gotoAndStop","drawScoresToScoreBoards","scores","scoreBoard","score","unitsAnimatedSprite","tensAnimatedSprite","drawCloudsAndWave","cloudAndWaveEngine","cloudSprite","drawGameStartMessage","frameTotal","gameStartMessage","drawReadyMessage","toggleReadyMessage","drawGameEndMessage","gameEndMessage","FadeInOut","black","setBlackAlphaTo","changeBlackAlphaBy","alphaIncrement","path","anchorX","anchorY","sprite","numberTextureArray","numberAnimatedSprites","setChildIndex","parent","child","PikaKeyboard","left","right","up","down","downRight","super","powerHitKeyIsDownPrevious","leftKey","Key","rightKey","upKey","downKey","powerHitKey","downRightKey","getInput","isDown","subscribe","unsubscribe","value","isUp","downListener","downHandler","bind","upListener","upHandler","event","code","preventDefault","window","addEventListener","removeEventListener","PikaAudio","sounds","bgm","PikaStereoSound","pi","pikachu","loop","properBGMVolume","properSFXVolume","adjustVolume","volume","turnBGMVolume","turnOn","turnSFXVolume","muteAll","unmuteAll","center","url","centerPanning","leftPanning","rightPanning","filters","v","play","leftOrCenterOrRight","stop","PikachuVolleyball","stage","view","intro","menu","game","fadeInOut","audio","keyboardArray","normalFPS","slowMotionFPS","SLOW_MOTION_FRAMES_NUM","slowMotionFramesLeft","slowMotionNumOfSkippedFrames","winningScore","roundEnded","afterMenuSelection","beforeStartOfNewGame","startOfNewGame","afterEndOfRound","beforeStartOfNextRound","noInputFrameCounter","noInputFrameTotal","paused","isStereoSound","_isPracticeMode","gameLoop","round","pressedPowerHit","playSoundEffect","restart","isPracticeMode","pauseResumeManager","_precedence","pause","pikaVolley","precedence","resume","setSelectedOptionsBtn","options","graphic","graphicSharpBtn","document","getElementById","graphicSoftBtn","classList","remove","add","bgmOnBtn","bgmOffBtn","sfx","stereoBtn","monoBtn","sfxOffBtn","speed","slowSpeedBtn","mediumSpeedBtn","fastSpeedBtn","winningScore5Btn","winningScore10Btn","winningScore15Btn","toggleDropdown","dropdownID","hideSubmenus","hideDropdownsExcept","toggle","showSubmenu","submenuBtnID","subMenuID","dropdowns","getElementsByClassName","length","id","submenus","submenuBtns","settings","renderer","antialias","backgroundColor","backgroundAlpha","forceCanvas","loader","setAttribute","appendChild","render","setup","ticker","applyOptions","maxFPS","applyAndSaveOptions","gameDropdownBtn","optionsDropdownBtn","aboutBtn","disabled","pauseBtn","contains","noticeBox1","noticeOKBtn1","winningScoreInNoticeBox1","isWinningScoreAlreadyReached","noticeBox2","noticeOKBtn2","textContent","practiceModeOnBtn","practiceModeOffBtn","aboutBox","closeAboutBtn","click","setUpBtns","saveOptions","target","matches","setUpToShowDropdownsAndSubmenus","menuBar","visibilityState","setUpUI","start","loadingBox","progressBar","onProgress","style","progress","onComplete","closeAboutBox","load","setUpInitialUI","localStorageWrapper","get","key","localStorage","getItem","err","console","error","set","setItem"],"sourceRoot":""} \ No newline at end of file +{"version":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,OAAO1K,CAAK,EAQd6K,IAAK,CAACN,EAAKvK,KACT,IACEwK,aAAaM,QAAQP,EAAKvK,EAG5B,CAFE,MAAO0K,GACPC,QAAQC,MAAMF,EAChB,G","sources":["webpack://pikachu-volleyball/./src/resources/js/assets_path.js","webpack://pikachu-volleyball/./src/resources/js/rand.js","webpack://pikachu-volleyball/./src/resources/js/physics.js","webpack://pikachu-volleyball/./src/resources/js/cloud_and_wave.js","webpack://pikachu-volleyball/./src/resources/js/view.js","webpack://pikachu-volleyball/./src/resources/js/keyboard.js","webpack://pikachu-volleyball/./src/resources/js/audio.js","webpack://pikachu-volleyball/./src/resources/js/pikavolley.js","webpack://pikachu-volleyball/./src/resources/js/ui.js","webpack://pikachu-volleyball/./src/resources/js/main.js","webpack://pikachu-volleyball/./src/resources/js/utils/local_storage_wrapper.js"],"sourcesContent":["/**\n * Manages the paths (file locations) of the game assets.\n */\n'use strict';\n\nexport const ASSETS_PATH = {\n SPRITE_SHEET: '../resources/assets/images/sprite_sheet.json',\n TEXTURES: {},\n SOUNDS: {},\n};\n\nconst TEXTURES = ASSETS_PATH.TEXTURES;\nTEXTURES.PIKACHU = (i, j) => `pikachu/pikachu_${i}_${j}.png`;\nTEXTURES.BALL = (s) => `ball/ball_${s}.png`;\nTEXTURES.NUMBER = (n) => `number/number_${n}.png`;\n\nTEXTURES.SKY_BLUE = 'objects/sky_blue.png';\nTEXTURES.MOUNTAIN = 'objects/mountain.png';\nTEXTURES.GROUND_RED = 'objects/ground_red.png';\nTEXTURES.GROUND_LINE = 'objects/ground_line.png';\nTEXTURES.GROUND_LINE_LEFT_MOST = 'objects/ground_line_leftmost.png';\nTEXTURES.GROUND_LINE_RIGHT_MOST = 'objects/ground_line_rightmost.png';\nTEXTURES.GROUND_YELLOW = 'objects/ground_yellow.png';\nTEXTURES.NET_PILLAR_TOP = 'objects/net_pillar_top.png';\nTEXTURES.NET_PILLAR = 'objects/net_pillar.png';\nTEXTURES.SHADOW = 'objects/shadow.png';\nTEXTURES.BALL_HYPER = 'ball/ball_hyper.png';\nTEXTURES.BALL_TRAIL = 'ball/ball_trail.png';\nTEXTURES.BALL_PUNCH = 'ball/ball_punch.png';\nTEXTURES.CLOUD = 'objects/cloud.png';\nTEXTURES.WAVE = 'objects/wave.png';\nTEXTURES.BLACK = 'objects/black.png';\n\nTEXTURES.SACHISOFT = 'messages/common/sachisoft.png';\nTEXTURES.READY = 'messages/common/ready.png';\nTEXTURES.GAME_END = 'messages/common/game_end.png';\n\nTEXTURES.MARK = 'messages/ja/mark.png';\nTEXTURES.POKEMON = 'messages/ja/pokemon.png';\nTEXTURES.PIKACHU_VOLLEYBALL = 'messages/ja/pikachu_volleyball.png';\nTEXTURES.FIGHT = 'messages/ja/fight.png';\nTEXTURES.WITH_COMPUTER = 'messages/ja/with_computer.png';\nTEXTURES.WITH_FRIEND = 'messages/ja/with_friend.png';\nTEXTURES.GAME_START = 'messages/ja/game_start.png';\n\nTEXTURES.SITTING_PIKACHU = 'sitting_pikachu.png';\n\nconst SOUNDS = ASSETS_PATH.SOUNDS;\nSOUNDS.BGM = '../resources/assets/sounds/bgm.mp3';\nSOUNDS.PIPIKACHU = '../resources/assets/sounds/WAVE140_1.wav';\nSOUNDS.PIKA = '../resources/assets/sounds/WAVE141_1.wav';\nSOUNDS.CHU = '../resources/assets/sounds/WAVE142_1.wav';\nSOUNDS.PI = '../resources/assets/sounds/WAVE143_1.wav';\nSOUNDS.PIKACHU = '../resources/assets/sounds/WAVE144_1.wav';\nSOUNDS.POWERHIT = '../resources/assets/sounds/WAVE145_1.wav';\nSOUNDS.BALLTOUCHESGROUND = '../resources/assets/sounds/WAVE146_1.wav';\n","/**\n * This module contains random number generator used for the game\n */\n'use strict';\n/** @typedef {function():number} RNG */\n\n/** @type {RNG} custom RNG (random number generator) function which generates a random number in [0, 1] */\nlet customRng = null;\n\n/**\n * Return random integer in [0, 32767]\n *\n * The machine code of the original game use \"_rand()\" function in Visual Studio 1988 Library.\n * I could't find out how this function works exactly.\n * But, anyhow, it should be a function that generate a random number.\n * I decided to use custom rand function which generates random integer in [0, 32767]\n * which follows rand() function in Visual Studio 2017 Library.\n *\n * By default, it uses the function \"Math.random\" for generating a random number.\n * A custom RNG function can used by setting the \"customRng\" as the custom RNG function.\n *\n * @return {number} random integer\n */\nexport function rand() {\n if (customRng === null) {\n return Math.floor(32768 * Math.random());\n }\n return Math.floor(32768 * customRng());\n}\n\n/**\n * Set custom RNG function\n * @param {RNG} rng\n */\nexport function setCustomRng(rng) {\n customRng = rng;\n}\n","/**\n * The Model part in the MVC pattern\n *\n * It is the core module which acts as a physics engine.\n * This physics engine calculates the movements of the ball and the players (Pikachus).\n *\n * It was gained by reverse engineering the original game.\n * The address of each function in the original machine code is specified at the comment above each function.\n * ex) FUN_00403dd0 means the original function at the address 00403dd0.\n *\n *\n * ** Some useful infos below **\n *\n * Ground width: 432 = 0x1B0\n * Ground height: 304 = 0x130\n *\n * X position coordinate: [0, 432], right-direction increasing\n * Y position coordinate: [0, 304], down-direction increasing\n *\n * Ball radius: 20 = 0x14\n * Ball diameter: 40 = 0x28\n *\n * Player half-width: 32 = 0x20\n * Player half-height: 32 = 0x20\n * Player width: 64 = 0x40\n * Player height: 64 = 0x40\n *\n */\n'use strict';\nimport { rand } from './rand.js';\n\n/** @constant @type {number} ground width */\nconst GROUND_WIDTH = 432;\n/** @constant @type {number} ground half-width, it is also the net pillar x coordinate */\nexport const GROUND_HALF_WIDTH = (GROUND_WIDTH / 2) | 0; // integer division\n/** @constant @type {number} player (Pikachu) length: width = height = 64 */\nconst PLAYER_LENGTH = 64;\n/** @constant @type {number} player half length */\nconst PLAYER_HALF_LENGTH = (PLAYER_LENGTH / 2) | 0; // integer division\n/** @constant @type {number} player's y coordinate when they are touching ground */\nconst PLAYER_TOUCHING_GROUND_Y_COORD = 244;\n/** @constant @type {number} ball's radius */\nconst BALL_RADIUS = 20;\n/** @constant @type {number} ball's y coordinate when it is touching ground */\nconst BALL_TOUCHING_GROUND_Y_COORD = 252;\n/** @constant @type {number} net pillar's half width (this value is on this physics engine only, not on the sprite pixel size) */\nconst NET_PILLAR_HALF_WIDTH = 25;\n/** @constant @type {number} net pillar top's top side y coordinate */\nconst NET_PILLAR_TOP_TOP_Y_COORD = 176;\n/** @constant @type {number} net pillar top's bottom side y coordinate (this value is on this physics engine only) */\nconst NET_PILLAR_TOP_BOTTOM_Y_COORD = 192;\n\n/**\n * It's for to limit the looping number of the infinite loops.\n * This constant is not in the original machine code. (The original machine code does not limit the looping number.)\n *\n * In the original ball x coord range setting (ball x coord in [20, 432]), the infinite loops in\n * {@link calculateExpectedLandingPointXFor} function and {@link expectedLandingPointXWhenPowerHit} function seems to be always terminated soon.\n * But if the ball x coord range is edited, for example, to [20, 432 - 20] for left-right symmetry,\n * it is observed that the infinite loop in {@link expectedLandingPointXWhenPowerHit} does not terminate.\n * So for safety, this infinite loop limit is included for the infinite loops mentioned above.\n * @constant @type {number}\n */\nconst INFINITE_LOOP_LIMIT = 1000;\n\n/**\n * Class representing a pack of physical objects i.e. players and ball\n * whose physical values are calculated and set by {@link physicsEngine} function\n */\nexport class PikaPhysics {\n /**\n * Create a physics pack\n * @param {boolean} isPlayer1Computer Is player on the left (player 1) controlled by computer?\n * @param {boolean} isPlayer2Computer Is player on the right (player 2) controlled by computer?\n */\n constructor(isPlayer1Computer, isPlayer2Computer) {\n this.player1 = new Player(false, isPlayer1Computer);\n this.player2 = new Player(true, isPlayer2Computer);\n this.ball = new Ball(false);\n }\n\n /**\n * run {@link physicsEngine} function with this physics object and user input\n *\n * @param {PikaUserInput[]} userInputArray userInputArray[0]: PikaUserInput object for player 1, userInputArray[1]: PikaUserInput object for player 2\n * @return {boolean} Is ball touching ground?\n */\n runEngineForNextFrame(userInputArray) {\n const isBallTouchingGround = physicsEngine(\n this.player1,\n this.player2,\n this.ball,\n userInputArray\n );\n return isBallTouchingGround;\n }\n}\n\n/**\n * Class (or precisely, Interface) representing user input (from keyboard or joystick, whatever)\n */\nexport class PikaUserInput {\n constructor() {\n /** @type {number} 0: no horizontal-direction input, -1: left-direction input, 1: right-direction input */\n this.xDirection = 0;\n /** @type {number} 0: no vertical-direction input, -1: up-direction input, 1: down-direction input */\n this.yDirection = 0;\n /** @type {number} 0: auto-repeated or no power hit input, 1: not auto-repeated power hit input */\n this.powerHit = 0;\n }\n}\n\n/**\n * Class representing a player\n *\n * Player 1 property address: 00411F28 -> +28 -> +10 -> +C -> ...\n * Player 2 property address: 00411F28 -> +28 -> +10 -> +10 -> ...\n * The \"...\" part is written on the line comment at the right side of each property.\n * e.g. address to player1.isPlayer: 00411F28 -> +28 -> +10 -> +C -> +A0\n * e.g. address to player2.isComputer: 00411F28 -> +28 -> +10 -> +10 -> +A4\n *\n * For initial values: refer to FUN_000403a90 && FUN_00401f40\n */\nclass Player {\n /**\n * create a player\n * @param {boolean} isPlayer2 Is this player on the right side?\n * @param {boolean} isComputer Is this player controlled by computer?\n */\n constructor(isPlayer2, isComputer) {\n /** @type {boolean} Is this player on the right side? */\n this.isPlayer2 = isPlayer2; // 0xA0\n /** @type {boolean} Is controlled by computer? */\n this.isComputer = isComputer; // 0xA4\n this.initializeForNewRound();\n\n /** @type {number} -1: left, 0: no diving, 1: right */\n this.divingDirection = 0; // 0xB4\n /** @type {number} */\n this.lyingDownDurationLeft = -1; // 0xB8\n /** @type {boolean} */\n this.isWinner = false; // 0xD0\n /** @type {boolean} */\n this.gameEnded = false; // 0xD4\n\n /**\n * It flips randomly to 0 or 1 by the {@link letComputerDecideUserInput} function (FUN_00402360)\n * when ball is hanging around on the other player's side.\n * If it is 0, computer player stands by around the middle point of their side.\n * If it is 1, computer player stands by adjacent to the net.\n * @type {number} 0 or 1\n */\n this.computerWhereToStandBy = 0; // 0xDC\n\n /**\n * This property is not in the player pointers of the original source code.\n * But for sound effect (especially for stereo sound),\n * it is convenient way to give sound property to a Player.\n * The original name is stereo sound.\n * @type {Object.}\n */\n this.sound = {\n pipikachu: false,\n pika: false,\n chu: false,\n };\n }\n\n /**\n * initialize for new round\n */\n initializeForNewRound() {\n /** @type {number} x coord */\n this.x = 36; // 0xA8 // initialized to 36 (player1) or 396 (player2)\n if (this.isPlayer2) {\n this.x = GROUND_WIDTH - 36;\n }\n /** @type {number} y coord */\n this.y = PLAYER_TOUCHING_GROUND_Y_COORD; // 0xAC // initialized to 244\n /** @type {number} y direction velocity */\n this.yVelocity = 0; // 0xB0 // initialized to 0\n /** @type {boolean} */\n this.isCollisionWithBallHappened = false; // 0xBC // initialized to 0 i.e false\n\n /**\n * Player's state\n * 0: normal, 1: jumping, 2: jumping_and_power_hitting, 3: diving\n * 4: lying_down_after_diving\n * 5: win!, 6: lost..\n * @type {number} 0, 1, 2, 3, 4, 5 or 6\n */\n this.state = 0; // 0xC0 // initialized to 0\n /** @type {number} */\n this.frameNumber = 0; // 0xC4 // initialized to 0\n /** @type {number} */\n this.normalStatusArmSwingDirection = 1; // 0xC8 // initialized to 1\n /** @type {number} */\n this.delayBeforeNextFrame = 0; // 0xCC // initialized to 0\n\n /**\n * This value is initialized to (_rand() % 5) before the start of every round.\n * The greater the number, the bolder the computer player.\n *\n * If computer has higher boldness,\n * judges more the ball is hanging around the other player's side,\n * has greater distance to the expected landing point of the ball,\n * jumps more,\n * and dives less.\n * See the source code of the {@link letComputerDecideUserInput} function (FUN_00402360).\n *\n * @type {number} 0, 1, 2, 3 or 4\n */\n this.computerBoldness = rand() % 5; // 0xD8 // initialized to (_rand() % 5)\n }\n}\n\n/**\n * Class representing a ball\n *\n * Ball property address: 00411F28 -> +28 -> +10 -> +14 -> ...\n * The \"...\" part is written on the line comment at the right side of each property.\n * e.g. address to ball.fineRotation: 00411F28 -> +28 -> +10 -> +14 -> +48\n *\n * For initial Values: refer to FUN_000403a90 && FUN_00402d60\n */\nclass Ball {\n /**\n * Create a ball\n * @param {boolean} isPlayer2Serve Will player 2 serve on this new round?\n */\n constructor(isPlayer2Serve) {\n this.initializeForNewRound(isPlayer2Serve);\n /** @type {number} x coord of expected landing point */\n this.expectedLandingPointX = 0; // 0x40\n /**\n * ball rotation frame number selector\n * During the period where it continues to be 5, hyper ball glitch occur.\n * @type {number} 0, 1, 2, 3, 4 or 5\n * */\n this.rotation = 0; // 0x44\n /** @type {number} */\n this.fineRotation = 0; // 0x48\n /** @type {number} x coord for punch effect */\n this.punchEffectX = 0; // 0x50\n /** @type {number} y coord for punch effect */\n this.punchEffectY = 0; // 0x54\n\n /**\n * Following previous values are for trailing effect for power hit\n * @type {number}\n */\n this.previousX = 0; // 0x58\n this.previousPreviousX = 0; // 0x5c\n this.previousY = 0; // 0x60\n this.previousPreviousY = 0; // 0x64\n\n /**\n * this property is not in the ball pointer of the original source code.\n * But for sound effect (especially for stereo sound),\n * it is convenient way to give sound property to a Ball.\n * The original name is stereo sound.\n */\n this.sound = {\n powerHit: false,\n ballTouchesGround: false,\n };\n }\n\n /**\n * Initialize for new round\n * @param {boolean} isPlayer2Serve will player on the right side serve on this new round?\n */\n initializeForNewRound(isPlayer2Serve) {\n /** @type {number} x coord */\n this.x = 56; // 0x30 // initialized to 56 or 376\n if (isPlayer2Serve === true) {\n this.x = GROUND_WIDTH - 56;\n }\n /** @type {number} y coord */\n this.y = 0; // 0x34 // initialized to 0\n /** @type {number} x direction velocity */\n this.xVelocity = 0; // 0x38 // initialized to 0\n /** @type {number} y direction velocity */\n this.yVelocity = 1; // 0x3C // initialized to 1\n /** @type {number} punch effect radius */\n this.punchEffectRadius = 0; // 0x4c // initialized to 0\n /** @type {boolean} is power hit */\n this.isPowerHit = false; // 0x68 // initialized to 0 i.e. false\n }\n}\n\n/**\n * FUN_00403dd0\n * This is the Pikachu Volleyball physics engine!\n * This physics engine calculates and set the physics values for the next frame.\n *\n * @param {Player} player1 player on the left side\n * @param {Player} player2 player on the right side\n * @param {Ball} ball ball\n * @param {PikaUserInput[]} userInputArray userInputArray[0]: user input for player 1, userInputArray[1]: user input for player 2\n * @return {boolean} Is ball touching ground?\n */\nfunction physicsEngine(player1, player2, ball, userInputArray) {\n const isBallTouchingGround =\n processCollisionBetweenBallAndWorldAndSetBallPosition(ball);\n\n let player;\n let theOtherPlayer;\n for (let i = 0; i < 2; i++) {\n if (i === 0) {\n player = player1;\n theOtherPlayer = player2;\n } else {\n player = player2;\n theOtherPlayer = player1;\n }\n\n // FUN_00402d90 omitted\n // FUN_00402810 omitted\n // this javascript code is refactored not to need above two function except for\n // a part of FUN_00402d90:\n // FUN_00402d90 include FUN_004031b0(calculateExpectedLandingPointXFor)\n calculateExpectedLandingPointXFor(ball); // calculate expected_X;\n\n processPlayerMovementAndSetPlayerPosition(\n player,\n userInputArray[i],\n theOtherPlayer,\n ball\n );\n\n // FUN_00402830 omitted\n // FUN_00406020 omitted\n // These two functions omitted above maybe participate in graphic drawing for a player\n }\n\n for (let i = 0; i < 2; i++) {\n if (i === 0) {\n player = player1;\n } else {\n player = player2;\n }\n\n // FUN_00402810 omitted: this javascript code is refactored not to need this function\n\n const isHappened = isCollisionBetweenBallAndPlayerHappened(\n ball,\n player.x,\n player.y\n );\n if (isHappened === true) {\n if (player.isCollisionWithBallHappened === false) {\n processCollisionBetweenBallAndPlayer(\n ball,\n player.x,\n userInputArray[i],\n player.state\n );\n player.isCollisionWithBallHappened = true;\n }\n } else {\n player.isCollisionWithBallHappened = false;\n }\n }\n\n // FUN_00403040\n // FUN_00406020\n // These two functions omitted above maybe participate in graphic drawing for a player\n\n return isBallTouchingGround;\n}\n\n/**\n * FUN_00403070\n * Is collision between ball and player happened?\n * @param {Ball} ball\n * @param {Player[\"x\"]} playerX player.x\n * @param {Player[\"y\"]} playerY player.y\n * @return {boolean}\n */\nfunction isCollisionBetweenBallAndPlayerHappened(ball, playerX, playerY) {\n let diff = ball.x - playerX;\n if (Math.abs(diff) <= PLAYER_HALF_LENGTH) {\n diff = ball.y - playerY;\n if (Math.abs(diff) <= PLAYER_HALF_LENGTH) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * FUN_00402dc0\n * Process collision between ball and world and set ball position\n * @param {Ball} ball\n * @return {boolean} Is ball touching ground?\n */\nfunction processCollisionBetweenBallAndWorldAndSetBallPosition(ball) {\n // This is not part of this function in the original assembly code.\n // In the original assembly code, it is processed in other function (FUN_00402ee0)\n // But it is proper to process here.\n ball.previousPreviousX = ball.previousX;\n ball.previousPreviousY = ball.previousY;\n ball.previousX = ball.x;\n ball.previousY = ball.y;\n\n // \"(ball.xVelocity / 2) | 0\" is integer division by 2\n let futureFineRotation = ball.fineRotation + ((ball.xVelocity / 2) | 0);\n // If futureFineRotation === 50, it skips next if statement finely.\n // Then ball.fineRotation = 50, and then ball.rotation = 5 (which designates hyper ball sprite!).\n // In this way, hyper ball glitch occur!\n // If this happen at the end of round,\n // since ball.xVelocity is 0-initialized at each start of round,\n // hyper ball sprite is rendered continuously until a collision happens.\n if (futureFineRotation < 0) {\n futureFineRotation += 50;\n } else if (futureFineRotation > 50) {\n futureFineRotation += -50;\n }\n ball.fineRotation = futureFineRotation;\n ball.rotation = (ball.fineRotation / 10) | 0; // integer division\n\n const futureBallX = ball.x + ball.xVelocity;\n /*\n If the center of ball would get out of left world bound or right world bound, bounce back.\n \n In this if statement, when considering left-right symmetry,\n \"futureBallX > GROUND_WIDTH\" should be changed to \"futureBallX > (GROUND_WIDTH - BALL_RADIUS)\",\n or \"futureBallX < BALL_RADIUS\" should be changed to \"futureBallX < 0\".\n Maybe the former one is more proper when seeing Pikachu player's x-direction boundary.\n Is this a mistake of the author of the original game?\n Or, was it set to this value to resolve infinite loop problem? (See comments on the constant INFINITE_LOOP_LIMIT.)\n If apply (futureBallX > (GROUND_WIDTH - BALL_RADIUS)), and if the maximum number of loop is not limited,\n it is observed that infinite loop in the function expectedLandingPointXWhenPowerHit does not terminate.\n */\n if (futureBallX < BALL_RADIUS || futureBallX > GROUND_WIDTH) {\n ball.xVelocity = -ball.xVelocity;\n }\n\n let futureBallY = ball.y + ball.yVelocity;\n // if the center of ball would get out of upper world bound\n if (futureBallY < 0) {\n ball.yVelocity = 1;\n }\n\n // If ball touches net\n if (\n Math.abs(ball.x - GROUND_HALF_WIDTH) < NET_PILLAR_HALF_WIDTH &&\n ball.y > NET_PILLAR_TOP_TOP_Y_COORD\n ) {\n if (ball.y <= NET_PILLAR_TOP_BOTTOM_Y_COORD) {\n if (ball.yVelocity > 0) {\n ball.yVelocity = -ball.yVelocity;\n }\n } else {\n if (ball.x < GROUND_HALF_WIDTH) {\n ball.xVelocity = -Math.abs(ball.xVelocity);\n } else {\n ball.xVelocity = Math.abs(ball.xVelocity);\n }\n }\n }\n\n futureBallY = ball.y + ball.yVelocity;\n // if ball would touch ground\n if (futureBallY > BALL_TOUCHING_GROUND_Y_COORD) {\n // FUN_00408470 omitted\n // the function omitted above receives 100 * (ball.x - 216),\n // i.e. horizontal displacement from net maybe for stereo sound?\n // code function (ballpointer + 0x28 + 0x10)? omitted\n // the omitted two functions maybe do a part of sound playback role.\n ball.sound.ballTouchesGround = true;\n\n ball.yVelocity = -ball.yVelocity;\n ball.punchEffectX = ball.x;\n ball.y = BALL_TOUCHING_GROUND_Y_COORD;\n ball.punchEffectRadius = BALL_RADIUS;\n ball.punchEffectY = BALL_TOUCHING_GROUND_Y_COORD + BALL_RADIUS;\n return true;\n }\n ball.y = futureBallY;\n ball.x = ball.x + ball.xVelocity;\n ball.yVelocity += 1;\n\n return false;\n}\n\n/**\n * FUN_00401fc0\n * Process player movement according to user input and set player position\n * @param {Player} player\n * @param {PikaUserInput} userInput\n * @param {Player} theOtherPlayer\n * @param {Ball} ball\n */\nfunction processPlayerMovementAndSetPlayerPosition(\n player,\n userInput,\n theOtherPlayer,\n ball\n) {\n if (player.isComputer === true) {\n letComputerDecideUserInput(player, ball, theOtherPlayer, userInput);\n }\n\n // if player is lying down.. don't move\n if (player.state === 4) {\n player.lyingDownDurationLeft += -1;\n if (player.lyingDownDurationLeft < -1) {\n player.state = 0;\n }\n return;\n }\n\n // process x-direction movement\n let playerVelocityX = 0;\n if (player.state < 5) {\n if (player.state < 3) {\n playerVelocityX = userInput.xDirection * 6;\n } else {\n // player.state === 3 i.e. player is diving..\n playerVelocityX = player.divingDirection * 8;\n }\n }\n\n const futurePlayerX = player.x + playerVelocityX;\n player.x = futurePlayerX;\n\n // process player's x-direction world boundary\n if (player.isPlayer2 === false) {\n // if player is player1\n if (futurePlayerX < PLAYER_HALF_LENGTH) {\n player.x = PLAYER_HALF_LENGTH;\n } else if (futurePlayerX > GROUND_HALF_WIDTH - PLAYER_HALF_LENGTH) {\n player.x = GROUND_HALF_WIDTH - PLAYER_HALF_LENGTH;\n }\n } else {\n // if player is player2\n if (futurePlayerX < GROUND_HALF_WIDTH + PLAYER_HALF_LENGTH) {\n player.x = GROUND_HALF_WIDTH + PLAYER_HALF_LENGTH;\n } else if (futurePlayerX > GROUND_WIDTH - PLAYER_HALF_LENGTH) {\n player.x = GROUND_WIDTH - PLAYER_HALF_LENGTH;\n }\n }\n\n // jump\n if (\n player.state < 3 &&\n userInput.yDirection === -1 && // up-direction input\n player.y === PLAYER_TOUCHING_GROUND_Y_COORD // player is touching on the ground\n ) {\n player.yVelocity = -16;\n player.state = 1;\n player.frameNumber = 0;\n // maybe-stereo-sound function FUN_00408470 (0x90) omitted:\n // refer to a detailed comment above about this function\n // maybe-sound code function (playerpointer + 0x90 + 0x10)? omitted\n player.sound.chu = true;\n }\n\n // gravity\n const futurePlayerY = player.y + player.yVelocity;\n player.y = futurePlayerY;\n if (futurePlayerY < PLAYER_TOUCHING_GROUND_Y_COORD) {\n player.yVelocity += 1;\n } else if (futurePlayerY > PLAYER_TOUCHING_GROUND_Y_COORD) {\n // if player is landing..\n player.yVelocity = 0;\n player.y = PLAYER_TOUCHING_GROUND_Y_COORD;\n player.frameNumber = 0;\n if (player.state === 3) {\n // if player is diving..\n player.state = 4;\n player.frameNumber = 0;\n player.lyingDownDurationLeft = 3;\n } else {\n player.state = 0;\n }\n }\n\n if (userInput.powerHit === 1) {\n if (player.state === 1) {\n // if player is jumping..\n // then player do power hit!\n player.delayBeforeNextFrame = 5;\n player.frameNumber = 0;\n player.state = 2;\n // maybe-sound function (playerpointer + 0x90 + 0x18)? omitted\n // maybe-stereo-sound function FUN_00408470 (0x90) omitted:\n // refer to a detailed comment above about this function\n // maybe-sound function (playerpointer + 0x90 + 0x14)? omitted\n player.sound.pika = true;\n } else if (player.state === 0 && userInput.xDirection !== 0) {\n // then player do diving!\n player.state = 3;\n player.frameNumber = 0;\n player.divingDirection = userInput.xDirection;\n player.yVelocity = -5;\n // maybe-stereo-sound function FUN_00408470 (0x90) omitted:\n // refer to a detailed comment above about this function\n // maybe-sound code function (playerpointer + 0x90 + 0x10)? omitted\n player.sound.chu = true;\n }\n }\n\n if (player.state === 1) {\n player.frameNumber = (player.frameNumber + 1) % 3;\n } else if (player.state === 2) {\n if (player.delayBeforeNextFrame < 1) {\n player.frameNumber += 1;\n if (player.frameNumber > 4) {\n player.frameNumber = 0;\n player.state = 1;\n }\n } else {\n player.delayBeforeNextFrame -= 1;\n }\n } else if (player.state === 0) {\n player.delayBeforeNextFrame += 1;\n if (player.delayBeforeNextFrame > 3) {\n player.delayBeforeNextFrame = 0;\n const futureFrameNumber =\n player.frameNumber + player.normalStatusArmSwingDirection;\n if (futureFrameNumber < 0 || futureFrameNumber > 4) {\n player.normalStatusArmSwingDirection =\n -player.normalStatusArmSwingDirection;\n }\n player.frameNumber =\n player.frameNumber + player.normalStatusArmSwingDirection;\n }\n }\n\n if (player.gameEnded === true) {\n if (player.state === 0) {\n if (player.isWinner === true) {\n player.state = 5;\n // maybe-stereo-sound function FUN_00408470 (0x90) omitted:\n // refer to a detailed comment above about this function\n // maybe-sound code function (0x98 + 0x10) omitted\n player.sound.pipikachu = true;\n } else {\n player.state = 6;\n }\n player.delayBeforeNextFrame = 0;\n player.frameNumber = 0;\n }\n processGameEndFrameFor(player);\n }\n}\n\n/**\n * FUN_004025e0\n * Process game end frame (for winner and loser motions) for the given player\n * @param {Player} player\n */\nfunction processGameEndFrameFor(player) {\n if (player.gameEnded === true && player.frameNumber < 4) {\n player.delayBeforeNextFrame += 1;\n if (player.delayBeforeNextFrame > 4) {\n player.delayBeforeNextFrame = 0;\n player.frameNumber += 1;\n }\n }\n}\n\n/**\n * FUN_004030a0\n * Process collision between ball and player.\n * This function only sets velocity of ball and expected landing point x of ball.\n * This function does not set position of ball.\n * The ball position is set by {@link processCollisionBetweenBallAndWorldAndSetBallPosition} function\n *\n * @param {Ball} ball\n * @param {Player[\"x\"]} playerX\n * @param {PikaUserInput} userInput\n * @param {Player[\"state\"]} playerState\n */\nfunction processCollisionBetweenBallAndPlayer(\n ball,\n playerX,\n userInput,\n playerState\n) {\n // playerX is maybe pika's x position\n // if collision occur,\n // greater the x position difference between pika and ball,\n // greater the x velocity of the ball.\n if (ball.x < playerX) {\n // Since javascript division is float division by default,\n // Here we use \"| 0\" to do integer division (refer to: https://stackoverflow.com/a/17218003/8581025)\n ball.xVelocity = -((Math.abs(ball.x - playerX) / 3) | 0);\n } else if (ball.x > playerX) {\n ball.xVelocity = (Math.abs(ball.x - playerX) / 3) | 0;\n }\n\n // If ball velocity x is 0, randomly choose one of -1, 0, 1.\n if (ball.xVelocity === 0) {\n ball.xVelocity = (rand() % 3) - 1;\n }\n\n const ballAbsYVelocity = Math.abs(ball.yVelocity);\n ball.yVelocity = -ballAbsYVelocity;\n\n if (ballAbsYVelocity < 15) {\n ball.yVelocity = -15;\n }\n\n // player is jumping and power hitting\n if (playerState === 2) {\n if (ball.x < GROUND_HALF_WIDTH) {\n ball.xVelocity = (Math.abs(userInput.xDirection) + 1) * 10;\n } else {\n ball.xVelocity = -(Math.abs(userInput.xDirection) + 1) * 10;\n }\n ball.punchEffectX = ball.x;\n ball.punchEffectY = ball.y;\n\n ball.yVelocity = Math.abs(ball.yVelocity) * userInput.yDirection * 2;\n ball.punchEffectRadius = BALL_RADIUS;\n // maybe-stereo-sound function FUN_00408470 (0x90) omitted:\n // refer to a detailed comment above about this function\n // maybe-soundcode function (ballpointer + 0x24 + 0x10) omitted:\n ball.sound.powerHit = true;\n\n ball.isPowerHit = true;\n } else {\n ball.isPowerHit = false;\n }\n\n calculateExpectedLandingPointXFor(ball);\n}\n\n/**\n * FUN_004031b0\n * Calculate x coordinate of expected landing point of the ball\n * @param {Ball} ball\n */\nfunction calculateExpectedLandingPointXFor(ball) {\n const copyBall = {\n x: ball.x,\n y: ball.y,\n xVelocity: ball.xVelocity,\n yVelocity: ball.yVelocity,\n };\n let loopCounter = 0;\n while (true) {\n loopCounter++;\n\n const futureCopyBallX = copyBall.xVelocity + copyBall.x;\n if (futureCopyBallX < BALL_RADIUS || futureCopyBallX > GROUND_WIDTH) {\n copyBall.xVelocity = -copyBall.xVelocity;\n }\n if (copyBall.y + copyBall.yVelocity < 0) {\n copyBall.yVelocity = 1;\n }\n\n // If copy ball touches net\n if (\n Math.abs(copyBall.x - GROUND_HALF_WIDTH) < NET_PILLAR_HALF_WIDTH &&\n copyBall.y > NET_PILLAR_TOP_TOP_Y_COORD\n ) {\n // It maybe should be <= NET_PILLAR_TOP_BOTTOM_Y_COORD as in FUN_00402dc0, is it the original game author's mistake?\n if (copyBall.y < NET_PILLAR_TOP_BOTTOM_Y_COORD) {\n if (copyBall.yVelocity > 0) {\n copyBall.yVelocity = -copyBall.yVelocity;\n }\n } else {\n if (copyBall.x < GROUND_HALF_WIDTH) {\n copyBall.xVelocity = -Math.abs(copyBall.xVelocity);\n } else {\n copyBall.xVelocity = Math.abs(copyBall.xVelocity);\n }\n }\n }\n\n copyBall.y = copyBall.y + copyBall.yVelocity;\n // if copyBall would touch ground\n if (\n copyBall.y > BALL_TOUCHING_GROUND_Y_COORD ||\n loopCounter >= INFINITE_LOOP_LIMIT\n ) {\n break;\n }\n copyBall.x = copyBall.x + copyBall.xVelocity;\n copyBall.yVelocity += 1;\n }\n ball.expectedLandingPointX = copyBall.x;\n}\n\n/**\n * FUN_00402360\n * Computer controls its player by this function.\n * Computer decides the user input for the player it controls,\n * according to the game situation it figures out\n * by the given parameters (player, ball and theOtherPlayer),\n * and reflects these to the given user input object.\n *\n * @param {Player} player The player whom computer controls\n * @param {Ball} ball ball\n * @param {Player} theOtherPlayer The other player\n * @param {PikaUserInput} userInput user input of the player whom computer controls\n */\nfunction letComputerDecideUserInput(player, ball, theOtherPlayer, userInput) {\n userInput.xDirection = 0;\n userInput.yDirection = 0;\n userInput.powerHit = 0;\n\n let virtualExpectedLandingPointX = ball.expectedLandingPointX;\n if (\n Math.abs(ball.x - player.x) > 100 &&\n Math.abs(ball.xVelocity) < player.computerBoldness + 5\n ) {\n const leftBoundary = Number(player.isPlayer2) * GROUND_HALF_WIDTH;\n if (\n (ball.expectedLandingPointX <= leftBoundary ||\n ball.expectedLandingPointX >=\n Number(player.isPlayer2) * GROUND_WIDTH + GROUND_HALF_WIDTH) &&\n player.computerWhereToStandBy === 0\n ) {\n // If conditions above met, the computer estimates the proper location to stay as the middle point of their side\n virtualExpectedLandingPointX =\n leftBoundary + ((GROUND_HALF_WIDTH / 2) | 0);\n }\n }\n\n if (\n Math.abs(virtualExpectedLandingPointX - player.x) >\n player.computerBoldness + 8\n ) {\n if (player.x < virtualExpectedLandingPointX) {\n userInput.xDirection = 1;\n } else {\n userInput.xDirection = -1;\n }\n } else if (rand() % 20 === 0) {\n player.computerWhereToStandBy = rand() % 2;\n }\n\n if (player.state === 0) {\n if (\n Math.abs(ball.xVelocity) < player.computerBoldness + 3 &&\n Math.abs(ball.x - player.x) < PLAYER_HALF_LENGTH &&\n ball.y > -36 &&\n ball.y < 10 * player.computerBoldness + 84 &&\n ball.yVelocity > 0\n ) {\n userInput.yDirection = -1;\n }\n\n const leftBoundary = Number(player.isPlayer2) * GROUND_HALF_WIDTH;\n const rightBoundary = (Number(player.isPlayer2) + 1) * GROUND_HALF_WIDTH;\n if (\n ball.expectedLandingPointX > leftBoundary &&\n ball.expectedLandingPointX < rightBoundary &&\n Math.abs(ball.x - player.x) >\n player.computerBoldness * 5 + PLAYER_LENGTH &&\n ball.x > leftBoundary &&\n ball.x < rightBoundary &&\n ball.y > 174\n ) {\n // If conditions above met, the computer decides to dive!\n userInput.powerHit = 1;\n if (player.x < ball.x) {\n userInput.xDirection = 1;\n } else {\n userInput.xDirection = -1;\n }\n }\n } else if (player.state === 1 || player.state === 2) {\n if (Math.abs(ball.x - player.x) > 8) {\n if (player.x < ball.x) {\n userInput.xDirection = 1;\n } else {\n userInput.xDirection = -1;\n }\n }\n if (Math.abs(ball.x - player.x) < 48 && Math.abs(ball.y - player.y) < 48) {\n const willInputPowerHit = decideWhetherInputPowerHit(\n player,\n ball,\n theOtherPlayer,\n userInput\n );\n if (willInputPowerHit === true) {\n userInput.powerHit = 1;\n if (\n Math.abs(theOtherPlayer.x - player.x) < 80 &&\n userInput.yDirection !== -1\n ) {\n userInput.yDirection = -1;\n }\n }\n }\n }\n}\n\n/**\n * FUN_00402630\n * This function is called by {@link letComputerDecideUserInput},\n * and also sets x and y direction user input so that it participate in\n * the decision of the direction of power hit.\n * @param {Player} player the player whom computer controls\n * @param {Ball} ball ball\n * @param {Player} theOtherPlayer The other player\n * @param {PikaUserInput} userInput user input for the player whom computer controls\n * @return {boolean} Will input power hit?\n */\nfunction decideWhetherInputPowerHit(player, ball, theOtherPlayer, userInput) {\n if (rand() % 2 === 0) {\n for (let xDirection = 1; xDirection > -1; xDirection--) {\n for (let yDirection = -1; yDirection < 2; yDirection++) {\n const expectedLandingPointX = expectedLandingPointXWhenPowerHit(\n xDirection,\n yDirection,\n ball\n );\n if (\n (expectedLandingPointX <=\n Number(player.isPlayer2) * GROUND_HALF_WIDTH ||\n expectedLandingPointX >=\n Number(player.isPlayer2) * GROUND_WIDTH + GROUND_HALF_WIDTH) &&\n Math.abs(expectedLandingPointX - theOtherPlayer.x) > PLAYER_LENGTH\n ) {\n userInput.xDirection = xDirection;\n userInput.yDirection = yDirection;\n return true;\n }\n }\n }\n } else {\n for (let xDirection = 1; xDirection > -1; xDirection--) {\n for (let yDirection = 1; yDirection > -2; yDirection--) {\n const expectedLandingPointX = expectedLandingPointXWhenPowerHit(\n xDirection,\n yDirection,\n ball\n );\n if (\n (expectedLandingPointX <=\n Number(player.isPlayer2) * GROUND_HALF_WIDTH ||\n expectedLandingPointX >=\n Number(player.isPlayer2) * GROUND_WIDTH + GROUND_HALF_WIDTH) &&\n Math.abs(expectedLandingPointX - theOtherPlayer.x) > PLAYER_LENGTH\n ) {\n userInput.xDirection = xDirection;\n userInput.yDirection = yDirection;\n return true;\n }\n }\n }\n }\n return false;\n}\n\n/**\n * FUN_00402870\n * This function is called by {@link decideWhetherInputPowerHit},\n * and calculates the expected x coordinate of the landing point of the ball\n * when power hit\n * @param {PikaUserInput[\"xDirection\"]} userInputXDirection\n * @param {PikaUserInput[\"yDirection\"]} userInputYDirection\n * @param {Ball} ball\n * @return {number} x coord of expected landing point when power hit the ball\n */\nfunction expectedLandingPointXWhenPowerHit(\n userInputXDirection,\n userInputYDirection,\n ball\n) {\n const copyBall = {\n x: ball.x,\n y: ball.y,\n xVelocity: ball.xVelocity,\n yVelocity: ball.yVelocity,\n };\n if (copyBall.x < GROUND_HALF_WIDTH) {\n copyBall.xVelocity = (Math.abs(userInputXDirection) + 1) * 10;\n } else {\n copyBall.xVelocity = -(Math.abs(userInputXDirection) + 1) * 10;\n }\n copyBall.yVelocity = Math.abs(copyBall.yVelocity) * userInputYDirection * 2;\n\n let loopCounter = 0;\n while (true) {\n loopCounter++;\n\n const futureCopyBallX = copyBall.x + copyBall.xVelocity;\n if (futureCopyBallX < BALL_RADIUS || futureCopyBallX > GROUND_WIDTH) {\n copyBall.xVelocity = -copyBall.xVelocity;\n }\n if (copyBall.y + copyBall.yVelocity < 0) {\n copyBall.yVelocity = 1;\n }\n if (\n Math.abs(copyBall.x - GROUND_HALF_WIDTH) < NET_PILLAR_HALF_WIDTH &&\n copyBall.y > NET_PILLAR_TOP_TOP_Y_COORD\n ) {\n /*\n The code below maybe is intended to make computer do mistakes.\n The player controlled by computer occasionally power hit ball that is bounced back by the net pillar,\n since code below do not anticipate the bounce back.\n */\n if (copyBall.yVelocity > 0) {\n copyBall.yVelocity = -copyBall.yVelocity;\n }\n /*\n An alternative code for making the computer not do those mistakes is as below.\n\n if (copyBall.y <= NET_PILLAR_TOP_BOTTOM_Y_COORD) {\n if (copyBall.yVelocity > 0) {\n copyBall.yVelocity = -copyBall.yVelocity;\n }\n } else {\n if (copyBall.x < GROUND_HALF_WIDTH) {\n copyBall.xVelocity = -Math.abs(copyBall.xVelocity);\n } else {\n copyBall.xVelocity = Math.abs(copyBall.xVelocity);\n }\n }\n */\n }\n copyBall.y = copyBall.y + copyBall.yVelocity;\n if (\n copyBall.y > BALL_TOUCHING_GROUND_Y_COORD ||\n loopCounter >= INFINITE_LOOP_LIMIT\n ) {\n return copyBall.x;\n }\n copyBall.x = copyBall.x + copyBall.xVelocity;\n copyBall.yVelocity += 1;\n }\n}\n","/**\n * This module takes charge of the physical motion of clouds (on the sky) and wave (on the bottom of game screen) in the game.\n * It is also a Model in MVC pattern and also rendered by \"view.js\".\n *\n * It is gained by reverse engineering the original game.\n * The address of the original function is in the comment.\n * ex) FUN_00404770 means the function at the address 00404770 in the machine code.\n */\n'use strict';\nimport { rand } from './rand.js';\n\n/**\n * Class represents a cloud\n */\nexport class Cloud {\n constructor() {\n this.topLeftPointX = -68 + (rand() % (432 + 68));\n this.topLeftPointY = rand() % 152;\n this.topLeftPointXVelocity = 1 + (rand() % 2);\n this.sizeDiffTurnNumber = rand() % 11;\n }\n\n get sizeDiff() {\n // this same as return [0, 1, 2, 3, 4, 5, 4, 3, 2, 1, 0][this.sizeDiffTurnNumber]\n return 5 - Math.abs(this.sizeDiffTurnNumber - 5);\n }\n\n get spriteTopLeftPointX() {\n return this.topLeftPointX - this.sizeDiff;\n }\n\n get spriteTopLeftPointY() {\n return this.topLeftPointY - this.sizeDiff;\n }\n\n get spriteWidth() {\n return 48 + 2 * this.sizeDiff;\n }\n\n get spriteHeight() {\n return 24 + 2 * this.sizeDiff;\n }\n}\n\n/**\n * Class representing wave\n */\nexport class Wave {\n constructor() {\n this.verticalCoord = 0;\n this.verticalCoordVelocity = 2;\n this.yCoords = [];\n for (let i = 0; i < 432 / 16; i++) {\n this.yCoords.push(314);\n }\n }\n}\n\n/**\n * FUN_00404770\n * Move clouds and wave\n * @param {Cloud[]} cloudArray\n * @param {Wave} wave\n */\nexport function cloudAndWaveEngine(cloudArray, wave) {\n for (let i = 0; i < 10; i++) {\n cloudArray[i].topLeftPointX += cloudArray[i].topLeftPointXVelocity;\n if (cloudArray[i].topLeftPointX > 432) {\n cloudArray[i].topLeftPointX = -68;\n cloudArray[i].topLeftPointY = rand() % 152;\n cloudArray[i].topLeftPointXVelocity = 1 + (rand() % 2);\n }\n cloudArray[i].sizeDiffTurnNumber =\n (cloudArray[i].sizeDiffTurnNumber + 1) % 11;\n }\n\n wave.verticalCoord += wave.verticalCoordVelocity;\n if (wave.verticalCoord > 32) {\n wave.verticalCoord = 32;\n wave.verticalCoordVelocity = -1;\n } else if (wave.verticalCoord < 0 && wave.verticalCoordVelocity < 0) {\n wave.verticalCoordVelocity = 2;\n wave.verticalCoord = -(rand() % 40);\n }\n\n for (let i = 0; i < 432 / 16; i++) {\n wave.yCoords[i] = 314 - wave.verticalCoord + (rand() % 3);\n }\n}\n","/**\n * The View part in the MVC pattern\n *\n * Some codes in this module were gained by reverse engineering the original machine code.\n * The codes gained by reverse engineering are commented by the address of the function referred to in the machine code.\n * ex) FUN_00405d50 means the function at the address 00405d50 in the machine code.\n */\n'use strict';\nimport { AnimatedSprite } from '@pixi/sprite-animated';\nimport { Sprite } from '@pixi/sprite';\nimport { Container } from '@pixi/display';\nimport { Cloud, Wave, cloudAndWaveEngine } from './cloud_and_wave.js';\nimport { ASSETS_PATH } from './assets_path.js';\n\n/** @typedef {import('@pixi/loaders').LoaderResource} LoaderResource */\n/** @typedef {import('@pixi/core').Texture} Texture */\n\nconst TEXTURES = ASSETS_PATH.TEXTURES;\n\n/** @constant @type {number} number of clouds to be rendered */\nconst NUM_OF_CLOUDS = 10;\n\n/**\n * Class representing intro view where the man with a briefcase mark appears\n */\nexport class IntroView {\n /**\n * Create an IntroView object\n * @param {Object.} resources loader.resources\n */\n constructor(resources) {\n const textures = resources[ASSETS_PATH.SPRITE_SHEET].textures;\n\n this.mark = makeSpriteWithAnchorXY(textures, TEXTURES.MARK, 0.5, 0.5);\n this.mark.x = 432 / 2;\n this.mark.y = 304 / 2;\n\n this.container = new Container();\n this.container.addChild(this.mark);\n }\n\n /** @return {boolean} Is visible? */\n get visible() {\n return this.container.visible;\n }\n\n /** @param {boolean} bool Is visible? */\n set visible(bool) {\n this.container.visible = bool;\n }\n\n /**\n * draw \"a man with a briefcase\" mark\n * @param {number} frameCounter\n */\n drawMark(frameCounter) {\n const mark = this.mark;\n if (frameCounter === 0) {\n mark.alpha = 0;\n return;\n }\n if (frameCounter < 100) {\n mark.alpha = Math.min(1, mark.alpha + 1 / 25);\n } else if (frameCounter >= 100) {\n mark.alpha = Math.max(0, mark.alpha - 1 / 25);\n }\n }\n}\n\n/**\n * Class representing menu view where you can select \"play with computer\" or \"play with friend\"\n */\nexport class MenuView {\n /**\n * Create a MenuView object\n * @param {Object.} resources loader.resources\n */\n constructor(resources) {\n const textures = resources[ASSETS_PATH.SPRITE_SHEET].textures;\n\n this.messages = {\n pokemon: makeSpriteWithAnchorXY(textures, TEXTURES.POKEMON, 0, 0),\n pikachuVolleyball: makeSpriteWithAnchorXY(\n textures,\n TEXTURES.PIKACHU_VOLLEYBALL,\n 0,\n 0\n ),\n withWho: [\n makeSpriteWithAnchorXY(textures, TEXTURES.WITH_COMPUTER, 0, 0),\n makeSpriteWithAnchorXY(textures, TEXTURES.WITH_FRIEND, 0, 0),\n ],\n sachisoft: makeSpriteWithAnchorXY(textures, TEXTURES.SACHISOFT, 0, 0),\n fight: makeSpriteWithAnchorXY(textures, TEXTURES.FIGHT, 0, 0),\n };\n this.sittingPikachuTilesContainer =\n makeSittingPikachuTilesContainer(textures);\n\n // referred to FUN_004059f0\n this.messages.sachisoft.x = 216 - this.messages.sachisoft.texture.width / 2;\n this.messages.sachisoft.y = 264;\n\n // referred to FUN_00405b70\n this.messages.pikachuVolleyball.x = 140;\n this.messages.pikachuVolleyball.y = 80;\n this.messages.pokemon.x = 170;\n this.messages.pokemon.y = 40;\n\n this.container = new Container();\n this.container.addChild(this.sittingPikachuTilesContainer);\n this.container.addChild(this.messages.pokemon);\n this.container.addChild(this.messages.pikachuVolleyball);\n this.container.addChild(this.messages.withWho[0]);\n this.container.addChild(this.messages.withWho[1]);\n this.container.addChild(this.messages.sachisoft);\n this.container.addChild(this.messages.fight);\n this.initializeVisibles();\n\n this.sittingPikachuTilesDisplacement = 0;\n this.selectedWithWho = -1; // 0: with computer, 1: with friend, -1: not selected\n this.selectedWithWhoMessageSizeIncrement = 2;\n }\n\n /** @return {boolean} Is visible? */\n get visible() {\n return this.container.visible;\n }\n\n /** @param {boolean} bool Is visible? */\n set visible(bool) {\n this.container.visible = bool;\n\n // when turn off view, initialize visibilities of sprites in this view\n if (bool === false) {\n this.initializeVisibles();\n }\n }\n\n initializeVisibles() {\n for (const prop in this.messages) {\n this.messages[prop].visible = false;\n }\n }\n\n /**\n * referred to FUN_00405d50\n * Draw \"fight!\" message which get bigger and smaller as frame goes\n * @param {number} frameCounter\n */\n drawFightMessage(frameCounter) {\n const sizeArray = [20, 22, 25, 27, 30, 27, 25, 22, 20];\n const fightMessage = this.messages.fight;\n const w = fightMessage.texture.width;\n const h = fightMessage.texture.height;\n\n if (frameCounter === 0) {\n fightMessage.visible = true;\n }\n\n if (frameCounter < 30) {\n const halfWidth = Math.floor(Math.floor((frameCounter * w) / 30) / 2);\n const halfHeight = Math.floor(Math.floor((frameCounter * h) / 30) / 2);\n fightMessage.width = halfWidth * 2; // width\n fightMessage.height = halfHeight * 2; // height\n fightMessage.x = 100 - halfWidth; // x coord\n fightMessage.y = 70 - halfHeight; // y coord\n } else {\n const index = (frameCounter + 1) % 9;\n // code ...\n const halfWidth = Math.floor(Math.floor((sizeArray[index] * w) / 30) / 2);\n const halfHeight = Math.floor(\n Math.floor((sizeArray[index] * h) / 30) / 2\n );\n fightMessage.width = halfWidth * 2; // width\n fightMessage.height = halfHeight * 2; // height\n fightMessage.y = 70 - halfHeight; // y coord\n fightMessage.x = 100 - halfWidth; // x coord\n }\n }\n\n /**\n * Draw sachisoft message as frame goes\n * @param {number} frameCounter\n */\n drawSachisoft(frameCounter) {\n if (frameCounter === 0) {\n this.messages.sachisoft.visible = true;\n this.messages.sachisoft.alpha = 0;\n }\n this.messages.sachisoft.alpha = Math.min(\n 1,\n this.messages.sachisoft.alpha + 0.04\n );\n\n if (frameCounter > 70) {\n this.messages.sachisoft.alpha = 1;\n }\n }\n\n /**\n * referred to FUN_00405ca0\n * Draw sitting pikachu tiles as frame goes\n * @param {number} frameCounter\n */\n drawSittingPikachuTiles(frameCounter) {\n if (frameCounter === 0) {\n this.sittingPikachuTilesContainer.visible = true;\n this.sittingPikachuTilesContainer.alpha = 0;\n }\n\n // movement\n // @ts-ignore\n const h = this.sittingPikachuTilesContainer.getChildAt(0).texture.height;\n this.sittingPikachuTilesDisplacement =\n (this.sittingPikachuTilesDisplacement + 2) % h;\n this.sittingPikachuTilesContainer.x = -this.sittingPikachuTilesDisplacement;\n this.sittingPikachuTilesContainer.y = -this.sittingPikachuTilesDisplacement;\n\n if (frameCounter > 30) {\n // alpha\n this.sittingPikachuTilesContainer.alpha = Math.min(\n 1,\n this.sittingPikachuTilesContainer.alpha + 0.04\n );\n }\n\n if (frameCounter > 70) {\n this.sittingPikachuTilesContainer.alpha = 1;\n }\n }\n\n /**\n * referred to FUN_00405b70\n * Draw pikachu volleyball message as frame goes\n * @param {number} frameCounter\n */\n drawPikachuVolleyballMessage(frameCounter) {\n if (frameCounter === 0) {\n this.messages.pikachuVolleyball.visible = false;\n return;\n }\n\n if (frameCounter > 30) {\n this.messages.pikachuVolleyball.visible = true;\n }\n\n if (frameCounter > 30 && frameCounter <= 44) {\n const xDiff = 195 - 15 * (frameCounter - 30);\n this.messages.pikachuVolleyball.x = 140 + xDiff;\n } else if (frameCounter > 44 && frameCounter <= 55) {\n this.messages.pikachuVolleyball.x = 140;\n this.messages.pikachuVolleyball.width = 200 - 15 * (frameCounter - 44);\n } else if (frameCounter > 55 && frameCounter <= 71) {\n this.messages.pikachuVolleyball.x = 140;\n this.messages.pikachuVolleyball.width = 40 + 15 * (frameCounter - 55);\n } else if (frameCounter > 71) {\n this.messages.pikachuVolleyball.x = 140;\n this.messages.pikachuVolleyball.width =\n this.messages.pikachuVolleyball.texture.width;\n }\n }\n\n /**\n * referred to FUN_00405b70\n * Draw pokemon message as frame goes\n * @param {number} frameCounter\n */\n drawPokemonMessage(frameCounter) {\n if (frameCounter === 0) {\n this.messages.pokemon.visible = false;\n return;\n }\n\n if (frameCounter > 71) {\n this.messages.pokemon.visible = true;\n }\n }\n\n /**\n * referred to FUN_00405ec0\n * Draw with who messages (with computer or with friend) as frame goes\n * @param {number} frameCounter\n */\n drawWithWhoMessages(frameCounter) {\n const withWho = this.messages.withWho;\n const w = withWho[0].texture.width;\n const h = withWho[0].texture.height;\n\n if (frameCounter === 0) {\n for (let i = 0; i < 2; i++) {\n withWho[i].visible = false;\n }\n return;\n }\n\n if (frameCounter > 70) {\n if (this.selectedWithWhoMessageSizeIncrement < 10) {\n this.selectedWithWhoMessageSizeIncrement += 1;\n }\n for (let i = 0; i < 2; i++) {\n const selected = Number(this.selectedWithWho === i); // 1 if selected, 0 otherwise\n const halfWidthIncrement =\n selected * (this.selectedWithWhoMessageSizeIncrement + 2);\n const halfHeightIncrement =\n selected * this.selectedWithWhoMessageSizeIncrement;\n\n withWho[i].visible = true;\n withWho[i].x = 216 - w / 2 - halfWidthIncrement;\n withWho[i].y = 184 + 30 * i - halfHeightIncrement;\n withWho[i].width = w + 2 * halfWidthIncrement;\n withWho[i].height = h + 2 * halfHeightIncrement;\n }\n }\n }\n\n /**\n * Select with who for the effect that selected option gets bigger\n * @param {number} i 0: with computer, 1: with friend\n */\n selectWithWho(i) {\n this.selectedWithWho = i;\n this.selectedWithWhoMessageSizeIncrement = 2;\n }\n}\n\n/**\n * Class represent a game view where pikachus, ball, clouds, waves, and backgrounds are\n */\nexport class GameView {\n /**\n * Create a GameView object\n * @param {Object.} resources\n */\n constructor(resources) {\n const textures = resources[ASSETS_PATH.SPRITE_SHEET].textures;\n\n // Display objects below\n this.bgContainer = makeBGContainer(textures);\n const playerSprites = makePlayerAnimatedSprites(textures);\n this.player1 = playerSprites[0];\n this.player2 = playerSprites[1];\n this.ball = makeBallAnimatedSprites(textures);\n this.ballHyper = makeSpriteWithAnchorXY(\n textures,\n TEXTURES.BALL_HYPER,\n 0.5,\n 0.5\n );\n this.ballTrail = makeSpriteWithAnchorXY(\n textures,\n TEXTURES.BALL_TRAIL,\n 0.5,\n 0.5\n );\n this.punch = makeSpriteWithAnchorXY(\n textures,\n TEXTURES.BALL_PUNCH,\n 0.5,\n 0.5\n );\n\n // this.scoreBoards[0] for player1, this.scoreBoards[1] for player2\n this.scoreBoards = [\n makeScoreBoardSprite(textures),\n makeScoreBoardSprite(textures),\n ];\n\n this.shadows = {\n forPlayer1: makeSpriteWithAnchorXY(textures, TEXTURES.SHADOW, 0.5, 0.5),\n forPlayer2: makeSpriteWithAnchorXY(textures, TEXTURES.SHADOW, 0.5, 0.5),\n forBall: makeSpriteWithAnchorXY(textures, TEXTURES.SHADOW, 0.5, 0.5),\n };\n\n this.messages = {\n gameStart: makeSpriteWithAnchorXY(textures, TEXTURES.GAME_START, 0, 0),\n ready: makeSpriteWithAnchorXY(textures, TEXTURES.READY, 0, 0),\n gameEnd: makeSpriteWithAnchorXY(textures, TEXTURES.GAME_END, 0, 0),\n };\n\n this.cloudContainer = makeCloudContainer(textures);\n this.waveContainer = makeWaveContainer(textures);\n\n // container which include whole display objects\n // Should be careful on addChild order\n // The later added, the more front(z-index) on screen\n this.container = new Container();\n this.container.addChild(this.bgContainer);\n this.container.addChild(this.cloudContainer);\n this.container.addChild(this.waveContainer);\n this.container.addChild(this.shadows.forPlayer1);\n this.container.addChild(this.shadows.forPlayer2);\n this.container.addChild(this.shadows.forBall);\n this.container.addChild(this.player1);\n this.container.addChild(this.player2);\n this.container.addChild(this.ballTrail);\n this.container.addChild(this.ballHyper);\n this.container.addChild(this.ball);\n this.container.addChild(this.punch);\n this.container.addChild(this.scoreBoards[0]);\n this.container.addChild(this.scoreBoards[1]);\n this.container.addChild(this.messages.gameStart);\n this.container.addChild(this.messages.ready);\n this.container.addChild(this.messages.gameEnd);\n\n // location and visibility setting\n this.bgContainer.x = 0;\n this.bgContainer.y = 0;\n this.cloudContainer.x = 0;\n this.cloudContainer.y = 0;\n this.waveContainer.x = 0;\n this.waveContainer.y = 0;\n\n this.messages.ready.x = 176;\n this.messages.ready.y = 38;\n this.scoreBoards[0].x = 14; // score board is 14 pixel distant from boundary\n this.scoreBoards[0].y = 10;\n this.scoreBoards[1].x = 432 - 32 - 32 - 14; // 32 pixel is for number (32x32px) width; one score board has tow numbers\n this.scoreBoards[1].y = 10;\n\n this.shadows.forPlayer1.y = 273;\n this.shadows.forPlayer2.y = 273;\n this.shadows.forBall.y = 273;\n\n this.initializeVisibles();\n\n // clouds and wave model.\n // This model is included in this view object, not on controller object\n // since it is not dependent on user input, and only used for rendering.\n this.cloudArray = [];\n for (let i = 0; i < NUM_OF_CLOUDS; i++) {\n this.cloudArray.push(new Cloud());\n }\n this.wave = new Wave();\n }\n\n /** @return {boolean} Is visible? */\n get visible() {\n return this.container.visible;\n }\n\n /** @param {boolean} bool Is visible? */\n set visible(bool) {\n this.container.visible = bool;\n\n // when turn off view\n if (bool === false) {\n this.initializeVisibles();\n }\n }\n\n initializeVisibles() {\n for (const prop in this.messages) {\n this.messages[prop].visible = false;\n }\n }\n\n /** @typedef {import(\"./physics\").PikaPhysics} PikaPhysics */\n /**\n * Draw players and ball in the given physics object\n * @param {PikaPhysics} physics PikaPhysics object to draw\n */\n drawPlayersAndBall(physics) {\n const player1 = physics.player1;\n const player2 = physics.player2;\n const ball = physics.ball;\n\n this.player1.x = player1.x;\n this.player1.y = player1.y;\n if (player1.state === 3 || player1.state === 4) {\n this.player1.scale.x = player1.divingDirection === -1 ? -1 : 1;\n } else {\n this.player1.scale.x = 1;\n }\n this.shadows.forPlayer1.x = player1.x;\n\n this.player2.x = player2.x;\n this.player2.y = player2.y;\n if (player2.state === 3 || player2.state === 4) {\n this.player2.scale.x = player2.divingDirection === 1 ? 1 : -1;\n } else {\n this.player2.scale.x = -1;\n }\n this.shadows.forPlayer2.x = player2.x;\n\n const frameNumber1 = getFrameNumberForPlayerAnimatedSprite(\n player1.state,\n player1.frameNumber\n );\n const frameNumber2 = getFrameNumberForPlayerAnimatedSprite(\n player2.state,\n player2.frameNumber\n );\n this.player1.gotoAndStop(frameNumber1);\n this.player2.gotoAndStop(frameNumber2);\n\n this.ball.x = ball.x;\n this.ball.y = ball.y;\n this.shadows.forBall.x = ball.x;\n this.ball.gotoAndStop(ball.rotation);\n\n // For punch effect, refer FUN_00402ee0\n if (ball.punchEffectRadius > 0) {\n ball.punchEffectRadius -= 2;\n this.punch.width = 2 * ball.punchEffectRadius;\n this.punch.height = 2 * ball.punchEffectRadius;\n this.punch.x = ball.punchEffectX;\n this.punch.y = ball.punchEffectY;\n this.punch.visible = true;\n } else {\n this.punch.visible = false;\n }\n\n if (ball.isPowerHit === true) {\n this.ballHyper.x = ball.previousX;\n this.ballHyper.y = ball.previousY;\n this.ballTrail.x = ball.previousPreviousX;\n this.ballTrail.y = ball.previousPreviousY;\n\n this.ballHyper.visible = true;\n this.ballTrail.visible = true;\n } else {\n this.ballHyper.visible = false;\n this.ballTrail.visible = false;\n }\n }\n\n /**\n * Draw scores to each score board\n * @param {number[]} scores [0] for player1 score, [1] for player2 score\n */\n drawScoresToScoreBoards(scores) {\n for (let i = 0; i < 2; i++) {\n const scoreBoard = this.scoreBoards[i];\n const score = scores[i];\n const unitsAnimatedSprite = scoreBoard.getChildAt(0);\n const tensAnimatedSprite = scoreBoard.getChildAt(1);\n // @ts-ignore\n unitsAnimatedSprite.gotoAndStop(score % 10);\n // @ts-ignore\n tensAnimatedSprite.gotoAndStop(Math.floor(score / 10) % 10);\n if (score >= 10) {\n tensAnimatedSprite.visible = true;\n } else {\n tensAnimatedSprite.visible = false;\n }\n }\n }\n\n /**\n * Draw clouds and wave\n */\n drawCloudsAndWave() {\n const cloudArray = this.cloudArray;\n const wave = this.wave;\n\n cloudAndWaveEngine(cloudArray, wave);\n\n for (let i = 0; i < NUM_OF_CLOUDS; i++) {\n const cloud = cloudArray[i];\n const cloudSprite = this.cloudContainer.getChildAt(i);\n cloudSprite.x = cloud.spriteTopLeftPointX;\n cloudSprite.y = cloud.spriteTopLeftPointY;\n // @ts-ignore\n cloudSprite.width = cloud.spriteWidth;\n // @ts-ignore\n cloudSprite.height = cloud.spriteHeight;\n }\n\n for (let i = 0; i < 432 / 16; i++) {\n const waveSprite = this.waveContainer.getChildAt(i);\n waveSprite.y = wave.yCoords[i];\n }\n }\n\n /**\n * refered FUN_00403f20\n * Draw game start message as frame goes\n * @param {number} frameCounter current frame number\n * @param {number} frameTotal total frame number for game start message\n */\n drawGameStartMessage(frameCounter, frameTotal) {\n if (frameCounter === 0) {\n this.messages.gameStart.visible = true;\n } else if (frameCounter >= frameTotal - 1) {\n this.messages.gameStart.visible = false;\n return;\n }\n\n const gameStartMessage = this.messages.gameStart;\n // game start message rendering\n const w = gameStartMessage.texture.width; // game start message texture width\n const h = gameStartMessage.texture.height; // game start message texture height\n const halfWidth = Math.floor((w * frameCounter) / 50);\n const halfHeight = Math.floor((h * frameCounter) / 50);\n gameStartMessage.x = 216 - halfWidth;\n gameStartMessage.y = 50 + 2 * halfHeight;\n gameStartMessage.width = 2 * halfWidth;\n gameStartMessage.height = 2 * halfHeight;\n }\n\n /**\n * Draw ready message\n * @param {boolean} bool turn on?\n */\n drawReadyMessage(bool) {\n this.messages.ready.visible = bool;\n }\n\n /**\n * Togle ready message.\n * Turn off if it's on, turn on if it's off.\n */\n toggleReadyMessage() {\n this.messages.ready.visible = !this.messages.ready.visible;\n }\n\n /**\n * refered FUN_00404070\n * Draw game end message as frame goes\n * @param {number} frameCounter\n */\n drawGameEndMessage(frameCounter) {\n const gameEndMessage = this.messages.gameEnd;\n const w = gameEndMessage.texture.width; // game end message texture width;\n const h = gameEndMessage.texture.height; // game end message texture height;\n\n if (frameCounter === 0) {\n gameEndMessage.visible = true;\n }\n if (frameCounter < 50) {\n const halfWidthIncrement = 2 * Math.floor(((50 - frameCounter) * w) / 50);\n const halfHeightIncrement =\n 2 * Math.floor(((50 - frameCounter) * h) / 50);\n\n gameEndMessage.x = 216 - w / 2 - halfWidthIncrement;\n gameEndMessage.y = 50 - halfHeightIncrement;\n gameEndMessage.width = w + 2 * halfWidthIncrement;\n gameEndMessage.height = h + 2 * halfHeightIncrement;\n } else {\n gameEndMessage.x = 216 - w / 2;\n gameEndMessage.y = 50;\n gameEndMessage.width = w;\n gameEndMessage.height = h;\n }\n }\n}\n\n/**\n * Class representing fade in out effect\n */\nexport class FadeInOut {\n constructor(resources) {\n const textures = resources[ASSETS_PATH.SPRITE_SHEET].textures;\n this.black = makeSpriteWithAnchorXY(textures, TEXTURES.BLACK, 0, 0);\n this.black.width = 432;\n this.black.height = 304;\n this.black.x = 0;\n this.black.y = 0;\n this.black.alpha = 1;\n }\n\n /** @return {boolean} Is visible? */\n get visible() {\n return this.black.visible;\n }\n\n /** @param {boolean} bool Is visible? */\n set visible(bool) {\n this.black.visible = bool;\n }\n\n /**\n * Set black alpha for fade in out\n * @param {number} alpha number in [0, 1]\n */\n setBlackAlphaTo(alpha) {\n this.black.alpha = alpha;\n if (this.black.alpha === 0) {\n this.black.visible = false;\n } else {\n this.black.visible = true;\n }\n }\n\n /**\n * Increase black alpha for fade in out\n * @param {number} alphaIncrement if alphaIncrement > 0: fade out, else fade in\n */\n changeBlackAlphaBy(alphaIncrement) {\n if (alphaIncrement >= 0) {\n this.black.alpha = Math.min(1, this.black.alpha + alphaIncrement);\n } else {\n this.black.alpha = Math.max(0, this.black.alpha + alphaIncrement);\n }\n if (this.black.alpha === 0) {\n this.black.visible = false;\n } else {\n this.black.visible = true;\n }\n }\n}\n\n/**\n * Make sitting pikachu tiles\n * @param {Object.} textures\n * @return {Container}\n */\nfunction makeSittingPikachuTilesContainer(textures) {\n const container = new Container();\n const texture = textures[TEXTURES.SITTING_PIKACHU];\n const w = texture.width;\n const h = texture.height;\n\n let tile;\n for (let j = 0; j < Math.floor(304 / h) + 2; j++) {\n for (let i = 0; i < Math.floor(432 / w) + 2; i++) {\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(container, tile, w * i, h * j);\n }\n }\n\n return container;\n}\n\n/**\n * Make background\n * @param {Object.} textures\n * @return {Container}\n */\nfunction makeBGContainer(textures) {\n const bgContainer = new Container();\n\n // sky\n let tile;\n let texture = textures[TEXTURES.SKY_BLUE];\n for (let j = 0; j < 12; j++) {\n for (let i = 0; i < 432 / 16; i++) {\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 16 * i, 16 * j);\n }\n }\n\n // mountain\n texture = textures[TEXTURES.MOUNTAIN];\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 0, 188);\n\n // ground_red\n texture = textures[TEXTURES.GROUND_RED];\n for (let i = 0; i < 432 / 16; i++) {\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 16 * i, 248);\n }\n\n // ground_line\n texture = textures[TEXTURES.GROUND_LINE];\n for (let i = 1; i < 432 / 16 - 1; i++) {\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 16 * i, 264);\n }\n texture = textures[TEXTURES.GROUND_LINE_LEFT_MOST];\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 0, 264);\n texture = textures[TEXTURES.GROUND_LINE_RIGHT_MOST];\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 432 - 16, 264);\n\n // ground_yellow\n texture = textures[TEXTURES.GROUND_YELLOW];\n for (let j = 0; j < 2; j++) {\n for (let i = 0; i < 432 / 16; i++) {\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(\n bgContainer,\n tile,\n 16 * i,\n 280 + 16 * j\n );\n }\n }\n\n // net pillar\n texture = textures[TEXTURES.NET_PILLAR_TOP];\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 213, 176);\n texture = textures[TEXTURES.NET_PILLAR];\n for (let j = 0; j < 12; j++) {\n tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(bgContainer, tile, 213, 184 + 8 * j);\n }\n\n return bgContainer;\n}\n\n/**\n * Make animated sprites for both players\n * @param {Object.} textures\n * @return {AnimatedSprite[]} [0] for player 1, [1] for player2\n */\nfunction makePlayerAnimatedSprites(textures) {\n const getPlayerTexture = (i, j) => textures[TEXTURES.PIKACHU(i, j)];\n const playerTextureArray = [];\n for (let i = 0; i < 7; i++) {\n if (i === 3) {\n playerTextureArray.push(getPlayerTexture(i, 0));\n playerTextureArray.push(getPlayerTexture(i, 1));\n } else if (i === 4) {\n playerTextureArray.push(getPlayerTexture(i, 0));\n } else {\n for (let j = 0; j < 5; j++) {\n playerTextureArray.push(getPlayerTexture(i, j));\n }\n }\n }\n const player1AnimatedSprite = new AnimatedSprite(playerTextureArray, false);\n const player2AnimatedSprite = new AnimatedSprite(playerTextureArray, false);\n\n player1AnimatedSprite.anchor.x = 0.5;\n player1AnimatedSprite.anchor.y = 0.5;\n player2AnimatedSprite.anchor.x = 0.5;\n player2AnimatedSprite.anchor.y = 0.5;\n\n return [player1AnimatedSprite, player2AnimatedSprite];\n}\n\n/**\n * Make animated sprite of ball\n * @param {Object.} textures\n * @return {AnimatedSprite}\n */\nfunction makeBallAnimatedSprites(textures) {\n const getBallTexture = (s) => textures[TEXTURES.BALL(s)];\n const ballTextureArray = [\n getBallTexture(0),\n getBallTexture(1),\n getBallTexture(2),\n getBallTexture(3),\n getBallTexture(4),\n getBallTexture('hyper'),\n ];\n const ballAnimatedSprite = new AnimatedSprite(ballTextureArray, false);\n\n ballAnimatedSprite.anchor.x = 0.5;\n ballAnimatedSprite.anchor.y = 0.5;\n\n return ballAnimatedSprite;\n}\n\n/**\n * Make sprite with the texture on the path and with the given anchor x, y\n * @param {Object.} textures\n * @param {string} path\n * @param {number} anchorX anchor.x, number in [0, 1]\n * @param {number} anchorY anchor.y, number in [0, 1]\n * @return {Sprite}\n */\nfunction makeSpriteWithAnchorXY(textures, path, anchorX, anchorY) {\n const sprite = new Sprite(textures[path]);\n sprite.anchor.x = anchorX;\n sprite.anchor.y = anchorY;\n return sprite;\n}\n\n/**\n * Make score boards\n * @param {Object.} textures\n * @return {Container} child with index 0 for player 1 score board, child with index 1 for player2 score board\n */\nfunction makeScoreBoardSprite(textures) {\n const getNumberTexture = (n) => textures[TEXTURES.NUMBER(n)];\n const numberTextureArray = [];\n for (let i = 0; i < 10; i++) {\n numberTextureArray.push(getNumberTexture(i));\n }\n const numberAnimatedSprites = [null, null];\n numberAnimatedSprites[0] = new AnimatedSprite(numberTextureArray, false);\n numberAnimatedSprites[1] = new AnimatedSprite(numberTextureArray, false);\n\n const scoreBoard = new Container();\n addChildToParentAndSetLocalPosition(\n scoreBoard,\n numberAnimatedSprites[0],\n 32,\n 0\n ); // for units\n addChildToParentAndSetLocalPosition(\n scoreBoard,\n numberAnimatedSprites[1],\n 0,\n 0\n ); // for tens\n\n scoreBoard.setChildIndex(numberAnimatedSprites[0], 0); // for units\n scoreBoard.setChildIndex(numberAnimatedSprites[1], 1); // for tens\n\n return scoreBoard;\n}\n\n/**\n * Make a container with cloud sprites\n * @param {Object.} textures\n * @return {Container}\n */\nfunction makeCloudContainer(textures) {\n const cloudContainer = new Container();\n const texture = textures[TEXTURES.CLOUD];\n for (let i = 0; i < NUM_OF_CLOUDS; i++) {\n const cloud = new Sprite(texture);\n cloud.anchor.x = 0;\n cloud.anchor.y = 0;\n cloudContainer.addChild(cloud);\n }\n\n return cloudContainer;\n}\n\n/**\n * Make a container with wave sprites\n * @param {Object.} textures\n * @return {Container}\n */\nfunction makeWaveContainer(textures) {\n const waveContainer = new Container();\n const texture = textures[TEXTURES.WAVE];\n for (let i = 0; i < 432 / 16; i++) {\n const tile = new Sprite(texture);\n addChildToParentAndSetLocalPosition(waveContainer, tile, 16 * i, 0);\n }\n\n return waveContainer;\n}\n\n/**\n * Add child to parent and set local position\n * @param {Container} parent\n * @param {Sprite} child\n * @param {number} x local x\n * @param {number} y local y\n */\nfunction addChildToParentAndSetLocalPosition(parent, child, x, y) {\n parent.addChild(child);\n child.anchor.x = 0;\n child.anchor.y = 0;\n child.x = x;\n child.y = y;\n}\n\n/**\n * Get frame number for player animated sprite corresponds to the player state\n *\n * number of frames for state 0, state 1 and state 2 is 5 for each.\n * number of frames for state 3 is 2.\n * number of frames for state 4 is 1.\n * number of frames for state 5, state 6 is 5 for each.\n * @param {number} state player state\n * @param {number} frameNumber\n */\nfunction getFrameNumberForPlayerAnimatedSprite(state, frameNumber) {\n if (state < 4) {\n return 5 * state + frameNumber;\n } else if (state === 4) {\n return 17 + frameNumber;\n } else if (state > 4) {\n return 18 + 5 * (state - 5) + frameNumber;\n }\n}\n","/**\n * This module takes charge of the user input via keyboard\n */\n'use strict';\nimport { PikaUserInput } from './physics.js';\n\n/**\n * Class representing a keyboard used to control a player\n */\nexport class PikaKeyboard extends PikaUserInput {\n /**\n * Create a keyboard used for game controller\n * left, right, up, down, powerHit: KeyboardEvent.code value for each\n * Refer {@link https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values}\n * @param {string} left KeyboardEvent.code value of the key to use for left\n * @param {string} right KeyboardEvent.code value of the key to use for right\n * @param {string} up KeyboardEvent.code value of the key to use for up\n * @param {string} down KeyboardEvent.code value of the key to use for down\n * @param {string} powerHit KeyboardEvent.code value of the key to use for power hit or selection\n * @param {string} downRight KeyboardEvent.code value of the key to use for having the same effect\n * when pressing down key and right key at the same time (Only player 1\n * has this key)\n */\n constructor(left, right, up, down, powerHit, downRight = null) {\n super();\n\n /** @type {boolean} */\n this.powerHitKeyIsDownPrevious = false;\n\n /** @type {Key} */\n this.leftKey = new Key(left);\n /** @type {Key} */\n this.rightKey = new Key(right);\n /** @type {Key} */\n this.upKey = new Key(up);\n /** @type {Key} */\n this.downKey = new Key(down);\n /** @type {Key} */\n this.powerHitKey = new Key(powerHit);\n /** @type {Key} */\n this.downRightKey = new Key(downRight);\n }\n\n /**\n * Get xDirection, yDirection, powerHit input from the keyboard.\n * This method is for freezing the keyboard input during the process of one game frame.\n */\n getInput() {\n if (this.leftKey.isDown) {\n this.xDirection = -1;\n } else if (\n this.rightKey.isDown ||\n (this.downRightKey && this.downRightKey.isDown)\n ) {\n this.xDirection = 1;\n } else {\n this.xDirection = 0;\n }\n\n if (this.upKey.isDown) {\n this.yDirection = -1;\n } else if (\n this.downKey.isDown ||\n (this.downRightKey && this.downRightKey.isDown)\n ) {\n this.yDirection = 1;\n } else {\n this.yDirection = 0;\n }\n\n const isDown = this.powerHitKey.isDown;\n if (!this.powerHitKeyIsDownPrevious && isDown) {\n this.powerHit = 1;\n } else {\n this.powerHit = 0;\n }\n this.powerHitKeyIsDownPrevious = isDown;\n }\n\n /**\n * Subscribe keydown, keyup event listeners for the keys of this keyboard\n */\n subscribe() {\n this.leftKey.subscribe();\n this.rightKey.subscribe();\n this.upKey.subscribe();\n this.downKey.subscribe();\n this.powerHitKey.subscribe();\n this.downRightKey.subscribe();\n }\n\n /**\n * Unsubscribe keydown, keyup event listeners for the keys of this keyboard\n */\n unsubscribe() {\n this.leftKey.unsubscribe();\n this.rightKey.unsubscribe();\n this.upKey.unsubscribe();\n this.downKey.unsubscribe();\n this.powerHitKey.unsubscribe();\n this.downRightKey.unsubscribe();\n }\n}\n\n/**\n * Class representing a key on a keyboard\n * referred to: https://github.com/kittykatattack/learningPixi\n */\nclass Key {\n /**\n * Create a key\n * Refer {@link https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/code/code_values}\n * @param {string} value KeyboardEvent.code value of this key\n */\n constructor(value) {\n this.value = value;\n this.isDown = false;\n this.isUp = true;\n\n this.downListener = this.downHandler.bind(this);\n this.upListener = this.upHandler.bind(this);\n this.subscribe();\n }\n\n /**\n * When key downed\n * @param {KeyboardEvent} event\n */\n downHandler(event) {\n if (event.code === this.value) {\n this.isDown = true;\n this.isUp = false;\n event.preventDefault();\n }\n }\n\n /**\n * When key upped\n * @param {KeyboardEvent} event\n */\n upHandler(event) {\n if (event.code === this.value) {\n this.isDown = false;\n this.isUp = true;\n event.preventDefault();\n }\n }\n\n /**\n * Subscribe event listeners\n */\n subscribe() {\n // I think an event listener for keyup should be attached\n // before the one for keydown to prevent a buggy behavior.\n // If keydown event listener were attached first and\n // a key was downed and upped before keyup event listener were attached,\n // I think the value of this.isDown would be true (and the value of this.isUp would be false)\n // for a while before the user press this key again.\n window.addEventListener('keyup', this.upListener);\n window.addEventListener('keydown', this.downListener);\n }\n\n /**\n * Unsubscribe event listeners\n */\n unsubscribe() {\n window.removeEventListener('keydown', this.downListener);\n window.removeEventListener('keyup', this.upListener);\n this.isDown = false;\n this.isUp = true;\n }\n}\n","/**\n * This module takes charge of the game audio (or sounds)\n */\n'use strict';\nimport { sound, Sound, filters } from '@pixi/sound';\nimport { ASSETS_PATH } from './assets_path.js';\n\nconst SOUNDS = ASSETS_PATH.SOUNDS;\n\n/** @typedef {import('@pixi/loaders').LoaderResource} LoaderResource */\n\n/**\n * Class representing audio\n */\nexport class PikaAudio {\n /**\n * Create a PikaAudio object\n * @param {Object.} resources loader.resources\n */\n constructor(resources) {\n /** @type {Object.} sounds pack */\n this.sounds = {\n bgm: new PikaStereoSound(resources[SOUNDS.BGM].sound),\n pipikachu: new PikaStereoSound(resources[SOUNDS.PIPIKACHU].sound),\n pika: new PikaStereoSound(resources[SOUNDS.PIKA].sound),\n chu: new PikaStereoSound(resources[SOUNDS.CHU].sound),\n pi: new PikaStereoSound(resources[SOUNDS.PI].sound),\n pikachu: new PikaStereoSound(resources[SOUNDS.PIKACHU].sound),\n powerHit: new PikaStereoSound(resources[SOUNDS.POWERHIT].sound),\n ballTouchesGround: new PikaStereoSound(\n resources[SOUNDS.BALLTOUCHESGROUND].sound\n ),\n };\n\n this.sounds.bgm.loop = true;\n /** @constant @type {number} proper bgm volume */\n this.properBGMVolume = 0.2;\n /** @constant @type {number} proper sfx volume */\n this.properSFXVolume = 0.35;\n this.adjustVolume();\n }\n\n /**\n * Adjust audio volume\n */\n adjustVolume() {\n for (const prop in this.sounds) {\n if (prop === 'bgm') {\n this.sounds[prop].volume = this.properBGMVolume;\n } else {\n this.sounds[prop].volume = this.properSFXVolume;\n }\n }\n }\n\n /**\n * turn BGM volume\n * @param {boolean} turnOn turnOn? turnOff\n */\n turnBGMVolume(turnOn) {\n let volume;\n if (turnOn) {\n volume = this.properBGMVolume;\n } else {\n volume = 0;\n }\n this.sounds.bgm.volume = volume;\n }\n\n /**\n * turn SFX volume\n * @param {boolean} turnOn turnOn? turnOff\n */\n turnSFXVolume(turnOn) {\n let volume;\n if (turnOn) {\n volume = this.properSFXVolume;\n } else {\n volume = 0;\n }\n for (const prop in this.sounds) {\n if (prop !== 'bgm') {\n this.sounds[prop].volume = volume;\n }\n }\n }\n\n muteAll() {\n sound.muteAll();\n }\n\n unmuteAll() {\n sound.unmuteAll();\n }\n}\n\n/**\n * Class representing a stereo sound\n */\nclass PikaStereoSound {\n /**\n * create a PikaStereoSound object\n * @param {Sound} sound\n */\n constructor(sound) {\n this.center = sound;\n this.left = Sound.from(sound.url);\n this.right = Sound.from(sound.url);\n\n const centerPanning = new filters.StereoFilter(0);\n const leftPanning = new filters.StereoFilter(-0.75);\n const rightPanning = new filters.StereoFilter(0.75);\n this.center.filters = [centerPanning];\n this.left.filters = [leftPanning];\n this.right.filters = [rightPanning];\n }\n\n /**\n * @param {number} v volume: number in [0, 1]\n */\n set volume(v) {\n this.center.volume = v;\n this.left.volume = v;\n this.right.volume = v;\n }\n\n /**\n * @param {boolean} bool\n */\n set loop(bool) {\n this.center.loop = bool;\n this.left.loop = bool;\n this.right.loop = bool;\n }\n\n /**\n * play this stereo sound\n * @param {number} leftOrCenterOrRight -1: left, 0: center, 1: right\n */\n play(leftOrCenterOrRight = 0) {\n if (leftOrCenterOrRight === 0) {\n this.center.play();\n } else if (leftOrCenterOrRight === -1) {\n this.left.play();\n } else if (leftOrCenterOrRight === 1) {\n this.right.play();\n }\n }\n\n /**\n * stop this stereo sound\n */\n stop() {\n this.center.stop();\n this.left.stop();\n this.right.stop();\n }\n}\n","/**\n * The Controller part in MVC pattern\n */\n'use strict';\nimport { GROUND_HALF_WIDTH, PikaPhysics } from './physics.js';\nimport { MenuView, GameView, FadeInOut, IntroView } from './view.js';\nimport { PikaKeyboard } from './keyboard.js';\nimport { PikaAudio } from './audio.js';\n\n/** @typedef {import('@pixi/display').Container} Container */\n/** @typedef {import('@pixi/loaders').LoaderResource} LoaderResource */\n\n/** @typedef GameState @type {function():void} */\n\n/**\n * Class representing Pikachu Volleyball game\n */\nexport class PikachuVolleyball {\n /**\n * Create a Pikachu Volleyball game which includes physics, view, audio\n * @param {Container} stage container which is rendered by PIXI.Renderer or PIXI.CanvasRenderer\n * @param {Object.} resources resources property of the PIXI.Loader object which is used for loading the game resources\n */\n constructor(stage, resources) {\n this.view = {\n intro: new IntroView(resources),\n menu: new MenuView(resources),\n game: new GameView(resources),\n fadeInOut: new FadeInOut(resources),\n };\n stage.addChild(this.view.intro.container);\n stage.addChild(this.view.menu.container);\n stage.addChild(this.view.game.container);\n stage.addChild(this.view.fadeInOut.black);\n this.view.intro.visible = false;\n this.view.menu.visible = false;\n this.view.game.visible = false;\n this.view.fadeInOut.visible = false;\n\n this.audio = new PikaAudio(resources);\n this.physics = new PikaPhysics(true, true);\n this.keyboardArray = [\n new PikaKeyboard('KeyD', 'KeyG', 'KeyR', 'KeyV', 'KeyZ', 'KeyF'), // for player1\n new PikaKeyboard( // for player2\n 'ArrowLeft',\n 'ArrowRight',\n 'ArrowUp',\n 'ArrowDown',\n 'Enter'\n ),\n ];\n\n /** @type {number} game fps */\n this.normalFPS = 25;\n /** @type {number} fps for slow motion */\n this.slowMotionFPS = 5;\n\n /** @constant @type {number} number of frames for slow motion */\n this.SLOW_MOTION_FRAMES_NUM = 6;\n /** @type {number} number of frames left for slow motion */\n this.slowMotionFramesLeft = 0;\n /** @type {number} number of elapsed normal fps frames for rendering slow motion */\n this.slowMotionNumOfSkippedFrames = 0;\n\n /** @type {number} 0: with computer, 1: with friend */\n this.selectedWithWho = 0;\n\n /** @type {number[]} [0] for player 1 score, [1] for player 2 score */\n this.scores = [0, 0];\n /** @type {number} winning score: if either one of the players reaches this score, game ends */\n this.winningScore = 15;\n\n /** @type {boolean} Is the game ended? */\n this.gameEnded = false;\n /** @type {boolean} Is the round ended? */\n this.roundEnded = false;\n /** @type {boolean} Will player 2 serve? */\n this.isPlayer2Serve = false;\n\n /** @type {number} frame counter */\n this.frameCounter = 0;\n /** @type {Object.} total number of frames for each game state */\n this.frameTotal = {\n intro: 165,\n afterMenuSelection: 15,\n beforeStartOfNewGame: 15,\n startOfNewGame: 71,\n afterEndOfRound: 5,\n beforeStartOfNextRound: 30,\n gameEnd: 211,\n };\n\n /** @type {number} counter for frames while there is no input from keyboard */\n this.noInputFrameCounter = 0;\n /** @type {Object.} total number of frames to be rendered while there is no input */\n this.noInputFrameTotal = {\n menu: 225,\n };\n\n /** @type {boolean} true: paused, false: not paused */\n this.paused = false;\n\n /** @type {boolean} true: stereo, false: mono */\n this.isStereoSound = true;\n\n /** @type {boolean} true: practice mode on, false: practice mode off */\n this._isPracticeMode = false;\n\n /**\n * The game state which is being rendered now\n * @type {GameState}\n */\n this.state = this.intro;\n }\n\n /**\n * Game loop\n * This function should be called at regular intervals ( interval = (1 / FPS) second )\n */\n gameLoop() {\n if (this.paused === true) {\n return;\n }\n if (this.slowMotionFramesLeft > 0) {\n this.slowMotionNumOfSkippedFrames++;\n if (\n this.slowMotionNumOfSkippedFrames %\n Math.round(this.normalFPS / this.slowMotionFPS) !==\n 0\n ) {\n return;\n }\n this.slowMotionFramesLeft--;\n this.slowMotionNumOfSkippedFrames = 0;\n }\n // catch keyboard input and freeze it\n this.keyboardArray[0].getInput();\n this.keyboardArray[1].getInput();\n this.state();\n }\n\n /**\n * Intro: a man with a brief case\n * @type {GameState}\n */\n intro() {\n if (this.frameCounter === 0) {\n this.view.intro.visible = true;\n this.view.fadeInOut.setBlackAlphaTo(0);\n this.audio.sounds.bgm.stop();\n }\n this.view.intro.drawMark(this.frameCounter);\n this.frameCounter++;\n\n if (\n this.keyboardArray[0].powerHit === 1 ||\n this.keyboardArray[1].powerHit === 1\n ) {\n this.frameCounter = 0;\n this.view.intro.visible = false;\n this.state = this.menu;\n }\n\n if (this.frameCounter >= this.frameTotal.intro) {\n this.frameCounter = 0;\n this.view.intro.visible = false;\n this.state = this.menu;\n }\n }\n\n /**\n * Menu: select who do you want to play. With computer? With friend?\n * @type {GameState}\n */\n menu() {\n if (this.frameCounter === 0) {\n this.view.menu.visible = true;\n this.view.fadeInOut.setBlackAlphaTo(0);\n this.selectedWithWho = 0;\n this.view.menu.selectWithWho(this.selectedWithWho);\n }\n this.view.menu.drawFightMessage(this.frameCounter);\n this.view.menu.drawSachisoft(this.frameCounter);\n this.view.menu.drawSittingPikachuTiles(this.frameCounter);\n this.view.menu.drawPikachuVolleyballMessage(this.frameCounter);\n this.view.menu.drawPokemonMessage(this.frameCounter);\n this.view.menu.drawWithWhoMessages(this.frameCounter);\n this.frameCounter++;\n\n if (\n this.frameCounter < 71 &&\n (this.keyboardArray[0].powerHit === 1 ||\n this.keyboardArray[1].powerHit === 1)\n ) {\n this.frameCounter = 71;\n return;\n }\n\n if (this.frameCounter <= 71) {\n return;\n }\n\n if (\n (this.keyboardArray[0].yDirection === -1 ||\n this.keyboardArray[1].yDirection === -1) &&\n this.selectedWithWho === 1\n ) {\n this.noInputFrameCounter = 0;\n this.selectedWithWho = 0;\n this.view.menu.selectWithWho(this.selectedWithWho);\n this.audio.sounds.pi.play();\n } else if (\n (this.keyboardArray[0].yDirection === 1 ||\n this.keyboardArray[1].yDirection === 1) &&\n this.selectedWithWho === 0\n ) {\n this.noInputFrameCounter = 0;\n this.selectedWithWho = 1;\n this.view.menu.selectWithWho(this.selectedWithWho);\n this.audio.sounds.pi.play();\n } else {\n this.noInputFrameCounter++;\n }\n\n if (\n this.keyboardArray[0].powerHit === 1 ||\n this.keyboardArray[1].powerHit === 1\n ) {\n if (this.selectedWithWho === 1) {\n this.physics.player1.isComputer = false;\n this.physics.player2.isComputer = false;\n } else {\n if (this.keyboardArray[0].powerHit === 1) {\n this.physics.player1.isComputer = false;\n this.physics.player2.isComputer = true;\n } else if (this.keyboardArray[1].powerHit === 1) {\n this.physics.player1.isComputer = true;\n this.physics.player2.isComputer = false;\n }\n }\n this.audio.sounds.pikachu.play();\n this.frameCounter = 0;\n this.noInputFrameCounter = 0;\n this.state = this.afterMenuSelection;\n return;\n }\n\n if (this.noInputFrameCounter >= this.noInputFrameTotal.menu) {\n this.physics.player1.isComputer = true;\n this.physics.player2.isComputer = true;\n this.frameCounter = 0;\n this.noInputFrameCounter = 0;\n this.state = this.afterMenuSelection;\n }\n }\n\n /**\n * Fade out after menu selection\n * @type {GameState}\n */\n afterMenuSelection() {\n this.view.fadeInOut.changeBlackAlphaBy(1 / 16);\n this.frameCounter++;\n if (this.frameCounter >= this.frameTotal.afterMenuSelection) {\n this.frameCounter = 0;\n this.state = this.beforeStartOfNewGame;\n }\n }\n\n /**\n * Delay before start of new game (This is for the delay that exist in the original game)\n * @type {GameState}\n */\n beforeStartOfNewGame() {\n this.frameCounter++;\n if (this.frameCounter >= this.frameTotal.beforeStartOfNewGame) {\n this.frameCounter = 0;\n this.view.menu.visible = false;\n this.state = this.startOfNewGame;\n }\n }\n\n /**\n * Start of new game: Initialize ball and players and print game start message\n * @type {GameState}\n */\n startOfNewGame() {\n if (this.frameCounter === 0) {\n this.view.game.visible = true;\n this.gameEnded = false;\n this.roundEnded = false;\n this.isPlayer2Serve = false;\n this.physics.player1.gameEnded = false;\n this.physics.player1.isWinner = false;\n this.physics.player2.gameEnded = false;\n this.physics.player2.isWinner = false;\n\n this.scores[0] = 0;\n this.scores[1] = 0;\n this.view.game.drawScoresToScoreBoards(this.scores);\n\n this.physics.player1.initializeForNewRound();\n this.physics.player2.initializeForNewRound();\n this.physics.ball.initializeForNewRound(this.isPlayer2Serve);\n this.view.game.drawPlayersAndBall(this.physics);\n\n this.view.fadeInOut.setBlackAlphaTo(1); // set black screen\n this.audio.sounds.bgm.play();\n }\n\n this.view.game.drawGameStartMessage(\n this.frameCounter,\n this.frameTotal.startOfNewGame\n );\n this.view.game.drawCloudsAndWave();\n this.view.fadeInOut.changeBlackAlphaBy(-(1 / 17)); // fade in\n this.frameCounter++;\n\n if (this.frameCounter >= this.frameTotal.startOfNewGame) {\n this.frameCounter = 0;\n this.view.fadeInOut.setBlackAlphaTo(0);\n this.state = this.round;\n }\n }\n\n /**\n * Round: the players play volleyball in this game state\n * @type {GameState}\n */\n round() {\n const pressedPowerHit =\n this.keyboardArray[0].powerHit === 1 ||\n this.keyboardArray[1].powerHit === 1;\n\n if (\n this.physics.player1.isComputer === true &&\n this.physics.player2.isComputer === true &&\n pressedPowerHit\n ) {\n this.frameCounter = 0;\n this.view.game.visible = false;\n this.state = this.intro;\n return;\n }\n\n const isBallTouchingGround = this.physics.runEngineForNextFrame(\n this.keyboardArray\n );\n\n this.playSoundEffect();\n this.view.game.drawPlayersAndBall(this.physics);\n this.view.game.drawCloudsAndWave();\n\n if (this.gameEnded === true) {\n this.view.game.drawGameEndMessage(this.frameCounter);\n this.frameCounter++;\n if (\n this.frameCounter >= this.frameTotal.gameEnd ||\n (this.frameCounter >= 70 && pressedPowerHit)\n ) {\n this.frameCounter = 0;\n this.view.game.visible = false;\n this.state = this.intro;\n }\n return;\n }\n\n if (\n isBallTouchingGround &&\n this._isPracticeMode === false &&\n this.roundEnded === false &&\n this.gameEnded === false\n ) {\n if (this.physics.ball.punchEffectX < GROUND_HALF_WIDTH) {\n this.isPlayer2Serve = true;\n this.scores[1] += 1;\n if (this.scores[1] >= this.winningScore) {\n this.gameEnded = true;\n this.physics.player1.isWinner = false;\n this.physics.player2.isWinner = true;\n this.physics.player1.gameEnded = true;\n this.physics.player2.gameEnded = true;\n }\n } else {\n this.isPlayer2Serve = false;\n this.scores[0] += 1;\n if (this.scores[0] >= this.winningScore) {\n this.gameEnded = true;\n this.physics.player1.isWinner = true;\n this.physics.player2.isWinner = false;\n this.physics.player1.gameEnded = true;\n this.physics.player2.gameEnded = true;\n }\n }\n this.view.game.drawScoresToScoreBoards(this.scores);\n if (this.roundEnded === false && this.gameEnded === false) {\n this.slowMotionFramesLeft = this.SLOW_MOTION_FRAMES_NUM;\n }\n this.roundEnded = true;\n }\n\n if (this.roundEnded === true && this.gameEnded === false) {\n // if this is the last frame of this round, begin fade out\n if (this.slowMotionFramesLeft === 0) {\n this.view.fadeInOut.changeBlackAlphaBy(1 / 16); // fade out\n this.state = this.afterEndOfRound;\n }\n }\n }\n\n /**\n * Fade out after end of round\n * @type {GameState}\n */\n afterEndOfRound() {\n this.view.fadeInOut.changeBlackAlphaBy(1 / 16);\n this.frameCounter++;\n if (this.frameCounter >= this.frameTotal.afterEndOfRound) {\n this.frameCounter = 0;\n this.state = this.beforeStartOfNextRound;\n }\n }\n\n /**\n * Before start of next round, initialize ball and players, and print ready message\n * @type {GameState}\n */\n beforeStartOfNextRound() {\n if (this.frameCounter === 0) {\n this.view.fadeInOut.setBlackAlphaTo(1);\n this.view.game.drawReadyMessage(false);\n\n this.physics.player1.initializeForNewRound();\n this.physics.player2.initializeForNewRound();\n this.physics.ball.initializeForNewRound(this.isPlayer2Serve);\n this.view.game.drawPlayersAndBall(this.physics);\n }\n\n this.view.game.drawCloudsAndWave();\n this.view.fadeInOut.changeBlackAlphaBy(-(1 / 16));\n\n this.frameCounter++;\n if (this.frameCounter % 5 === 0) {\n this.view.game.toggleReadyMessage();\n }\n\n if (this.frameCounter >= this.frameTotal.beforeStartOfNextRound) {\n this.frameCounter = 0;\n this.view.game.drawReadyMessage(false);\n this.view.fadeInOut.setBlackAlphaTo(0);\n this.roundEnded = false;\n this.state = this.round;\n }\n }\n\n /**\n * Play sound effect on {@link round}\n */\n playSoundEffect() {\n const audio = this.audio;\n for (let i = 0; i < 2; i++) {\n const player = this.physics[`player${i + 1}`];\n const sound = player.sound;\n let leftOrCenterOrRight = 0;\n if (this.isStereoSound) {\n leftOrCenterOrRight = i === 0 ? -1 : 1;\n }\n if (sound.pipikachu === true) {\n audio.sounds.pipikachu.play(leftOrCenterOrRight);\n sound.pipikachu = false;\n }\n if (sound.pika === true) {\n audio.sounds.pika.play(leftOrCenterOrRight);\n sound.pika = false;\n }\n if (sound.chu === true) {\n audio.sounds.chu.play(leftOrCenterOrRight);\n sound.chu = false;\n }\n }\n const ball = this.physics.ball;\n const sound = ball.sound;\n let leftOrCenterOrRight = 0;\n if (this.isStereoSound) {\n if (ball.punchEffectX < GROUND_HALF_WIDTH) {\n leftOrCenterOrRight = -1;\n } else if (ball.punchEffectX > GROUND_HALF_WIDTH) {\n leftOrCenterOrRight = 1;\n }\n }\n if (sound.powerHit === true) {\n audio.sounds.powerHit.play(leftOrCenterOrRight);\n sound.powerHit = false;\n }\n if (sound.ballTouchesGround === true) {\n audio.sounds.ballTouchesGround.play(leftOrCenterOrRight);\n sound.ballTouchesGround = false;\n }\n }\n\n /**\n * Called if restart button clicked\n */\n restart() {\n this.frameCounter = 0;\n this.noInputFrameCounter = 0;\n this.slowMotionFramesLeft = 0;\n this.slowMotionNumOfSkippedFrames = 0;\n this.view.menu.visible = false;\n this.view.game.visible = false;\n this.state = this.intro;\n }\n\n /** @return {boolean} */\n get isPracticeMode() {\n return this._isPracticeMode;\n }\n\n /**\n * @param {boolean} bool true: turn on practice mode, false: turn off practice mode\n */\n set isPracticeMode(bool) {\n this._isPracticeMode = bool;\n this.view.game.scoreBoards[0].visible = !bool;\n this.view.game.scoreBoards[1].visible = !bool;\n }\n}\n","/**\n * Manages event listeners relevant to the UI (menu bar, buttons, etc.) of the web page\n */\n'use strict';\n\nimport { localStorageWrapper } from './utils/local_storage_wrapper.js';\n\n/** @typedef {import('./pikavolley.js').PikachuVolleyball} PikachuVolleyball */\n/** @typedef {import('@pixi/ticker').Ticker} Ticker */\n/** @typedef {{graphic?: string, bgm?: string, sfx?: string, speed?: string, winningScore?: string}} Options */\n\n/**\n * Enum for \"game paused by what?\".\n * The greater the number, the higher the precedence.\n *\n * @readonly\n * @enum {number}\n */\nconst PauseResumePrecedence = {\n pauseBtn: 3,\n messageBox: 2,\n dropdown: 1,\n notPaused: 0,\n};\n\n/**\n * Manages pausing and resuming of the game\n */\nconst pauseResumeManager = {\n /** @type {number} PauseResumePrecedence enum */\n _precedence: PauseResumePrecedence.notPaused,\n /**\n * Pause game\n * @param {PikachuVolleyball} pikaVolley\n * @param {number} precedence PauseResumePrecedence enum\n */\n pause: function (pikaVolley, precedence) {\n // @ts-ignore\n if (precedence > this._precedence) {\n pikaVolley.paused = true;\n this._precedence = precedence;\n }\n },\n /**\n * Resume game\n * @param {PikachuVolleyball} pikaVolley\n * @param {number} precedence PauseResumePrecedence enum\n */\n resume: function (pikaVolley, precedence) {\n if (precedence === this._precedence) {\n pikaVolley.paused = false;\n this._precedence = PauseResumePrecedence.notPaused;\n }\n },\n};\n\n/**\n * Set up the user interface: menu bar, buttons, dropdowns, submenus, etc.\n * @param {PikachuVolleyball} pikaVolley\n * @param {Ticker} ticker\n */\nexport function setUpUI(pikaVolley, ticker) {\n /**\n * Apply options\n * @param {Options} options\n */\n const applyOptions = (options) => {\n setSelectedOptionsBtn(options);\n switch (options.graphic) {\n case 'sharp':\n document.getElementById('game-canvas').classList.remove('graphic-soft');\n break;\n case 'soft':\n document.getElementById('game-canvas').classList.add('graphic-soft');\n break;\n }\n switch (options.bgm) {\n case 'on':\n pikaVolley.audio.turnBGMVolume(true);\n break;\n case 'off':\n pikaVolley.audio.turnBGMVolume(false);\n break;\n }\n switch (options.sfx) {\n case 'stereo':\n pikaVolley.audio.turnSFXVolume(true);\n pikaVolley.isStereoSound = true;\n break;\n case 'mono':\n pikaVolley.audio.turnSFXVolume(true);\n pikaVolley.isStereoSound = false;\n break;\n case 'off':\n pikaVolley.audio.turnSFXVolume(false);\n break;\n }\n switch (options.speed) {\n case 'slow':\n pikaVolley.normalFPS = 20;\n ticker.maxFPS = pikaVolley.normalFPS;\n break;\n case 'medium':\n pikaVolley.normalFPS = 25;\n ticker.maxFPS = pikaVolley.normalFPS;\n break;\n case 'fast':\n pikaVolley.normalFPS = 30;\n ticker.maxFPS = pikaVolley.normalFPS;\n break;\n }\n switch (options.winningScore) {\n case '5':\n pikaVolley.winningScore = 5;\n break;\n case '10':\n pikaVolley.winningScore = 10;\n break;\n case '15':\n pikaVolley.winningScore = 15;\n break;\n }\n };\n\n /**\n * Save options\n * @param {Options} options\n */\n const saveOptions = (options) => {\n setSelectedOptionsBtn(options);\n if (options.graphic) {\n localStorageWrapper.set('pv-offline-graphic', options.graphic);\n }\n if (options.bgm) {\n localStorageWrapper.set('pv-offline-bgm', options.bgm);\n }\n if (options.sfx) {\n localStorageWrapper.set('pv-offline-sfx', options.sfx);\n }\n if (options.speed) {\n localStorageWrapper.set('pv-offline-speed', options.speed);\n }\n if (options.winningScore) {\n localStorageWrapper.set('pv-offline-winningScore', options.winningScore);\n }\n };\n\n /**\n * Load options\n * @returns {Options}\n */\n const loadOptions = () => ({\n graphic: localStorageWrapper.get('pv-offline-graphic'),\n bgm: localStorageWrapper.get('pv-offline-bgm'),\n sfx: localStorageWrapper.get('pv-offline-sfx'),\n speed: localStorageWrapper.get('pv-offline-speed'),\n winningScore: localStorageWrapper.get('pv-offline-winningScore'),\n });\n\n /**\n * Apply and save options\n * @param {Options} options\n */\n const applyAndSaveOptions = (options) => {\n applyOptions(options);\n saveOptions(options);\n };\n\n // Load and apply saved options\n applyOptions(loadOptions());\n\n setUpBtns(pikaVolley, applyAndSaveOptions);\n setUpToShowDropdownsAndSubmenus(pikaVolley);\n\n // hide or show menubar if the user presses the \"esc\" key\n window.addEventListener('keydown', (event) => {\n if (event.code === 'Escape') {\n const menuBar = document.getElementById('menu-bar');\n if (menuBar.classList.contains('hidden')) {\n menuBar.classList.remove('hidden');\n } else {\n menuBar.classList.add('hidden');\n }\n event.preventDefault();\n } else if (event.code === 'Space') {\n const aboutBox = document.getElementById('about-box');\n if (aboutBox.classList.contains('hidden')) {\n event.preventDefault();\n }\n }\n });\n\n document.addEventListener('visibilitychange', function () {\n if (document.visibilityState === 'visible') {\n pikaVolley.audio.unmuteAll();\n } else {\n pikaVolley.audio.muteAll();\n }\n });\n}\n\n/**\n * Attach event listeners to the buttons\n * @param {PikachuVolleyball} pikaVolley\n * @param {(options: Options) => void} applyAndSaveOptions\n */\nfunction setUpBtns(pikaVolley, applyAndSaveOptions) {\n const gameDropdownBtn = document.getElementById('game-dropdown-btn');\n const optionsDropdownBtn = document.getElementById('options-dropdown-btn');\n const aboutBtn = document.getElementById('about-btn');\n // @ts-ignore\n gameDropdownBtn.disabled = false;\n // @ts-ignore\n optionsDropdownBtn.disabled = false;\n // @ts-ignore\n aboutBtn.disabled = false;\n\n const pauseBtn = document.getElementById('pause-btn');\n pauseBtn.addEventListener('click', () => {\n if (pauseBtn.classList.contains('selected')) {\n pauseBtn.classList.remove('selected');\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.pauseBtn);\n } else {\n pauseBtn.classList.add('selected');\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.pauseBtn);\n }\n });\n\n const restartBtn = document.getElementById('restart-btn');\n restartBtn.addEventListener('click', () => {\n if (pauseBtn.classList.contains('selected')) {\n pauseBtn.classList.remove('selected');\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.pauseBtn);\n }\n pikaVolley.restart();\n });\n\n const graphicSharpBtn = document.getElementById('graphic-sharp-btn');\n const graphicSoftBtn = document.getElementById('graphic-soft-btn');\n graphicSharpBtn.addEventListener('click', () => {\n applyAndSaveOptions({ graphic: 'sharp' });\n });\n graphicSoftBtn.addEventListener('click', () => {\n applyAndSaveOptions({ graphic: 'soft' });\n });\n\n const bgmOnBtn = document.getElementById('bgm-on-btn');\n const bgmOffBtn = document.getElementById('bgm-off-btn');\n bgmOnBtn.addEventListener('click', () => {\n applyAndSaveOptions({ bgm: 'on' });\n });\n bgmOffBtn.addEventListener('click', () => {\n applyAndSaveOptions({ bgm: 'off' });\n });\n\n const stereoBtn = document.getElementById('stereo-btn');\n const monoBtn = document.getElementById('mono-btn');\n const sfxOffBtn = document.getElementById('sfx-off-btn');\n stereoBtn.addEventListener('click', () => {\n applyAndSaveOptions({ sfx: 'stereo' });\n });\n monoBtn.addEventListener('click', () => {\n applyAndSaveOptions({ sfx: 'mono' });\n });\n sfxOffBtn.addEventListener('click', () => {\n applyAndSaveOptions({ sfx: 'off' });\n });\n\n // Game speed:\n // slow: 1 frame per 50ms = 20 FPS\n // medium: 1 frame per 40ms = 25 FPS\n // fast: 1 frame per 33ms = 30.303030... FPS\n const slowSpeedBtn = document.getElementById('slow-speed-btn');\n const mediumSpeedBtn = document.getElementById('medium-speed-btn');\n const fastSpeedBtn = document.getElementById('fast-speed-btn');\n slowSpeedBtn.addEventListener('click', () => {\n applyAndSaveOptions({ speed: 'slow' });\n });\n mediumSpeedBtn.addEventListener('click', () => {\n applyAndSaveOptions({ speed: 'medium' });\n });\n fastSpeedBtn.addEventListener('click', () => {\n applyAndSaveOptions({ speed: 'fast' });\n });\n\n const winningScore5Btn = document.getElementById('winning-score-5-btn');\n const winningScore10Btn = document.getElementById('winning-score-10-btn');\n const winningScore15Btn = document.getElementById('winning-score-15-btn');\n const noticeBox1 = document.getElementById('notice-box-1');\n const noticeOKBtn1 = document.getElementById('notice-ok-btn-1');\n const winningScoreInNoticeBox1 = document.getElementById(\n 'winning-score-in-notice-box-1'\n );\n function isWinningScoreAlreadyReached(winningScore) {\n const isGamePlaying =\n pikaVolley.state === pikaVolley.round ||\n pikaVolley.state === pikaVolley.afterEndOfRound ||\n pikaVolley.state === pikaVolley.beforeStartOfNextRound;\n if (\n isGamePlaying &&\n (pikaVolley.scores[0] >= winningScore ||\n pikaVolley.scores[1] >= winningScore)\n ) {\n return true;\n }\n return false;\n }\n const noticeBox2 = document.getElementById('notice-box-2');\n const noticeOKBtn2 = document.getElementById('notice-ok-btn-2');\n winningScore5Btn.addEventListener('click', () => {\n if (winningScore5Btn.classList.contains('selected')) {\n return;\n }\n if (pikaVolley.isPracticeMode === true) {\n noticeBox2.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n // @ts-ignore\n aboutBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n return;\n }\n if (isWinningScoreAlreadyReached(5)) {\n winningScoreInNoticeBox1.textContent = '5';\n noticeBox1.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n // @ts-ignore\n aboutBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n return;\n }\n applyAndSaveOptions({ winningScore: '5' });\n });\n winningScore10Btn.addEventListener('click', () => {\n if (winningScore10Btn.classList.contains('selected')) {\n return;\n }\n if (pikaVolley.isPracticeMode === true) {\n noticeBox2.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n // @ts-ignore\n aboutBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n return;\n }\n if (isWinningScoreAlreadyReached(10)) {\n winningScoreInNoticeBox1.textContent = '10';\n noticeBox1.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n // @ts-ignore\n aboutBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n return;\n }\n applyAndSaveOptions({ winningScore: '10' });\n });\n winningScore15Btn.addEventListener('click', () => {\n if (winningScore15Btn.classList.contains('selected')) {\n return;\n }\n if (pikaVolley.isPracticeMode === true) {\n noticeBox2.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n // @ts-ignore\n aboutBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n return;\n }\n if (isWinningScoreAlreadyReached(15)) {\n winningScoreInNoticeBox1.textContent = '15';\n noticeBox1.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n // @ts-ignore\n aboutBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n return;\n }\n applyAndSaveOptions({ winningScore: '15' });\n });\n noticeOKBtn1.addEventListener('click', () => {\n if (!noticeBox1.classList.contains('hidden')) {\n noticeBox1.classList.add('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = false;\n // @ts-ignore\n optionsDropdownBtn.disabled = false;\n // @ts-ignore\n aboutBtn.disabled = false;\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.messageBox);\n }\n });\n noticeOKBtn2.addEventListener('click', () => {\n if (!noticeBox2.classList.contains('hidden')) {\n noticeBox2.classList.add('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = false;\n // @ts-ignore\n optionsDropdownBtn.disabled = false;\n // @ts-ignore\n aboutBtn.disabled = false;\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.messageBox);\n }\n });\n\n const practiceModeOnBtn = document.getElementById('practice-mode-on-btn');\n const practiceModeOffBtn = document.getElementById('practice-mode-off-btn');\n practiceModeOnBtn.addEventListener('click', () => {\n practiceModeOffBtn.classList.remove('selected');\n practiceModeOnBtn.classList.add('selected');\n pikaVolley.isPracticeMode = true;\n });\n practiceModeOffBtn.addEventListener('click', () => {\n practiceModeOnBtn.classList.remove('selected');\n practiceModeOffBtn.classList.add('selected');\n pikaVolley.isPracticeMode = false;\n });\n\n const aboutBox = document.getElementById('about-box');\n const closeAboutBtn = document.getElementById('close-about-btn');\n aboutBtn.addEventListener('click', () => {\n if (aboutBox.classList.contains('hidden')) {\n aboutBox.classList.remove('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.messageBox);\n } else {\n aboutBox.classList.add('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = false;\n // @ts-ignore\n optionsDropdownBtn.disabled = false;\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.messageBox);\n }\n });\n closeAboutBtn.addEventListener('click', () => {\n if (!aboutBox.classList.contains('hidden')) {\n aboutBox.classList.add('hidden');\n // @ts-ignore\n gameDropdownBtn.disabled = false;\n // @ts-ignore\n optionsDropdownBtn.disabled = false;\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.messageBox);\n }\n });\n\n const resetToDefaultBtn = document.getElementById('reset-to-default-btn');\n resetToDefaultBtn.addEventListener('click', () => {\n // turn off practice mode\n practiceModeOffBtn.click();\n\n // and restore the reset options to default\n const defaultOptions = {\n graphic: 'sharp',\n bgm: 'on',\n sfx: 'stereo',\n speed: 'medium',\n winningScore: '15',\n };\n applyAndSaveOptions(defaultOptions);\n });\n}\n\n/**\n * Set selected (checked) options btn fit to options\n * @param {Options} options\n */\nfunction setSelectedOptionsBtn(options) {\n if (options.graphic) {\n const graphicSharpBtn = document.getElementById('graphic-sharp-btn');\n const graphicSoftBtn = document.getElementById('graphic-soft-btn');\n switch (options.graphic) {\n case 'sharp':\n graphicSoftBtn.classList.remove('selected');\n graphicSharpBtn.classList.add('selected');\n break;\n case 'soft':\n graphicSharpBtn.classList.remove('selected');\n graphicSoftBtn.classList.add('selected');\n break;\n }\n }\n if (options.bgm) {\n const bgmOnBtn = document.getElementById('bgm-on-btn');\n const bgmOffBtn = document.getElementById('bgm-off-btn');\n switch (options.bgm) {\n case 'on':\n bgmOffBtn.classList.remove('selected');\n bgmOnBtn.classList.add('selected');\n break;\n case 'off':\n bgmOnBtn.classList.remove('selected');\n bgmOffBtn.classList.add('selected');\n break;\n }\n }\n if (options.sfx) {\n const stereoBtn = document.getElementById('stereo-btn');\n const monoBtn = document.getElementById('mono-btn');\n const sfxOffBtn = document.getElementById('sfx-off-btn');\n switch (options.sfx) {\n case 'stereo':\n monoBtn.classList.remove('selected');\n sfxOffBtn.classList.remove('selected');\n stereoBtn.classList.add('selected');\n break;\n case 'mono':\n sfxOffBtn.classList.remove('selected');\n stereoBtn.classList.remove('selected');\n monoBtn.classList.add('selected');\n break;\n case 'off':\n stereoBtn.classList.remove('selected');\n monoBtn.classList.remove('selected');\n sfxOffBtn.classList.add('selected');\n break;\n }\n }\n if (options.speed) {\n const slowSpeedBtn = document.getElementById('slow-speed-btn');\n const mediumSpeedBtn = document.getElementById('medium-speed-btn');\n const fastSpeedBtn = document.getElementById('fast-speed-btn');\n switch (options.speed) {\n case 'slow':\n mediumSpeedBtn.classList.remove('selected');\n fastSpeedBtn.classList.remove('selected');\n slowSpeedBtn.classList.add('selected');\n break;\n case 'medium':\n fastSpeedBtn.classList.remove('selected');\n slowSpeedBtn.classList.remove('selected');\n mediumSpeedBtn.classList.add('selected');\n break;\n case 'fast':\n slowSpeedBtn.classList.remove('selected');\n mediumSpeedBtn.classList.remove('selected');\n fastSpeedBtn.classList.add('selected');\n break;\n }\n }\n if (options.winningScore) {\n const winningScore5Btn = document.getElementById('winning-score-5-btn');\n const winningScore10Btn = document.getElementById('winning-score-10-btn');\n const winningScore15Btn = document.getElementById('winning-score-15-btn');\n switch (options.winningScore) {\n case '5':\n winningScore10Btn.classList.remove('selected');\n winningScore15Btn.classList.remove('selected');\n winningScore5Btn.classList.add('selected');\n break;\n case '10':\n winningScore15Btn.classList.remove('selected');\n winningScore5Btn.classList.remove('selected');\n winningScore10Btn.classList.add('selected');\n break;\n case '15':\n winningScore5Btn.classList.remove('selected');\n winningScore10Btn.classList.remove('selected');\n winningScore15Btn.classList.add('selected');\n break;\n }\n }\n}\n\n/**\n * Attach event listeners to show dropdowns and submenus properly\n * @param {PikachuVolleyball} pikaVolley\n */\nfunction setUpToShowDropdownsAndSubmenus(pikaVolley) {\n // hide dropdowns and submenus if the user clicks outside of these\n window.addEventListener('click', (event) => {\n // @ts-ignore\n if (!event.target.matches('.dropdown-btn, .submenu-btn')) {\n hideSubmenus();\n hideDropdownsExcept('');\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.dropdown);\n }\n });\n\n // set up to show dropdowns\n document.getElementById('game-dropdown-btn').addEventListener('click', () => {\n toggleDropdown('game-dropdown', pikaVolley);\n });\n document\n .getElementById('options-dropdown-btn')\n .addEventListener('click', () => {\n toggleDropdown('options-dropdown', pikaVolley);\n });\n\n // set up to show submenus on mouseover event\n document\n .getElementById('graphic-submenu-btn')\n .addEventListener('mouseover', () => {\n showSubmenu('graphic-submenu-btn', 'graphic-submenu');\n });\n document\n .getElementById('bgm-submenu-btn')\n .addEventListener('mouseover', () => {\n showSubmenu('bgm-submenu-btn', 'bgm-submenu');\n });\n document\n .getElementById('sfx-submenu-btn')\n .addEventListener('mouseover', () => {\n showSubmenu('sfx-submenu-btn', 'sfx-submenu');\n });\n document\n .getElementById('speed-submenu-btn')\n .addEventListener('mouseover', () => {\n showSubmenu('speed-submenu-btn', 'speed-submenu');\n });\n document\n .getElementById('winning-score-submenu-btn')\n .addEventListener('mouseover', () => {\n showSubmenu('winning-score-submenu-btn', 'winning-score-submenu');\n });\n document\n .getElementById('practice-mode-submenu-btn')\n .addEventListener('mouseover', () => {\n showSubmenu('practice-mode-submenu-btn', 'practice-mode-submenu');\n });\n document\n .getElementById('reset-to-default-btn')\n .addEventListener('mouseover', () => {\n hideSubmenus();\n });\n\n // set up to show submenus on click event\n // (it is for touch device equipped with physical keyboard)\n document.getElementById('bgm-submenu-btn').addEventListener('click', () => {\n showSubmenu('bgm-submenu-btn', 'bgm-submenu');\n });\n document.getElementById('sfx-submenu-btn').addEventListener('click', () => {\n showSubmenu('sfx-submenu-btn', 'sfx-submenu');\n });\n document.getElementById('speed-submenu-btn').addEventListener('click', () => {\n showSubmenu('speed-submenu-btn', 'speed-submenu');\n });\n document\n .getElementById('winning-score-submenu-btn')\n .addEventListener('click', () => {\n showSubmenu('winning-score-submenu-btn', 'winning-score-submenu');\n });\n document\n .getElementById('practice-mode-submenu-btn')\n .addEventListener('click', () => {\n showSubmenu('practice-mode-submenu-btn', 'practice-mode-submenu');\n });\n document\n .getElementById('reset-to-default-btn')\n .addEventListener('click', () => {\n hideSubmenus();\n });\n}\n\n/**\n * Toggle (show or hide) the dropdown menu\n * @param {string} dropdownID html element id of the dropdown to toggle\n * @param {PikachuVolleyball} pikaVolley\n */\nfunction toggleDropdown(dropdownID, pikaVolley) {\n hideSubmenus();\n hideDropdownsExcept(dropdownID);\n const willShow = document.getElementById(dropdownID).classList.toggle('show');\n if (willShow) {\n pauseResumeManager.pause(pikaVolley, PauseResumePrecedence.dropdown);\n } else {\n pauseResumeManager.resume(pikaVolley, PauseResumePrecedence.dropdown);\n }\n}\n\n/**\n * Show the submenu\n * @param {string} submenuBtnID html element id of the submenu button whose submenu to show\n * @param {string} subMenuID html element id of the submenu to show\n */\nfunction showSubmenu(submenuBtnID, subMenuID) {\n hideSubmenus();\n document.getElementById(submenuBtnID).classList.add('open');\n document.getElementById(subMenuID).classList.add('show');\n}\n\n/**\n * Hide all other dropdowns except the dropdown\n * @param {string} dropdownID html element id of the dropdown\n */\nfunction hideDropdownsExcept(dropdownID) {\n const dropdowns = document.getElementsByClassName('dropdown');\n for (let i = 0; i < dropdowns.length; i++) {\n if (dropdowns[i].id !== dropdownID) {\n dropdowns[i].classList.remove('show');\n }\n }\n}\n\n/**\n * Hide all submenus\n */\nfunction hideSubmenus() {\n const submenus = document.getElementsByClassName('submenu');\n for (let i = 0; i < submenus.length; i++) {\n submenus[i].classList.remove('show');\n }\n const submenuBtns = document.getElementsByClassName('submenu-btn');\n for (let i = 0; i < submenuBtns.length; i++) {\n submenuBtns[i].classList.remove('open');\n }\n}\n","/**\n * This is the main script which executes the game.\n * General explanations for the all source code files of the game are following.\n *\n ********************************************************************************************************************\n * This web version of the Pikachu Volleyball is made by\n * reverse engineering the core part of the original Pikachu Volleyball game\n * which is developed by \"1997 (C) SACHI SOFT / SAWAYAKAN Programmers\" & \"1997 (C) Satoshi Takenouchi\".\n *\n * \"physics.js\", \"cloud_and_wave.js\", and some codes in \"view.js\" are the results of this reverse engineering.\n * Refer to the comments in each file for the machine code addresses of the original functions.\n ********************************************************************************************************************\n *\n * This web version game is mainly composed of three parts which follows MVC pattern.\n * 1) \"physics.js\" (Model): The physics engine which takes charge of the dynamics of the ball and the players (Pikachus).\n * It is gained by reverse engineering the machine code of the original game.\n * 2) \"view.js\" (View): The rendering part of the game which depends on pixi.js (https://www.pixijs.com/, https://github.com/pixijs/pixi.js) library.\n * Some codes in this part is gained by reverse engineering the original machine code.\n * 3) \"pikavolley.js\" (Controller): Make the game work by controlling the Model and the View according to the user input.\n *\n * And explanations for other source files are below.\n * - \"cloud_and_wave.js\": This is also a Model part which takes charge of the clouds and wave motion in the game. Of course, it is also rendered by \"view.js\".\n * It is also gained by reverse engineering the original machine code.\n * - \"keyboard.js\": Support the Controller(\"pikavolley.js\") to get a user input via keyboard.\n * - \"audio.js\": The game audio or sounds. It depends on pixi-sound (https://github.com/pixijs/pixi-sound) library.\n * - \"rand.js\": For the random function used in the Models (\"physics.js\", \"cloud_and_wave.js\").\n * - \"assets_path.js\": For the assets (image files, sound files) locations.\n * - \"ui.js\": For the user interface (menu bar, buttons etc.) of the html page.\n */\n'use strict';\nimport { settings } from '@pixi/settings';\nimport { SCALE_MODES } from '@pixi/constants';\nimport { Renderer, BatchRenderer, autoDetectRenderer } from '@pixi/core';\nimport { Prepare } from '@pixi/prepare';\nimport { Container } from '@pixi/display';\nimport { Loader } from '@pixi/loaders';\nimport { SpritesheetLoader } from '@pixi/spritesheet';\nimport { Ticker } from '@pixi/ticker';\nimport { CanvasRenderer } from '@pixi/canvas-renderer';\nimport { CanvasSpriteRenderer } from '@pixi/canvas-sprite';\nimport { CanvasPrepare } from '@pixi/canvas-prepare';\nimport '@pixi/canvas-display';\nimport { PikachuVolleyball } from './pikavolley.js';\nimport { ASSETS_PATH } from './assets_path.js';\nimport { setUpUI } from './ui.js';\n\n// Reference for how to use Renderer.registerPlugin:\n// https://github.com/pixijs/pixijs/blob/af3c0c6bb15aeb1049178c972e4a14bb4cabfce4/bundles/pixi.js/src/index.ts#L27-L34\nRenderer.registerPlugin('prepare', Prepare);\nRenderer.registerPlugin('batch', BatchRenderer);\n// Reference for how to use CanvasRenderer.registerPlugin:\n// https://github.com/pixijs/pixijs/blob/af3c0c6bb15aeb1049178c972e4a14bb4cabfce4/bundles/pixi.js-legacy/src/index.ts#L13-L19\nCanvasRenderer.registerPlugin('prepare', CanvasPrepare);\nCanvasRenderer.registerPlugin('sprite', CanvasSpriteRenderer);\nLoader.registerPlugin(SpritesheetLoader);\n\n// Set settings.RESOLUTION to 2 instead of 1 to make the game screen do not look\n// much blurry in case of the image rendering mode of 'image-rendering: auto',\n// which is like bilinear interpolation, which is used in \"soft\" game graphic option.\nsettings.RESOLUTION = 2;\nsettings.SCALE_MODE = SCALE_MODES.NEAREST;\nsettings.ROUND_PIXELS = true;\n\nconst renderer = autoDetectRenderer({\n width: 432,\n height: 304,\n antialias: false,\n backgroundColor: 0x000000,\n backgroundAlpha: 1,\n // Decided to use only Canvas for compatibility reason. One player had reported that\n // on their browser, where pixi chooses to use WebGL renderer, the graphics are not fine.\n // And the issue had been fixed by using Canvas renderer. And also for the sake of testing,\n // it is more comfortable just to stick with Canvas renderer so that it is unnecessary to switch\n // between WebGL renderer and Canvas renderer.\n forceCanvas: true,\n});\n\nconst stage = new Container();\nconst ticker = new Ticker();\nconst loader = new Loader();\n\nrenderer.view.setAttribute('id', 'game-canvas');\ndocument.getElementById('game-canvas-container').appendChild(renderer.view);\nrenderer.render(stage); // To make the initial canvas painting stable in the Firefox browser.\n\nloader.add(ASSETS_PATH.SPRITE_SHEET);\nfor (const prop in ASSETS_PATH.SOUNDS) {\n loader.add(ASSETS_PATH.SOUNDS[prop]);\n}\n\nsetUpInitialUI();\n\n/**\n * Set up the initial UI.\n */\nfunction setUpInitialUI() {\n const loadingBox = document.getElementById('loading-box');\n const progressBar = document.getElementById('progress-bar');\n loader.onProgress.add(() => {\n progressBar.style.width = `${loader.progress}%`;\n });\n loader.onComplete.add(() => {\n loadingBox.classList.add('hidden');\n });\n\n const aboutBox = document.getElementById('about-box');\n const aboutBtn = document.getElementById('about-btn');\n const closeAboutBtn = document.getElementById('close-about-btn');\n const gameDropdownBtn = document.getElementById('game-dropdown-btn');\n const optionsDropdownBtn = document.getElementById('options-dropdown-btn');\n // @ts-ignore\n gameDropdownBtn.disabled = true;\n // @ts-ignore\n optionsDropdownBtn.disabled = true;\n const closeAboutBox = () => {\n if (!aboutBox.classList.contains('hidden')) {\n aboutBox.classList.add('hidden');\n // @ts-ignore\n aboutBtn.disabled = true;\n }\n aboutBtn.getElementsByClassName('text-play')[0].classList.add('hidden');\n aboutBtn.getElementsByClassName('text-about')[0].classList.remove('hidden');\n aboutBtn.classList.remove('glow');\n closeAboutBtn\n .getElementsByClassName('text-play')[0]\n .classList.add('hidden');\n closeAboutBtn\n .getElementsByClassName('text-close')[0]\n .classList.remove('hidden');\n closeAboutBtn.classList.remove('glow');\n\n loader.load(setup); // setup is called after loader finishes loading\n loadingBox.classList.remove('hidden');\n aboutBtn.removeEventListener('click', closeAboutBox);\n closeAboutBtn.removeEventListener('click', closeAboutBox);\n };\n aboutBtn.addEventListener('click', closeAboutBox);\n closeAboutBtn.addEventListener('click', closeAboutBox);\n}\n\n/**\n * Set up the game and the full UI, and start the game.\n */\nfunction setup() {\n const pikaVolley = new PikachuVolleyball(stage, loader.resources);\n setUpUI(pikaVolley, ticker);\n start(pikaVolley);\n}\n\n/**\n * Start the game.\n * @param {PikachuVolleyball} pikaVolley\n */\nfunction start(pikaVolley) {\n ticker.maxFPS = pikaVolley.normalFPS;\n ticker.add(() => {\n pikaVolley.gameLoop();\n renderer.render(stage);\n });\n ticker.start();\n}\n","export const localStorageWrapper = {\n /**\n * Get value corresponding to the key from localStorage\n * @param {string} key\n * @returns {string|null}\n */\n get: (key) => {\n let value = null;\n try {\n value = localStorage.getItem(key);\n } catch (err) {\n console.error(err);\n }\n return value;\n },\n\n /*\n * Set key-value pair to the localStorage\n * @param {string} key\n * @param {string} value\n */\n set: (key, value) => {\n try {\n localStorage.setItem(key, value);\n } catch (err) {\n console.error(err);\n }\n },\n};\n"],"names":["ASSETS_PATH","SPRITE_SHEET","TEXTURES","SOUNDS","PIKACHU","i","j","BALL","s","NUMBER","n","SKY_BLUE","MOUNTAIN","GROUND_RED","GROUND_LINE","GROUND_LINE_LEFT_MOST","GROUND_LINE_RIGHT_MOST","GROUND_YELLOW","NET_PILLAR_TOP","NET_PILLAR","SHADOW","BALL_HYPER","BALL_TRAIL","BALL_PUNCH","CLOUD","WAVE","BLACK","SACHISOFT","READY","GAME_END","MARK","POKEMON","PIKACHU_VOLLEYBALL","FIGHT","WITH_COMPUTER","WITH_FRIEND","GAME_START","SITTING_PIKACHU","BGM","PIPIKACHU","PIKA","CHU","PI","POWERHIT","BALLTOUCHESGROUND","rand","Math","floor","random","GROUND_WIDTH","GROUND_HALF_WIDTH","PLAYER_TOUCHING_GROUND_Y_COORD","BALL_TOUCHING_GROUND_Y_COORD","PikaPhysics","constructor","isPlayer1Computer","isPlayer2Computer","this","player1","Player","player2","ball","Ball","runEngineForNextFrame","userInputArray","isBallTouchingGround","previousPreviousX","previousX","previousPreviousY","previousY","x","y","futureFineRotation","fineRotation","xVelocity","rotation","futureBallX","futureBallY","yVelocity","abs","sound","ballTouchesGround","punchEffectX","punchEffectRadius","punchEffectY","processCollisionBetweenBallAndWorldAndSetBallPosition","player","theOtherPlayer","calculateExpectedLandingPointXFor","processPlayerMovementAndSetPlayerPosition","isCollisionBetweenBallAndPlayerHappened","isCollisionWithBallHappened","processCollisionBetweenBallAndPlayer","state","physicsEngine","isPlayer2","isComputer","initializeForNewRound","divingDirection","lyingDownDurationLeft","isWinner","gameEnded","computerWhereToStandBy","pipikachu","pika","chu","frameNumber","normalStatusArmSwingDirection","delayBeforeNextFrame","computerBoldness","isPlayer2Serve","expectedLandingPointX","powerHit","isPowerHit","playerX","playerY","diff","userInput","xDirection","yDirection","virtualExpectedLandingPointX","leftBoundary","Number","rightBoundary","willInputPowerHit","expectedLandingPointXWhenPowerHit","decideWhetherInputPowerHit","letComputerDecideUserInput","playerVelocityX","futurePlayerX","futurePlayerY","futureFrameNumber","processGameEndFrameFor","playerState","ballAbsYVelocity","copyBall","loopCounter","futureCopyBallX","userInputXDirection","userInputYDirection","Cloud","topLeftPointX","topLeftPointY","topLeftPointXVelocity","sizeDiffTurnNumber","sizeDiff","spriteTopLeftPointX","spriteTopLeftPointY","spriteWidth","spriteHeight","Wave","verticalCoord","verticalCoordVelocity","yCoords","push","IntroView","resources","textures","mark","makeSpriteWithAnchorXY","container","addChild","visible","bool","drawMark","frameCounter","alpha","min","max","MenuView","messages","pokemon","pikachuVolleyball","withWho","sachisoft","fight","sittingPikachuTilesContainer","texture","w","width","h","height","tile","addChildToParentAndSetLocalPosition","makeSittingPikachuTilesContainer","initializeVisibles","sittingPikachuTilesDisplacement","selectedWithWho","selectedWithWhoMessageSizeIncrement","prop","drawFightMessage","sizeArray","fightMessage","halfWidth","halfHeight","index","drawSachisoft","drawSittingPikachuTiles","getChildAt","drawPikachuVolleyballMessage","xDiff","drawPokemonMessage","drawWithWhoMessages","selected","halfWidthIncrement","halfHeightIncrement","selectWithWho","GameView","bgContainer","makeBGContainer","playerSprites","getPlayerTexture","playerTextureArray","player1AnimatedSprite","player2AnimatedSprite","anchor","makePlayerAnimatedSprites","getBallTexture","ballTextureArray","ballAnimatedSprite","makeBallAnimatedSprites","ballHyper","ballTrail","punch","scoreBoards","makeScoreBoardSprite","shadows","forPlayer1","forPlayer2","forBall","gameStart","ready","gameEnd","cloudContainer","cloud","makeCloudContainer","waveContainer","makeWaveContainer","cloudArray","wave","drawPlayersAndBall","physics","scale","frameNumber1","getFrameNumberForPlayerAnimatedSprite","frameNumber2","gotoAndStop","drawScoresToScoreBoards","scores","scoreBoard","score","unitsAnimatedSprite","tensAnimatedSprite","drawCloudsAndWave","cloudAndWaveEngine","cloudSprite","drawGameStartMessage","frameTotal","gameStartMessage","drawReadyMessage","toggleReadyMessage","drawGameEndMessage","gameEndMessage","FadeInOut","black","setBlackAlphaTo","changeBlackAlphaBy","alphaIncrement","path","anchorX","anchorY","sprite","numberTextureArray","numberAnimatedSprites","setChildIndex","parent","child","PikaKeyboard","left","right","up","down","downRight","super","powerHitKeyIsDownPrevious","leftKey","Key","rightKey","upKey","downKey","powerHitKey","downRightKey","getInput","isDown","subscribe","unsubscribe","value","isUp","downListener","downHandler","bind","upListener","upHandler","event","code","preventDefault","window","addEventListener","removeEventListener","PikaAudio","sounds","bgm","PikaStereoSound","pi","pikachu","loop","properBGMVolume","properSFXVolume","adjustVolume","volume","turnBGMVolume","turnOn","turnSFXVolume","muteAll","unmuteAll","center","url","centerPanning","leftPanning","rightPanning","filters","v","play","leftOrCenterOrRight","stop","PikachuVolleyball","stage","view","intro","menu","game","fadeInOut","audio","keyboardArray","normalFPS","slowMotionFPS","SLOW_MOTION_FRAMES_NUM","slowMotionFramesLeft","slowMotionNumOfSkippedFrames","winningScore","roundEnded","afterMenuSelection","beforeStartOfNewGame","startOfNewGame","afterEndOfRound","beforeStartOfNextRound","noInputFrameCounter","noInputFrameTotal","paused","isStereoSound","_isPracticeMode","gameLoop","round","pressedPowerHit","playSoundEffect","restart","isPracticeMode","pauseResumeManager","_precedence","pause","pikaVolley","precedence","resume","setSelectedOptionsBtn","options","graphic","graphicSharpBtn","document","getElementById","graphicSoftBtn","classList","remove","add","bgmOnBtn","bgmOffBtn","sfx","stereoBtn","monoBtn","sfxOffBtn","speed","slowSpeedBtn","mediumSpeedBtn","fastSpeedBtn","winningScore5Btn","winningScore10Btn","winningScore15Btn","toggleDropdown","dropdownID","hideSubmenus","hideDropdownsExcept","toggle","showSubmenu","submenuBtnID","subMenuID","dropdowns","getElementsByClassName","length","id","submenus","submenuBtns","settings","renderer","antialias","backgroundColor","backgroundAlpha","forceCanvas","loader","setAttribute","appendChild","render","setup","ticker","applyOptions","maxFPS","applyAndSaveOptions","gameDropdownBtn","optionsDropdownBtn","aboutBtn","disabled","pauseBtn","contains","noticeBox1","noticeOKBtn1","winningScoreInNoticeBox1","isWinningScoreAlreadyReached","noticeBox2","noticeOKBtn2","textContent","practiceModeOnBtn","practiceModeOffBtn","aboutBox","closeAboutBtn","click","setUpBtns","saveOptions","target","matches","setUpToShowDropdownsAndSubmenus","menuBar","visibilityState","setUpUI","start","loadingBox","progressBar","onProgress","style","progress","onComplete","closeAboutBox","load","setUpInitialUI","localStorageWrapper","get","key","localStorage","getItem","err","console","error","set","setItem"],"sourceRoot":""} \ No newline at end of file diff --git a/sw.js b/sw.js index 55826ec..b1f485d 100644 --- a/sw.js +++ b/sw.js @@ -1,2 +1,2 @@ -if(!self.define){let e,s={};const r=(r,i)=>(r=new URL(r+".js",i).href,s[r]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=r,e.onload=s,document.head.appendChild(e)}else e=r,importScripts(r),s()})).then((()=>{let e=s[r];if(!e)throw new Error(`Module ${r} didn’t register its module`);return e})));self.define=(i,d)=>{const a=e||("document"in self?document.currentScript.src:"")||location.href;if(s[a])return;let c={};const o=e=>r(e,a),n={module:{uri:a},exports:c,require:o};s[a]=Promise.all(i.map((e=>n[e]||o(e)))).then((e=>(d(...e),c)))}}define(["./workbox-d5348a15"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"407.bundle.js",revision:"1bee7c3e4f681d79778458d562f32fdb"},{url:"407.bundle.js.LICENSE.txt",revision:"5c018e230a018b5417ea6d77f6db7997"},{url:"dark_color_scheme.bundle.js",revision:"15fd2ff5720636254dd3bff5cd6ab7c4"},{url:"en/index.html",revision:"73d53cf8902a7dc8bb18379429f15e54"},{url:"en/manifest.json",revision:"9c2fba642fff247e04697110fcc58ff9"},{url:"en/update-history/index.html",revision:"bea1c2c31f98ef4eb330652620bcaaef"},{url:"index.html",revision:"97623352ef3b2b2572bfa2108aeabdfe"},{url:"is_embedded_in_other_website.bundle.js",revision:"ed9756eafdc0b1ae07d5457b20c2c84e"},{url:"ko.bundle.js",revision:"85b7983e86676f7e9e59a1ad52034a2b"},{url:"ko/index.html",revision:"1e8f3facc13c49fd930b02739e75cee4"},{url:"ko/manifest.json",revision:"20e0d1683d218b21f80574bc139aeb81"},{url:"ko/update-history/index.html",revision:"c6e62362ae9c9cda053d3dde3e38e983"},{url:"main.bundle.js",revision:"69b2ba9b0cb43b71dcc726e3b1c26afb"},{url:"resources/assets/images/IDI_PIKAICON-0.png",revision:"818a5aabfd92f99c7d1f98b8361d3c7f"},{url:"resources/assets/images/IDI_PIKAICON-1_gap_filled.png",revision:"f3f21ca643c4ff5e692b8de485ae8004"},{url:"resources/assets/images/IDI_PIKAICON-1_gap_filled_192.png",revision:"dac21c95f585cb036ad61246d3d722b2"},{url:"resources/assets/images/IDI_PIKAICON-1_gap_filled_512.png",revision:"6cbcbdfef391a347ba1643574bd7ed1b"},{url:"resources/assets/images/controls.png",revision:"5275b91d01abe46c45f43fe59c95d170"},{url:"resources/assets/images/controls_ko.png",revision:"c5c52fd2313b63d024ad06060609c84f"},{url:"resources/assets/images/screenshot.png",revision:"3867bffd4bef3786694f9ebeb77d4d1d"},{url:"resources/assets/images/sprite_sheet.json",revision:"5b62092ca5b40d420e906629b647c919"},{url:"resources/assets/images/sprite_sheet.png",revision:"4fc3712243966195534ee80e1ca81364"},{url:"resources/assets/sounds/WAVE140_1.wav",revision:"a31e486f9bf2dfa2548a4208d78edc1f"},{url:"resources/assets/sounds/WAVE141_1.wav",revision:"e6b661515829712630bbead41d86ee8d"},{url:"resources/assets/sounds/WAVE142_1.wav",revision:"918c03522e79304ad8bb8891c35f58a3"},{url:"resources/assets/sounds/WAVE143_1.wav",revision:"eb2ac1cb1900cd970cdd86be87ebea11"},{url:"resources/assets/sounds/WAVE144_1.wav",revision:"6b16d233bc68aea2a7d071eee85da431"},{url:"resources/assets/sounds/WAVE145_1.wav",revision:"85da47de3575fbedaef71188fe4fc05f"},{url:"resources/assets/sounds/WAVE146_1.wav",revision:"9976daa90c7fd3f7008cf30e7cda8825"},{url:"resources/assets/sounds/bgm.mp3",revision:"029ae684624b50612c09a255264b2d93"},{url:"resources/style.css",revision:"9243735970a4dd56f1b6ea2297612c68"},{url:"runtime.bundle.js",revision:"5515a84be76013d8df230538de8a73bc"},{url:"zh/index.html",revision:"cca881dee46987e0fca1320f69cebc65"},{url:"zh/manifest.json",revision:"bd6076c6691c90bfda46149789420061"},{url:"zh/update-history/index.html",revision:"72f77973d4c583f26c63a6678fa4c4bf"}],{}),e.cleanupOutdatedCaches()})); +if(!self.define){let e,s={};const r=(r,i)=>(r=new URL(r+".js",i).href,s[r]||new Promise((s=>{if("document"in self){const e=document.createElement("script");e.src=r,e.onload=s,document.head.appendChild(e)}else e=r,importScripts(r),s()})).then((()=>{let e=s[r];if(!e)throw new Error(`Module ${r} didn’t register its module`);return e})));self.define=(i,d)=>{const a=e||("document"in self?document.currentScript.src:"")||location.href;if(s[a])return;let c={};const o=e=>r(e,a),n={module:{uri:a},exports:c,require:o};s[a]=Promise.all(i.map((e=>n[e]||o(e)))).then((e=>(d(...e),c)))}}define(["./workbox-f065e1a2"],(function(e){"use strict";self.addEventListener("message",(e=>{e.data&&"SKIP_WAITING"===e.data.type&&self.skipWaiting()})),e.precacheAndRoute([{url:"407.bundle.js",revision:"1bee7c3e4f681d79778458d562f32fdb"},{url:"407.bundle.js.LICENSE.txt",revision:"5c018e230a018b5417ea6d77f6db7997"},{url:"dark_color_scheme.bundle.js",revision:"15fd2ff5720636254dd3bff5cd6ab7c4"},{url:"en/index.html",revision:"73d53cf8902a7dc8bb18379429f15e54"},{url:"en/manifest.json",revision:"9c2fba642fff247e04697110fcc58ff9"},{url:"en/update-history/index.html",revision:"bea1c2c31f98ef4eb330652620bcaaef"},{url:"index.html",revision:"97623352ef3b2b2572bfa2108aeabdfe"},{url:"is_embedded_in_other_website.bundle.js",revision:"ed9756eafdc0b1ae07d5457b20c2c84e"},{url:"ko.bundle.js",revision:"85b7983e86676f7e9e59a1ad52034a2b"},{url:"ko/index.html",revision:"1e8f3facc13c49fd930b02739e75cee4"},{url:"ko/manifest.json",revision:"20e0d1683d218b21f80574bc139aeb81"},{url:"ko/update-history/index.html",revision:"c6e62362ae9c9cda053d3dde3e38e983"},{url:"main.bundle.js",revision:"69b2ba9b0cb43b71dcc726e3b1c26afb"},{url:"resources/assets/images/IDI_PIKAICON-0.png",revision:"818a5aabfd92f99c7d1f98b8361d3c7f"},{url:"resources/assets/images/IDI_PIKAICON-1_gap_filled.png",revision:"f3f21ca643c4ff5e692b8de485ae8004"},{url:"resources/assets/images/IDI_PIKAICON-1_gap_filled_192.png",revision:"dac21c95f585cb036ad61246d3d722b2"},{url:"resources/assets/images/IDI_PIKAICON-1_gap_filled_512.png",revision:"6cbcbdfef391a347ba1643574bd7ed1b"},{url:"resources/assets/images/controls.png",revision:"5275b91d01abe46c45f43fe59c95d170"},{url:"resources/assets/images/controls_ko.png",revision:"c5c52fd2313b63d024ad06060609c84f"},{url:"resources/assets/images/screenshot.png",revision:"3867bffd4bef3786694f9ebeb77d4d1d"},{url:"resources/assets/images/sprite_sheet.json",revision:"5b62092ca5b40d420e906629b647c919"},{url:"resources/assets/images/sprite_sheet.png",revision:"4fc3712243966195534ee80e1ca81364"},{url:"resources/assets/sounds/WAVE140_1.wav",revision:"a31e486f9bf2dfa2548a4208d78edc1f"},{url:"resources/assets/sounds/WAVE141_1.wav",revision:"e6b661515829712630bbead41d86ee8d"},{url:"resources/assets/sounds/WAVE142_1.wav",revision:"918c03522e79304ad8bb8891c35f58a3"},{url:"resources/assets/sounds/WAVE143_1.wav",revision:"eb2ac1cb1900cd970cdd86be87ebea11"},{url:"resources/assets/sounds/WAVE144_1.wav",revision:"6b16d233bc68aea2a7d071eee85da431"},{url:"resources/assets/sounds/WAVE145_1.wav",revision:"85da47de3575fbedaef71188fe4fc05f"},{url:"resources/assets/sounds/WAVE146_1.wav",revision:"9976daa90c7fd3f7008cf30e7cda8825"},{url:"resources/assets/sounds/bgm.mp3",revision:"029ae684624b50612c09a255264b2d93"},{url:"resources/style.css",revision:"9243735970a4dd56f1b6ea2297612c68"},{url:"runtime.bundle.js",revision:"5515a84be76013d8df230538de8a73bc"},{url:"zh/index.html",revision:"cca881dee46987e0fca1320f69cebc65"},{url:"zh/manifest.json",revision:"bd6076c6691c90bfda46149789420061"},{url:"zh/update-history/index.html",revision:"72f77973d4c583f26c63a6678fa4c4bf"}],{}),e.cleanupOutdatedCaches()})); //# sourceMappingURL=sw.js.map diff --git a/sw.js.map b/sw.js.map index 799f3cf..f36fa20 100644 --- a/sw.js.map +++ b/sw.js.map @@ -1 +1 @@ -{"version":3,"file":"sw.js","sources":["../../../../../private/var/folders/cg/kth39qgn39sd9nwkpkpx3kz40000gn/T/f264fa66d5f67bfce0c81a8011c331da/sw.js"],"sourcesContent":["import {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/Users/kyutae/develop/Pikachu_Volleyball/pikachu-volleyball/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {cleanupOutdatedCaches as workbox_precaching_cleanupOutdatedCaches} from '/Users/kyutae/develop/Pikachu_Volleyball/pikachu-volleyball/node_modules/workbox-precaching/cleanupOutdatedCaches.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.addEventListener('message', (event) => {\n if (event.data && event.data.type === 'SKIP_WAITING') {\n self.skipWaiting();\n }\n});\n\n\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"407.bundle.js\",\n \"revision\": \"1bee7c3e4f681d79778458d562f32fdb\"\n },\n {\n \"url\": \"407.bundle.js.LICENSE.txt\",\n \"revision\": \"5c018e230a018b5417ea6d77f6db7997\"\n },\n {\n \"url\": \"dark_color_scheme.bundle.js\",\n \"revision\": \"15fd2ff5720636254dd3bff5cd6ab7c4\"\n },\n {\n \"url\": \"en/index.html\",\n \"revision\": \"73d53cf8902a7dc8bb18379429f15e54\"\n },\n {\n \"url\": \"en/manifest.json\",\n \"revision\": \"9c2fba642fff247e04697110fcc58ff9\"\n },\n {\n \"url\": \"en/update-history/index.html\",\n \"revision\": \"bea1c2c31f98ef4eb330652620bcaaef\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"97623352ef3b2b2572bfa2108aeabdfe\"\n },\n {\n \"url\": \"is_embedded_in_other_website.bundle.js\",\n \"revision\": \"ed9756eafdc0b1ae07d5457b20c2c84e\"\n },\n {\n \"url\": \"ko.bundle.js\",\n \"revision\": \"85b7983e86676f7e9e59a1ad52034a2b\"\n },\n {\n \"url\": \"ko/index.html\",\n \"revision\": \"1e8f3facc13c49fd930b02739e75cee4\"\n },\n {\n \"url\": \"ko/manifest.json\",\n \"revision\": \"20e0d1683d218b21f80574bc139aeb81\"\n },\n {\n \"url\": \"ko/update-history/index.html\",\n \"revision\": \"c6e62362ae9c9cda053d3dde3e38e983\"\n },\n {\n \"url\": \"main.bundle.js\",\n \"revision\": \"69b2ba9b0cb43b71dcc726e3b1c26afb\"\n },\n {\n \"url\": \"resources/assets/images/IDI_PIKAICON-0.png\",\n \"revision\": \"818a5aabfd92f99c7d1f98b8361d3c7f\"\n },\n {\n \"url\": \"resources/assets/images/IDI_PIKAICON-1_gap_filled.png\",\n \"revision\": \"f3f21ca643c4ff5e692b8de485ae8004\"\n },\n {\n \"url\": \"resources/assets/images/IDI_PIKAICON-1_gap_filled_192.png\",\n \"revision\": \"dac21c95f585cb036ad61246d3d722b2\"\n },\n {\n \"url\": \"resources/assets/images/IDI_PIKAICON-1_gap_filled_512.png\",\n \"revision\": \"6cbcbdfef391a347ba1643574bd7ed1b\"\n },\n {\n \"url\": \"resources/assets/images/controls.png\",\n \"revision\": \"5275b91d01abe46c45f43fe59c95d170\"\n },\n {\n \"url\": \"resources/assets/images/controls_ko.png\",\n \"revision\": \"c5c52fd2313b63d024ad06060609c84f\"\n },\n {\n \"url\": \"resources/assets/images/screenshot.png\",\n \"revision\": \"3867bffd4bef3786694f9ebeb77d4d1d\"\n },\n {\n \"url\": \"resources/assets/images/sprite_sheet.json\",\n \"revision\": \"5b62092ca5b40d420e906629b647c919\"\n },\n {\n \"url\": \"resources/assets/images/sprite_sheet.png\",\n \"revision\": \"4fc3712243966195534ee80e1ca81364\"\n },\n {\n \"url\": \"resources/assets/sounds/WAVE140_1.wav\",\n \"revision\": \"a31e486f9bf2dfa2548a4208d78edc1f\"\n },\n {\n \"url\": \"resources/assets/sounds/WAVE141_1.wav\",\n \"revision\": \"e6b661515829712630bbead41d86ee8d\"\n },\n {\n \"url\": \"resources/assets/sounds/WAVE142_1.wav\",\n \"revision\": \"918c03522e79304ad8bb8891c35f58a3\"\n },\n {\n \"url\": \"resources/assets/sounds/WAVE143_1.wav\",\n \"revision\": \"eb2ac1cb1900cd970cdd86be87ebea11\"\n },\n {\n \"url\": \"resources/assets/sounds/WAVE144_1.wav\",\n \"revision\": \"6b16d233bc68aea2a7d071eee85da431\"\n },\n {\n \"url\": \"resources/assets/sounds/WAVE145_1.wav\",\n \"revision\": \"85da47de3575fbedaef71188fe4fc05f\"\n },\n {\n \"url\": \"resources/assets/sounds/WAVE146_1.wav\",\n \"revision\": \"9976daa90c7fd3f7008cf30e7cda8825\"\n },\n {\n \"url\": \"resources/assets/sounds/bgm.mp3\",\n \"revision\": \"029ae684624b50612c09a255264b2d93\"\n },\n {\n \"url\": \"resources/style.css\",\n \"revision\": \"9243735970a4dd56f1b6ea2297612c68\"\n },\n {\n \"url\": \"runtime.bundle.js\",\n \"revision\": \"5515a84be76013d8df230538de8a73bc\"\n },\n {\n \"url\": \"zh/index.html\",\n \"revision\": \"cca881dee46987e0fca1320f69cebc65\"\n },\n {\n \"url\": \"zh/manifest.json\",\n \"revision\": \"bd6076c6691c90bfda46149789420061\"\n },\n {\n \"url\": \"zh/update-history/index.html\",\n \"revision\": \"72f77973d4c583f26c63a6678fa4c4bf\"\n }\n], {});\nworkbox_precaching_cleanupOutdatedCaches();\n\n\n\n\n\n\n\n"],"names":["self","addEventListener","event","data","type","skipWaiting","workbox_precaching_precacheAndRoute","url","revision","workbox_precaching_cleanupOutdatedCaches"],"mappings":"0nBAoBAA,KAAKC,iBAAiB,WAAYC,IAC5BA,EAAMC,MAA4B,iBAApBD,EAAMC,KAAKC,MAC3BJ,KAAKK,aACN,IAWHC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,eACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,iBACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,wDACPC,SAAY,oCAEd,CACED,IAAO,4DACPC,SAAY,oCAEd,CACED,IAAO,4DACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,qCAEb,CA7IgC,GA8InCC,EAAAA"} \ No newline at end of file +{"version":3,"file":"sw.js","sources":["../../../../../tmp/926727de700b4556732a7df18f134d15/sw.js"],"sourcesContent":["import {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/home/kyutae/develop/Pikachu_Volleyball/pikachu-volleyball/node_modules/workbox-precaching/precacheAndRoute.mjs';\nimport {cleanupOutdatedCaches as workbox_precaching_cleanupOutdatedCaches} from '/home/kyutae/develop/Pikachu_Volleyball/pikachu-volleyball/node_modules/workbox-precaching/cleanupOutdatedCaches.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.addEventListener('message', (event) => {\n if (event.data && event.data.type === 'SKIP_WAITING') {\n self.skipWaiting();\n }\n});\n\n\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"407.bundle.js\",\n \"revision\": \"1bee7c3e4f681d79778458d562f32fdb\"\n },\n {\n \"url\": \"407.bundle.js.LICENSE.txt\",\n \"revision\": \"5c018e230a018b5417ea6d77f6db7997\"\n },\n {\n \"url\": \"dark_color_scheme.bundle.js\",\n \"revision\": \"15fd2ff5720636254dd3bff5cd6ab7c4\"\n },\n {\n \"url\": \"en/index.html\",\n \"revision\": \"73d53cf8902a7dc8bb18379429f15e54\"\n },\n {\n \"url\": \"en/manifest.json\",\n \"revision\": \"9c2fba642fff247e04697110fcc58ff9\"\n },\n {\n \"url\": \"en/update-history/index.html\",\n \"revision\": \"bea1c2c31f98ef4eb330652620bcaaef\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"97623352ef3b2b2572bfa2108aeabdfe\"\n },\n {\n \"url\": \"is_embedded_in_other_website.bundle.js\",\n \"revision\": \"ed9756eafdc0b1ae07d5457b20c2c84e\"\n },\n {\n \"url\": \"ko.bundle.js\",\n \"revision\": \"85b7983e86676f7e9e59a1ad52034a2b\"\n },\n {\n \"url\": \"ko/index.html\",\n \"revision\": \"1e8f3facc13c49fd930b02739e75cee4\"\n },\n {\n \"url\": \"ko/manifest.json\",\n \"revision\": \"20e0d1683d218b21f80574bc139aeb81\"\n },\n {\n \"url\": \"ko/update-history/index.html\",\n \"revision\": \"c6e62362ae9c9cda053d3dde3e38e983\"\n },\n {\n \"url\": \"main.bundle.js\",\n \"revision\": \"69b2ba9b0cb43b71dcc726e3b1c26afb\"\n },\n {\n \"url\": \"resources/assets/images/IDI_PIKAICON-0.png\",\n \"revision\": \"818a5aabfd92f99c7d1f98b8361d3c7f\"\n },\n {\n \"url\": \"resources/assets/images/IDI_PIKAICON-1_gap_filled.png\",\n \"revision\": \"f3f21ca643c4ff5e692b8de485ae8004\"\n },\n {\n \"url\": \"resources/assets/images/IDI_PIKAICON-1_gap_filled_192.png\",\n \"revision\": \"dac21c95f585cb036ad61246d3d722b2\"\n },\n {\n \"url\": \"resources/assets/images/IDI_PIKAICON-1_gap_filled_512.png\",\n \"revision\": \"6cbcbdfef391a347ba1643574bd7ed1b\"\n },\n {\n \"url\": \"resources/assets/images/controls.png\",\n \"revision\": \"5275b91d01abe46c45f43fe59c95d170\"\n },\n {\n \"url\": \"resources/assets/images/controls_ko.png\",\n \"revision\": \"c5c52fd2313b63d024ad06060609c84f\"\n },\n {\n \"url\": \"resources/assets/images/screenshot.png\",\n \"revision\": \"3867bffd4bef3786694f9ebeb77d4d1d\"\n },\n {\n \"url\": \"resources/assets/images/sprite_sheet.json\",\n \"revision\": \"5b62092ca5b40d420e906629b647c919\"\n },\n {\n \"url\": \"resources/assets/images/sprite_sheet.png\",\n \"revision\": \"4fc3712243966195534ee80e1ca81364\"\n },\n {\n \"url\": \"resources/assets/sounds/WAVE140_1.wav\",\n \"revision\": \"a31e486f9bf2dfa2548a4208d78edc1f\"\n },\n {\n \"url\": \"resources/assets/sounds/WAVE141_1.wav\",\n \"revision\": \"e6b661515829712630bbead41d86ee8d\"\n },\n {\n \"url\": \"resources/assets/sounds/WAVE142_1.wav\",\n \"revision\": \"918c03522e79304ad8bb8891c35f58a3\"\n },\n {\n \"url\": \"resources/assets/sounds/WAVE143_1.wav\",\n \"revision\": \"eb2ac1cb1900cd970cdd86be87ebea11\"\n },\n {\n \"url\": \"resources/assets/sounds/WAVE144_1.wav\",\n \"revision\": \"6b16d233bc68aea2a7d071eee85da431\"\n },\n {\n \"url\": \"resources/assets/sounds/WAVE145_1.wav\",\n \"revision\": \"85da47de3575fbedaef71188fe4fc05f\"\n },\n {\n \"url\": \"resources/assets/sounds/WAVE146_1.wav\",\n \"revision\": \"9976daa90c7fd3f7008cf30e7cda8825\"\n },\n {\n \"url\": \"resources/assets/sounds/bgm.mp3\",\n \"revision\": \"029ae684624b50612c09a255264b2d93\"\n },\n {\n \"url\": \"resources/style.css\",\n \"revision\": \"9243735970a4dd56f1b6ea2297612c68\"\n },\n {\n \"url\": \"runtime.bundle.js\",\n \"revision\": \"5515a84be76013d8df230538de8a73bc\"\n },\n {\n \"url\": \"zh/index.html\",\n \"revision\": \"cca881dee46987e0fca1320f69cebc65\"\n },\n {\n \"url\": \"zh/manifest.json\",\n \"revision\": \"bd6076c6691c90bfda46149789420061\"\n },\n {\n \"url\": \"zh/update-history/index.html\",\n \"revision\": \"72f77973d4c583f26c63a6678fa4c4bf\"\n }\n], {});\nworkbox_precaching_cleanupOutdatedCaches();\n\n\n\n\n\n\n\n"],"names":["self","addEventListener","event","data","type","skipWaiting","workbox_precaching_precacheAndRoute","url","revision","workbox_precaching_cleanupOutdatedCaches"],"mappings":"0nBAoBAA,KAAKC,iBAAiB,WAAYC,IAC5BA,EAAMC,MAA4B,iBAApBD,EAAMC,KAAKC,MAC3BJ,KAAKK,aACP,IAWFC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,eACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,iBACPC,SAAY,oCAEd,CACED,IAAO,6CACPC,SAAY,oCAEd,CACED,IAAO,wDACPC,SAAY,oCAEd,CACED,IAAO,4DACPC,SAAY,oCAEd,CACED,IAAO,4DACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,4CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,kCACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,gBACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,qCAEb,CAAE,GACLC,EAAAA"} \ No newline at end of file diff --git a/workbox-d5348a15.js b/workbox-f065e1a2.js similarity index 99% rename from workbox-d5348a15.js rename to workbox-f065e1a2.js index 6c4e3e6..ac9558e 100644 --- a/workbox-d5348a15.js +++ b/workbox-f065e1a2.js @@ -1,2 +1,2 @@ define(["exports"],(function(t){"use strict";try{self["workbox:core:6.5.2"]&&_()}catch(t){}const e=(t,...e)=>{let s=t;return e.length>0&&(s+=` :: ${JSON.stringify(e)}`),s};class s extends Error{constructor(t,s){super(e(t,s)),this.name=t,this.details=s}}try{self["workbox:routing:6.5.2"]&&_()}catch(t){}const n=t=>t&&"object"==typeof t?t:{handle:t};class i{constructor(t,e,s="GET"){this.handler=n(e),this.match=t,this.method=s}setCatchHandler(t){this.catchHandler=n(t)}}class r extends i{constructor(t,e,s){super((({url:e})=>{const s=t.exec(e.href);if(s&&(e.origin===location.origin||0===s.index))return s.slice(1)}),e,s)}}class o{constructor(){this.t=new Map,this.i=new Map}get routes(){return this.t}addFetchListener(){self.addEventListener("fetch",(t=>{const{request:e}=t,s=this.handleRequest({request:e,event:t});s&&t.respondWith(s)}))}addCacheListener(){self.addEventListener("message",(t=>{if(t.data&&"CACHE_URLS"===t.data.type){const{payload:e}=t.data,s=Promise.all(e.urlsToCache.map((e=>{"string"==typeof e&&(e=[e]);const s=new Request(...e);return this.handleRequest({request:s,event:t})})));t.waitUntil(s),t.ports&&t.ports[0]&&s.then((()=>t.ports[0].postMessage(!0)))}}))}handleRequest({request:t,event:e}){const s=new URL(t.url,location.href);if(!s.protocol.startsWith("http"))return;const n=s.origin===location.origin,{params:i,route:r}=this.findMatchingRoute({event:e,request:t,sameOrigin:n,url:s});let o=r&&r.handler;const a=t.method;if(!o&&this.i.has(a)&&(o=this.i.get(a)),!o)return;let c;try{c=o.handle({url:s,request:t,event:e,params:i})}catch(t){c=Promise.reject(t)}const h=r&&r.catchHandler;return c instanceof Promise&&(this.o||h)&&(c=c.catch((async n=>{if(h)try{return await h.handle({url:s,request:t,event:e,params:i})}catch(t){t instanceof Error&&(n=t)}if(this.o)return this.o.handle({url:s,request:t,event:e});throw n}))),c}findMatchingRoute({url:t,sameOrigin:e,request:s,event:n}){const i=this.t.get(s.method)||[];for(const r of i){let i;const o=r.match({url:t,sameOrigin:e,request:s,event:n});if(o)return i=o,(Array.isArray(i)&&0===i.length||o.constructor===Object&&0===Object.keys(o).length||"boolean"==typeof o)&&(i=void 0),{route:r,params:i}}return{}}setDefaultHandler(t,e="GET"){this.i.set(e,n(t))}setCatchHandler(t){this.o=n(t)}registerRoute(t){this.t.has(t.method)||this.t.set(t.method,[]),this.t.get(t.method).push(t)}unregisterRoute(t){if(!this.t.has(t.method))throw new s("unregister-route-but-not-found-with-method",{method:t.method});const e=this.t.get(t.method).indexOf(t);if(!(e>-1))throw new s("unregister-route-route-not-registered");this.t.get(t.method).splice(e,1)}}let a;const c={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},h=t=>[c.prefix,t,c.suffix].filter((t=>t&&t.length>0)).join("-"),u=t=>t||h(c.precache),l=t=>t||h(c.runtime);function f(t,e){const s=e();return t.waitUntil(s),s}try{self["workbox:precaching:6.5.2"]&&_()}catch(t){}function w(t){if(!t)throw new s("add-to-cache-list-unexpected-type",{entry:t});if("string"==typeof t){const e=new URL(t,location.href);return{cacheKey:e.href,url:e.href}}const{revision:e,url:n}=t;if(!n)throw new s("add-to-cache-list-unexpected-type",{entry:t});if(!e){const t=new URL(n,location.href);return{cacheKey:t.href,url:t.href}}const i=new URL(n,location.href),r=new URL(n,location.href);return i.searchParams.set("__WB_REVISION__",e),{cacheKey:i.href,url:r.href}}class d{constructor(){this.updatedURLs=[],this.notUpdatedURLs=[],this.handlerWillStart=async({request:t,state:e})=>{e&&(e.originalRequest=t)},this.cachedResponseWillBeUsed=async({event:t,state:e,cachedResponse:s})=>{if("install"===t.type&&e&&e.originalRequest&&e.originalRequest instanceof Request){const t=e.originalRequest.url;s?this.notUpdatedURLs.push(t):this.updatedURLs.push(t)}return s}}}class p{constructor({precacheController:t}){this.cacheKeyWillBeUsed=async({request:t,params:e})=>{const s=(null==e?void 0:e.cacheKey)||this.h.getCacheKeyForURL(t.url);return s?new Request(s,{headers:t.headers}):t},this.h=t}}let y;async function g(t,e){let n=null;if(t.url){n=new URL(t.url).origin}if(n!==self.location.origin)throw new s("cross-origin-copy-response",{origin:n});const i=t.clone(),r={headers:new Headers(i.headers),status:i.status,statusText:i.statusText},o=e?e(r):r,a=function(){if(void 0===y){const t=new Response("");if("body"in t)try{new Response(t.body),y=!0}catch(t){y=!1}y=!1}return y}()?i.body:await i.blob();return new Response(a,o)}function R(t,e){const s=new URL(t);for(const t of e)s.searchParams.delete(t);return s.href}class m{constructor(){this.promise=new Promise(((t,e)=>{this.resolve=t,this.reject=e}))}}const v=new Set;try{self["workbox:strategies:6.5.2"]&&_()}catch(t){}function q(t){return"string"==typeof t?new Request(t):t}class U{constructor(t,e){this.u={},Object.assign(this,e),this.event=e.event,this.l=t,this.p=new m,this.g=[],this.R=[...t.plugins],this.m=new Map;for(const t of this.R)this.m.set(t,{});this.event.waitUntil(this.p.promise)}async fetch(t){const{event:e}=this;let n=q(t);if("navigate"===n.mode&&e instanceof FetchEvent&&e.preloadResponse){const t=await e.preloadResponse;if(t)return t}const i=this.hasCallback("fetchDidFail")?n.clone():null;try{for(const t of this.iterateCallbacks("requestWillFetch"))n=await t({request:n.clone(),event:e})}catch(t){if(t instanceof Error)throw new s("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const r=n.clone();try{let t;t=await fetch(n,"navigate"===n.mode?void 0:this.l.fetchOptions);for(const s of this.iterateCallbacks("fetchDidSucceed"))t=await s({event:e,request:r,response:t});return t}catch(t){throw i&&await this.runCallbacks("fetchDidFail",{error:t,event:e,originalRequest:i.clone(),request:r.clone()}),t}}async fetchAndCachePut(t){const e=await this.fetch(t),s=e.clone();return this.waitUntil(this.cachePut(t,s)),e}async cacheMatch(t){const e=q(t);let s;const{cacheName:n,matchOptions:i}=this.l,r=await this.getCacheKey(e,"read"),o=Object.assign(Object.assign({},i),{cacheName:n});s=await caches.match(r,o);for(const t of this.iterateCallbacks("cachedResponseWillBeUsed"))s=await t({cacheName:n,matchOptions:i,cachedResponse:s,request:r,event:this.event})||void 0;return s}async cachePut(t,e){const n=q(t);var i;await(i=0,new Promise((t=>setTimeout(t,i))));const r=await this.getCacheKey(n,"write");if(!e)throw new s("cache-put-with-no-response",{url:(o=r.url,new URL(String(o),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var o;const a=await this.v(e);if(!a)return!1;const{cacheName:c,matchOptions:h}=this.l,u=await self.caches.open(c),l=this.hasCallback("cacheDidUpdate"),f=l?await async function(t,e,s,n){const i=R(e.url,s);if(e.url===i)return t.match(e,n);const r=Object.assign(Object.assign({},n),{ignoreSearch:!0}),o=await t.keys(e,r);for(const e of o)if(i===R(e.url,s))return t.match(e,n)}(u,r.clone(),["__WB_REVISION__"],h):null;try{await u.put(r,l?a.clone():a)}catch(t){if(t instanceof Error)throw"QuotaExceededError"===t.name&&await async function(){for(const t of v)await t()}(),t}for(const t of this.iterateCallbacks("cacheDidUpdate"))await t({cacheName:c,oldResponse:f,newResponse:a.clone(),request:r,event:this.event});return!0}async getCacheKey(t,e){const s=`${t.url} | ${e}`;if(!this.u[s]){let n=t;for(const t of this.iterateCallbacks("cacheKeyWillBeUsed"))n=q(await t({mode:e,request:n,event:this.event,params:this.params}));this.u[s]=n}return this.u[s]}hasCallback(t){for(const e of this.l.plugins)if(t in e)return!0;return!1}async runCallbacks(t,e){for(const s of this.iterateCallbacks(t))await s(e)}*iterateCallbacks(t){for(const e of this.l.plugins)if("function"==typeof e[t]){const s=this.m.get(e),n=n=>{const i=Object.assign(Object.assign({},n),{state:s});return e[t](i)};yield n}}waitUntil(t){return this.g.push(t),t}async doneWaiting(){let t;for(;t=this.g.shift();)await t}destroy(){this.p.resolve(null)}async v(t){let e=t,s=!1;for(const t of this.iterateCallbacks("cacheWillUpdate"))if(e=await t({request:this.request,response:e,event:this.event})||void 0,s=!0,!e)break;return s||e&&200!==e.status&&(e=void 0),e}}class L extends class{constructor(t={}){this.cacheName=l(t.cacheName),this.plugins=t.plugins||[],this.fetchOptions=t.fetchOptions,this.matchOptions=t.matchOptions}handle(t){const[e]=this.handleAll(t);return e}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const e=t.event,s="string"==typeof t.request?new Request(t.request):t.request,n="params"in t?t.params:void 0,i=new U(this,{event:e,request:s,params:n}),r=this.q(i,s,e);return[r,this.U(r,i,s,e)]}async q(t,e,n){let i;await t.runCallbacks("handlerWillStart",{event:n,request:e});try{if(i=await this.L(e,t),!i||"error"===i.type)throw new s("no-response",{url:e.url})}catch(s){if(s instanceof Error)for(const r of t.iterateCallbacks("handlerDidError"))if(i=await r({error:s,event:n,request:e}),i)break;if(!i)throw s}for(const s of t.iterateCallbacks("handlerWillRespond"))i=await s({event:n,request:e,response:i});return i}async U(t,e,s,n){let i,r;try{i=await t}catch(r){}try{await e.runCallbacks("handlerDidRespond",{event:n,request:s,response:i}),await e.doneWaiting()}catch(t){t instanceof Error&&(r=t)}if(await e.runCallbacks("handlerDidComplete",{event:n,request:s,response:i,error:r}),e.destroy(),r)throw r}}{constructor(t={}){t.cacheName=u(t.cacheName),super(t),this._=!1!==t.fallbackToNetwork,this.plugins.push(L.copyRedirectedCacheableResponsesPlugin)}async L(t,e){const s=await e.cacheMatch(t);return s||(e.event&&"install"===e.event.type?await this.C(t,e):await this.O(t,e))}async O(t,e){let n;const i=e.params||{};if(!this._)throw new s("missing-precache-entry",{cacheName:this.cacheName,url:t.url});{const s=i.integrity,r=t.integrity,o=!r||r===s;n=await e.fetch(new Request(t,{integrity:r||s})),s&&o&&(this.N(),await e.cachePut(t,n.clone()))}return n}async C(t,e){this.N();const n=await e.fetch(t);if(!await e.cachePut(t,n.clone()))throw new s("bad-precaching-response",{url:t.url,status:n.status});return n}N(){let t=null,e=0;for(const[s,n]of this.plugins.entries())n!==L.copyRedirectedCacheableResponsesPlugin&&(n===L.defaultPrecacheCacheabilityPlugin&&(t=s),n.cacheWillUpdate&&e++);0===e?this.plugins.push(L.defaultPrecacheCacheabilityPlugin):e>1&&null!==t&&this.plugins.splice(t,1)}}L.defaultPrecacheCacheabilityPlugin={cacheWillUpdate:async({response:t})=>!t||t.status>=400?null:t},L.copyRedirectedCacheableResponsesPlugin={cacheWillUpdate:async({response:t})=>t.redirected?await g(t):t};class b{constructor({cacheName:t,plugins:e=[],fallbackToNetwork:s=!0}={}){this.k=new Map,this.K=new Map,this.P=new Map,this.l=new L({cacheName:u(t),plugins:[...e,new p({precacheController:this})],fallbackToNetwork:s}),this.install=this.install.bind(this),this.activate=this.activate.bind(this)}get strategy(){return this.l}precache(t){this.addToCacheList(t),this.T||(self.addEventListener("install",this.install),self.addEventListener("activate",this.activate),this.T=!0)}addToCacheList(t){const e=[];for(const n of t){"string"==typeof n?e.push(n):n&&void 0===n.revision&&e.push(n.url);const{cacheKey:t,url:i}=w(n),r="string"!=typeof n&&n.revision?"reload":"default";if(this.k.has(i)&&this.k.get(i)!==t)throw new s("add-to-cache-list-conflicting-entries",{firstEntry:this.k.get(i),secondEntry:t});if("string"!=typeof n&&n.integrity){if(this.P.has(t)&&this.P.get(t)!==n.integrity)throw new s("add-to-cache-list-conflicting-integrities",{url:i});this.P.set(t,n.integrity)}if(this.k.set(i,t),this.K.set(i,r),e.length>0){const t=`Workbox is precaching URLs without revision info: ${e.join(", ")}\nThis is generally NOT safe. Learn more at https://bit.ly/wb-precache`;console.warn(t)}}}install(t){return f(t,(async()=>{const e=new d;this.strategy.plugins.push(e);for(const[e,s]of this.k){const n=this.P.get(s),i=this.K.get(e),r=new Request(e,{integrity:n,cache:i,credentials:"same-origin"});await Promise.all(this.strategy.handleAll({params:{cacheKey:s},request:r,event:t}))}const{updatedURLs:s,notUpdatedURLs:n}=e;return{updatedURLs:s,notUpdatedURLs:n}}))}activate(t){return f(t,(async()=>{const t=await self.caches.open(this.strategy.cacheName),e=await t.keys(),s=new Set(this.k.values()),n=[];for(const i of e)s.has(i.url)||(await t.delete(i),n.push(i.url));return{deletedURLs:n}}))}getURLsToCacheKeys(){return this.k}getCachedURLs(){return[...this.k.keys()]}getCacheKeyForURL(t){const e=new URL(t,location.href);return this.k.get(e.href)}getIntegrityForCacheKey(t){return this.P.get(t)}async matchPrecache(t){const e=t instanceof Request?t.url:t,s=this.getCacheKeyForURL(e);if(s){return(await self.caches.open(this.strategy.cacheName)).match(s)}}createHandlerBoundToURL(t){const e=this.getCacheKeyForURL(t);if(!e)throw new s("non-precached-url",{url:t});return s=>(s.request=new Request(t),s.params=Object.assign({cacheKey:e},s.params),this.strategy.handle(s))}}let C;const E=()=>(C||(C=new b),C);class O extends i{constructor(t,e){super((({request:s})=>{const n=t.getURLsToCacheKeys();for(const i of function*(t,{ignoreURLParametersMatching:e=[/^utm_/,/^fbclid$/],directoryIndex:s="index.html",cleanURLs:n=!0,urlManipulation:i}={}){const r=new URL(t,location.href);r.hash="",yield r.href;const o=function(t,e=[]){for(const s of[...t.searchParams.keys()])e.some((t=>t.test(s)))&&t.searchParams.delete(s);return t}(r,e);if(yield o.href,s&&o.pathname.endsWith("/")){const t=new URL(o.href);t.pathname+=s,yield t.href}if(n){const t=new URL(o.href);t.pathname+=".html",yield t.href}if(i){const t=i({url:r});for(const e of t)yield e.href}}(s.url,e)){const e=n.get(i);if(e){return{cacheKey:e,integrity:t.getIntegrityForCacheKey(e)}}}}),t.strategy)}}function x(t){const e=E();!function(t,e,n){let c;if("string"==typeof t){const s=new URL(t,location.href);c=new i((({url:t})=>t.href===s.href),e,n)}else if(t instanceof RegExp)c=new r(t,e,n);else if("function"==typeof t)c=new i(t,e,n);else{if(!(t instanceof i))throw new s("unsupported-route-type",{moduleName:"workbox-routing",funcName:"registerRoute",paramName:"capture"});c=t}(a||(a=new o,a.addFetchListener(),a.addCacheListener()),a).registerRoute(c)}(new O(e,t))}t.cleanupOutdatedCaches=function(){self.addEventListener("activate",(t=>{const e=u();t.waitUntil((async(t,e="-precache-")=>{const s=(await self.caches.keys()).filter((s=>s.includes(e)&&s.includes(self.registration.scope)&&s!==t));return await Promise.all(s.map((t=>self.caches.delete(t)))),s})(e).then((t=>{})))}))},t.precacheAndRoute=function(t,e){!function(t){E().precache(t)}(t),x(e)}})); -//# sourceMappingURL=workbox-d5348a15.js.map +//# sourceMappingURL=workbox-f065e1a2.js.map diff --git a/workbox-d5348a15.js.map b/workbox-f065e1a2.js.map similarity index 84% rename from workbox-d5348a15.js.map rename to workbox-f065e1a2.js.map index f383724..7aeefdc 100644 --- a/workbox-d5348a15.js.map +++ b/workbox-f065e1a2.js.map @@ -1 +1 @@ -{"version":3,"file":"workbox-d5348a15.js","sources":["node_modules/workbox-core/_version.js","node_modules/workbox-core/_private/logger.js","node_modules/workbox-core/models/messages/messageGenerator.js","node_modules/workbox-core/_private/WorkboxError.js","node_modules/workbox-routing/_version.js","node_modules/workbox-routing/utils/constants.js","node_modules/workbox-routing/utils/normalizeHandler.js","node_modules/workbox-routing/Route.js","node_modules/workbox-routing/RegExpRoute.js","node_modules/workbox-routing/Router.js","node_modules/workbox-routing/utils/getOrCreateDefaultRouter.js","node_modules/workbox-core/_private/cacheNames.js","node_modules/workbox-core/_private/waitUntil.js","node_modules/workbox-precaching/_version.js","node_modules/workbox-precaching/utils/createCacheKey.js","node_modules/workbox-precaching/utils/PrecacheInstallReportPlugin.js","node_modules/workbox-precaching/utils/PrecacheCacheKeyPlugin.js","node_modules/workbox-core/_private/canConstructResponseFromBodyStream.js","node_modules/workbox-core/copyResponse.js","node_modules/workbox-core/_private/cacheMatchIgnoreParams.js","node_modules/workbox-core/_private/Deferred.js","node_modules/workbox-core/models/quotaErrorCallbacks.js","node_modules/workbox-strategies/_version.js","node_modules/workbox-strategies/StrategyHandler.js","node_modules/workbox-core/_private/timeout.js","node_modules/workbox-core/_private/getFriendlyURL.js","node_modules/workbox-core/_private/executeQuotaErrorCallbacks.js","node_modules/workbox-precaching/PrecacheStrategy.js","node_modules/workbox-strategies/Strategy.js","node_modules/workbox-precaching/PrecacheController.js","node_modules/workbox-precaching/utils/getOrCreatePrecacheController.js","node_modules/workbox-precaching/PrecacheRoute.js","node_modules/workbox-precaching/utils/generateURLVariations.js","node_modules/workbox-precaching/utils/removeIgnoredSearchParams.js","node_modules/workbox-precaching/addRoute.js","node_modules/workbox-routing/registerRoute.js","node_modules/workbox-precaching/cleanupOutdatedCaches.js","node_modules/workbox-precaching/utils/deleteOutdatedCaches.js","node_modules/workbox-precaching/precacheAndRoute.js","node_modules/workbox-precaching/precache.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:core:6.5.2'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst logger = (process.env.NODE_ENV === 'production'\n ? null\n : (() => {\n // Don't overwrite this value if it's already set.\n // See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923\n if (!('__WB_DISABLE_DEV_LOGS' in self)) {\n self.__WB_DISABLE_DEV_LOGS = false;\n }\n let inGroup = false;\n const methodToColorMap = {\n debug: `#7f8c8d`,\n log: `#2ecc71`,\n warn: `#f39c12`,\n error: `#c0392b`,\n groupCollapsed: `#3498db`,\n groupEnd: null, // No colored prefix on groupEnd\n };\n const print = function (method, args) {\n if (self.__WB_DISABLE_DEV_LOGS) {\n return;\n }\n if (method === 'groupCollapsed') {\n // Safari doesn't print all console.groupCollapsed() arguments:\n // https://bugs.webkit.org/show_bug.cgi?id=182754\n if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n console[method](...args);\n return;\n }\n }\n const styles = [\n `background: ${methodToColorMap[method]}`,\n `border-radius: 0.5em`,\n `color: white`,\n `font-weight: bold`,\n `padding: 2px 0.5em`,\n ];\n // When in a group, the workbox prefix is not displayed.\n const logPrefix = inGroup ? [] : ['%cworkbox', styles.join(';')];\n console[method](...logPrefix, ...args);\n if (method === 'groupCollapsed') {\n inGroup = true;\n }\n if (method === 'groupEnd') {\n inGroup = false;\n }\n };\n // eslint-disable-next-line @typescript-eslint/ban-types\n const api = {};\n const loggerMethods = Object.keys(methodToColorMap);\n for (const key of loggerMethods) {\n const method = key;\n api[method] = (...args) => {\n print(method, args);\n };\n }\n return api;\n })());\nexport { logger };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messages } from './messages.js';\nimport '../../_version.js';\nconst fallback = (code, ...args) => {\n let msg = code;\n if (args.length > 0) {\n msg += ` :: ${JSON.stringify(args)}`;\n }\n return msg;\n};\nconst generatorFunction = (code, details = {}) => {\n const message = messages[code];\n if (!message) {\n throw new Error(`Unable to find message for code '${code}'.`);\n }\n return message(details);\n};\nexport const messageGenerator = process.env.NODE_ENV === 'production' ? fallback : generatorFunction;\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messageGenerator } from '../models/messages/messageGenerator.js';\nimport '../_version.js';\n/**\n * Workbox errors should be thrown with this class.\n * This allows use to ensure the type easily in tests,\n * helps developers identify errors from workbox\n * easily and allows use to optimise error\n * messages correctly.\n *\n * @private\n */\nclass WorkboxError extends Error {\n /**\n *\n * @param {string} errorCode The error code that\n * identifies this particular error.\n * @param {Object=} details Any relevant arguments\n * that will help developers identify issues should\n * be added as a key on the context object.\n */\n constructor(errorCode, details) {\n const message = messageGenerator(errorCode, details);\n super(message);\n this.name = errorCode;\n this.details = details;\n }\n}\nexport { WorkboxError };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:routing:6.5.2'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The default HTTP method, 'GET', used when there's no specific method\n * configured for a route.\n *\n * @type {string}\n *\n * @private\n */\nexport const defaultMethod = 'GET';\n/**\n * The list of valid HTTP methods associated with requests that could be routed.\n *\n * @type {Array}\n *\n * @private\n */\nexport const validMethods = [\n 'DELETE',\n 'GET',\n 'HEAD',\n 'PATCH',\n 'POST',\n 'PUT',\n];\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport '../_version.js';\n/**\n * @param {function()|Object} handler Either a function, or an object with a\n * 'handle' method.\n * @return {Object} An object with a handle method.\n *\n * @private\n */\nexport const normalizeHandler = (handler) => {\n if (handler && typeof handler === 'object') {\n if (process.env.NODE_ENV !== 'production') {\n assert.hasMethod(handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return handler;\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(handler, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return { handle: handler };\n }\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { defaultMethod, validMethods } from './utils/constants.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport './_version.js';\n/**\n * A `Route` consists of a pair of callback functions, \"match\" and \"handler\".\n * The \"match\" callback determine if a route should be used to \"handle\" a\n * request by returning a non-falsy value if it can. The \"handler\" callback\n * is called when there is a match and should return a Promise that resolves\n * to a `Response`.\n *\n * @memberof workbox-routing\n */\nclass Route {\n /**\n * Constructor for Route class.\n *\n * @param {workbox-routing~matchCallback} match\n * A callback function that determines whether the route matches a given\n * `fetch` event by returning a non-falsy value.\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resolving to a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(match, handler, method = defaultMethod) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(match, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'match',\n });\n if (method) {\n assert.isOneOf(method, validMethods, { paramName: 'method' });\n }\n }\n // These values are referenced directly by Router so cannot be\n // altered by minificaton.\n this.handler = normalizeHandler(handler);\n this.match = match;\n this.method = method;\n }\n /**\n *\n * @param {workbox-routing-handlerCallback} handler A callback\n * function that returns a Promise resolving to a Response\n */\n setCatchHandler(handler) {\n this.catchHandler = normalizeHandler(handler);\n }\n}\nexport { Route };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { Route } from './Route.js';\nimport './_version.js';\n/**\n * RegExpRoute makes it easy to create a regular expression based\n * {@link workbox-routing.Route}.\n *\n * For same-origin requests the RegExp only needs to match part of the URL. For\n * requests against third-party servers, you must define a RegExp that matches\n * the start of the URL.\n *\n * @memberof workbox-routing\n * @extends workbox-routing.Route\n */\nclass RegExpRoute extends Route {\n /**\n * If the regular expression contains\n * [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references},\n * the captured values will be passed to the\n * {@link workbox-routing~handlerCallback} `params`\n * argument.\n *\n * @param {RegExp} regExp The regular expression to match against URLs.\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(regExp, handler, method) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(regExp, RegExp, {\n moduleName: 'workbox-routing',\n className: 'RegExpRoute',\n funcName: 'constructor',\n paramName: 'pattern',\n });\n }\n const match = ({ url }) => {\n const result = regExp.exec(url.href);\n // Return immediately if there's no match.\n if (!result) {\n return;\n }\n // Require that the match start at the first character in the URL string\n // if it's a cross-origin request.\n // See https://github.com/GoogleChrome/workbox/issues/281 for the context\n // behind this behavior.\n if (url.origin !== location.origin && result.index !== 0) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`The regular expression '${regExp.toString()}' only partially matched ` +\n `against the cross-origin URL '${url.toString()}'. RegExpRoute's will only ` +\n `handle cross-origin requests if they match the entire URL.`);\n }\n return;\n }\n // If the route matches, but there aren't any capture groups defined, then\n // this will return [], which is truthy and therefore sufficient to\n // indicate a match.\n // If there are capture groups, then it will return their values.\n return result.slice(1);\n };\n super(match, handler, method);\n }\n}\nexport { RegExpRoute };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { defaultMethod } from './utils/constants.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport './_version.js';\n/**\n * The Router can be used to process a `FetchEvent` using one or more\n * {@link workbox-routing.Route}, responding with a `Response` if\n * a matching route exists.\n *\n * If no route matches a given a request, the Router will use a \"default\"\n * handler if one is defined.\n *\n * Should the matching Route throw an error, the Router will use a \"catch\"\n * handler if one is defined to gracefully deal with issues and respond with a\n * Request.\n *\n * If a request matches multiple routes, the **earliest** registered route will\n * be used to respond to the request.\n *\n * @memberof workbox-routing\n */\nclass Router {\n /**\n * Initializes a new Router.\n */\n constructor() {\n this._routes = new Map();\n this._defaultHandlerMap = new Map();\n }\n /**\n * @return {Map>} routes A `Map` of HTTP\n * method name ('GET', etc.) to an array of all the corresponding `Route`\n * instances that are registered.\n */\n get routes() {\n return this._routes;\n }\n /**\n * Adds a fetch event listener to respond to events when a route matches\n * the event's request.\n */\n addFetchListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('fetch', ((event) => {\n const { request } = event;\n const responsePromise = this.handleRequest({ request, event });\n if (responsePromise) {\n event.respondWith(responsePromise);\n }\n }));\n }\n /**\n * Adds a message event listener for URLs to cache from the window.\n * This is useful to cache resources loaded on the page prior to when the\n * service worker started controlling it.\n *\n * The format of the message data sent from the window should be as follows.\n * Where the `urlsToCache` array may consist of URL strings or an array of\n * URL string + `requestInit` object (the same as you'd pass to `fetch()`).\n *\n * ```\n * {\n * type: 'CACHE_URLS',\n * payload: {\n * urlsToCache: [\n * './script1.js',\n * './script2.js',\n * ['./script3.js', {mode: 'no-cors'}],\n * ],\n * },\n * }\n * ```\n */\n addCacheListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('message', ((event) => {\n // event.data is type 'any'\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (event.data && event.data.type === 'CACHE_URLS') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const { payload } = event.data;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Caching URLs from the window`, payload.urlsToCache);\n }\n const requestPromises = Promise.all(payload.urlsToCache.map((entry) => {\n if (typeof entry === 'string') {\n entry = [entry];\n }\n const request = new Request(...entry);\n return this.handleRequest({ request, event });\n // TODO(philipwalton): TypeScript errors without this typecast for\n // some reason (probably a bug). The real type here should work but\n // doesn't: `Array | undefined>`.\n })); // TypeScript\n event.waitUntil(requestPromises);\n // If a MessageChannel was used, reply to the message on success.\n if (event.ports && event.ports[0]) {\n void requestPromises.then(() => event.ports[0].postMessage(true));\n }\n }\n }));\n }\n /**\n * Apply the routing rules to a FetchEvent object to get a Response from an\n * appropriate Route's handler.\n *\n * @param {Object} options\n * @param {Request} options.request The request to handle.\n * @param {ExtendableEvent} options.event The event that triggered the\n * request.\n * @return {Promise|undefined} A promise is returned if a\n * registered route can handle the request. If there is no matching\n * route and there's no `defaultHandler`, `undefined` is returned.\n */\n handleRequest({ request, event, }) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'handleRequest',\n paramName: 'options.request',\n });\n }\n const url = new URL(request.url, location.href);\n if (!url.protocol.startsWith('http')) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Workbox Router only supports URLs that start with 'http'.`);\n }\n return;\n }\n const sameOrigin = url.origin === location.origin;\n const { params, route } = this.findMatchingRoute({\n event,\n request,\n sameOrigin,\n url,\n });\n let handler = route && route.handler;\n const debugMessages = [];\n if (process.env.NODE_ENV !== 'production') {\n if (handler) {\n debugMessages.push([`Found a route to handle this request:`, route]);\n if (params) {\n debugMessages.push([\n `Passing the following params to the route's handler:`,\n params,\n ]);\n }\n }\n }\n // If we don't have a handler because there was no matching route, then\n // fall back to defaultHandler if that's defined.\n const method = request.method;\n if (!handler && this._defaultHandlerMap.has(method)) {\n if (process.env.NODE_ENV !== 'production') {\n debugMessages.push(`Failed to find a matching route. Falling ` +\n `back to the default handler for ${method}.`);\n }\n handler = this._defaultHandlerMap.get(method);\n }\n if (!handler) {\n if (process.env.NODE_ENV !== 'production') {\n // No handler so Workbox will do nothing. If logs is set of debug\n // i.e. verbose, we should print out this information.\n logger.debug(`No route found for: ${getFriendlyURL(url)}`);\n }\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // We have a handler, meaning Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Router is responding to: ${getFriendlyURL(url)}`);\n debugMessages.forEach((msg) => {\n if (Array.isArray(msg)) {\n logger.log(...msg);\n }\n else {\n logger.log(msg);\n }\n });\n logger.groupEnd();\n }\n // Wrap in try and catch in case the handle method throws a synchronous\n // error. It should still callback to the catch handler.\n let responsePromise;\n try {\n responsePromise = handler.handle({ url, request, event, params });\n }\n catch (err) {\n responsePromise = Promise.reject(err);\n }\n // Get route's catch handler, if it exists\n const catchHandler = route && route.catchHandler;\n if (responsePromise instanceof Promise &&\n (this._catchHandler || catchHandler)) {\n responsePromise = responsePromise.catch(async (err) => {\n // If there's a route catch handler, process that first\n if (catchHandler) {\n if (process.env.NODE_ENV !== 'production') {\n // Still include URL here as it will be async from the console group\n // and may not make sense without the URL\n logger.groupCollapsed(`Error thrown when responding to: ` +\n ` ${getFriendlyURL(url)}. Falling back to route's Catch Handler.`);\n logger.error(`Error thrown by:`, route);\n logger.error(err);\n logger.groupEnd();\n }\n try {\n return await catchHandler.handle({ url, request, event, params });\n }\n catch (catchErr) {\n if (catchErr instanceof Error) {\n err = catchErr;\n }\n }\n }\n if (this._catchHandler) {\n if (process.env.NODE_ENV !== 'production') {\n // Still include URL here as it will be async from the console group\n // and may not make sense without the URL\n logger.groupCollapsed(`Error thrown when responding to: ` +\n ` ${getFriendlyURL(url)}. Falling back to global Catch Handler.`);\n logger.error(`Error thrown by:`, route);\n logger.error(err);\n logger.groupEnd();\n }\n return this._catchHandler.handle({ url, request, event });\n }\n throw err;\n });\n }\n return responsePromise;\n }\n /**\n * Checks a request and URL (and optionally an event) against the list of\n * registered routes, and if there's a match, returns the corresponding\n * route along with any params generated by the match.\n *\n * @param {Object} options\n * @param {URL} options.url\n * @param {boolean} options.sameOrigin The result of comparing `url.origin`\n * against the current origin.\n * @param {Request} options.request The request to match.\n * @param {Event} options.event The corresponding event.\n * @return {Object} An object with `route` and `params` properties.\n * They are populated if a matching route was found or `undefined`\n * otherwise.\n */\n findMatchingRoute({ url, sameOrigin, request, event, }) {\n const routes = this._routes.get(request.method) || [];\n for (const route of routes) {\n let params;\n // route.match returns type any, not possible to change right now.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const matchResult = route.match({ url, sameOrigin, request, event });\n if (matchResult) {\n if (process.env.NODE_ENV !== 'production') {\n // Warn developers that using an async matchCallback is almost always\n // not the right thing to do.\n if (matchResult instanceof Promise) {\n logger.warn(`While routing ${getFriendlyURL(url)}, an async ` +\n `matchCallback function was used. Please convert the ` +\n `following route to use a synchronous matchCallback function:`, route);\n }\n }\n // See https://github.com/GoogleChrome/workbox/issues/2079\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n params = matchResult;\n if (Array.isArray(params) && params.length === 0) {\n // Instead of passing an empty array in as params, use undefined.\n params = undefined;\n }\n else if (matchResult.constructor === Object && // eslint-disable-line\n Object.keys(matchResult).length === 0) {\n // Instead of passing an empty object in as params, use undefined.\n params = undefined;\n }\n else if (typeof matchResult === 'boolean') {\n // For the boolean value true (rather than just something truth-y),\n // don't set params.\n // See https://github.com/GoogleChrome/workbox/pull/2134#issuecomment-513924353\n params = undefined;\n }\n // Return early if have a match.\n return { route, params };\n }\n }\n // If no match was found above, return and empty object.\n return {};\n }\n /**\n * Define a default `handler` that's called when no routes explicitly\n * match the incoming request.\n *\n * Each HTTP method ('GET', 'POST', etc.) gets its own default handler.\n *\n * Without a default handler, unmatched requests will go against the\n * network as if there were no service worker present.\n *\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n * @param {string} [method='GET'] The HTTP method to associate with this\n * default handler. Each method has its own default.\n */\n setDefaultHandler(handler, method = defaultMethod) {\n this._defaultHandlerMap.set(method, normalizeHandler(handler));\n }\n /**\n * If a Route throws an error while handling a request, this `handler`\n * will be called and given a chance to provide a response.\n *\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n */\n setCatchHandler(handler) {\n this._catchHandler = normalizeHandler(handler);\n }\n /**\n * Registers a route with the router.\n *\n * @param {workbox-routing.Route} route The route to register.\n */\n registerRoute(route) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(route, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route, 'match', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.isType(route.handler, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route.handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.handler',\n });\n assert.isType(route.method, 'string', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.method',\n });\n }\n if (!this._routes.has(route.method)) {\n this._routes.set(route.method, []);\n }\n // Give precedence to all of the earlier routes by adding this additional\n // route to the end of the array.\n this._routes.get(route.method).push(route);\n }\n /**\n * Unregisters a route with the router.\n *\n * @param {workbox-routing.Route} route The route to unregister.\n */\n unregisterRoute(route) {\n if (!this._routes.has(route.method)) {\n throw new WorkboxError('unregister-route-but-not-found-with-method', {\n method: route.method,\n });\n }\n const routeIndex = this._routes.get(route.method).indexOf(route);\n if (routeIndex > -1) {\n this._routes.get(route.method).splice(routeIndex, 1);\n }\n else {\n throw new WorkboxError('unregister-route-route-not-registered');\n }\n }\n}\nexport { Router };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { Router } from '../Router.js';\nimport '../_version.js';\nlet defaultRouter;\n/**\n * Creates a new, singleton Router instance if one does not exist. If one\n * does already exist, that instance is returned.\n *\n * @private\n * @return {Router}\n */\nexport const getOrCreateDefaultRouter = () => {\n if (!defaultRouter) {\n defaultRouter = new Router();\n // The helpers that use the default Router assume these listeners exist.\n defaultRouter.addFetchListener();\n defaultRouter.addCacheListener();\n }\n return defaultRouter;\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst _cacheNameDetails = {\n googleAnalytics: 'googleAnalytics',\n precache: 'precache-v2',\n prefix: 'workbox',\n runtime: 'runtime',\n suffix: typeof registration !== 'undefined' ? registration.scope : '',\n};\nconst _createCacheName = (cacheName) => {\n return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix]\n .filter((value) => value && value.length > 0)\n .join('-');\n};\nconst eachCacheNameDetail = (fn) => {\n for (const key of Object.keys(_cacheNameDetails)) {\n fn(key);\n }\n};\nexport const cacheNames = {\n updateDetails: (details) => {\n eachCacheNameDetail((key) => {\n if (typeof details[key] === 'string') {\n _cacheNameDetails[key] = details[key];\n }\n });\n },\n getGoogleAnalyticsName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);\n },\n getPrecacheName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.precache);\n },\n getPrefix: () => {\n return _cacheNameDetails.prefix;\n },\n getRuntimeName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.runtime);\n },\n getSuffix: () => {\n return _cacheNameDetails.suffix;\n },\n};\n","/*\n Copyright 2020 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A utility method that makes it easier to use `event.waitUntil` with\n * async functions and return the result.\n *\n * @param {ExtendableEvent} event\n * @param {Function} asyncFn\n * @return {Function}\n * @private\n */\nfunction waitUntil(event, asyncFn) {\n const returnPromise = asyncFn();\n event.waitUntil(returnPromise);\n return returnPromise;\n}\nexport { waitUntil };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:precaching:6.5.2'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport '../_version.js';\n// Name of the search parameter used to store revision info.\nconst REVISION_SEARCH_PARAM = '__WB_REVISION__';\n/**\n * Converts a manifest entry into a versioned URL suitable for precaching.\n *\n * @param {Object|string} entry\n * @return {string} A URL with versioning info.\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function createCacheKey(entry) {\n if (!entry) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If a precache manifest entry is a string, it's assumed to be a versioned\n // URL, like '/app.abcd1234.js'. Return as-is.\n if (typeof entry === 'string') {\n const urlObject = new URL(entry, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n const { revision, url } = entry;\n if (!url) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If there's just a URL and no revision, then it's also assumed to be a\n // versioned URL.\n if (!revision) {\n const urlObject = new URL(url, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n // Otherwise, construct a properly versioned URL using the custom Workbox\n // search parameter along with the revision info.\n const cacheKeyURL = new URL(url, location.href);\n const originalURL = new URL(url, location.href);\n cacheKeyURL.searchParams.set(REVISION_SEARCH_PARAM, revision);\n return {\n cacheKey: cacheKeyURL.href,\n url: originalURL.href,\n };\n}\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A plugin, designed to be used with PrecacheController, to determine the\n * of assets that were updated (or not updated) during the install event.\n *\n * @private\n */\nclass PrecacheInstallReportPlugin {\n constructor() {\n this.updatedURLs = [];\n this.notUpdatedURLs = [];\n this.handlerWillStart = async ({ request, state, }) => {\n // TODO: `state` should never be undefined...\n if (state) {\n state.originalRequest = request;\n }\n };\n this.cachedResponseWillBeUsed = async ({ event, state, cachedResponse, }) => {\n if (event.type === 'install') {\n if (state &&\n state.originalRequest &&\n state.originalRequest instanceof Request) {\n // TODO: `state` should never be undefined...\n const url = state.originalRequest.url;\n if (cachedResponse) {\n this.notUpdatedURLs.push(url);\n }\n else {\n this.updatedURLs.push(url);\n }\n }\n }\n return cachedResponse;\n };\n }\n}\nexport { PrecacheInstallReportPlugin };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A plugin, designed to be used with PrecacheController, to translate URLs into\n * the corresponding cache key, based on the current revision info.\n *\n * @private\n */\nclass PrecacheCacheKeyPlugin {\n constructor({ precacheController }) {\n this.cacheKeyWillBeUsed = async ({ request, params, }) => {\n // Params is type any, can't change right now.\n /* eslint-disable */\n const cacheKey = (params === null || params === void 0 ? void 0 : params.cacheKey) ||\n this._precacheController.getCacheKeyForURL(request.url);\n /* eslint-enable */\n return cacheKey\n ? new Request(cacheKey, { headers: request.headers })\n : request;\n };\n this._precacheController = precacheController;\n }\n}\nexport { PrecacheCacheKeyPlugin };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nlet supportStatus;\n/**\n * A utility function that determines whether the current browser supports\n * constructing a new `Response` from a `response.body` stream.\n *\n * @return {boolean} `true`, if the current browser can successfully\n * construct a `Response` from a `response.body` stream, `false` otherwise.\n *\n * @private\n */\nfunction canConstructResponseFromBodyStream() {\n if (supportStatus === undefined) {\n const testResponse = new Response('');\n if ('body' in testResponse) {\n try {\n new Response(testResponse.body);\n supportStatus = true;\n }\n catch (error) {\n supportStatus = false;\n }\n }\n supportStatus = false;\n }\n return supportStatus;\n}\nexport { canConstructResponseFromBodyStream };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { canConstructResponseFromBodyStream } from './_private/canConstructResponseFromBodyStream.js';\nimport { WorkboxError } from './_private/WorkboxError.js';\nimport './_version.js';\n/**\n * Allows developers to copy a response and modify its `headers`, `status`,\n * or `statusText` values (the values settable via a\n * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax}\n * object in the constructor).\n * To modify these values, pass a function as the second argument. That\n * function will be invoked with a single object with the response properties\n * `{headers, status, statusText}`. The return value of this function will\n * be used as the `ResponseInit` for the new `Response`. To change the values\n * either modify the passed parameter(s) and return it, or return a totally\n * new object.\n *\n * This method is intentionally limited to same-origin responses, regardless of\n * whether CORS was used or not.\n *\n * @param {Response} response\n * @param {Function} modifier\n * @memberof workbox-core\n */\nasync function copyResponse(response, modifier) {\n let origin = null;\n // If response.url isn't set, assume it's cross-origin and keep origin null.\n if (response.url) {\n const responseURL = new URL(response.url);\n origin = responseURL.origin;\n }\n if (origin !== self.location.origin) {\n throw new WorkboxError('cross-origin-copy-response', { origin });\n }\n const clonedResponse = response.clone();\n // Create a fresh `ResponseInit` object by cloning the headers.\n const responseInit = {\n headers: new Headers(clonedResponse.headers),\n status: clonedResponse.status,\n statusText: clonedResponse.statusText,\n };\n // Apply any user modifications.\n const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit;\n // Create the new response from the body stream and `ResponseInit`\n // modifications. Note: not all browsers support the Response.body stream,\n // so fall back to reading the entire body into memory as a blob.\n const body = canConstructResponseFromBodyStream()\n ? clonedResponse.body\n : await clonedResponse.blob();\n return new Response(body, modifiedResponseInit);\n}\nexport { copyResponse };\n","/*\n Copyright 2020 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nfunction stripParams(fullURL, ignoreParams) {\n const strippedURL = new URL(fullURL);\n for (const param of ignoreParams) {\n strippedURL.searchParams.delete(param);\n }\n return strippedURL.href;\n}\n/**\n * Matches an item in the cache, ignoring specific URL params. This is similar\n * to the `ignoreSearch` option, but it allows you to ignore just specific\n * params (while continuing to match on the others).\n *\n * @private\n * @param {Cache} cache\n * @param {Request} request\n * @param {Object} matchOptions\n * @param {Array} ignoreParams\n * @return {Promise}\n */\nasync function cacheMatchIgnoreParams(cache, request, ignoreParams, matchOptions) {\n const strippedRequestURL = stripParams(request.url, ignoreParams);\n // If the request doesn't include any ignored params, match as normal.\n if (request.url === strippedRequestURL) {\n return cache.match(request, matchOptions);\n }\n // Otherwise, match by comparing keys\n const keysOptions = Object.assign(Object.assign({}, matchOptions), { ignoreSearch: true });\n const cacheKeys = await cache.keys(request, keysOptions);\n for (const cacheKey of cacheKeys) {\n const strippedCacheKeyURL = stripParams(cacheKey.url, ignoreParams);\n if (strippedRequestURL === strippedCacheKeyURL) {\n return cache.match(cacheKey, matchOptions);\n }\n }\n return;\n}\nexport { cacheMatchIgnoreParams };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The Deferred class composes Promises in a way that allows for them to be\n * resolved or rejected from outside the constructor. In most cases promises\n * should be used directly, but Deferreds can be necessary when the logic to\n * resolve a promise must be separate.\n *\n * @private\n */\nclass Deferred {\n /**\n * Creates a promise and exposes its resolve and reject functions as methods.\n */\n constructor() {\n this.promise = new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n }\n}\nexport { Deferred };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n// Callbacks to be executed whenever there's a quota error.\n// Can't change Function type right now.\n// eslint-disable-next-line @typescript-eslint/ban-types\nconst quotaErrorCallbacks = new Set();\nexport { quotaErrorCallbacks };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:strategies:6.5.2'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheMatchIgnoreParams } from 'workbox-core/_private/cacheMatchIgnoreParams.js';\nimport { Deferred } from 'workbox-core/_private/Deferred.js';\nimport { executeQuotaErrorCallbacks } from 'workbox-core/_private/executeQuotaErrorCallbacks.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { timeout } from 'workbox-core/_private/timeout.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport './_version.js';\nfunction toRequest(input) {\n return typeof input === 'string' ? new Request(input) : input;\n}\n/**\n * A class created every time a Strategy instance instance calls\n * {@link workbox-strategies.Strategy~handle} or\n * {@link workbox-strategies.Strategy~handleAll} that wraps all fetch and\n * cache actions around plugin callbacks and keeps track of when the strategy\n * is \"done\" (i.e. all added `event.waitUntil()` promises have resolved).\n *\n * @memberof workbox-strategies\n */\nclass StrategyHandler {\n /**\n * Creates a new instance associated with the passed strategy and event\n * that's handling the request.\n *\n * The constructor also initializes the state that will be passed to each of\n * the plugins handling this request.\n *\n * @param {workbox-strategies.Strategy} strategy\n * @param {Object} options\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {ExtendableEvent} options.event The event associated with the\n * request.\n * @param {URL} [options.url]\n * @param {*} [options.params] The return value from the\n * {@link workbox-routing~matchCallback} (if applicable).\n */\n constructor(strategy, options) {\n this._cacheKeys = {};\n /**\n * The request the strategy is performing (passed to the strategy's\n * `handle()` or `handleAll()` method).\n * @name request\n * @instance\n * @type {Request}\n * @memberof workbox-strategies.StrategyHandler\n */\n /**\n * The event associated with this request.\n * @name event\n * @instance\n * @type {ExtendableEvent}\n * @memberof workbox-strategies.StrategyHandler\n */\n /**\n * A `URL` instance of `request.url` (if passed to the strategy's\n * `handle()` or `handleAll()` method).\n * Note: the `url` param will be present if the strategy was invoked\n * from a workbox `Route` object.\n * @name url\n * @instance\n * @type {URL|undefined}\n * @memberof workbox-strategies.StrategyHandler\n */\n /**\n * A `param` value (if passed to the strategy's\n * `handle()` or `handleAll()` method).\n * Note: the `param` param will be present if the strategy was invoked\n * from a workbox `Route` object and the\n * {@link workbox-routing~matchCallback} returned\n * a truthy value (it will be that value).\n * @name params\n * @instance\n * @type {*|undefined}\n * @memberof workbox-strategies.StrategyHandler\n */\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(options.event, ExtendableEvent, {\n moduleName: 'workbox-strategies',\n className: 'StrategyHandler',\n funcName: 'constructor',\n paramName: 'options.event',\n });\n }\n Object.assign(this, options);\n this.event = options.event;\n this._strategy = strategy;\n this._handlerDeferred = new Deferred();\n this._extendLifetimePromises = [];\n // Copy the plugins list (since it's mutable on the strategy),\n // so any mutations don't affect this handler instance.\n this._plugins = [...strategy.plugins];\n this._pluginStateMap = new Map();\n for (const plugin of this._plugins) {\n this._pluginStateMap.set(plugin, {});\n }\n this.event.waitUntil(this._handlerDeferred.promise);\n }\n /**\n * Fetches a given request (and invokes any applicable plugin callback\n * methods) using the `fetchOptions` (for non-navigation requests) and\n * `plugins` defined on the `Strategy` object.\n *\n * The following plugin lifecycle methods are invoked when using this method:\n * - `requestWillFetch()`\n * - `fetchDidSucceed()`\n * - `fetchDidFail()`\n *\n * @param {Request|string} input The URL or request to fetch.\n * @return {Promise}\n */\n async fetch(input) {\n const { event } = this;\n let request = toRequest(input);\n if (request.mode === 'navigate' &&\n event instanceof FetchEvent &&\n event.preloadResponse) {\n const possiblePreloadResponse = (await event.preloadResponse);\n if (possiblePreloadResponse) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Using a preloaded navigation response for ` +\n `'${getFriendlyURL(request.url)}'`);\n }\n return possiblePreloadResponse;\n }\n }\n // If there is a fetchDidFail plugin, we need to save a clone of the\n // original request before it's either modified by a requestWillFetch\n // plugin or before the original request's body is consumed via fetch().\n const originalRequest = this.hasCallback('fetchDidFail')\n ? request.clone()\n : null;\n try {\n for (const cb of this.iterateCallbacks('requestWillFetch')) {\n request = await cb({ request: request.clone(), event });\n }\n }\n catch (err) {\n if (err instanceof Error) {\n throw new WorkboxError('plugin-error-request-will-fetch', {\n thrownErrorMessage: err.message,\n });\n }\n }\n // The request can be altered by plugins with `requestWillFetch` making\n // the original request (most likely from a `fetch` event) different\n // from the Request we make. Pass both to `fetchDidFail` to aid debugging.\n const pluginFilteredRequest = request.clone();\n try {\n let fetchResponse;\n // See https://github.com/GoogleChrome/workbox/issues/1796\n fetchResponse = await fetch(request, request.mode === 'navigate' ? undefined : this._strategy.fetchOptions);\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Network request for ` +\n `'${getFriendlyURL(request.url)}' returned a response with ` +\n `status '${fetchResponse.status}'.`);\n }\n for (const callback of this.iterateCallbacks('fetchDidSucceed')) {\n fetchResponse = await callback({\n event,\n request: pluginFilteredRequest,\n response: fetchResponse,\n });\n }\n return fetchResponse;\n }\n catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Network request for ` +\n `'${getFriendlyURL(request.url)}' threw an error.`, error);\n }\n // `originalRequest` will only exist if a `fetchDidFail` callback\n // is being used (see above).\n if (originalRequest) {\n await this.runCallbacks('fetchDidFail', {\n error: error,\n event,\n originalRequest: originalRequest.clone(),\n request: pluginFilteredRequest.clone(),\n });\n }\n throw error;\n }\n }\n /**\n * Calls `this.fetch()` and (in the background) runs `this.cachePut()` on\n * the response generated by `this.fetch()`.\n *\n * The call to `this.cachePut()` automatically invokes `this.waitUntil()`,\n * so you do not have to manually call `waitUntil()` on the event.\n *\n * @param {Request|string} input The request or URL to fetch and cache.\n * @return {Promise}\n */\n async fetchAndCachePut(input) {\n const response = await this.fetch(input);\n const responseClone = response.clone();\n void this.waitUntil(this.cachePut(input, responseClone));\n return response;\n }\n /**\n * Matches a request from the cache (and invokes any applicable plugin\n * callback methods) using the `cacheName`, `matchOptions`, and `plugins`\n * defined on the strategy object.\n *\n * The following plugin lifecycle methods are invoked when using this method:\n * - cacheKeyWillByUsed()\n * - cachedResponseWillByUsed()\n *\n * @param {Request|string} key The Request or URL to use as the cache key.\n * @return {Promise} A matching response, if found.\n */\n async cacheMatch(key) {\n const request = toRequest(key);\n let cachedResponse;\n const { cacheName, matchOptions } = this._strategy;\n const effectiveRequest = await this.getCacheKey(request, 'read');\n const multiMatchOptions = Object.assign(Object.assign({}, matchOptions), { cacheName });\n cachedResponse = await caches.match(effectiveRequest, multiMatchOptions);\n if (process.env.NODE_ENV !== 'production') {\n if (cachedResponse) {\n logger.debug(`Found a cached response in '${cacheName}'.`);\n }\n else {\n logger.debug(`No cached response found in '${cacheName}'.`);\n }\n }\n for (const callback of this.iterateCallbacks('cachedResponseWillBeUsed')) {\n cachedResponse =\n (await callback({\n cacheName,\n matchOptions,\n cachedResponse,\n request: effectiveRequest,\n event: this.event,\n })) || undefined;\n }\n return cachedResponse;\n }\n /**\n * Puts a request/response pair in the cache (and invokes any applicable\n * plugin callback methods) using the `cacheName` and `plugins` defined on\n * the strategy object.\n *\n * The following plugin lifecycle methods are invoked when using this method:\n * - cacheKeyWillByUsed()\n * - cacheWillUpdate()\n * - cacheDidUpdate()\n *\n * @param {Request|string} key The request or URL to use as the cache key.\n * @param {Response} response The response to cache.\n * @return {Promise} `false` if a cacheWillUpdate caused the response\n * not be cached, and `true` otherwise.\n */\n async cachePut(key, response) {\n const request = toRequest(key);\n // Run in the next task to avoid blocking other cache reads.\n // https://github.com/w3c/ServiceWorker/issues/1397\n await timeout(0);\n const effectiveRequest = await this.getCacheKey(request, 'write');\n if (process.env.NODE_ENV !== 'production') {\n if (effectiveRequest.method && effectiveRequest.method !== 'GET') {\n throw new WorkboxError('attempt-to-cache-non-get-request', {\n url: getFriendlyURL(effectiveRequest.url),\n method: effectiveRequest.method,\n });\n }\n // See https://github.com/GoogleChrome/workbox/issues/2818\n const vary = response.headers.get('Vary');\n if (vary) {\n logger.debug(`The response for ${getFriendlyURL(effectiveRequest.url)} ` +\n `has a 'Vary: ${vary}' header. ` +\n `Consider setting the {ignoreVary: true} option on your strategy ` +\n `to ensure cache matching and deletion works as expected.`);\n }\n }\n if (!response) {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Cannot cache non-existent response for ` +\n `'${getFriendlyURL(effectiveRequest.url)}'.`);\n }\n throw new WorkboxError('cache-put-with-no-response', {\n url: getFriendlyURL(effectiveRequest.url),\n });\n }\n const responseToCache = await this._ensureResponseSafeToCache(response);\n if (!responseToCache) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Response '${getFriendlyURL(effectiveRequest.url)}' ` +\n `will not be cached.`, responseToCache);\n }\n return false;\n }\n const { cacheName, matchOptions } = this._strategy;\n const cache = await self.caches.open(cacheName);\n const hasCacheUpdateCallback = this.hasCallback('cacheDidUpdate');\n const oldResponse = hasCacheUpdateCallback\n ? await cacheMatchIgnoreParams(\n // TODO(philipwalton): the `__WB_REVISION__` param is a precaching\n // feature. Consider into ways to only add this behavior if using\n // precaching.\n cache, effectiveRequest.clone(), ['__WB_REVISION__'], matchOptions)\n : null;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Updating the '${cacheName}' cache with a new Response ` +\n `for ${getFriendlyURL(effectiveRequest.url)}.`);\n }\n try {\n await cache.put(effectiveRequest, hasCacheUpdateCallback ? responseToCache.clone() : responseToCache);\n }\n catch (error) {\n if (error instanceof Error) {\n // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError\n if (error.name === 'QuotaExceededError') {\n await executeQuotaErrorCallbacks();\n }\n throw error;\n }\n }\n for (const callback of this.iterateCallbacks('cacheDidUpdate')) {\n await callback({\n cacheName,\n oldResponse,\n newResponse: responseToCache.clone(),\n request: effectiveRequest,\n event: this.event,\n });\n }\n return true;\n }\n /**\n * Checks the list of plugins for the `cacheKeyWillBeUsed` callback, and\n * executes any of those callbacks found in sequence. The final `Request`\n * object returned by the last plugin is treated as the cache key for cache\n * reads and/or writes. If no `cacheKeyWillBeUsed` plugin callbacks have\n * been registered, the passed request is returned unmodified\n *\n * @param {Request} request\n * @param {string} mode\n * @return {Promise}\n */\n async getCacheKey(request, mode) {\n const key = `${request.url} | ${mode}`;\n if (!this._cacheKeys[key]) {\n let effectiveRequest = request;\n for (const callback of this.iterateCallbacks('cacheKeyWillBeUsed')) {\n effectiveRequest = toRequest(await callback({\n mode,\n request: effectiveRequest,\n event: this.event,\n // params has a type any can't change right now.\n params: this.params, // eslint-disable-line\n }));\n }\n this._cacheKeys[key] = effectiveRequest;\n }\n return this._cacheKeys[key];\n }\n /**\n * Returns true if the strategy has at least one plugin with the given\n * callback.\n *\n * @param {string} name The name of the callback to check for.\n * @return {boolean}\n */\n hasCallback(name) {\n for (const plugin of this._strategy.plugins) {\n if (name in plugin) {\n return true;\n }\n }\n return false;\n }\n /**\n * Runs all plugin callbacks matching the given name, in order, passing the\n * given param object (merged ith the current plugin state) as the only\n * argument.\n *\n * Note: since this method runs all plugins, it's not suitable for cases\n * where the return value of a callback needs to be applied prior to calling\n * the next callback. See\n * {@link workbox-strategies.StrategyHandler#iterateCallbacks}\n * below for how to handle that case.\n *\n * @param {string} name The name of the callback to run within each plugin.\n * @param {Object} param The object to pass as the first (and only) param\n * when executing each callback. This object will be merged with the\n * current plugin state prior to callback execution.\n */\n async runCallbacks(name, param) {\n for (const callback of this.iterateCallbacks(name)) {\n // TODO(philipwalton): not sure why `any` is needed. It seems like\n // this should work with `as WorkboxPluginCallbackParam[C]`.\n await callback(param);\n }\n }\n /**\n * Accepts a callback and returns an iterable of matching plugin callbacks,\n * where each callback is wrapped with the current handler state (i.e. when\n * you call each callback, whatever object parameter you pass it will\n * be merged with the plugin's current state).\n *\n * @param {string} name The name fo the callback to run\n * @return {Array}\n */\n *iterateCallbacks(name) {\n for (const plugin of this._strategy.plugins) {\n if (typeof plugin[name] === 'function') {\n const state = this._pluginStateMap.get(plugin);\n const statefulCallback = (param) => {\n const statefulParam = Object.assign(Object.assign({}, param), { state });\n // TODO(philipwalton): not sure why `any` is needed. It seems like\n // this should work with `as WorkboxPluginCallbackParam[C]`.\n return plugin[name](statefulParam);\n };\n yield statefulCallback;\n }\n }\n }\n /**\n * Adds a promise to the\n * [extend lifetime promises]{@link https://w3c.github.io/ServiceWorker/#extendableevent-extend-lifetime-promises}\n * of the event event associated with the request being handled (usually a\n * `FetchEvent`).\n *\n * Note: you can await\n * {@link workbox-strategies.StrategyHandler~doneWaiting}\n * to know when all added promises have settled.\n *\n * @param {Promise} promise A promise to add to the extend lifetime promises\n * of the event that triggered the request.\n */\n waitUntil(promise) {\n this._extendLifetimePromises.push(promise);\n return promise;\n }\n /**\n * Returns a promise that resolves once all promises passed to\n * {@link workbox-strategies.StrategyHandler~waitUntil}\n * have settled.\n *\n * Note: any work done after `doneWaiting()` settles should be manually\n * passed to an event's `waitUntil()` method (not this handler's\n * `waitUntil()` method), otherwise the service worker thread my be killed\n * prior to your work completing.\n */\n async doneWaiting() {\n let promise;\n while ((promise = this._extendLifetimePromises.shift())) {\n await promise;\n }\n }\n /**\n * Stops running the strategy and immediately resolves any pending\n * `waitUntil()` promises.\n */\n destroy() {\n this._handlerDeferred.resolve(null);\n }\n /**\n * This method will call cacheWillUpdate on the available plugins (or use\n * status === 200) to determine if the Response is safe and valid to cache.\n *\n * @param {Request} options.request\n * @param {Response} options.response\n * @return {Promise}\n *\n * @private\n */\n async _ensureResponseSafeToCache(response) {\n let responseToCache = response;\n let pluginsUsed = false;\n for (const callback of this.iterateCallbacks('cacheWillUpdate')) {\n responseToCache =\n (await callback({\n request: this.request,\n response: responseToCache,\n event: this.event,\n })) || undefined;\n pluginsUsed = true;\n if (!responseToCache) {\n break;\n }\n }\n if (!pluginsUsed) {\n if (responseToCache && responseToCache.status !== 200) {\n responseToCache = undefined;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (responseToCache) {\n if (responseToCache.status !== 200) {\n if (responseToCache.status === 0) {\n logger.warn(`The response for '${this.request.url}' ` +\n `is an opaque response. The caching strategy that you're ` +\n `using will not cache opaque responses by default.`);\n }\n else {\n logger.debug(`The response for '${this.request.url}' ` +\n `returned a status code of '${response.status}' and won't ` +\n `be cached as a result.`);\n }\n }\n }\n }\n }\n return responseToCache;\n }\n}\nexport { StrategyHandler };\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Returns a promise that resolves and the passed number of milliseconds.\n * This utility is an async/await-friendly version of `setTimeout`.\n *\n * @param {number} ms\n * @return {Promise}\n * @private\n */\nexport function timeout(ms) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst getFriendlyURL = (url) => {\n const urlObj = new URL(String(url), location.href);\n // See https://github.com/GoogleChrome/workbox/issues/2323\n // We want to include everything, except for the origin if it's same-origin.\n return urlObj.href.replace(new RegExp(`^${location.origin}`), '');\n};\nexport { getFriendlyURL };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from '../_private/logger.js';\nimport { quotaErrorCallbacks } from '../models/quotaErrorCallbacks.js';\nimport '../_version.js';\n/**\n * Runs all of the callback functions, one at a time sequentially, in the order\n * in which they were registered.\n *\n * @memberof workbox-core\n * @private\n */\nasync function executeQuotaErrorCallbacks() {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`About to run ${quotaErrorCallbacks.size} ` +\n `callbacks to clean up caches.`);\n }\n for (const callback of quotaErrorCallbacks) {\n await callback();\n if (process.env.NODE_ENV !== 'production') {\n logger.log(callback, 'is complete.');\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.log('Finished running callbacks.');\n }\n}\nexport { executeQuotaErrorCallbacks };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { copyResponse } from 'workbox-core/copyResponse.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Strategy } from 'workbox-strategies/Strategy.js';\nimport './_version.js';\n/**\n * A {@link workbox-strategies.Strategy} implementation\n * specifically designed to work with\n * {@link workbox-precaching.PrecacheController}\n * to both cache and fetch precached assets.\n *\n * Note: an instance of this class is created automatically when creating a\n * `PrecacheController`; it's generally not necessary to create this yourself.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-precaching\n */\nclass PrecacheStrategy extends Strategy {\n /**\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] Cache name to store and retrieve\n * requests. Defaults to the cache names provided by\n * {@link workbox-core.cacheNames}.\n * @param {Array} [options.plugins] {@link https://developers.google.com/web/tools/workbox/guides/using-plugins|Plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} [options.fetchOptions] Values passed along to the\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters|init}\n * of all fetch() requests made by this strategy.\n * @param {Object} [options.matchOptions] The\n * {@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions|CacheQueryOptions}\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\n * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to\n * get the response from the network if there's a precache miss.\n */\n constructor(options = {}) {\n options.cacheName = cacheNames.getPrecacheName(options.cacheName);\n super(options);\n this._fallbackToNetwork =\n options.fallbackToNetwork === false ? false : true;\n // Redirected responses cannot be used to satisfy a navigation request, so\n // any redirected response must be \"copied\" rather than cloned, so the new\n // response doesn't contain the `redirected` flag. See:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1\n this.plugins.push(PrecacheStrategy.copyRedirectedCacheableResponsesPlugin);\n }\n /**\n * @private\n * @param {Request|string} request A request to run this strategy for.\n * @param {workbox-strategies.StrategyHandler} handler The event that\n * triggered the request.\n * @return {Promise}\n */\n async _handle(request, handler) {\n const response = await handler.cacheMatch(request);\n if (response) {\n return response;\n }\n // If this is an `install` event for an entry that isn't already cached,\n // then populate the cache.\n if (handler.event && handler.event.type === 'install') {\n return await this._handleInstall(request, handler);\n }\n // Getting here means something went wrong. An entry that should have been\n // precached wasn't found in the cache.\n return await this._handleFetch(request, handler);\n }\n async _handleFetch(request, handler) {\n let response;\n const params = (handler.params || {});\n // Fall back to the network if we're configured to do so.\n if (this._fallbackToNetwork) {\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`The precached response for ` +\n `${getFriendlyURL(request.url)} in ${this.cacheName} was not ` +\n `found. Falling back to the network.`);\n }\n const integrityInManifest = params.integrity;\n const integrityInRequest = request.integrity;\n const noIntegrityConflict = !integrityInRequest || integrityInRequest === integrityInManifest;\n response = await handler.fetch(new Request(request, {\n integrity: integrityInRequest || integrityInManifest,\n }));\n // It's only \"safe\" to repair the cache if we're using SRI to guarantee\n // that the response matches the precache manifest's expectations,\n // and there's either a) no integrity property in the incoming request\n // or b) there is an integrity, and it matches the precache manifest.\n // See https://github.com/GoogleChrome/workbox/issues/2858\n if (integrityInManifest && noIntegrityConflict) {\n this._useDefaultCacheabilityPluginIfNeeded();\n const wasCached = await handler.cachePut(request, response.clone());\n if (process.env.NODE_ENV !== 'production') {\n if (wasCached) {\n logger.log(`A response for ${getFriendlyURL(request.url)} ` +\n `was used to \"repair\" the precache.`);\n }\n }\n }\n }\n else {\n // This shouldn't normally happen, but there are edge cases:\n // https://github.com/GoogleChrome/workbox/issues/1441\n throw new WorkboxError('missing-precache-entry', {\n cacheName: this.cacheName,\n url: request.url,\n });\n }\n if (process.env.NODE_ENV !== 'production') {\n const cacheKey = params.cacheKey || (await handler.getCacheKey(request, 'read'));\n // Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Precaching is responding to: ` + getFriendlyURL(request.url));\n logger.log(`Serving the precached url: ${getFriendlyURL(cacheKey instanceof Request ? cacheKey.url : cacheKey)}`);\n logger.groupCollapsed(`View request details here.`);\n logger.log(request);\n logger.groupEnd();\n logger.groupCollapsed(`View response details here.`);\n logger.log(response);\n logger.groupEnd();\n logger.groupEnd();\n }\n return response;\n }\n async _handleInstall(request, handler) {\n this._useDefaultCacheabilityPluginIfNeeded();\n const response = await handler.fetch(request);\n // Make sure we defer cachePut() until after we know the response\n // should be cached; see https://github.com/GoogleChrome/workbox/issues/2737\n const wasCached = await handler.cachePut(request, response.clone());\n if (!wasCached) {\n // Throwing here will lead to the `install` handler failing, which\n // we want to do if *any* of the responses aren't safe to cache.\n throw new WorkboxError('bad-precaching-response', {\n url: request.url,\n status: response.status,\n });\n }\n return response;\n }\n /**\n * This method is complex, as there a number of things to account for:\n *\n * The `plugins` array can be set at construction, and/or it might be added to\n * to at any time before the strategy is used.\n *\n * At the time the strategy is used (i.e. during an `install` event), there\n * needs to be at least one plugin that implements `cacheWillUpdate` in the\n * array, other than `copyRedirectedCacheableResponsesPlugin`.\n *\n * - If this method is called and there are no suitable `cacheWillUpdate`\n * plugins, we need to add `defaultPrecacheCacheabilityPlugin`.\n *\n * - If this method is called and there is exactly one `cacheWillUpdate`, then\n * we don't have to do anything (this might be a previously added\n * `defaultPrecacheCacheabilityPlugin`, or it might be a custom plugin).\n *\n * - If this method is called and there is more than one `cacheWillUpdate`,\n * then we need to check if one is `defaultPrecacheCacheabilityPlugin`. If so,\n * we need to remove it. (This situation is unlikely, but it could happen if\n * the strategy is used multiple times, the first without a `cacheWillUpdate`,\n * and then later on after manually adding a custom `cacheWillUpdate`.)\n *\n * See https://github.com/GoogleChrome/workbox/issues/2737 for more context.\n *\n * @private\n */\n _useDefaultCacheabilityPluginIfNeeded() {\n let defaultPluginIndex = null;\n let cacheWillUpdatePluginCount = 0;\n for (const [index, plugin] of this.plugins.entries()) {\n // Ignore the copy redirected plugin when determining what to do.\n if (plugin === PrecacheStrategy.copyRedirectedCacheableResponsesPlugin) {\n continue;\n }\n // Save the default plugin's index, in case it needs to be removed.\n if (plugin === PrecacheStrategy.defaultPrecacheCacheabilityPlugin) {\n defaultPluginIndex = index;\n }\n if (plugin.cacheWillUpdate) {\n cacheWillUpdatePluginCount++;\n }\n }\n if (cacheWillUpdatePluginCount === 0) {\n this.plugins.push(PrecacheStrategy.defaultPrecacheCacheabilityPlugin);\n }\n else if (cacheWillUpdatePluginCount > 1 && defaultPluginIndex !== null) {\n // Only remove the default plugin; multiple custom plugins are allowed.\n this.plugins.splice(defaultPluginIndex, 1);\n }\n // Nothing needs to be done if cacheWillUpdatePluginCount is 1\n }\n}\nPrecacheStrategy.defaultPrecacheCacheabilityPlugin = {\n async cacheWillUpdate({ response }) {\n if (!response || response.status >= 400) {\n return null;\n }\n return response;\n },\n};\nPrecacheStrategy.copyRedirectedCacheableResponsesPlugin = {\n async cacheWillUpdate({ response }) {\n return response.redirected ? await copyResponse(response) : response;\n },\n};\nexport { PrecacheStrategy };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { StrategyHandler } from './StrategyHandler.js';\nimport './_version.js';\n/**\n * An abstract base class that all other strategy classes must extend from:\n *\n * @memberof workbox-strategies\n */\nclass Strategy {\n /**\n * Creates a new instance of the strategy and sets all documented option\n * properties as public instance properties.\n *\n * Note: if a custom strategy class extends the base Strategy class and does\n * not need more than these properties, it does not need to define its own\n * constructor.\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] Cache name to store and retrieve\n * requests. Defaults to the cache names provided by\n * {@link workbox-core.cacheNames}.\n * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} [options.fetchOptions] Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)\n * `fetch()` requests made by this strategy.\n * @param {Object} [options.matchOptions] The\n * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\n */\n constructor(options = {}) {\n /**\n * Cache name to store and retrieve\n * requests. Defaults to the cache names provided by\n * {@link workbox-core.cacheNames}.\n *\n * @type {string}\n */\n this.cacheName = cacheNames.getRuntimeName(options.cacheName);\n /**\n * The list\n * [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * used by this strategy.\n *\n * @type {Array}\n */\n this.plugins = options.plugins || [];\n /**\n * Values passed along to the\n * [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}\n * of all fetch() requests made by this strategy.\n *\n * @type {Object}\n */\n this.fetchOptions = options.fetchOptions;\n /**\n * The\n * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\n *\n * @type {Object}\n */\n this.matchOptions = options.matchOptions;\n }\n /**\n * Perform a request strategy and returns a `Promise` that will resolve with\n * a `Response`, invoking all relevant plugin callbacks.\n *\n * When a strategy instance is registered with a Workbox\n * {@link workbox-routing.Route}, this method is automatically\n * called when the route matches.\n *\n * Alternatively, this method can be used in a standalone `FetchEvent`\n * listener by passing it to `event.respondWith()`.\n *\n * @param {FetchEvent|Object} options A `FetchEvent` or an object with the\n * properties listed below.\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {ExtendableEvent} options.event The event associated with the\n * request.\n * @param {URL} [options.url]\n * @param {*} [options.params]\n */\n handle(options) {\n const [responseDone] = this.handleAll(options);\n return responseDone;\n }\n /**\n * Similar to {@link workbox-strategies.Strategy~handle}, but\n * instead of just returning a `Promise` that resolves to a `Response` it\n * it will return an tuple of `[response, done]` promises, where the former\n * (`response`) is equivalent to what `handle()` returns, and the latter is a\n * Promise that will resolve once any promises that were added to\n * `event.waitUntil()` as part of performing the strategy have completed.\n *\n * You can await the `done` promise to ensure any extra work performed by\n * the strategy (usually caching responses) completes successfully.\n *\n * @param {FetchEvent|Object} options A `FetchEvent` or an object with the\n * properties listed below.\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {ExtendableEvent} options.event The event associated with the\n * request.\n * @param {URL} [options.url]\n * @param {*} [options.params]\n * @return {Array} A tuple of [response, done]\n * promises that can be used to determine when the response resolves as\n * well as when the handler has completed all its work.\n */\n handleAll(options) {\n // Allow for flexible options to be passed.\n if (options instanceof FetchEvent) {\n options = {\n event: options,\n request: options.request,\n };\n }\n const event = options.event;\n const request = typeof options.request === 'string'\n ? new Request(options.request)\n : options.request;\n const params = 'params' in options ? options.params : undefined;\n const handler = new StrategyHandler(this, { event, request, params });\n const responseDone = this._getResponse(handler, request, event);\n const handlerDone = this._awaitComplete(responseDone, handler, request, event);\n // Return an array of promises, suitable for use with Promise.all().\n return [responseDone, handlerDone];\n }\n async _getResponse(handler, request, event) {\n await handler.runCallbacks('handlerWillStart', { event, request });\n let response = undefined;\n try {\n response = await this._handle(request, handler);\n // The \"official\" Strategy subclasses all throw this error automatically,\n // but in case a third-party Strategy doesn't, ensure that we have a\n // consistent failure when there's no response or an error response.\n if (!response || response.type === 'error') {\n throw new WorkboxError('no-response', { url: request.url });\n }\n }\n catch (error) {\n if (error instanceof Error) {\n for (const callback of handler.iterateCallbacks('handlerDidError')) {\n response = await callback({ error, event, request });\n if (response) {\n break;\n }\n }\n }\n if (!response) {\n throw error;\n }\n else if (process.env.NODE_ENV !== 'production') {\n logger.log(`While responding to '${getFriendlyURL(request.url)}', ` +\n `an ${error instanceof Error ? error.toString() : ''} error occurred. Using a fallback response provided by ` +\n `a handlerDidError plugin.`);\n }\n }\n for (const callback of handler.iterateCallbacks('handlerWillRespond')) {\n response = await callback({ event, request, response });\n }\n return response;\n }\n async _awaitComplete(responseDone, handler, request, event) {\n let response;\n let error;\n try {\n response = await responseDone;\n }\n catch (error) {\n // Ignore errors, as response errors should be caught via the `response`\n // promise above. The `done` promise will only throw for errors in\n // promises passed to `handler.waitUntil()`.\n }\n try {\n await handler.runCallbacks('handlerDidRespond', {\n event,\n request,\n response,\n });\n await handler.doneWaiting();\n }\n catch (waitUntilError) {\n if (waitUntilError instanceof Error) {\n error = waitUntilError;\n }\n }\n await handler.runCallbacks('handlerDidComplete', {\n event,\n request,\n response,\n error: error,\n });\n handler.destroy();\n if (error) {\n throw error;\n }\n }\n}\nexport { Strategy };\n/**\n * Classes extending the `Strategy` based class should implement this method,\n * and leverage the {@link workbox-strategies.StrategyHandler}\n * arg to perform all fetching and cache logic, which will ensure all relevant\n * cache, cache options, fetch options and plugins are used (per the current\n * strategy instance).\n *\n * @name _handle\n * @instance\n * @abstract\n * @function\n * @param {Request} request\n * @param {workbox-strategies.StrategyHandler} handler\n * @return {Promise}\n *\n * @memberof workbox-strategies.Strategy\n */\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { waitUntil } from 'workbox-core/_private/waitUntil.js';\nimport { createCacheKey } from './utils/createCacheKey.js';\nimport { PrecacheInstallReportPlugin } from './utils/PrecacheInstallReportPlugin.js';\nimport { PrecacheCacheKeyPlugin } from './utils/PrecacheCacheKeyPlugin.js';\nimport { printCleanupDetails } from './utils/printCleanupDetails.js';\nimport { printInstallDetails } from './utils/printInstallDetails.js';\nimport { PrecacheStrategy } from './PrecacheStrategy.js';\nimport './_version.js';\n/**\n * Performs efficient precaching of assets.\n *\n * @memberof workbox-precaching\n */\nclass PrecacheController {\n /**\n * Create a new PrecacheController.\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] The cache to use for precaching.\n * @param {string} [options.plugins] Plugins to use when precaching as well\n * as responding to fetch events for precached assets.\n * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to\n * get the response from the network if there's a precache miss.\n */\n constructor({ cacheName, plugins = [], fallbackToNetwork = true, } = {}) {\n this._urlsToCacheKeys = new Map();\n this._urlsToCacheModes = new Map();\n this._cacheKeysToIntegrities = new Map();\n this._strategy = new PrecacheStrategy({\n cacheName: cacheNames.getPrecacheName(cacheName),\n plugins: [\n ...plugins,\n new PrecacheCacheKeyPlugin({ precacheController: this }),\n ],\n fallbackToNetwork,\n });\n // Bind the install and activate methods to the instance.\n this.install = this.install.bind(this);\n this.activate = this.activate.bind(this);\n }\n /**\n * @type {workbox-precaching.PrecacheStrategy} The strategy created by this controller and\n * used to cache assets and respond to fetch events.\n */\n get strategy() {\n return this._strategy;\n }\n /**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * {@link workbox-core.cacheNames|\"precache cache\"} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * @param {Array} [entries=[]] Array of entries to precache.\n */\n precache(entries) {\n this.addToCacheList(entries);\n if (!this._installAndActiveListenersAdded) {\n self.addEventListener('install', this.install);\n self.addEventListener('activate', this.activate);\n this._installAndActiveListenersAdded = true;\n }\n }\n /**\n * This method will add items to the precache list, removing duplicates\n * and ensuring the information is valid.\n *\n * @param {Array} entries\n * Array of entries to precache.\n */\n addToCacheList(entries) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isArray(entries, {\n moduleName: 'workbox-precaching',\n className: 'PrecacheController',\n funcName: 'addToCacheList',\n paramName: 'entries',\n });\n }\n const urlsToWarnAbout = [];\n for (const entry of entries) {\n // See https://github.com/GoogleChrome/workbox/issues/2259\n if (typeof entry === 'string') {\n urlsToWarnAbout.push(entry);\n }\n else if (entry && entry.revision === undefined) {\n urlsToWarnAbout.push(entry.url);\n }\n const { cacheKey, url } = createCacheKey(entry);\n const cacheMode = typeof entry !== 'string' && entry.revision ? 'reload' : 'default';\n if (this._urlsToCacheKeys.has(url) &&\n this._urlsToCacheKeys.get(url) !== cacheKey) {\n throw new WorkboxError('add-to-cache-list-conflicting-entries', {\n firstEntry: this._urlsToCacheKeys.get(url),\n secondEntry: cacheKey,\n });\n }\n if (typeof entry !== 'string' && entry.integrity) {\n if (this._cacheKeysToIntegrities.has(cacheKey) &&\n this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) {\n throw new WorkboxError('add-to-cache-list-conflicting-integrities', {\n url,\n });\n }\n this._cacheKeysToIntegrities.set(cacheKey, entry.integrity);\n }\n this._urlsToCacheKeys.set(url, cacheKey);\n this._urlsToCacheModes.set(url, cacheMode);\n if (urlsToWarnAbout.length > 0) {\n const warningMessage = `Workbox is precaching URLs without revision ` +\n `info: ${urlsToWarnAbout.join(', ')}\\nThis is generally NOT safe. ` +\n `Learn more at https://bit.ly/wb-precache`;\n if (process.env.NODE_ENV === 'production') {\n // Use console directly to display this warning without bloating\n // bundle sizes by pulling in all of the logger codebase in prod.\n console.warn(warningMessage);\n }\n else {\n logger.warn(warningMessage);\n }\n }\n }\n }\n /**\n * Precaches new and updated assets. Call this method from the service worker\n * install event.\n *\n * Note: this method calls `event.waitUntil()` for you, so you do not need\n * to call it yourself in your event handlers.\n *\n * @param {ExtendableEvent} event\n * @return {Promise}\n */\n install(event) {\n // waitUntil returns Promise\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return waitUntil(event, async () => {\n const installReportPlugin = new PrecacheInstallReportPlugin();\n this.strategy.plugins.push(installReportPlugin);\n // Cache entries one at a time.\n // See https://github.com/GoogleChrome/workbox/issues/2528\n for (const [url, cacheKey] of this._urlsToCacheKeys) {\n const integrity = this._cacheKeysToIntegrities.get(cacheKey);\n const cacheMode = this._urlsToCacheModes.get(url);\n const request = new Request(url, {\n integrity,\n cache: cacheMode,\n credentials: 'same-origin',\n });\n await Promise.all(this.strategy.handleAll({\n params: { cacheKey },\n request,\n event,\n }));\n }\n const { updatedURLs, notUpdatedURLs } = installReportPlugin;\n if (process.env.NODE_ENV !== 'production') {\n printInstallDetails(updatedURLs, notUpdatedURLs);\n }\n return { updatedURLs, notUpdatedURLs };\n });\n }\n /**\n * Deletes assets that are no longer present in the current precache manifest.\n * Call this method from the service worker activate event.\n *\n * Note: this method calls `event.waitUntil()` for you, so you do not need\n * to call it yourself in your event handlers.\n *\n * @param {ExtendableEvent} event\n * @return {Promise}\n */\n activate(event) {\n // waitUntil returns Promise\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return waitUntil(event, async () => {\n const cache = await self.caches.open(this.strategy.cacheName);\n const currentlyCachedRequests = await cache.keys();\n const expectedCacheKeys = new Set(this._urlsToCacheKeys.values());\n const deletedURLs = [];\n for (const request of currentlyCachedRequests) {\n if (!expectedCacheKeys.has(request.url)) {\n await cache.delete(request);\n deletedURLs.push(request.url);\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n printCleanupDetails(deletedURLs);\n }\n return { deletedURLs };\n });\n }\n /**\n * Returns a mapping of a precached URL to the corresponding cache key, taking\n * into account the revision information for the URL.\n *\n * @return {Map} A URL to cache key mapping.\n */\n getURLsToCacheKeys() {\n return this._urlsToCacheKeys;\n }\n /**\n * Returns a list of all the URLs that have been precached by the current\n * service worker.\n *\n * @return {Array} The precached URLs.\n */\n getCachedURLs() {\n return [...this._urlsToCacheKeys.keys()];\n }\n /**\n * Returns the cache key used for storing a given URL. If that URL is\n * unversioned, like `/index.html', then the cache key will be the original\n * URL with a search parameter appended to it.\n *\n * @param {string} url A URL whose cache key you want to look up.\n * @return {string} The versioned URL that corresponds to a cache key\n * for the original URL, or undefined if that URL isn't precached.\n */\n getCacheKeyForURL(url) {\n const urlObject = new URL(url, location.href);\n return this._urlsToCacheKeys.get(urlObject.href);\n }\n /**\n * @param {string} url A cache key whose SRI you want to look up.\n * @return {string} The subresource integrity associated with the cache key,\n * or undefined if it's not set.\n */\n getIntegrityForCacheKey(cacheKey) {\n return this._cacheKeysToIntegrities.get(cacheKey);\n }\n /**\n * This acts as a drop-in replacement for\n * [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)\n * with the following differences:\n *\n * - It knows what the name of the precache is, and only checks in that cache.\n * - It allows you to pass in an \"original\" URL without versioning parameters,\n * and it will automatically look up the correct cache key for the currently\n * active revision of that URL.\n *\n * E.g., `matchPrecache('index.html')` will find the correct precached\n * response for the currently active service worker, even if the actual cache\n * key is `'/index.html?__WB_REVISION__=1234abcd'`.\n *\n * @param {string|Request} request The key (without revisioning parameters)\n * to look up in the precache.\n * @return {Promise}\n */\n async matchPrecache(request) {\n const url = request instanceof Request ? request.url : request;\n const cacheKey = this.getCacheKeyForURL(url);\n if (cacheKey) {\n const cache = await self.caches.open(this.strategy.cacheName);\n return cache.match(cacheKey);\n }\n return undefined;\n }\n /**\n * Returns a function that looks up `url` in the precache (taking into\n * account revision information), and returns the corresponding `Response`.\n *\n * @param {string} url The precached URL which will be used to lookup the\n * `Response`.\n * @return {workbox-routing~handlerCallback}\n */\n createHandlerBoundToURL(url) {\n const cacheKey = this.getCacheKeyForURL(url);\n if (!cacheKey) {\n throw new WorkboxError('non-precached-url', { url });\n }\n return (options) => {\n options.request = new Request(url);\n options.params = Object.assign({ cacheKey }, options.params);\n return this.strategy.handle(options);\n };\n }\n}\nexport { PrecacheController };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { PrecacheController } from '../PrecacheController.js';\nimport '../_version.js';\nlet precacheController;\n/**\n * @return {PrecacheController}\n * @private\n */\nexport const getOrCreatePrecacheController = () => {\n if (!precacheController) {\n precacheController = new PrecacheController();\n }\n return precacheController;\n};\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { Route } from 'workbox-routing/Route.js';\nimport { generateURLVariations } from './utils/generateURLVariations.js';\nimport './_version.js';\n/**\n * A subclass of {@link workbox-routing.Route} that takes a\n * {@link workbox-precaching.PrecacheController}\n * instance and uses it to match incoming requests and handle fetching\n * responses from the precache.\n *\n * @memberof workbox-precaching\n * @extends workbox-routing.Route\n */\nclass PrecacheRoute extends Route {\n /**\n * @param {PrecacheController} precacheController A `PrecacheController`\n * instance used to both match requests and respond to fetch events.\n * @param {Object} [options] Options to control how requests are matched\n * against the list of precached URLs.\n * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will\n * check cache entries for a URLs ending with '/' to see if there is a hit when\n * appending the `directoryIndex` value.\n * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/, /^fbclid$/]] An\n * array of regex's to remove search params when looking for a cache match.\n * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n * check the cache for the URL with a `.html` added to the end of the end.\n * @param {workbox-precaching~urlManipulation} [options.urlManipulation]\n * This is a function that should take a URL and return an array of\n * alternative URLs that should be checked for precache matches.\n */\n constructor(precacheController, options) {\n const match = ({ request, }) => {\n const urlsToCacheKeys = precacheController.getURLsToCacheKeys();\n for (const possibleURL of generateURLVariations(request.url, options)) {\n const cacheKey = urlsToCacheKeys.get(possibleURL);\n if (cacheKey) {\n const integrity = precacheController.getIntegrityForCacheKey(cacheKey);\n return { cacheKey, integrity };\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Precaching did not find a match for ` + getFriendlyURL(request.url));\n }\n return;\n };\n super(match, precacheController.strategy);\n }\n}\nexport { PrecacheRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { removeIgnoredSearchParams } from './removeIgnoredSearchParams.js';\nimport '../_version.js';\n/**\n * Generator function that yields possible variations on the original URL to\n * check, one at a time.\n *\n * @param {string} url\n * @param {Object} options\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function* generateURLVariations(url, { ignoreURLParametersMatching = [/^utm_/, /^fbclid$/], directoryIndex = 'index.html', cleanURLs = true, urlManipulation, } = {}) {\n const urlObject = new URL(url, location.href);\n urlObject.hash = '';\n yield urlObject.href;\n const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching);\n yield urlWithoutIgnoredParams.href;\n if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) {\n const directoryURL = new URL(urlWithoutIgnoredParams.href);\n directoryURL.pathname += directoryIndex;\n yield directoryURL.href;\n }\n if (cleanURLs) {\n const cleanURL = new URL(urlWithoutIgnoredParams.href);\n cleanURL.pathname += '.html';\n yield cleanURL.href;\n }\n if (urlManipulation) {\n const additionalURLs = urlManipulation({ url: urlObject });\n for (const urlToAttempt of additionalURLs) {\n yield urlToAttempt.href;\n }\n }\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Removes any URL search parameters that should be ignored.\n *\n * @param {URL} urlObject The original URL.\n * @param {Array} ignoreURLParametersMatching RegExps to test against\n * each search parameter name. Matches mean that the search parameter should be\n * ignored.\n * @return {URL} The URL with any ignored search parameters removed.\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) {\n // Convert the iterable into an array at the start of the loop to make sure\n // deletion doesn't mess up iteration.\n for (const paramName of [...urlObject.searchParams.keys()]) {\n if (ignoreURLParametersMatching.some((regExp) => regExp.test(paramName))) {\n urlObject.searchParams.delete(paramName);\n }\n }\n return urlObject;\n}\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { registerRoute } from 'workbox-routing/registerRoute.js';\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport { PrecacheRoute } from './PrecacheRoute.js';\nimport './_version.js';\n/**\n * Add a `fetch` listener to the service worker that will\n * respond to\n * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}\n * with precached assets.\n *\n * Requests for assets that aren't precached, the `FetchEvent` will not be\n * responded to, allowing the event to fall through to other `fetch` event\n * listeners.\n *\n * @param {Object} [options] See the {@link workbox-precaching.PrecacheRoute}\n * options.\n *\n * @memberof workbox-precaching\n */\nfunction addRoute(options) {\n const precacheController = getOrCreatePrecacheController();\n const precacheRoute = new PrecacheRoute(precacheController, options);\n registerRoute(precacheRoute);\n}\nexport { addRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Route } from './Route.js';\nimport { RegExpRoute } from './RegExpRoute.js';\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * Easily register a RegExp, string, or function with a caching\n * strategy to a singleton Router instance.\n *\n * This method will generate a Route for you if needed and\n * call {@link workbox-routing.Router#registerRoute}.\n *\n * @param {RegExp|string|workbox-routing.Route~matchCallback|workbox-routing.Route} capture\n * If the capture param is a `Route`, all other arguments will be ignored.\n * @param {workbox-routing~handlerCallback} [handler] A callback\n * function that returns a Promise resulting in a Response. This parameter\n * is required if `capture` is not a `Route` object.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n * @return {workbox-routing.Route} The generated `Route`.\n *\n * @memberof workbox-routing\n */\nfunction registerRoute(capture, handler, method) {\n let route;\n if (typeof capture === 'string') {\n const captureUrl = new URL(capture, location.href);\n if (process.env.NODE_ENV !== 'production') {\n if (!(capture.startsWith('/') || capture.startsWith('http'))) {\n throw new WorkboxError('invalid-string', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n // We want to check if Express-style wildcards are in the pathname only.\n // TODO: Remove this log message in v4.\n const valueToCheck = capture.startsWith('http')\n ? captureUrl.pathname\n : capture;\n // See https://github.com/pillarjs/path-to-regexp#parameters\n const wildcards = '[*:?+]';\n if (new RegExp(`${wildcards}`).exec(valueToCheck)) {\n logger.debug(`The '$capture' parameter contains an Express-style wildcard ` +\n `character (${wildcards}). Strings are now always interpreted as ` +\n `exact matches; use a RegExp for partial or wildcard matches.`);\n }\n }\n const matchCallback = ({ url }) => {\n if (process.env.NODE_ENV !== 'production') {\n if (url.pathname === captureUrl.pathname &&\n url.origin !== captureUrl.origin) {\n logger.debug(`${capture} only partially matches the cross-origin URL ` +\n `${url.toString()}. This route will only handle cross-origin requests ` +\n `if they match the entire URL.`);\n }\n }\n return url.href === captureUrl.href;\n };\n // If `capture` is a string then `handler` and `method` must be present.\n route = new Route(matchCallback, handler, method);\n }\n else if (capture instanceof RegExp) {\n // If `capture` is a `RegExp` then `handler` and `method` must be present.\n route = new RegExpRoute(capture, handler, method);\n }\n else if (typeof capture === 'function') {\n // If `capture` is a function then `handler` and `method` must be present.\n route = new Route(capture, handler, method);\n }\n else if (capture instanceof Route) {\n route = capture;\n }\n else {\n throw new WorkboxError('unsupported-route-type', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n const defaultRouter = getOrCreateDefaultRouter();\n defaultRouter.registerRoute(route);\n return route;\n}\nexport { registerRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { deleteOutdatedCaches } from './utils/deleteOutdatedCaches.js';\nimport './_version.js';\n/**\n * Adds an `activate` event listener which will clean up incompatible\n * precaches that were created by older versions of Workbox.\n *\n * @memberof workbox-precaching\n */\nfunction cleanupOutdatedCaches() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('activate', ((event) => {\n const cacheName = cacheNames.getPrecacheName();\n event.waitUntil(deleteOutdatedCaches(cacheName).then((cachesDeleted) => {\n if (process.env.NODE_ENV !== 'production') {\n if (cachesDeleted.length > 0) {\n logger.log(`The following out-of-date precaches were cleaned up ` +\n `automatically:`, cachesDeleted);\n }\n }\n }));\n }));\n}\nexport { cleanupOutdatedCaches };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst SUBSTRING_TO_FIND = '-precache-';\n/**\n * Cleans up incompatible precaches that were created by older versions of\n * Workbox, by a service worker registered under the current scope.\n *\n * This is meant to be called as part of the `activate` event.\n *\n * This should be safe to use as long as you don't include `substringToFind`\n * (defaulting to `-precache-`) in your non-precache cache names.\n *\n * @param {string} currentPrecacheName The cache name currently in use for\n * precaching. This cache won't be deleted.\n * @param {string} [substringToFind='-precache-'] Cache names which include this\n * substring will be deleted (excluding `currentPrecacheName`).\n * @return {Array} A list of all the cache names that were deleted.\n *\n * @private\n * @memberof workbox-precaching\n */\nconst deleteOutdatedCaches = async (currentPrecacheName, substringToFind = SUBSTRING_TO_FIND) => {\n const cacheNames = await self.caches.keys();\n const cacheNamesToDelete = cacheNames.filter((cacheName) => {\n return (cacheName.includes(substringToFind) &&\n cacheName.includes(self.registration.scope) &&\n cacheName !== currentPrecacheName);\n });\n await Promise.all(cacheNamesToDelete.map((cacheName) => self.caches.delete(cacheName)));\n return cacheNamesToDelete;\n};\nexport { deleteOutdatedCaches };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { addRoute } from './addRoute.js';\nimport { precache } from './precache.js';\nimport './_version.js';\n/**\n * This method will add entries to the precache list and add a route to\n * respond to fetch events.\n *\n * This is a convenience method that will call\n * {@link workbox-precaching.precache} and\n * {@link workbox-precaching.addRoute} in a single call.\n *\n * @param {Array} entries Array of entries to precache.\n * @param {Object} [options] See the\n * {@link workbox-precaching.PrecacheRoute} options.\n *\n * @memberof workbox-precaching\n */\nfunction precacheAndRoute(entries, options) {\n precache(entries);\n addRoute(options);\n}\nexport { precacheAndRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * {@link workbox-core.cacheNames|\"precache cache\"} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * Please note: This method **will not** serve any of the cached files for you.\n * It only precaches files. To respond to a network request you call\n * {@link workbox-precaching.addRoute}.\n *\n * If you have a single array of files to precache, you can just call\n * {@link workbox-precaching.precacheAndRoute}.\n *\n * @param {Array} [entries=[]] Array of entries to precache.\n *\n * @memberof workbox-precaching\n */\nfunction precache(entries) {\n const precacheController = getOrCreatePrecacheController();\n precacheController.precache(entries);\n}\nexport { precache };\n"],"names":["self","_","e","messageGenerator","code","args","msg","length","JSON","stringify","WorkboxError","Error","constructor","errorCode","details","super","this","name","normalizeHandler","handler","handle","Route","match","method","setCatchHandler","catchHandler","RegExpRoute","regExp","url","result","exec","href","origin","location","index","slice","Router","_routes","Map","_defaultHandlerMap","routes","addFetchListener","addEventListener","event","request","responsePromise","handleRequest","respondWith","addCacheListener","data","type","payload","requestPromises","Promise","all","urlsToCache","map","entry","Request","waitUntil","ports","then","postMessage","URL","protocol","startsWith","sameOrigin","params","route","findMatchingRoute","has","get","err","reject","_catchHandler","catch","async","catchErr","matchResult","Array","isArray","Object","keys","undefined","setDefaultHandler","set","registerRoute","push","unregisterRoute","routeIndex","indexOf","splice","defaultRouter","_cacheNameDetails","googleAnalytics","precache","prefix","runtime","suffix","registration","scope","_createCacheName","cacheName","filter","value","join","cacheNames","userCacheName","asyncFn","returnPromise","createCacheKey","urlObject","cacheKey","revision","cacheKeyURL","originalURL","searchParams","PrecacheInstallReportPlugin","updatedURLs","notUpdatedURLs","handlerWillStart","state","originalRequest","cachedResponseWillBeUsed","cachedResponse","PrecacheCacheKeyPlugin","precacheController","cacheKeyWillBeUsed","_precacheController","getCacheKeyForURL","headers","supportStatus","copyResponse","response","modifier","clonedResponse","clone","responseInit","Headers","status","statusText","modifiedResponseInit","body","testResponse","Response","error","canConstructResponseFromBodyStream","blob","stripParams","fullURL","ignoreParams","strippedURL","param","delete","Deferred","promise","resolve","quotaErrorCallbacks","Set","toRequest","input","StrategyHandler","strategy","options","_cacheKeys","assign","_strategy","_handlerDeferred","_extendLifetimePromises","_plugins","plugins","_pluginStateMap","plugin","mode","FetchEvent","preloadResponse","possiblePreloadResponse","hasCallback","cb","iterateCallbacks","thrownErrorMessage","message","pluginFilteredRequest","fetchResponse","fetch","fetchOptions","callback","runCallbacks","responseClone","cachePut","key","matchOptions","effectiveRequest","getCacheKey","multiMatchOptions","caches","ms","setTimeout","String","replace","RegExp","responseToCache","_ensureResponseSafeToCache","cache","open","hasCacheUpdateCallback","oldResponse","strippedRequestURL","keysOptions","ignoreSearch","cacheKeys","cacheMatchIgnoreParams","put","executeQuotaErrorCallbacks","newResponse","statefulCallback","statefulParam","shift","destroy","pluginsUsed","PrecacheStrategy","responseDone","handleAll","_getResponse","_awaitComplete","_handle","doneWaiting","waitUntilError","_fallbackToNetwork","fallbackToNetwork","copyRedirectedCacheableResponsesPlugin","cacheMatch","_handleInstall","_handleFetch","integrityInManifest","integrity","integrityInRequest","noIntegrityConflict","_useDefaultCacheabilityPluginIfNeeded","defaultPluginIndex","cacheWillUpdatePluginCount","entries","defaultPrecacheCacheabilityPlugin","cacheWillUpdate","redirected","PrecacheController","_urlsToCacheKeys","_urlsToCacheModes","_cacheKeysToIntegrities","install","bind","activate","addToCacheList","_installAndActiveListenersAdded","urlsToWarnAbout","cacheMode","firstEntry","secondEntry","warningMessage","console","warn","installReportPlugin","credentials","currentlyCachedRequests","expectedCacheKeys","values","deletedURLs","getURLsToCacheKeys","getCachedURLs","getIntegrityForCacheKey","createHandlerBoundToURL","getOrCreatePrecacheController","PrecacheRoute","urlsToCacheKeys","possibleURL","ignoreURLParametersMatching","directoryIndex","cleanURLs","urlManipulation","hash","urlWithoutIgnoredParams","paramName","some","test","removeIgnoredSearchParams","pathname","endsWith","directoryURL","cleanURL","additionalURLs","urlToAttempt","generateURLVariations","addRoute","capture","captureUrl","moduleName","funcName","currentPrecacheName","substringToFind","cacheNamesToDelete","includes","deleteOutdatedCaches","cachesDeleted"],"mappings":"6CAEA,IACIA,KAAK,uBAAyBC,GAExB,CAAV,MAAOC,GAAG,C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AAclJ,EAAoBqC,GAE/D,yBEZD,WAEInK,KAAK0C,iBAAiB,YAAcC,IAChC,MAAM2D,EAAYI,IAClB/D,EAAMgB,UCMeiB,OAAO6N,EAAqBC,EAnB/B,gBAoBtB,MACMC,SADmB3S,KAAKmM,OAAOjH,QACCqB,QAAQD,GAClCA,EAAUsM,SAASF,IACvBpM,EAAUsM,SAAS5S,KAAKmG,aAAaC,QACrCE,IAAcmM,IAGtB,aADMpP,QAAQC,IAAIqP,EAAmBnP,KAAK8C,GAActG,KAAKmM,OAAO1C,OAAOnD,MACpEqM,CAAP,EDdoBE,CAAqBvM,GAAWzC,MAAMiP,QAAtD,GASP,qBEND,SAA0B7D,EAAS9E,ICInC,SAAkB8E,GACa8B,IACRhL,SAASkJ,EAC/B,CDNGlJ,CAASkJ,GACTmD,EAASjI,EACZ"} \ No newline at end of file +{"version":3,"file":"workbox-f065e1a2.js","sources":["node_modules/workbox-core/_version.js","node_modules/workbox-core/_private/logger.js","node_modules/workbox-core/models/messages/messageGenerator.js","node_modules/workbox-core/_private/WorkboxError.js","node_modules/workbox-routing/_version.js","node_modules/workbox-routing/utils/constants.js","node_modules/workbox-routing/utils/normalizeHandler.js","node_modules/workbox-routing/Route.js","node_modules/workbox-routing/RegExpRoute.js","node_modules/workbox-routing/Router.js","node_modules/workbox-routing/utils/getOrCreateDefaultRouter.js","node_modules/workbox-core/_private/cacheNames.js","node_modules/workbox-core/_private/waitUntil.js","node_modules/workbox-precaching/_version.js","node_modules/workbox-precaching/utils/createCacheKey.js","node_modules/workbox-precaching/utils/PrecacheInstallReportPlugin.js","node_modules/workbox-precaching/utils/PrecacheCacheKeyPlugin.js","node_modules/workbox-core/_private/canConstructResponseFromBodyStream.js","node_modules/workbox-core/copyResponse.js","node_modules/workbox-core/_private/cacheMatchIgnoreParams.js","node_modules/workbox-core/_private/Deferred.js","node_modules/workbox-core/models/quotaErrorCallbacks.js","node_modules/workbox-strategies/_version.js","node_modules/workbox-strategies/StrategyHandler.js","node_modules/workbox-core/_private/timeout.js","node_modules/workbox-core/_private/getFriendlyURL.js","node_modules/workbox-core/_private/executeQuotaErrorCallbacks.js","node_modules/workbox-precaching/PrecacheStrategy.js","node_modules/workbox-strategies/Strategy.js","node_modules/workbox-precaching/PrecacheController.js","node_modules/workbox-precaching/utils/getOrCreatePrecacheController.js","node_modules/workbox-precaching/PrecacheRoute.js","node_modules/workbox-precaching/utils/generateURLVariations.js","node_modules/workbox-precaching/utils/removeIgnoredSearchParams.js","node_modules/workbox-precaching/addRoute.js","node_modules/workbox-routing/registerRoute.js","node_modules/workbox-precaching/cleanupOutdatedCaches.js","node_modules/workbox-precaching/utils/deleteOutdatedCaches.js","node_modules/workbox-precaching/precacheAndRoute.js","node_modules/workbox-precaching/precache.js"],"sourcesContent":["\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:core:6.5.2'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst logger = (process.env.NODE_ENV === 'production'\n ? null\n : (() => {\n // Don't overwrite this value if it's already set.\n // See https://github.com/GoogleChrome/workbox/pull/2284#issuecomment-560470923\n if (!('__WB_DISABLE_DEV_LOGS' in self)) {\n self.__WB_DISABLE_DEV_LOGS = false;\n }\n let inGroup = false;\n const methodToColorMap = {\n debug: `#7f8c8d`,\n log: `#2ecc71`,\n warn: `#f39c12`,\n error: `#c0392b`,\n groupCollapsed: `#3498db`,\n groupEnd: null, // No colored prefix on groupEnd\n };\n const print = function (method, args) {\n if (self.__WB_DISABLE_DEV_LOGS) {\n return;\n }\n if (method === 'groupCollapsed') {\n // Safari doesn't print all console.groupCollapsed() arguments:\n // https://bugs.webkit.org/show_bug.cgi?id=182754\n if (/^((?!chrome|android).)*safari/i.test(navigator.userAgent)) {\n console[method](...args);\n return;\n }\n }\n const styles = [\n `background: ${methodToColorMap[method]}`,\n `border-radius: 0.5em`,\n `color: white`,\n `font-weight: bold`,\n `padding: 2px 0.5em`,\n ];\n // When in a group, the workbox prefix is not displayed.\n const logPrefix = inGroup ? [] : ['%cworkbox', styles.join(';')];\n console[method](...logPrefix, ...args);\n if (method === 'groupCollapsed') {\n inGroup = true;\n }\n if (method === 'groupEnd') {\n inGroup = false;\n }\n };\n // eslint-disable-next-line @typescript-eslint/ban-types\n const api = {};\n const loggerMethods = Object.keys(methodToColorMap);\n for (const key of loggerMethods) {\n const method = key;\n api[method] = (...args) => {\n print(method, args);\n };\n }\n return api;\n })());\nexport { logger };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messages } from './messages.js';\nimport '../../_version.js';\nconst fallback = (code, ...args) => {\n let msg = code;\n if (args.length > 0) {\n msg += ` :: ${JSON.stringify(args)}`;\n }\n return msg;\n};\nconst generatorFunction = (code, details = {}) => {\n const message = messages[code];\n if (!message) {\n throw new Error(`Unable to find message for code '${code}'.`);\n }\n return message(details);\n};\nexport const messageGenerator = process.env.NODE_ENV === 'production' ? fallback : generatorFunction;\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { messageGenerator } from '../models/messages/messageGenerator.js';\nimport '../_version.js';\n/**\n * Workbox errors should be thrown with this class.\n * This allows use to ensure the type easily in tests,\n * helps developers identify errors from workbox\n * easily and allows use to optimise error\n * messages correctly.\n *\n * @private\n */\nclass WorkboxError extends Error {\n /**\n *\n * @param {string} errorCode The error code that\n * identifies this particular error.\n * @param {Object=} details Any relevant arguments\n * that will help developers identify issues should\n * be added as a key on the context object.\n */\n constructor(errorCode, details) {\n const message = messageGenerator(errorCode, details);\n super(message);\n this.name = errorCode;\n this.details = details;\n }\n}\nexport { WorkboxError };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:routing:6.5.2'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The default HTTP method, 'GET', used when there's no specific method\n * configured for a route.\n *\n * @type {string}\n *\n * @private\n */\nexport const defaultMethod = 'GET';\n/**\n * The list of valid HTTP methods associated with requests that could be routed.\n *\n * @type {Array}\n *\n * @private\n */\nexport const validMethods = [\n 'DELETE',\n 'GET',\n 'HEAD',\n 'PATCH',\n 'POST',\n 'PUT',\n];\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport '../_version.js';\n/**\n * @param {function()|Object} handler Either a function, or an object with a\n * 'handle' method.\n * @return {Object} An object with a handle method.\n *\n * @private\n */\nexport const normalizeHandler = (handler) => {\n if (handler && typeof handler === 'object') {\n if (process.env.NODE_ENV !== 'production') {\n assert.hasMethod(handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return handler;\n }\n else {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(handler, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'handler',\n });\n }\n return { handle: handler };\n }\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { defaultMethod, validMethods } from './utils/constants.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport './_version.js';\n/**\n * A `Route` consists of a pair of callback functions, \"match\" and \"handler\".\n * The \"match\" callback determine if a route should be used to \"handle\" a\n * request by returning a non-falsy value if it can. The \"handler\" callback\n * is called when there is a match and should return a Promise that resolves\n * to a `Response`.\n *\n * @memberof workbox-routing\n */\nclass Route {\n /**\n * Constructor for Route class.\n *\n * @param {workbox-routing~matchCallback} match\n * A callback function that determines whether the route matches a given\n * `fetch` event by returning a non-falsy value.\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resolving to a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(match, handler, method = defaultMethod) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(match, 'function', {\n moduleName: 'workbox-routing',\n className: 'Route',\n funcName: 'constructor',\n paramName: 'match',\n });\n if (method) {\n assert.isOneOf(method, validMethods, { paramName: 'method' });\n }\n }\n // These values are referenced directly by Router so cannot be\n // altered by minificaton.\n this.handler = normalizeHandler(handler);\n this.match = match;\n this.method = method;\n }\n /**\n *\n * @param {workbox-routing-handlerCallback} handler A callback\n * function that returns a Promise resolving to a Response\n */\n setCatchHandler(handler) {\n this.catchHandler = normalizeHandler(handler);\n }\n}\nexport { Route };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { Route } from './Route.js';\nimport './_version.js';\n/**\n * RegExpRoute makes it easy to create a regular expression based\n * {@link workbox-routing.Route}.\n *\n * For same-origin requests the RegExp only needs to match part of the URL. For\n * requests against third-party servers, you must define a RegExp that matches\n * the start of the URL.\n *\n * @memberof workbox-routing\n * @extends workbox-routing.Route\n */\nclass RegExpRoute extends Route {\n /**\n * If the regular expression contains\n * [capture groups]{@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp#grouping-back-references},\n * the captured values will be passed to the\n * {@link workbox-routing~handlerCallback} `params`\n * argument.\n *\n * @param {RegExp} regExp The regular expression to match against URLs.\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n */\n constructor(regExp, handler, method) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(regExp, RegExp, {\n moduleName: 'workbox-routing',\n className: 'RegExpRoute',\n funcName: 'constructor',\n paramName: 'pattern',\n });\n }\n const match = ({ url }) => {\n const result = regExp.exec(url.href);\n // Return immediately if there's no match.\n if (!result) {\n return;\n }\n // Require that the match start at the first character in the URL string\n // if it's a cross-origin request.\n // See https://github.com/GoogleChrome/workbox/issues/281 for the context\n // behind this behavior.\n if (url.origin !== location.origin && result.index !== 0) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`The regular expression '${regExp.toString()}' only partially matched ` +\n `against the cross-origin URL '${url.toString()}'. RegExpRoute's will only ` +\n `handle cross-origin requests if they match the entire URL.`);\n }\n return;\n }\n // If the route matches, but there aren't any capture groups defined, then\n // this will return [], which is truthy and therefore sufficient to\n // indicate a match.\n // If there are capture groups, then it will return their values.\n return result.slice(1);\n };\n super(match, handler, method);\n }\n}\nexport { RegExpRoute };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { defaultMethod } from './utils/constants.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { normalizeHandler } from './utils/normalizeHandler.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport './_version.js';\n/**\n * The Router can be used to process a `FetchEvent` using one or more\n * {@link workbox-routing.Route}, responding with a `Response` if\n * a matching route exists.\n *\n * If no route matches a given a request, the Router will use a \"default\"\n * handler if one is defined.\n *\n * Should the matching Route throw an error, the Router will use a \"catch\"\n * handler if one is defined to gracefully deal with issues and respond with a\n * Request.\n *\n * If a request matches multiple routes, the **earliest** registered route will\n * be used to respond to the request.\n *\n * @memberof workbox-routing\n */\nclass Router {\n /**\n * Initializes a new Router.\n */\n constructor() {\n this._routes = new Map();\n this._defaultHandlerMap = new Map();\n }\n /**\n * @return {Map>} routes A `Map` of HTTP\n * method name ('GET', etc.) to an array of all the corresponding `Route`\n * instances that are registered.\n */\n get routes() {\n return this._routes;\n }\n /**\n * Adds a fetch event listener to respond to events when a route matches\n * the event's request.\n */\n addFetchListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('fetch', ((event) => {\n const { request } = event;\n const responsePromise = this.handleRequest({ request, event });\n if (responsePromise) {\n event.respondWith(responsePromise);\n }\n }));\n }\n /**\n * Adds a message event listener for URLs to cache from the window.\n * This is useful to cache resources loaded on the page prior to when the\n * service worker started controlling it.\n *\n * The format of the message data sent from the window should be as follows.\n * Where the `urlsToCache` array may consist of URL strings or an array of\n * URL string + `requestInit` object (the same as you'd pass to `fetch()`).\n *\n * ```\n * {\n * type: 'CACHE_URLS',\n * payload: {\n * urlsToCache: [\n * './script1.js',\n * './script2.js',\n * ['./script3.js', {mode: 'no-cors'}],\n * ],\n * },\n * }\n * ```\n */\n addCacheListener() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('message', ((event) => {\n // event.data is type 'any'\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (event.data && event.data.type === 'CACHE_URLS') {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const { payload } = event.data;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Caching URLs from the window`, payload.urlsToCache);\n }\n const requestPromises = Promise.all(payload.urlsToCache.map((entry) => {\n if (typeof entry === 'string') {\n entry = [entry];\n }\n const request = new Request(...entry);\n return this.handleRequest({ request, event });\n // TODO(philipwalton): TypeScript errors without this typecast for\n // some reason (probably a bug). The real type here should work but\n // doesn't: `Array | undefined>`.\n })); // TypeScript\n event.waitUntil(requestPromises);\n // If a MessageChannel was used, reply to the message on success.\n if (event.ports && event.ports[0]) {\n void requestPromises.then(() => event.ports[0].postMessage(true));\n }\n }\n }));\n }\n /**\n * Apply the routing rules to a FetchEvent object to get a Response from an\n * appropriate Route's handler.\n *\n * @param {Object} options\n * @param {Request} options.request The request to handle.\n * @param {ExtendableEvent} options.event The event that triggered the\n * request.\n * @return {Promise|undefined} A promise is returned if a\n * registered route can handle the request. If there is no matching\n * route and there's no `defaultHandler`, `undefined` is returned.\n */\n handleRequest({ request, event, }) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(request, Request, {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'handleRequest',\n paramName: 'options.request',\n });\n }\n const url = new URL(request.url, location.href);\n if (!url.protocol.startsWith('http')) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Workbox Router only supports URLs that start with 'http'.`);\n }\n return;\n }\n const sameOrigin = url.origin === location.origin;\n const { params, route } = this.findMatchingRoute({\n event,\n request,\n sameOrigin,\n url,\n });\n let handler = route && route.handler;\n const debugMessages = [];\n if (process.env.NODE_ENV !== 'production') {\n if (handler) {\n debugMessages.push([`Found a route to handle this request:`, route]);\n if (params) {\n debugMessages.push([\n `Passing the following params to the route's handler:`,\n params,\n ]);\n }\n }\n }\n // If we don't have a handler because there was no matching route, then\n // fall back to defaultHandler if that's defined.\n const method = request.method;\n if (!handler && this._defaultHandlerMap.has(method)) {\n if (process.env.NODE_ENV !== 'production') {\n debugMessages.push(`Failed to find a matching route. Falling ` +\n `back to the default handler for ${method}.`);\n }\n handler = this._defaultHandlerMap.get(method);\n }\n if (!handler) {\n if (process.env.NODE_ENV !== 'production') {\n // No handler so Workbox will do nothing. If logs is set of debug\n // i.e. verbose, we should print out this information.\n logger.debug(`No route found for: ${getFriendlyURL(url)}`);\n }\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // We have a handler, meaning Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Router is responding to: ${getFriendlyURL(url)}`);\n debugMessages.forEach((msg) => {\n if (Array.isArray(msg)) {\n logger.log(...msg);\n }\n else {\n logger.log(msg);\n }\n });\n logger.groupEnd();\n }\n // Wrap in try and catch in case the handle method throws a synchronous\n // error. It should still callback to the catch handler.\n let responsePromise;\n try {\n responsePromise = handler.handle({ url, request, event, params });\n }\n catch (err) {\n responsePromise = Promise.reject(err);\n }\n // Get route's catch handler, if it exists\n const catchHandler = route && route.catchHandler;\n if (responsePromise instanceof Promise &&\n (this._catchHandler || catchHandler)) {\n responsePromise = responsePromise.catch(async (err) => {\n // If there's a route catch handler, process that first\n if (catchHandler) {\n if (process.env.NODE_ENV !== 'production') {\n // Still include URL here as it will be async from the console group\n // and may not make sense without the URL\n logger.groupCollapsed(`Error thrown when responding to: ` +\n ` ${getFriendlyURL(url)}. Falling back to route's Catch Handler.`);\n logger.error(`Error thrown by:`, route);\n logger.error(err);\n logger.groupEnd();\n }\n try {\n return await catchHandler.handle({ url, request, event, params });\n }\n catch (catchErr) {\n if (catchErr instanceof Error) {\n err = catchErr;\n }\n }\n }\n if (this._catchHandler) {\n if (process.env.NODE_ENV !== 'production') {\n // Still include URL here as it will be async from the console group\n // and may not make sense without the URL\n logger.groupCollapsed(`Error thrown when responding to: ` +\n ` ${getFriendlyURL(url)}. Falling back to global Catch Handler.`);\n logger.error(`Error thrown by:`, route);\n logger.error(err);\n logger.groupEnd();\n }\n return this._catchHandler.handle({ url, request, event });\n }\n throw err;\n });\n }\n return responsePromise;\n }\n /**\n * Checks a request and URL (and optionally an event) against the list of\n * registered routes, and if there's a match, returns the corresponding\n * route along with any params generated by the match.\n *\n * @param {Object} options\n * @param {URL} options.url\n * @param {boolean} options.sameOrigin The result of comparing `url.origin`\n * against the current origin.\n * @param {Request} options.request The request to match.\n * @param {Event} options.event The corresponding event.\n * @return {Object} An object with `route` and `params` properties.\n * They are populated if a matching route was found or `undefined`\n * otherwise.\n */\n findMatchingRoute({ url, sameOrigin, request, event, }) {\n const routes = this._routes.get(request.method) || [];\n for (const route of routes) {\n let params;\n // route.match returns type any, not possible to change right now.\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const matchResult = route.match({ url, sameOrigin, request, event });\n if (matchResult) {\n if (process.env.NODE_ENV !== 'production') {\n // Warn developers that using an async matchCallback is almost always\n // not the right thing to do.\n if (matchResult instanceof Promise) {\n logger.warn(`While routing ${getFriendlyURL(url)}, an async ` +\n `matchCallback function was used. Please convert the ` +\n `following route to use a synchronous matchCallback function:`, route);\n }\n }\n // See https://github.com/GoogleChrome/workbox/issues/2079\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n params = matchResult;\n if (Array.isArray(params) && params.length === 0) {\n // Instead of passing an empty array in as params, use undefined.\n params = undefined;\n }\n else if (matchResult.constructor === Object && // eslint-disable-line\n Object.keys(matchResult).length === 0) {\n // Instead of passing an empty object in as params, use undefined.\n params = undefined;\n }\n else if (typeof matchResult === 'boolean') {\n // For the boolean value true (rather than just something truth-y),\n // don't set params.\n // See https://github.com/GoogleChrome/workbox/pull/2134#issuecomment-513924353\n params = undefined;\n }\n // Return early if have a match.\n return { route, params };\n }\n }\n // If no match was found above, return and empty object.\n return {};\n }\n /**\n * Define a default `handler` that's called when no routes explicitly\n * match the incoming request.\n *\n * Each HTTP method ('GET', 'POST', etc.) gets its own default handler.\n *\n * Without a default handler, unmatched requests will go against the\n * network as if there were no service worker present.\n *\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n * @param {string} [method='GET'] The HTTP method to associate with this\n * default handler. Each method has its own default.\n */\n setDefaultHandler(handler, method = defaultMethod) {\n this._defaultHandlerMap.set(method, normalizeHandler(handler));\n }\n /**\n * If a Route throws an error while handling a request, this `handler`\n * will be called and given a chance to provide a response.\n *\n * @param {workbox-routing~handlerCallback} handler A callback\n * function that returns a Promise resulting in a Response.\n */\n setCatchHandler(handler) {\n this._catchHandler = normalizeHandler(handler);\n }\n /**\n * Registers a route with the router.\n *\n * @param {workbox-routing.Route} route The route to register.\n */\n registerRoute(route) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isType(route, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route, 'match', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.isType(route.handler, 'object', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route',\n });\n assert.hasMethod(route.handler, 'handle', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.handler',\n });\n assert.isType(route.method, 'string', {\n moduleName: 'workbox-routing',\n className: 'Router',\n funcName: 'registerRoute',\n paramName: 'route.method',\n });\n }\n if (!this._routes.has(route.method)) {\n this._routes.set(route.method, []);\n }\n // Give precedence to all of the earlier routes by adding this additional\n // route to the end of the array.\n this._routes.get(route.method).push(route);\n }\n /**\n * Unregisters a route with the router.\n *\n * @param {workbox-routing.Route} route The route to unregister.\n */\n unregisterRoute(route) {\n if (!this._routes.has(route.method)) {\n throw new WorkboxError('unregister-route-but-not-found-with-method', {\n method: route.method,\n });\n }\n const routeIndex = this._routes.get(route.method).indexOf(route);\n if (routeIndex > -1) {\n this._routes.get(route.method).splice(routeIndex, 1);\n }\n else {\n throw new WorkboxError('unregister-route-route-not-registered');\n }\n }\n}\nexport { Router };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { Router } from '../Router.js';\nimport '../_version.js';\nlet defaultRouter;\n/**\n * Creates a new, singleton Router instance if one does not exist. If one\n * does already exist, that instance is returned.\n *\n * @private\n * @return {Router}\n */\nexport const getOrCreateDefaultRouter = () => {\n if (!defaultRouter) {\n defaultRouter = new Router();\n // The helpers that use the default Router assume these listeners exist.\n defaultRouter.addFetchListener();\n defaultRouter.addCacheListener();\n }\n return defaultRouter;\n};\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst _cacheNameDetails = {\n googleAnalytics: 'googleAnalytics',\n precache: 'precache-v2',\n prefix: 'workbox',\n runtime: 'runtime',\n suffix: typeof registration !== 'undefined' ? registration.scope : '',\n};\nconst _createCacheName = (cacheName) => {\n return [_cacheNameDetails.prefix, cacheName, _cacheNameDetails.suffix]\n .filter((value) => value && value.length > 0)\n .join('-');\n};\nconst eachCacheNameDetail = (fn) => {\n for (const key of Object.keys(_cacheNameDetails)) {\n fn(key);\n }\n};\nexport const cacheNames = {\n updateDetails: (details) => {\n eachCacheNameDetail((key) => {\n if (typeof details[key] === 'string') {\n _cacheNameDetails[key] = details[key];\n }\n });\n },\n getGoogleAnalyticsName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.googleAnalytics);\n },\n getPrecacheName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.precache);\n },\n getPrefix: () => {\n return _cacheNameDetails.prefix;\n },\n getRuntimeName: (userCacheName) => {\n return userCacheName || _createCacheName(_cacheNameDetails.runtime);\n },\n getSuffix: () => {\n return _cacheNameDetails.suffix;\n },\n};\n","/*\n Copyright 2020 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A utility method that makes it easier to use `event.waitUntil` with\n * async functions and return the result.\n *\n * @param {ExtendableEvent} event\n * @param {Function} asyncFn\n * @return {Function}\n * @private\n */\nfunction waitUntil(event, asyncFn) {\n const returnPromise = asyncFn();\n event.waitUntil(returnPromise);\n return returnPromise;\n}\nexport { waitUntil };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:precaching:6.5.2'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport '../_version.js';\n// Name of the search parameter used to store revision info.\nconst REVISION_SEARCH_PARAM = '__WB_REVISION__';\n/**\n * Converts a manifest entry into a versioned URL suitable for precaching.\n *\n * @param {Object|string} entry\n * @return {string} A URL with versioning info.\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function createCacheKey(entry) {\n if (!entry) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If a precache manifest entry is a string, it's assumed to be a versioned\n // URL, like '/app.abcd1234.js'. Return as-is.\n if (typeof entry === 'string') {\n const urlObject = new URL(entry, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n const { revision, url } = entry;\n if (!url) {\n throw new WorkboxError('add-to-cache-list-unexpected-type', { entry });\n }\n // If there's just a URL and no revision, then it's also assumed to be a\n // versioned URL.\n if (!revision) {\n const urlObject = new URL(url, location.href);\n return {\n cacheKey: urlObject.href,\n url: urlObject.href,\n };\n }\n // Otherwise, construct a properly versioned URL using the custom Workbox\n // search parameter along with the revision info.\n const cacheKeyURL = new URL(url, location.href);\n const originalURL = new URL(url, location.href);\n cacheKeyURL.searchParams.set(REVISION_SEARCH_PARAM, revision);\n return {\n cacheKey: cacheKeyURL.href,\n url: originalURL.href,\n };\n}\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A plugin, designed to be used with PrecacheController, to determine the\n * of assets that were updated (or not updated) during the install event.\n *\n * @private\n */\nclass PrecacheInstallReportPlugin {\n constructor() {\n this.updatedURLs = [];\n this.notUpdatedURLs = [];\n this.handlerWillStart = async ({ request, state, }) => {\n // TODO: `state` should never be undefined...\n if (state) {\n state.originalRequest = request;\n }\n };\n this.cachedResponseWillBeUsed = async ({ event, state, cachedResponse, }) => {\n if (event.type === 'install') {\n if (state &&\n state.originalRequest &&\n state.originalRequest instanceof Request) {\n // TODO: `state` should never be undefined...\n const url = state.originalRequest.url;\n if (cachedResponse) {\n this.notUpdatedURLs.push(url);\n }\n else {\n this.updatedURLs.push(url);\n }\n }\n }\n return cachedResponse;\n };\n }\n}\nexport { PrecacheInstallReportPlugin };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * A plugin, designed to be used with PrecacheController, to translate URLs into\n * the corresponding cache key, based on the current revision info.\n *\n * @private\n */\nclass PrecacheCacheKeyPlugin {\n constructor({ precacheController }) {\n this.cacheKeyWillBeUsed = async ({ request, params, }) => {\n // Params is type any, can't change right now.\n /* eslint-disable */\n const cacheKey = (params === null || params === void 0 ? void 0 : params.cacheKey) ||\n this._precacheController.getCacheKeyForURL(request.url);\n /* eslint-enable */\n return cacheKey\n ? new Request(cacheKey, { headers: request.headers })\n : request;\n };\n this._precacheController = precacheController;\n }\n}\nexport { PrecacheCacheKeyPlugin };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nlet supportStatus;\n/**\n * A utility function that determines whether the current browser supports\n * constructing a new `Response` from a `response.body` stream.\n *\n * @return {boolean} `true`, if the current browser can successfully\n * construct a `Response` from a `response.body` stream, `false` otherwise.\n *\n * @private\n */\nfunction canConstructResponseFromBodyStream() {\n if (supportStatus === undefined) {\n const testResponse = new Response('');\n if ('body' in testResponse) {\n try {\n new Response(testResponse.body);\n supportStatus = true;\n }\n catch (error) {\n supportStatus = false;\n }\n }\n supportStatus = false;\n }\n return supportStatus;\n}\nexport { canConstructResponseFromBodyStream };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { canConstructResponseFromBodyStream } from './_private/canConstructResponseFromBodyStream.js';\nimport { WorkboxError } from './_private/WorkboxError.js';\nimport './_version.js';\n/**\n * Allows developers to copy a response and modify its `headers`, `status`,\n * or `statusText` values (the values settable via a\n * [`ResponseInit`]{@link https://developer.mozilla.org/en-US/docs/Web/API/Response/Response#Syntax}\n * object in the constructor).\n * To modify these values, pass a function as the second argument. That\n * function will be invoked with a single object with the response properties\n * `{headers, status, statusText}`. The return value of this function will\n * be used as the `ResponseInit` for the new `Response`. To change the values\n * either modify the passed parameter(s) and return it, or return a totally\n * new object.\n *\n * This method is intentionally limited to same-origin responses, regardless of\n * whether CORS was used or not.\n *\n * @param {Response} response\n * @param {Function} modifier\n * @memberof workbox-core\n */\nasync function copyResponse(response, modifier) {\n let origin = null;\n // If response.url isn't set, assume it's cross-origin and keep origin null.\n if (response.url) {\n const responseURL = new URL(response.url);\n origin = responseURL.origin;\n }\n if (origin !== self.location.origin) {\n throw new WorkboxError('cross-origin-copy-response', { origin });\n }\n const clonedResponse = response.clone();\n // Create a fresh `ResponseInit` object by cloning the headers.\n const responseInit = {\n headers: new Headers(clonedResponse.headers),\n status: clonedResponse.status,\n statusText: clonedResponse.statusText,\n };\n // Apply any user modifications.\n const modifiedResponseInit = modifier ? modifier(responseInit) : responseInit;\n // Create the new response from the body stream and `ResponseInit`\n // modifications. Note: not all browsers support the Response.body stream,\n // so fall back to reading the entire body into memory as a blob.\n const body = canConstructResponseFromBodyStream()\n ? clonedResponse.body\n : await clonedResponse.blob();\n return new Response(body, modifiedResponseInit);\n}\nexport { copyResponse };\n","/*\n Copyright 2020 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nfunction stripParams(fullURL, ignoreParams) {\n const strippedURL = new URL(fullURL);\n for (const param of ignoreParams) {\n strippedURL.searchParams.delete(param);\n }\n return strippedURL.href;\n}\n/**\n * Matches an item in the cache, ignoring specific URL params. This is similar\n * to the `ignoreSearch` option, but it allows you to ignore just specific\n * params (while continuing to match on the others).\n *\n * @private\n * @param {Cache} cache\n * @param {Request} request\n * @param {Object} matchOptions\n * @param {Array} ignoreParams\n * @return {Promise}\n */\nasync function cacheMatchIgnoreParams(cache, request, ignoreParams, matchOptions) {\n const strippedRequestURL = stripParams(request.url, ignoreParams);\n // If the request doesn't include any ignored params, match as normal.\n if (request.url === strippedRequestURL) {\n return cache.match(request, matchOptions);\n }\n // Otherwise, match by comparing keys\n const keysOptions = Object.assign(Object.assign({}, matchOptions), { ignoreSearch: true });\n const cacheKeys = await cache.keys(request, keysOptions);\n for (const cacheKey of cacheKeys) {\n const strippedCacheKeyURL = stripParams(cacheKey.url, ignoreParams);\n if (strippedRequestURL === strippedCacheKeyURL) {\n return cache.match(cacheKey, matchOptions);\n }\n }\n return;\n}\nexport { cacheMatchIgnoreParams };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * The Deferred class composes Promises in a way that allows for them to be\n * resolved or rejected from outside the constructor. In most cases promises\n * should be used directly, but Deferreds can be necessary when the logic to\n * resolve a promise must be separate.\n *\n * @private\n */\nclass Deferred {\n /**\n * Creates a promise and exposes its resolve and reject functions as methods.\n */\n constructor() {\n this.promise = new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n }\n}\nexport { Deferred };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n// Callbacks to be executed whenever there's a quota error.\n// Can't change Function type right now.\n// eslint-disable-next-line @typescript-eslint/ban-types\nconst quotaErrorCallbacks = new Set();\nexport { quotaErrorCallbacks };\n","\"use strict\";\n// @ts-ignore\ntry {\n self['workbox:strategies:6.5.2'] && _();\n}\ncatch (e) { }\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheMatchIgnoreParams } from 'workbox-core/_private/cacheMatchIgnoreParams.js';\nimport { Deferred } from 'workbox-core/_private/Deferred.js';\nimport { executeQuotaErrorCallbacks } from 'workbox-core/_private/executeQuotaErrorCallbacks.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { timeout } from 'workbox-core/_private/timeout.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport './_version.js';\nfunction toRequest(input) {\n return typeof input === 'string' ? new Request(input) : input;\n}\n/**\n * A class created every time a Strategy instance instance calls\n * {@link workbox-strategies.Strategy~handle} or\n * {@link workbox-strategies.Strategy~handleAll} that wraps all fetch and\n * cache actions around plugin callbacks and keeps track of when the strategy\n * is \"done\" (i.e. all added `event.waitUntil()` promises have resolved).\n *\n * @memberof workbox-strategies\n */\nclass StrategyHandler {\n /**\n * Creates a new instance associated with the passed strategy and event\n * that's handling the request.\n *\n * The constructor also initializes the state that will be passed to each of\n * the plugins handling this request.\n *\n * @param {workbox-strategies.Strategy} strategy\n * @param {Object} options\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {ExtendableEvent} options.event The event associated with the\n * request.\n * @param {URL} [options.url]\n * @param {*} [options.params] The return value from the\n * {@link workbox-routing~matchCallback} (if applicable).\n */\n constructor(strategy, options) {\n this._cacheKeys = {};\n /**\n * The request the strategy is performing (passed to the strategy's\n * `handle()` or `handleAll()` method).\n * @name request\n * @instance\n * @type {Request}\n * @memberof workbox-strategies.StrategyHandler\n */\n /**\n * The event associated with this request.\n * @name event\n * @instance\n * @type {ExtendableEvent}\n * @memberof workbox-strategies.StrategyHandler\n */\n /**\n * A `URL` instance of `request.url` (if passed to the strategy's\n * `handle()` or `handleAll()` method).\n * Note: the `url` param will be present if the strategy was invoked\n * from a workbox `Route` object.\n * @name url\n * @instance\n * @type {URL|undefined}\n * @memberof workbox-strategies.StrategyHandler\n */\n /**\n * A `param` value (if passed to the strategy's\n * `handle()` or `handleAll()` method).\n * Note: the `param` param will be present if the strategy was invoked\n * from a workbox `Route` object and the\n * {@link workbox-routing~matchCallback} returned\n * a truthy value (it will be that value).\n * @name params\n * @instance\n * @type {*|undefined}\n * @memberof workbox-strategies.StrategyHandler\n */\n if (process.env.NODE_ENV !== 'production') {\n assert.isInstance(options.event, ExtendableEvent, {\n moduleName: 'workbox-strategies',\n className: 'StrategyHandler',\n funcName: 'constructor',\n paramName: 'options.event',\n });\n }\n Object.assign(this, options);\n this.event = options.event;\n this._strategy = strategy;\n this._handlerDeferred = new Deferred();\n this._extendLifetimePromises = [];\n // Copy the plugins list (since it's mutable on the strategy),\n // so any mutations don't affect this handler instance.\n this._plugins = [...strategy.plugins];\n this._pluginStateMap = new Map();\n for (const plugin of this._plugins) {\n this._pluginStateMap.set(plugin, {});\n }\n this.event.waitUntil(this._handlerDeferred.promise);\n }\n /**\n * Fetches a given request (and invokes any applicable plugin callback\n * methods) using the `fetchOptions` (for non-navigation requests) and\n * `plugins` defined on the `Strategy` object.\n *\n * The following plugin lifecycle methods are invoked when using this method:\n * - `requestWillFetch()`\n * - `fetchDidSucceed()`\n * - `fetchDidFail()`\n *\n * @param {Request|string} input The URL or request to fetch.\n * @return {Promise}\n */\n async fetch(input) {\n const { event } = this;\n let request = toRequest(input);\n if (request.mode === 'navigate' &&\n event instanceof FetchEvent &&\n event.preloadResponse) {\n const possiblePreloadResponse = (await event.preloadResponse);\n if (possiblePreloadResponse) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Using a preloaded navigation response for ` +\n `'${getFriendlyURL(request.url)}'`);\n }\n return possiblePreloadResponse;\n }\n }\n // If there is a fetchDidFail plugin, we need to save a clone of the\n // original request before it's either modified by a requestWillFetch\n // plugin or before the original request's body is consumed via fetch().\n const originalRequest = this.hasCallback('fetchDidFail')\n ? request.clone()\n : null;\n try {\n for (const cb of this.iterateCallbacks('requestWillFetch')) {\n request = await cb({ request: request.clone(), event });\n }\n }\n catch (err) {\n if (err instanceof Error) {\n throw new WorkboxError('plugin-error-request-will-fetch', {\n thrownErrorMessage: err.message,\n });\n }\n }\n // The request can be altered by plugins with `requestWillFetch` making\n // the original request (most likely from a `fetch` event) different\n // from the Request we make. Pass both to `fetchDidFail` to aid debugging.\n const pluginFilteredRequest = request.clone();\n try {\n let fetchResponse;\n // See https://github.com/GoogleChrome/workbox/issues/1796\n fetchResponse = await fetch(request, request.mode === 'navigate' ? undefined : this._strategy.fetchOptions);\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Network request for ` +\n `'${getFriendlyURL(request.url)}' returned a response with ` +\n `status '${fetchResponse.status}'.`);\n }\n for (const callback of this.iterateCallbacks('fetchDidSucceed')) {\n fetchResponse = await callback({\n event,\n request: pluginFilteredRequest,\n response: fetchResponse,\n });\n }\n return fetchResponse;\n }\n catch (error) {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`Network request for ` +\n `'${getFriendlyURL(request.url)}' threw an error.`, error);\n }\n // `originalRequest` will only exist if a `fetchDidFail` callback\n // is being used (see above).\n if (originalRequest) {\n await this.runCallbacks('fetchDidFail', {\n error: error,\n event,\n originalRequest: originalRequest.clone(),\n request: pluginFilteredRequest.clone(),\n });\n }\n throw error;\n }\n }\n /**\n * Calls `this.fetch()` and (in the background) runs `this.cachePut()` on\n * the response generated by `this.fetch()`.\n *\n * The call to `this.cachePut()` automatically invokes `this.waitUntil()`,\n * so you do not have to manually call `waitUntil()` on the event.\n *\n * @param {Request|string} input The request or URL to fetch and cache.\n * @return {Promise}\n */\n async fetchAndCachePut(input) {\n const response = await this.fetch(input);\n const responseClone = response.clone();\n void this.waitUntil(this.cachePut(input, responseClone));\n return response;\n }\n /**\n * Matches a request from the cache (and invokes any applicable plugin\n * callback methods) using the `cacheName`, `matchOptions`, and `plugins`\n * defined on the strategy object.\n *\n * The following plugin lifecycle methods are invoked when using this method:\n * - cacheKeyWillByUsed()\n * - cachedResponseWillByUsed()\n *\n * @param {Request|string} key The Request or URL to use as the cache key.\n * @return {Promise} A matching response, if found.\n */\n async cacheMatch(key) {\n const request = toRequest(key);\n let cachedResponse;\n const { cacheName, matchOptions } = this._strategy;\n const effectiveRequest = await this.getCacheKey(request, 'read');\n const multiMatchOptions = Object.assign(Object.assign({}, matchOptions), { cacheName });\n cachedResponse = await caches.match(effectiveRequest, multiMatchOptions);\n if (process.env.NODE_ENV !== 'production') {\n if (cachedResponse) {\n logger.debug(`Found a cached response in '${cacheName}'.`);\n }\n else {\n logger.debug(`No cached response found in '${cacheName}'.`);\n }\n }\n for (const callback of this.iterateCallbacks('cachedResponseWillBeUsed')) {\n cachedResponse =\n (await callback({\n cacheName,\n matchOptions,\n cachedResponse,\n request: effectiveRequest,\n event: this.event,\n })) || undefined;\n }\n return cachedResponse;\n }\n /**\n * Puts a request/response pair in the cache (and invokes any applicable\n * plugin callback methods) using the `cacheName` and `plugins` defined on\n * the strategy object.\n *\n * The following plugin lifecycle methods are invoked when using this method:\n * - cacheKeyWillByUsed()\n * - cacheWillUpdate()\n * - cacheDidUpdate()\n *\n * @param {Request|string} key The request or URL to use as the cache key.\n * @param {Response} response The response to cache.\n * @return {Promise} `false` if a cacheWillUpdate caused the response\n * not be cached, and `true` otherwise.\n */\n async cachePut(key, response) {\n const request = toRequest(key);\n // Run in the next task to avoid blocking other cache reads.\n // https://github.com/w3c/ServiceWorker/issues/1397\n await timeout(0);\n const effectiveRequest = await this.getCacheKey(request, 'write');\n if (process.env.NODE_ENV !== 'production') {\n if (effectiveRequest.method && effectiveRequest.method !== 'GET') {\n throw new WorkboxError('attempt-to-cache-non-get-request', {\n url: getFriendlyURL(effectiveRequest.url),\n method: effectiveRequest.method,\n });\n }\n // See https://github.com/GoogleChrome/workbox/issues/2818\n const vary = response.headers.get('Vary');\n if (vary) {\n logger.debug(`The response for ${getFriendlyURL(effectiveRequest.url)} ` +\n `has a 'Vary: ${vary}' header. ` +\n `Consider setting the {ignoreVary: true} option on your strategy ` +\n `to ensure cache matching and deletion works as expected.`);\n }\n }\n if (!response) {\n if (process.env.NODE_ENV !== 'production') {\n logger.error(`Cannot cache non-existent response for ` +\n `'${getFriendlyURL(effectiveRequest.url)}'.`);\n }\n throw new WorkboxError('cache-put-with-no-response', {\n url: getFriendlyURL(effectiveRequest.url),\n });\n }\n const responseToCache = await this._ensureResponseSafeToCache(response);\n if (!responseToCache) {\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Response '${getFriendlyURL(effectiveRequest.url)}' ` +\n `will not be cached.`, responseToCache);\n }\n return false;\n }\n const { cacheName, matchOptions } = this._strategy;\n const cache = await self.caches.open(cacheName);\n const hasCacheUpdateCallback = this.hasCallback('cacheDidUpdate');\n const oldResponse = hasCacheUpdateCallback\n ? await cacheMatchIgnoreParams(\n // TODO(philipwalton): the `__WB_REVISION__` param is a precaching\n // feature. Consider into ways to only add this behavior if using\n // precaching.\n cache, effectiveRequest.clone(), ['__WB_REVISION__'], matchOptions)\n : null;\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Updating the '${cacheName}' cache with a new Response ` +\n `for ${getFriendlyURL(effectiveRequest.url)}.`);\n }\n try {\n await cache.put(effectiveRequest, hasCacheUpdateCallback ? responseToCache.clone() : responseToCache);\n }\n catch (error) {\n if (error instanceof Error) {\n // See https://developer.mozilla.org/en-US/docs/Web/API/DOMException#exception-QuotaExceededError\n if (error.name === 'QuotaExceededError') {\n await executeQuotaErrorCallbacks();\n }\n throw error;\n }\n }\n for (const callback of this.iterateCallbacks('cacheDidUpdate')) {\n await callback({\n cacheName,\n oldResponse,\n newResponse: responseToCache.clone(),\n request: effectiveRequest,\n event: this.event,\n });\n }\n return true;\n }\n /**\n * Checks the list of plugins for the `cacheKeyWillBeUsed` callback, and\n * executes any of those callbacks found in sequence. The final `Request`\n * object returned by the last plugin is treated as the cache key for cache\n * reads and/or writes. If no `cacheKeyWillBeUsed` plugin callbacks have\n * been registered, the passed request is returned unmodified\n *\n * @param {Request} request\n * @param {string} mode\n * @return {Promise}\n */\n async getCacheKey(request, mode) {\n const key = `${request.url} | ${mode}`;\n if (!this._cacheKeys[key]) {\n let effectiveRequest = request;\n for (const callback of this.iterateCallbacks('cacheKeyWillBeUsed')) {\n effectiveRequest = toRequest(await callback({\n mode,\n request: effectiveRequest,\n event: this.event,\n // params has a type any can't change right now.\n params: this.params, // eslint-disable-line\n }));\n }\n this._cacheKeys[key] = effectiveRequest;\n }\n return this._cacheKeys[key];\n }\n /**\n * Returns true if the strategy has at least one plugin with the given\n * callback.\n *\n * @param {string} name The name of the callback to check for.\n * @return {boolean}\n */\n hasCallback(name) {\n for (const plugin of this._strategy.plugins) {\n if (name in plugin) {\n return true;\n }\n }\n return false;\n }\n /**\n * Runs all plugin callbacks matching the given name, in order, passing the\n * given param object (merged ith the current plugin state) as the only\n * argument.\n *\n * Note: since this method runs all plugins, it's not suitable for cases\n * where the return value of a callback needs to be applied prior to calling\n * the next callback. See\n * {@link workbox-strategies.StrategyHandler#iterateCallbacks}\n * below for how to handle that case.\n *\n * @param {string} name The name of the callback to run within each plugin.\n * @param {Object} param The object to pass as the first (and only) param\n * when executing each callback. This object will be merged with the\n * current plugin state prior to callback execution.\n */\n async runCallbacks(name, param) {\n for (const callback of this.iterateCallbacks(name)) {\n // TODO(philipwalton): not sure why `any` is needed. It seems like\n // this should work with `as WorkboxPluginCallbackParam[C]`.\n await callback(param);\n }\n }\n /**\n * Accepts a callback and returns an iterable of matching plugin callbacks,\n * where each callback is wrapped with the current handler state (i.e. when\n * you call each callback, whatever object parameter you pass it will\n * be merged with the plugin's current state).\n *\n * @param {string} name The name fo the callback to run\n * @return {Array}\n */\n *iterateCallbacks(name) {\n for (const plugin of this._strategy.plugins) {\n if (typeof plugin[name] === 'function') {\n const state = this._pluginStateMap.get(plugin);\n const statefulCallback = (param) => {\n const statefulParam = Object.assign(Object.assign({}, param), { state });\n // TODO(philipwalton): not sure why `any` is needed. It seems like\n // this should work with `as WorkboxPluginCallbackParam[C]`.\n return plugin[name](statefulParam);\n };\n yield statefulCallback;\n }\n }\n }\n /**\n * Adds a promise to the\n * [extend lifetime promises]{@link https://w3c.github.io/ServiceWorker/#extendableevent-extend-lifetime-promises}\n * of the event event associated with the request being handled (usually a\n * `FetchEvent`).\n *\n * Note: you can await\n * {@link workbox-strategies.StrategyHandler~doneWaiting}\n * to know when all added promises have settled.\n *\n * @param {Promise} promise A promise to add to the extend lifetime promises\n * of the event that triggered the request.\n */\n waitUntil(promise) {\n this._extendLifetimePromises.push(promise);\n return promise;\n }\n /**\n * Returns a promise that resolves once all promises passed to\n * {@link workbox-strategies.StrategyHandler~waitUntil}\n * have settled.\n *\n * Note: any work done after `doneWaiting()` settles should be manually\n * passed to an event's `waitUntil()` method (not this handler's\n * `waitUntil()` method), otherwise the service worker thread my be killed\n * prior to your work completing.\n */\n async doneWaiting() {\n let promise;\n while ((promise = this._extendLifetimePromises.shift())) {\n await promise;\n }\n }\n /**\n * Stops running the strategy and immediately resolves any pending\n * `waitUntil()` promises.\n */\n destroy() {\n this._handlerDeferred.resolve(null);\n }\n /**\n * This method will call cacheWillUpdate on the available plugins (or use\n * status === 200) to determine if the Response is safe and valid to cache.\n *\n * @param {Request} options.request\n * @param {Response} options.response\n * @return {Promise}\n *\n * @private\n */\n async _ensureResponseSafeToCache(response) {\n let responseToCache = response;\n let pluginsUsed = false;\n for (const callback of this.iterateCallbacks('cacheWillUpdate')) {\n responseToCache =\n (await callback({\n request: this.request,\n response: responseToCache,\n event: this.event,\n })) || undefined;\n pluginsUsed = true;\n if (!responseToCache) {\n break;\n }\n }\n if (!pluginsUsed) {\n if (responseToCache && responseToCache.status !== 200) {\n responseToCache = undefined;\n }\n if (process.env.NODE_ENV !== 'production') {\n if (responseToCache) {\n if (responseToCache.status !== 200) {\n if (responseToCache.status === 0) {\n logger.warn(`The response for '${this.request.url}' ` +\n `is an opaque response. The caching strategy that you're ` +\n `using will not cache opaque responses by default.`);\n }\n else {\n logger.debug(`The response for '${this.request.url}' ` +\n `returned a status code of '${response.status}' and won't ` +\n `be cached as a result.`);\n }\n }\n }\n }\n }\n return responseToCache;\n }\n}\nexport { StrategyHandler };\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Returns a promise that resolves and the passed number of milliseconds.\n * This utility is an async/await-friendly version of `setTimeout`.\n *\n * @param {number} ms\n * @return {Promise}\n * @private\n */\nexport function timeout(ms) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst getFriendlyURL = (url) => {\n const urlObj = new URL(String(url), location.href);\n // See https://github.com/GoogleChrome/workbox/issues/2323\n // We want to include everything, except for the origin if it's same-origin.\n return urlObj.href.replace(new RegExp(`^${location.origin}`), '');\n};\nexport { getFriendlyURL };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from '../_private/logger.js';\nimport { quotaErrorCallbacks } from '../models/quotaErrorCallbacks.js';\nimport '../_version.js';\n/**\n * Runs all of the callback functions, one at a time sequentially, in the order\n * in which they were registered.\n *\n * @memberof workbox-core\n * @private\n */\nasync function executeQuotaErrorCallbacks() {\n if (process.env.NODE_ENV !== 'production') {\n logger.log(`About to run ${quotaErrorCallbacks.size} ` +\n `callbacks to clean up caches.`);\n }\n for (const callback of quotaErrorCallbacks) {\n await callback();\n if (process.env.NODE_ENV !== 'production') {\n logger.log(callback, 'is complete.');\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.log('Finished running callbacks.');\n }\n}\nexport { executeQuotaErrorCallbacks };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { copyResponse } from 'workbox-core/copyResponse.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Strategy } from 'workbox-strategies/Strategy.js';\nimport './_version.js';\n/**\n * A {@link workbox-strategies.Strategy} implementation\n * specifically designed to work with\n * {@link workbox-precaching.PrecacheController}\n * to both cache and fetch precached assets.\n *\n * Note: an instance of this class is created automatically when creating a\n * `PrecacheController`; it's generally not necessary to create this yourself.\n *\n * @extends workbox-strategies.Strategy\n * @memberof workbox-precaching\n */\nclass PrecacheStrategy extends Strategy {\n /**\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] Cache name to store and retrieve\n * requests. Defaults to the cache names provided by\n * {@link workbox-core.cacheNames}.\n * @param {Array} [options.plugins] {@link https://developers.google.com/web/tools/workbox/guides/using-plugins|Plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} [options.fetchOptions] Values passed along to the\n * {@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters|init}\n * of all fetch() requests made by this strategy.\n * @param {Object} [options.matchOptions] The\n * {@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions|CacheQueryOptions}\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\n * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to\n * get the response from the network if there's a precache miss.\n */\n constructor(options = {}) {\n options.cacheName = cacheNames.getPrecacheName(options.cacheName);\n super(options);\n this._fallbackToNetwork =\n options.fallbackToNetwork === false ? false : true;\n // Redirected responses cannot be used to satisfy a navigation request, so\n // any redirected response must be \"copied\" rather than cloned, so the new\n // response doesn't contain the `redirected` flag. See:\n // https://bugs.chromium.org/p/chromium/issues/detail?id=669363&desc=2#c1\n this.plugins.push(PrecacheStrategy.copyRedirectedCacheableResponsesPlugin);\n }\n /**\n * @private\n * @param {Request|string} request A request to run this strategy for.\n * @param {workbox-strategies.StrategyHandler} handler The event that\n * triggered the request.\n * @return {Promise}\n */\n async _handle(request, handler) {\n const response = await handler.cacheMatch(request);\n if (response) {\n return response;\n }\n // If this is an `install` event for an entry that isn't already cached,\n // then populate the cache.\n if (handler.event && handler.event.type === 'install') {\n return await this._handleInstall(request, handler);\n }\n // Getting here means something went wrong. An entry that should have been\n // precached wasn't found in the cache.\n return await this._handleFetch(request, handler);\n }\n async _handleFetch(request, handler) {\n let response;\n const params = (handler.params || {});\n // Fall back to the network if we're configured to do so.\n if (this._fallbackToNetwork) {\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(`The precached response for ` +\n `${getFriendlyURL(request.url)} in ${this.cacheName} was not ` +\n `found. Falling back to the network.`);\n }\n const integrityInManifest = params.integrity;\n const integrityInRequest = request.integrity;\n const noIntegrityConflict = !integrityInRequest || integrityInRequest === integrityInManifest;\n response = await handler.fetch(new Request(request, {\n integrity: integrityInRequest || integrityInManifest,\n }));\n // It's only \"safe\" to repair the cache if we're using SRI to guarantee\n // that the response matches the precache manifest's expectations,\n // and there's either a) no integrity property in the incoming request\n // or b) there is an integrity, and it matches the precache manifest.\n // See https://github.com/GoogleChrome/workbox/issues/2858\n if (integrityInManifest && noIntegrityConflict) {\n this._useDefaultCacheabilityPluginIfNeeded();\n const wasCached = await handler.cachePut(request, response.clone());\n if (process.env.NODE_ENV !== 'production') {\n if (wasCached) {\n logger.log(`A response for ${getFriendlyURL(request.url)} ` +\n `was used to \"repair\" the precache.`);\n }\n }\n }\n }\n else {\n // This shouldn't normally happen, but there are edge cases:\n // https://github.com/GoogleChrome/workbox/issues/1441\n throw new WorkboxError('missing-precache-entry', {\n cacheName: this.cacheName,\n url: request.url,\n });\n }\n if (process.env.NODE_ENV !== 'production') {\n const cacheKey = params.cacheKey || (await handler.getCacheKey(request, 'read'));\n // Workbox is going to handle the route.\n // print the routing details to the console.\n logger.groupCollapsed(`Precaching is responding to: ` + getFriendlyURL(request.url));\n logger.log(`Serving the precached url: ${getFriendlyURL(cacheKey instanceof Request ? cacheKey.url : cacheKey)}`);\n logger.groupCollapsed(`View request details here.`);\n logger.log(request);\n logger.groupEnd();\n logger.groupCollapsed(`View response details here.`);\n logger.log(response);\n logger.groupEnd();\n logger.groupEnd();\n }\n return response;\n }\n async _handleInstall(request, handler) {\n this._useDefaultCacheabilityPluginIfNeeded();\n const response = await handler.fetch(request);\n // Make sure we defer cachePut() until after we know the response\n // should be cached; see https://github.com/GoogleChrome/workbox/issues/2737\n const wasCached = await handler.cachePut(request, response.clone());\n if (!wasCached) {\n // Throwing here will lead to the `install` handler failing, which\n // we want to do if *any* of the responses aren't safe to cache.\n throw new WorkboxError('bad-precaching-response', {\n url: request.url,\n status: response.status,\n });\n }\n return response;\n }\n /**\n * This method is complex, as there a number of things to account for:\n *\n * The `plugins` array can be set at construction, and/or it might be added to\n * to at any time before the strategy is used.\n *\n * At the time the strategy is used (i.e. during an `install` event), there\n * needs to be at least one plugin that implements `cacheWillUpdate` in the\n * array, other than `copyRedirectedCacheableResponsesPlugin`.\n *\n * - If this method is called and there are no suitable `cacheWillUpdate`\n * plugins, we need to add `defaultPrecacheCacheabilityPlugin`.\n *\n * - If this method is called and there is exactly one `cacheWillUpdate`, then\n * we don't have to do anything (this might be a previously added\n * `defaultPrecacheCacheabilityPlugin`, or it might be a custom plugin).\n *\n * - If this method is called and there is more than one `cacheWillUpdate`,\n * then we need to check if one is `defaultPrecacheCacheabilityPlugin`. If so,\n * we need to remove it. (This situation is unlikely, but it could happen if\n * the strategy is used multiple times, the first without a `cacheWillUpdate`,\n * and then later on after manually adding a custom `cacheWillUpdate`.)\n *\n * See https://github.com/GoogleChrome/workbox/issues/2737 for more context.\n *\n * @private\n */\n _useDefaultCacheabilityPluginIfNeeded() {\n let defaultPluginIndex = null;\n let cacheWillUpdatePluginCount = 0;\n for (const [index, plugin] of this.plugins.entries()) {\n // Ignore the copy redirected plugin when determining what to do.\n if (plugin === PrecacheStrategy.copyRedirectedCacheableResponsesPlugin) {\n continue;\n }\n // Save the default plugin's index, in case it needs to be removed.\n if (plugin === PrecacheStrategy.defaultPrecacheCacheabilityPlugin) {\n defaultPluginIndex = index;\n }\n if (plugin.cacheWillUpdate) {\n cacheWillUpdatePluginCount++;\n }\n }\n if (cacheWillUpdatePluginCount === 0) {\n this.plugins.push(PrecacheStrategy.defaultPrecacheCacheabilityPlugin);\n }\n else if (cacheWillUpdatePluginCount > 1 && defaultPluginIndex !== null) {\n // Only remove the default plugin; multiple custom plugins are allowed.\n this.plugins.splice(defaultPluginIndex, 1);\n }\n // Nothing needs to be done if cacheWillUpdatePluginCount is 1\n }\n}\nPrecacheStrategy.defaultPrecacheCacheabilityPlugin = {\n async cacheWillUpdate({ response }) {\n if (!response || response.status >= 400) {\n return null;\n }\n return response;\n },\n};\nPrecacheStrategy.copyRedirectedCacheableResponsesPlugin = {\n async cacheWillUpdate({ response }) {\n return response.redirected ? await copyResponse(response) : response;\n },\n};\nexport { PrecacheStrategy };\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { StrategyHandler } from './StrategyHandler.js';\nimport './_version.js';\n/**\n * An abstract base class that all other strategy classes must extend from:\n *\n * @memberof workbox-strategies\n */\nclass Strategy {\n /**\n * Creates a new instance of the strategy and sets all documented option\n * properties as public instance properties.\n *\n * Note: if a custom strategy class extends the base Strategy class and does\n * not need more than these properties, it does not need to define its own\n * constructor.\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] Cache name to store and retrieve\n * requests. Defaults to the cache names provided by\n * {@link workbox-core.cacheNames}.\n * @param {Array} [options.plugins] [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * to use in conjunction with this caching strategy.\n * @param {Object} [options.fetchOptions] Values passed along to the\n * [`init`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)\n * of [non-navigation](https://github.com/GoogleChrome/workbox/issues/1796)\n * `fetch()` requests made by this strategy.\n * @param {Object} [options.matchOptions] The\n * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\n */\n constructor(options = {}) {\n /**\n * Cache name to store and retrieve\n * requests. Defaults to the cache names provided by\n * {@link workbox-core.cacheNames}.\n *\n * @type {string}\n */\n this.cacheName = cacheNames.getRuntimeName(options.cacheName);\n /**\n * The list\n * [Plugins]{@link https://developers.google.com/web/tools/workbox/guides/using-plugins}\n * used by this strategy.\n *\n * @type {Array}\n */\n this.plugins = options.plugins || [];\n /**\n * Values passed along to the\n * [`init`]{@link https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters}\n * of all fetch() requests made by this strategy.\n *\n * @type {Object}\n */\n this.fetchOptions = options.fetchOptions;\n /**\n * The\n * [`CacheQueryOptions`]{@link https://w3c.github.io/ServiceWorker/#dictdef-cachequeryoptions}\n * for any `cache.match()` or `cache.put()` calls made by this strategy.\n *\n * @type {Object}\n */\n this.matchOptions = options.matchOptions;\n }\n /**\n * Perform a request strategy and returns a `Promise` that will resolve with\n * a `Response`, invoking all relevant plugin callbacks.\n *\n * When a strategy instance is registered with a Workbox\n * {@link workbox-routing.Route}, this method is automatically\n * called when the route matches.\n *\n * Alternatively, this method can be used in a standalone `FetchEvent`\n * listener by passing it to `event.respondWith()`.\n *\n * @param {FetchEvent|Object} options A `FetchEvent` or an object with the\n * properties listed below.\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {ExtendableEvent} options.event The event associated with the\n * request.\n * @param {URL} [options.url]\n * @param {*} [options.params]\n */\n handle(options) {\n const [responseDone] = this.handleAll(options);\n return responseDone;\n }\n /**\n * Similar to {@link workbox-strategies.Strategy~handle}, but\n * instead of just returning a `Promise` that resolves to a `Response` it\n * it will return an tuple of `[response, done]` promises, where the former\n * (`response`) is equivalent to what `handle()` returns, and the latter is a\n * Promise that will resolve once any promises that were added to\n * `event.waitUntil()` as part of performing the strategy have completed.\n *\n * You can await the `done` promise to ensure any extra work performed by\n * the strategy (usually caching responses) completes successfully.\n *\n * @param {FetchEvent|Object} options A `FetchEvent` or an object with the\n * properties listed below.\n * @param {Request|string} options.request A request to run this strategy for.\n * @param {ExtendableEvent} options.event The event associated with the\n * request.\n * @param {URL} [options.url]\n * @param {*} [options.params]\n * @return {Array} A tuple of [response, done]\n * promises that can be used to determine when the response resolves as\n * well as when the handler has completed all its work.\n */\n handleAll(options) {\n // Allow for flexible options to be passed.\n if (options instanceof FetchEvent) {\n options = {\n event: options,\n request: options.request,\n };\n }\n const event = options.event;\n const request = typeof options.request === 'string'\n ? new Request(options.request)\n : options.request;\n const params = 'params' in options ? options.params : undefined;\n const handler = new StrategyHandler(this, { event, request, params });\n const responseDone = this._getResponse(handler, request, event);\n const handlerDone = this._awaitComplete(responseDone, handler, request, event);\n // Return an array of promises, suitable for use with Promise.all().\n return [responseDone, handlerDone];\n }\n async _getResponse(handler, request, event) {\n await handler.runCallbacks('handlerWillStart', { event, request });\n let response = undefined;\n try {\n response = await this._handle(request, handler);\n // The \"official\" Strategy subclasses all throw this error automatically,\n // but in case a third-party Strategy doesn't, ensure that we have a\n // consistent failure when there's no response or an error response.\n if (!response || response.type === 'error') {\n throw new WorkboxError('no-response', { url: request.url });\n }\n }\n catch (error) {\n if (error instanceof Error) {\n for (const callback of handler.iterateCallbacks('handlerDidError')) {\n response = await callback({ error, event, request });\n if (response) {\n break;\n }\n }\n }\n if (!response) {\n throw error;\n }\n else if (process.env.NODE_ENV !== 'production') {\n logger.log(`While responding to '${getFriendlyURL(request.url)}', ` +\n `an ${error instanceof Error ? error.toString() : ''} error occurred. Using a fallback response provided by ` +\n `a handlerDidError plugin.`);\n }\n }\n for (const callback of handler.iterateCallbacks('handlerWillRespond')) {\n response = await callback({ event, request, response });\n }\n return response;\n }\n async _awaitComplete(responseDone, handler, request, event) {\n let response;\n let error;\n try {\n response = await responseDone;\n }\n catch (error) {\n // Ignore errors, as response errors should be caught via the `response`\n // promise above. The `done` promise will only throw for errors in\n // promises passed to `handler.waitUntil()`.\n }\n try {\n await handler.runCallbacks('handlerDidRespond', {\n event,\n request,\n response,\n });\n await handler.doneWaiting();\n }\n catch (waitUntilError) {\n if (waitUntilError instanceof Error) {\n error = waitUntilError;\n }\n }\n await handler.runCallbacks('handlerDidComplete', {\n event,\n request,\n response,\n error: error,\n });\n handler.destroy();\n if (error) {\n throw error;\n }\n }\n}\nexport { Strategy };\n/**\n * Classes extending the `Strategy` based class should implement this method,\n * and leverage the {@link workbox-strategies.StrategyHandler}\n * arg to perform all fetching and cache logic, which will ensure all relevant\n * cache, cache options, fetch options and plugins are used (per the current\n * strategy instance).\n *\n * @name _handle\n * @instance\n * @abstract\n * @function\n * @param {Request} request\n * @param {workbox-strategies.StrategyHandler} handler\n * @return {Promise}\n *\n * @memberof workbox-strategies.Strategy\n */\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { assert } from 'workbox-core/_private/assert.js';\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { waitUntil } from 'workbox-core/_private/waitUntil.js';\nimport { createCacheKey } from './utils/createCacheKey.js';\nimport { PrecacheInstallReportPlugin } from './utils/PrecacheInstallReportPlugin.js';\nimport { PrecacheCacheKeyPlugin } from './utils/PrecacheCacheKeyPlugin.js';\nimport { printCleanupDetails } from './utils/printCleanupDetails.js';\nimport { printInstallDetails } from './utils/printInstallDetails.js';\nimport { PrecacheStrategy } from './PrecacheStrategy.js';\nimport './_version.js';\n/**\n * Performs efficient precaching of assets.\n *\n * @memberof workbox-precaching\n */\nclass PrecacheController {\n /**\n * Create a new PrecacheController.\n *\n * @param {Object} [options]\n * @param {string} [options.cacheName] The cache to use for precaching.\n * @param {string} [options.plugins] Plugins to use when precaching as well\n * as responding to fetch events for precached assets.\n * @param {boolean} [options.fallbackToNetwork=true] Whether to attempt to\n * get the response from the network if there's a precache miss.\n */\n constructor({ cacheName, plugins = [], fallbackToNetwork = true, } = {}) {\n this._urlsToCacheKeys = new Map();\n this._urlsToCacheModes = new Map();\n this._cacheKeysToIntegrities = new Map();\n this._strategy = new PrecacheStrategy({\n cacheName: cacheNames.getPrecacheName(cacheName),\n plugins: [\n ...plugins,\n new PrecacheCacheKeyPlugin({ precacheController: this }),\n ],\n fallbackToNetwork,\n });\n // Bind the install and activate methods to the instance.\n this.install = this.install.bind(this);\n this.activate = this.activate.bind(this);\n }\n /**\n * @type {workbox-precaching.PrecacheStrategy} The strategy created by this controller and\n * used to cache assets and respond to fetch events.\n */\n get strategy() {\n return this._strategy;\n }\n /**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * {@link workbox-core.cacheNames|\"precache cache\"} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * @param {Array} [entries=[]] Array of entries to precache.\n */\n precache(entries) {\n this.addToCacheList(entries);\n if (!this._installAndActiveListenersAdded) {\n self.addEventListener('install', this.install);\n self.addEventListener('activate', this.activate);\n this._installAndActiveListenersAdded = true;\n }\n }\n /**\n * This method will add items to the precache list, removing duplicates\n * and ensuring the information is valid.\n *\n * @param {Array} entries\n * Array of entries to precache.\n */\n addToCacheList(entries) {\n if (process.env.NODE_ENV !== 'production') {\n assert.isArray(entries, {\n moduleName: 'workbox-precaching',\n className: 'PrecacheController',\n funcName: 'addToCacheList',\n paramName: 'entries',\n });\n }\n const urlsToWarnAbout = [];\n for (const entry of entries) {\n // See https://github.com/GoogleChrome/workbox/issues/2259\n if (typeof entry === 'string') {\n urlsToWarnAbout.push(entry);\n }\n else if (entry && entry.revision === undefined) {\n urlsToWarnAbout.push(entry.url);\n }\n const { cacheKey, url } = createCacheKey(entry);\n const cacheMode = typeof entry !== 'string' && entry.revision ? 'reload' : 'default';\n if (this._urlsToCacheKeys.has(url) &&\n this._urlsToCacheKeys.get(url) !== cacheKey) {\n throw new WorkboxError('add-to-cache-list-conflicting-entries', {\n firstEntry: this._urlsToCacheKeys.get(url),\n secondEntry: cacheKey,\n });\n }\n if (typeof entry !== 'string' && entry.integrity) {\n if (this._cacheKeysToIntegrities.has(cacheKey) &&\n this._cacheKeysToIntegrities.get(cacheKey) !== entry.integrity) {\n throw new WorkboxError('add-to-cache-list-conflicting-integrities', {\n url,\n });\n }\n this._cacheKeysToIntegrities.set(cacheKey, entry.integrity);\n }\n this._urlsToCacheKeys.set(url, cacheKey);\n this._urlsToCacheModes.set(url, cacheMode);\n if (urlsToWarnAbout.length > 0) {\n const warningMessage = `Workbox is precaching URLs without revision ` +\n `info: ${urlsToWarnAbout.join(', ')}\\nThis is generally NOT safe. ` +\n `Learn more at https://bit.ly/wb-precache`;\n if (process.env.NODE_ENV === 'production') {\n // Use console directly to display this warning without bloating\n // bundle sizes by pulling in all of the logger codebase in prod.\n console.warn(warningMessage);\n }\n else {\n logger.warn(warningMessage);\n }\n }\n }\n }\n /**\n * Precaches new and updated assets. Call this method from the service worker\n * install event.\n *\n * Note: this method calls `event.waitUntil()` for you, so you do not need\n * to call it yourself in your event handlers.\n *\n * @param {ExtendableEvent} event\n * @return {Promise}\n */\n install(event) {\n // waitUntil returns Promise\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return waitUntil(event, async () => {\n const installReportPlugin = new PrecacheInstallReportPlugin();\n this.strategy.plugins.push(installReportPlugin);\n // Cache entries one at a time.\n // See https://github.com/GoogleChrome/workbox/issues/2528\n for (const [url, cacheKey] of this._urlsToCacheKeys) {\n const integrity = this._cacheKeysToIntegrities.get(cacheKey);\n const cacheMode = this._urlsToCacheModes.get(url);\n const request = new Request(url, {\n integrity,\n cache: cacheMode,\n credentials: 'same-origin',\n });\n await Promise.all(this.strategy.handleAll({\n params: { cacheKey },\n request,\n event,\n }));\n }\n const { updatedURLs, notUpdatedURLs } = installReportPlugin;\n if (process.env.NODE_ENV !== 'production') {\n printInstallDetails(updatedURLs, notUpdatedURLs);\n }\n return { updatedURLs, notUpdatedURLs };\n });\n }\n /**\n * Deletes assets that are no longer present in the current precache manifest.\n * Call this method from the service worker activate event.\n *\n * Note: this method calls `event.waitUntil()` for you, so you do not need\n * to call it yourself in your event handlers.\n *\n * @param {ExtendableEvent} event\n * @return {Promise}\n */\n activate(event) {\n // waitUntil returns Promise\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return waitUntil(event, async () => {\n const cache = await self.caches.open(this.strategy.cacheName);\n const currentlyCachedRequests = await cache.keys();\n const expectedCacheKeys = new Set(this._urlsToCacheKeys.values());\n const deletedURLs = [];\n for (const request of currentlyCachedRequests) {\n if (!expectedCacheKeys.has(request.url)) {\n await cache.delete(request);\n deletedURLs.push(request.url);\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n printCleanupDetails(deletedURLs);\n }\n return { deletedURLs };\n });\n }\n /**\n * Returns a mapping of a precached URL to the corresponding cache key, taking\n * into account the revision information for the URL.\n *\n * @return {Map} A URL to cache key mapping.\n */\n getURLsToCacheKeys() {\n return this._urlsToCacheKeys;\n }\n /**\n * Returns a list of all the URLs that have been precached by the current\n * service worker.\n *\n * @return {Array} The precached URLs.\n */\n getCachedURLs() {\n return [...this._urlsToCacheKeys.keys()];\n }\n /**\n * Returns the cache key used for storing a given URL. If that URL is\n * unversioned, like `/index.html', then the cache key will be the original\n * URL with a search parameter appended to it.\n *\n * @param {string} url A URL whose cache key you want to look up.\n * @return {string} The versioned URL that corresponds to a cache key\n * for the original URL, or undefined if that URL isn't precached.\n */\n getCacheKeyForURL(url) {\n const urlObject = new URL(url, location.href);\n return this._urlsToCacheKeys.get(urlObject.href);\n }\n /**\n * @param {string} url A cache key whose SRI you want to look up.\n * @return {string} The subresource integrity associated with the cache key,\n * or undefined if it's not set.\n */\n getIntegrityForCacheKey(cacheKey) {\n return this._cacheKeysToIntegrities.get(cacheKey);\n }\n /**\n * This acts as a drop-in replacement for\n * [`cache.match()`](https://developer.mozilla.org/en-US/docs/Web/API/Cache/match)\n * with the following differences:\n *\n * - It knows what the name of the precache is, and only checks in that cache.\n * - It allows you to pass in an \"original\" URL without versioning parameters,\n * and it will automatically look up the correct cache key for the currently\n * active revision of that URL.\n *\n * E.g., `matchPrecache('index.html')` will find the correct precached\n * response for the currently active service worker, even if the actual cache\n * key is `'/index.html?__WB_REVISION__=1234abcd'`.\n *\n * @param {string|Request} request The key (without revisioning parameters)\n * to look up in the precache.\n * @return {Promise}\n */\n async matchPrecache(request) {\n const url = request instanceof Request ? request.url : request;\n const cacheKey = this.getCacheKeyForURL(url);\n if (cacheKey) {\n const cache = await self.caches.open(this.strategy.cacheName);\n return cache.match(cacheKey);\n }\n return undefined;\n }\n /**\n * Returns a function that looks up `url` in the precache (taking into\n * account revision information), and returns the corresponding `Response`.\n *\n * @param {string} url The precached URL which will be used to lookup the\n * `Response`.\n * @return {workbox-routing~handlerCallback}\n */\n createHandlerBoundToURL(url) {\n const cacheKey = this.getCacheKeyForURL(url);\n if (!cacheKey) {\n throw new WorkboxError('non-precached-url', { url });\n }\n return (options) => {\n options.request = new Request(url);\n options.params = Object.assign({ cacheKey }, options.params);\n return this.strategy.handle(options);\n };\n }\n}\nexport { PrecacheController };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { PrecacheController } from '../PrecacheController.js';\nimport '../_version.js';\nlet precacheController;\n/**\n * @return {PrecacheController}\n * @private\n */\nexport const getOrCreatePrecacheController = () => {\n if (!precacheController) {\n precacheController = new PrecacheController();\n }\n return precacheController;\n};\n","/*\n Copyright 2020 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { getFriendlyURL } from 'workbox-core/_private/getFriendlyURL.js';\nimport { Route } from 'workbox-routing/Route.js';\nimport { generateURLVariations } from './utils/generateURLVariations.js';\nimport './_version.js';\n/**\n * A subclass of {@link workbox-routing.Route} that takes a\n * {@link workbox-precaching.PrecacheController}\n * instance and uses it to match incoming requests and handle fetching\n * responses from the precache.\n *\n * @memberof workbox-precaching\n * @extends workbox-routing.Route\n */\nclass PrecacheRoute extends Route {\n /**\n * @param {PrecacheController} precacheController A `PrecacheController`\n * instance used to both match requests and respond to fetch events.\n * @param {Object} [options] Options to control how requests are matched\n * against the list of precached URLs.\n * @param {string} [options.directoryIndex=index.html] The `directoryIndex` will\n * check cache entries for a URLs ending with '/' to see if there is a hit when\n * appending the `directoryIndex` value.\n * @param {Array} [options.ignoreURLParametersMatching=[/^utm_/, /^fbclid$/]] An\n * array of regex's to remove search params when looking for a cache match.\n * @param {boolean} [options.cleanURLs=true] The `cleanURLs` option will\n * check the cache for the URL with a `.html` added to the end of the end.\n * @param {workbox-precaching~urlManipulation} [options.urlManipulation]\n * This is a function that should take a URL and return an array of\n * alternative URLs that should be checked for precache matches.\n */\n constructor(precacheController, options) {\n const match = ({ request, }) => {\n const urlsToCacheKeys = precacheController.getURLsToCacheKeys();\n for (const possibleURL of generateURLVariations(request.url, options)) {\n const cacheKey = urlsToCacheKeys.get(possibleURL);\n if (cacheKey) {\n const integrity = precacheController.getIntegrityForCacheKey(cacheKey);\n return { cacheKey, integrity };\n }\n }\n if (process.env.NODE_ENV !== 'production') {\n logger.debug(`Precaching did not find a match for ` + getFriendlyURL(request.url));\n }\n return;\n };\n super(match, precacheController.strategy);\n }\n}\nexport { PrecacheRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { removeIgnoredSearchParams } from './removeIgnoredSearchParams.js';\nimport '../_version.js';\n/**\n * Generator function that yields possible variations on the original URL to\n * check, one at a time.\n *\n * @param {string} url\n * @param {Object} options\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function* generateURLVariations(url, { ignoreURLParametersMatching = [/^utm_/, /^fbclid$/], directoryIndex = 'index.html', cleanURLs = true, urlManipulation, } = {}) {\n const urlObject = new URL(url, location.href);\n urlObject.hash = '';\n yield urlObject.href;\n const urlWithoutIgnoredParams = removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching);\n yield urlWithoutIgnoredParams.href;\n if (directoryIndex && urlWithoutIgnoredParams.pathname.endsWith('/')) {\n const directoryURL = new URL(urlWithoutIgnoredParams.href);\n directoryURL.pathname += directoryIndex;\n yield directoryURL.href;\n }\n if (cleanURLs) {\n const cleanURL = new URL(urlWithoutIgnoredParams.href);\n cleanURL.pathname += '.html';\n yield cleanURL.href;\n }\n if (urlManipulation) {\n const additionalURLs = urlManipulation({ url: urlObject });\n for (const urlToAttempt of additionalURLs) {\n yield urlToAttempt.href;\n }\n }\n}\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\n/**\n * Removes any URL search parameters that should be ignored.\n *\n * @param {URL} urlObject The original URL.\n * @param {Array} ignoreURLParametersMatching RegExps to test against\n * each search parameter name. Matches mean that the search parameter should be\n * ignored.\n * @return {URL} The URL with any ignored search parameters removed.\n *\n * @private\n * @memberof workbox-precaching\n */\nexport function removeIgnoredSearchParams(urlObject, ignoreURLParametersMatching = []) {\n // Convert the iterable into an array at the start of the loop to make sure\n // deletion doesn't mess up iteration.\n for (const paramName of [...urlObject.searchParams.keys()]) {\n if (ignoreURLParametersMatching.some((regExp) => regExp.test(paramName))) {\n urlObject.searchParams.delete(paramName);\n }\n }\n return urlObject;\n}\n","/*\n Copyright 2019 Google LLC\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { registerRoute } from 'workbox-routing/registerRoute.js';\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport { PrecacheRoute } from './PrecacheRoute.js';\nimport './_version.js';\n/**\n * Add a `fetch` listener to the service worker that will\n * respond to\n * [network requests]{@link https://developer.mozilla.org/en-US/docs/Web/API/Service_Worker_API/Using_Service_Workers#Custom_responses_to_requests}\n * with precached assets.\n *\n * Requests for assets that aren't precached, the `FetchEvent` will not be\n * responded to, allowing the event to fall through to other `fetch` event\n * listeners.\n *\n * @param {Object} [options] See the {@link workbox-precaching.PrecacheRoute}\n * options.\n *\n * @memberof workbox-precaching\n */\nfunction addRoute(options) {\n const precacheController = getOrCreatePrecacheController();\n const precacheRoute = new PrecacheRoute(precacheController, options);\n registerRoute(precacheRoute);\n}\nexport { addRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { WorkboxError } from 'workbox-core/_private/WorkboxError.js';\nimport { Route } from './Route.js';\nimport { RegExpRoute } from './RegExpRoute.js';\nimport { getOrCreateDefaultRouter } from './utils/getOrCreateDefaultRouter.js';\nimport './_version.js';\n/**\n * Easily register a RegExp, string, or function with a caching\n * strategy to a singleton Router instance.\n *\n * This method will generate a Route for you if needed and\n * call {@link workbox-routing.Router#registerRoute}.\n *\n * @param {RegExp|string|workbox-routing.Route~matchCallback|workbox-routing.Route} capture\n * If the capture param is a `Route`, all other arguments will be ignored.\n * @param {workbox-routing~handlerCallback} [handler] A callback\n * function that returns a Promise resulting in a Response. This parameter\n * is required if `capture` is not a `Route` object.\n * @param {string} [method='GET'] The HTTP method to match the Route\n * against.\n * @return {workbox-routing.Route} The generated `Route`.\n *\n * @memberof workbox-routing\n */\nfunction registerRoute(capture, handler, method) {\n let route;\n if (typeof capture === 'string') {\n const captureUrl = new URL(capture, location.href);\n if (process.env.NODE_ENV !== 'production') {\n if (!(capture.startsWith('/') || capture.startsWith('http'))) {\n throw new WorkboxError('invalid-string', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n // We want to check if Express-style wildcards are in the pathname only.\n // TODO: Remove this log message in v4.\n const valueToCheck = capture.startsWith('http')\n ? captureUrl.pathname\n : capture;\n // See https://github.com/pillarjs/path-to-regexp#parameters\n const wildcards = '[*:?+]';\n if (new RegExp(`${wildcards}`).exec(valueToCheck)) {\n logger.debug(`The '$capture' parameter contains an Express-style wildcard ` +\n `character (${wildcards}). Strings are now always interpreted as ` +\n `exact matches; use a RegExp for partial or wildcard matches.`);\n }\n }\n const matchCallback = ({ url }) => {\n if (process.env.NODE_ENV !== 'production') {\n if (url.pathname === captureUrl.pathname &&\n url.origin !== captureUrl.origin) {\n logger.debug(`${capture} only partially matches the cross-origin URL ` +\n `${url.toString()}. This route will only handle cross-origin requests ` +\n `if they match the entire URL.`);\n }\n }\n return url.href === captureUrl.href;\n };\n // If `capture` is a string then `handler` and `method` must be present.\n route = new Route(matchCallback, handler, method);\n }\n else if (capture instanceof RegExp) {\n // If `capture` is a `RegExp` then `handler` and `method` must be present.\n route = new RegExpRoute(capture, handler, method);\n }\n else if (typeof capture === 'function') {\n // If `capture` is a function then `handler` and `method` must be present.\n route = new Route(capture, handler, method);\n }\n else if (capture instanceof Route) {\n route = capture;\n }\n else {\n throw new WorkboxError('unsupported-route-type', {\n moduleName: 'workbox-routing',\n funcName: 'registerRoute',\n paramName: 'capture',\n });\n }\n const defaultRouter = getOrCreateDefaultRouter();\n defaultRouter.registerRoute(route);\n return route;\n}\nexport { registerRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { cacheNames } from 'workbox-core/_private/cacheNames.js';\nimport { logger } from 'workbox-core/_private/logger.js';\nimport { deleteOutdatedCaches } from './utils/deleteOutdatedCaches.js';\nimport './_version.js';\n/**\n * Adds an `activate` event listener which will clean up incompatible\n * precaches that were created by older versions of Workbox.\n *\n * @memberof workbox-precaching\n */\nfunction cleanupOutdatedCaches() {\n // See https://github.com/Microsoft/TypeScript/issues/28357#issuecomment-436484705\n self.addEventListener('activate', ((event) => {\n const cacheName = cacheNames.getPrecacheName();\n event.waitUntil(deleteOutdatedCaches(cacheName).then((cachesDeleted) => {\n if (process.env.NODE_ENV !== 'production') {\n if (cachesDeleted.length > 0) {\n logger.log(`The following out-of-date precaches were cleaned up ` +\n `automatically:`, cachesDeleted);\n }\n }\n }));\n }));\n}\nexport { cleanupOutdatedCaches };\n","/*\n Copyright 2018 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport '../_version.js';\nconst SUBSTRING_TO_FIND = '-precache-';\n/**\n * Cleans up incompatible precaches that were created by older versions of\n * Workbox, by a service worker registered under the current scope.\n *\n * This is meant to be called as part of the `activate` event.\n *\n * This should be safe to use as long as you don't include `substringToFind`\n * (defaulting to `-precache-`) in your non-precache cache names.\n *\n * @param {string} currentPrecacheName The cache name currently in use for\n * precaching. This cache won't be deleted.\n * @param {string} [substringToFind='-precache-'] Cache names which include this\n * substring will be deleted (excluding `currentPrecacheName`).\n * @return {Array} A list of all the cache names that were deleted.\n *\n * @private\n * @memberof workbox-precaching\n */\nconst deleteOutdatedCaches = async (currentPrecacheName, substringToFind = SUBSTRING_TO_FIND) => {\n const cacheNames = await self.caches.keys();\n const cacheNamesToDelete = cacheNames.filter((cacheName) => {\n return (cacheName.includes(substringToFind) &&\n cacheName.includes(self.registration.scope) &&\n cacheName !== currentPrecacheName);\n });\n await Promise.all(cacheNamesToDelete.map((cacheName) => self.caches.delete(cacheName)));\n return cacheNamesToDelete;\n};\nexport { deleteOutdatedCaches };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { addRoute } from './addRoute.js';\nimport { precache } from './precache.js';\nimport './_version.js';\n/**\n * This method will add entries to the precache list and add a route to\n * respond to fetch events.\n *\n * This is a convenience method that will call\n * {@link workbox-precaching.precache} and\n * {@link workbox-precaching.addRoute} in a single call.\n *\n * @param {Array} entries Array of entries to precache.\n * @param {Object} [options] See the\n * {@link workbox-precaching.PrecacheRoute} options.\n *\n * @memberof workbox-precaching\n */\nfunction precacheAndRoute(entries, options) {\n precache(entries);\n addRoute(options);\n}\nexport { precacheAndRoute };\n","/*\n Copyright 2019 Google LLC\n\n Use of this source code is governed by an MIT-style\n license that can be found in the LICENSE file or at\n https://opensource.org/licenses/MIT.\n*/\nimport { getOrCreatePrecacheController } from './utils/getOrCreatePrecacheController.js';\nimport './_version.js';\n/**\n * Adds items to the precache list, removing any duplicates and\n * stores the files in the\n * {@link workbox-core.cacheNames|\"precache cache\"} when the service\n * worker installs.\n *\n * This method can be called multiple times.\n *\n * Please note: This method **will not** serve any of the cached files for you.\n * It only precaches files. To respond to a network request you call\n * {@link workbox-precaching.addRoute}.\n *\n * If you have a single array of files to precache, you can just call\n * {@link workbox-precaching.precacheAndRoute}.\n *\n * @param {Array} [entries=[]] Array of entries to precache.\n *\n * @memberof workbox-precaching\n */\nfunction precache(entries) {\n const precacheController = getOrCreatePrecacheController();\n precacheController.precache(entries);\n}\nexport { precache };\n"],"names":["self","_","e","messageGenerator","fallback","code","args","msg","length","JSON","stringify","WorkboxError","Error","constructor","errorCode","details","super","this","name","normalizeHandler","handler","handle","Route","match","method","setCatchHandler","catchHandler","RegExpRoute","regExp","url","result","exec","href","origin","location","index","slice","Router","_routes","Map","_defaultHandlerMap","routes","addFetchListener","addEventListener","event","request","responsePromise","handleRequest","respondWith","addCacheListener","data","type","payload","requestPromises","Promise","all","urlsToCache","map","entry","Request","waitUntil","ports","then","postMessage","URL","protocol","startsWith","sameOrigin","params","route","findMatchingRoute","has","get","err","reject","_catchHandler","catch","async","catchErr","matchResult","Array","isArray","Object","keys","undefined","setDefaultHandler","set","registerRoute","push","unregisterRoute","routeIndex","indexOf","splice","defaultRouter","_cacheNameDetails","googleAnalytics","precache","prefix","runtime","suffix","registration","scope","_createCacheName","cacheName","filter","value","join","cacheNames","userCacheName","asyncFn","returnPromise","createCacheKey","urlObject","cacheKey","revision","cacheKeyURL","originalURL","searchParams","PrecacheInstallReportPlugin","updatedURLs","notUpdatedURLs","handlerWillStart","state","originalRequest","cachedResponseWillBeUsed","cachedResponse","PrecacheCacheKeyPlugin","precacheController","cacheKeyWillBeUsed","_precacheController","getCacheKeyForURL","headers","supportStatus","copyResponse","response","modifier","clonedResponse","clone","responseInit","Headers","status","statusText","modifiedResponseInit","body","testResponse","Response","error","canConstructResponseFromBodyStream","blob","stripParams","fullURL","ignoreParams","strippedURL","param","delete","Deferred","promise","resolve","quotaErrorCallbacks","Set","toRequest","input","StrategyHandler","strategy","options","_cacheKeys","assign","_strategy","_handlerDeferred","_extendLifetimePromises","_plugins","plugins","_pluginStateMap","plugin","mode","FetchEvent","preloadResponse","possiblePreloadResponse","hasCallback","cb","iterateCallbacks","thrownErrorMessage","message","pluginFilteredRequest","fetchResponse","fetch","fetchOptions","callback","runCallbacks","responseClone","cachePut","key","matchOptions","effectiveRequest","getCacheKey","multiMatchOptions","caches","ms","setTimeout","String","replace","RegExp","responseToCache","_ensureResponseSafeToCache","cache","open","hasCacheUpdateCallback","oldResponse","strippedRequestURL","keysOptions","ignoreSearch","cacheKeys","cacheMatchIgnoreParams","put","executeQuotaErrorCallbacks","newResponse","statefulCallback","statefulParam","shift","destroy","pluginsUsed","PrecacheStrategy","responseDone","handleAll","_getResponse","_awaitComplete","_handle","doneWaiting","waitUntilError","_fallbackToNetwork","fallbackToNetwork","copyRedirectedCacheableResponsesPlugin","cacheMatch","_handleInstall","_handleFetch","integrityInManifest","integrity","integrityInRequest","noIntegrityConflict","_useDefaultCacheabilityPluginIfNeeded","defaultPluginIndex","cacheWillUpdatePluginCount","entries","defaultPrecacheCacheabilityPlugin","cacheWillUpdate","redirected","PrecacheController","_urlsToCacheKeys","_urlsToCacheModes","_cacheKeysToIntegrities","install","bind","activate","addToCacheList","_installAndActiveListenersAdded","urlsToWarnAbout","cacheMode","firstEntry","secondEntry","warningMessage","console","warn","installReportPlugin","credentials","currentlyCachedRequests","expectedCacheKeys","values","deletedURLs","getURLsToCacheKeys","getCachedURLs","getIntegrityForCacheKey","createHandlerBoundToURL","getOrCreatePrecacheController","PrecacheRoute","urlsToCacheKeys","possibleURL","ignoreURLParametersMatching","directoryIndex","cleanURLs","urlManipulation","hash","urlWithoutIgnoredParams","paramName","some","test","removeIgnoredSearchParams","pathname","endsWith","directoryURL","cleanURL","additionalURLs","urlToAttempt","generateURLVariations","addRoute","capture","captureUrl","matchCallback","moduleName","funcName","currentPrecacheName","substringToFind","cacheNamesToDelete","includes","deleteOutdatedCaches","cachesDeleted"],"mappings":"6CAEA,IACIA,KAAK,uBAAyBC,GAExB,CAAV,MAAOC,GAAG,CCEV,MCgBaC,EAdIC,CAACC,KAASC,KACvB,IAAIC,EAAMF,EAIV,OAHIC,EAAKE,OAAS,IACdD,GAAQ,OAAME,KAAKC,UAAUJ,MAE1BC,CAAG,ECId,MAAMI,UAAqBC,MASvBC,YAAYC,EAAWC,GAEnBC,MADgBb,EAAiBW,EAAWC,IAE5CE,KAAKC,KAAOJ,EACZG,KAAKF,QAAUA,CACnB,EC9BJ,IACIf,KAAK,0BAA4BC,GAE3B,CAAV,MAAOC,GAAG,CCWH,MCAMiB,EAAoBC,GACzBA,GAA8B,iBAAZA,EASXA,EAWA,CAAEC,OAAQD,GCjBzB,MAAME,EAYFT,YAAYU,EAAOH,EAASI,EFhBH,OE8BrBP,KAAKG,QAAUD,EAAiBC,GAChCH,KAAKM,MAAQA,EACbN,KAAKO,OAASA,CACl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