'use strict';
const MANIFEST = 'flutter-app-manifest';
const TEMP = 'flutter-temp-cache';
const CACHE_NAME = 'flutter-app-cache';
const RESOURCES = {
  "assets/AssetManifest.json": "f3a500f85b9ab058aa7c664056bfe0af",
"assets/assets/images/about_asia.jpg": "f11ae531ba1ed701ae3b1b2f8c6cf2a4",
"assets/assets/images/about_balen.png": "46b5108dd88e65ab4bf1e5b900740c47",
"assets/assets/images/about_balene.png": "b87d02ac777dfdb65726c0f35351768b",
"assets/assets/images/africa.jpg": "943754cac658439a9d232d8ebca755db",
"assets/assets/images/antarctica.jpg": "57a72dce4966bd4d7df011b0f6f1e504",
"assets/assets/images/apple.png": "9afcd7bf90b31e6be1cb8242c2c82ef1",
"assets/assets/images/asia.jpg": "a0bdd51dc5836dbdc0c7f63d6edab44f",
"assets/assets/images/australia.jpg": "943754cac658439a9d232d8ebca755db",
"assets/assets/images/company.png": "65932f47bd6d472f2672f6ed2d79f254",
"assets/assets/images/europe.jpg": "57a72dce4966bd4d7df011b0f6f1e504",
"assets/assets/images/google.png": "b609bf7d75391c6be2e78748bdce0d17",
"assets/assets/images/huawei.png": "65f92602b4c255df7bc99002c7eb23b6",
"assets/assets/images/neo.jpg": "a4889f31662701932df2dd0e37cbe7dc",
"assets/assets/images/sim.jpeg": "444dc66984b5dd1d66035d288a0193cc",
"assets/assets/images/south_america.jpg": "3f896db8bf0f6f686522ab5a62302f90",
"assets/assets/images/Travel-card-2.png": "be5f472350a3e357f248382ef348c12d",
"assets/assets/images/vo.png": "640113e52f4573fe3324f111b9daa399",
"assets/assets/images/voucher%2520(1).jpg": "8ebea4e8f2f5216a2eddb33c67d535dd",
"assets/assets/images/voucher%2520(2).jpg": "51c3069c33efe2747ec02a0730892a6d",
"assets/assets/images/voucher%2520(3).jpg": "fc85b47a9b536731087ad87b4dae55ef",
"assets/assets/images/voucher%2520(4).jpg": "67d03379b8c3fd0185a619024f6640e9",
"assets/assets/images/voucher_.jpg": "42e9e610c3d3c233839ad08ea523345b",
"assets/assets/logo/brands%2520(1).jpg": "0c2fd09cb27a266349f4812a3bda4931",
"assets/assets/logo/brands%2520(1).png": "aa02fc39961fa6a60c82678438bf4ffc",
"assets/assets/logo/brands%2520(10).jpg": "537d8ff1a5e8da0a9340011cbc849737",
"assets/assets/logo/brands%2520(10).png": "c9ca4ee89e0d9b59b780502d2b305b11",
"assets/assets/logo/brands%2520(11).jpg": "84896bad6b2831fdf39ba5309160eb1f",
"assets/assets/logo/brands%2520(11).png": "28c606dbbf31a2dc8af80166ae1a5762",
"assets/assets/logo/brands%2520(12).jpg": "e171c0c0c21e4fdff18bfa7d0b11732a",
"assets/assets/logo/brands%2520(12).png": "1533548d0c3f2f3b97ec0ab163eddb50",
"assets/assets/logo/brands%2520(13).jpg": "95b595f8e161436fb696156906f9b6f6",
"assets/assets/logo/brands%2520(13).png": "eec52c9eaf1a993ecc9de0a5d828a940",
"assets/assets/logo/brands%2520(14).jpg": "74ba8d2592b1825eae543f9c6af826f7",
"assets/assets/logo/brands%2520(14).png": "31eaf8fbfe06e092a979508e82ce6190",
"assets/assets/logo/brands%2520(15).jpg": "76b7b3cb3444ba1601e487d6af9405da",
"assets/assets/logo/brands%2520(15).png": "9634cb5d585e2e435cf588cb52a4ae03",
"assets/assets/logo/brands%2520(16).jpg": "d8eb792788e6fa443d22e800c64b0615",
"assets/assets/logo/brands%2520(16).png": "ebe4c3a3d00e00e9b26d18fcde77a3b6",
"assets/assets/logo/brands%2520(17).jpg": "56dd845db869b8c7b3d6ddddaedc15c4",
"assets/assets/logo/brands%2520(17).png": "d667993bac2e343f9e60e07df7ed5483",
"assets/assets/logo/brands%2520(18).jpg": "7c93fb4581e6151dfeba9b97f33503d7",
"assets/assets/logo/brands%2520(18).png": "3934e8b7182062b2118b5329a2294964",
"assets/assets/logo/brands%2520(19).jpg": "0de0136ebc4dfc9df69aa89f6e73d4d9",
"assets/assets/logo/brands%2520(19).png": "594668996b828d1de3cb13ae2a542e53",
"assets/assets/logo/brands%2520(2).jpg": "86cc439cb41f4f56d5f44991e0762ce8",
"assets/assets/logo/brands%2520(2).png": "55321f3c57fdbd20c9d81256d70a4cf3",
"assets/assets/logo/brands%2520(20).jpg": "b712921b3bb5b351bb1d52d16d451f28",
"assets/assets/logo/brands%2520(20).png": "ee97f5c1313177de473069882c8b8986",
"assets/assets/logo/brands%2520(21).png": "f237788e50df35457730f08b20bd6e57",
"assets/assets/logo/brands%2520(23).png": "11dc437ab8ef0c32289c092083d20068",
"assets/assets/logo/brands%2520(24).png": "f04ec20c9be56045793cf33053f5878a",
"assets/assets/logo/brands%2520(25).png": "608492808b786387dd68bbd4252f0142",
"assets/assets/logo/brands%2520(26).png": "e264c830895d3aefbc11fa05d68d1a24",
"assets/assets/logo/brands%2520(27).png": "ae9fdebac8fa3bd2d03e53ec30d41c0e",
"assets/assets/logo/brands%2520(28).png": "7347b297a2e147a7cbd2f2cae983abee",
"assets/assets/logo/brands%2520(29).png": "6f88c8f476c9b445db5ed479e39e5ced",
"assets/assets/logo/brands%2520(3).jpg": "70cfb121c8f54bfaf84bcb1e5cd96794",
"assets/assets/logo/brands%2520(3).png": "038cce631aae8f29a7cc6cc94b448623",
"assets/assets/logo/brands%2520(30).png": "c33e4243414f3ce5c118b18321af6956",
"assets/assets/logo/brands%2520(31).png": "1e36b6f6b462da7e10fd6f6727e0c87c",
"assets/assets/logo/brands%2520(32).png": "7b94f01d198497ca5db2a6e3cf52276e",
"assets/assets/logo/brands%2520(4).jpg": "1f486243781317ecd62ad74492af740b",
"assets/assets/logo/brands%2520(4).png": "80049857d63894aef528baa99633542f",
"assets/assets/logo/brands%2520(5).jpg": "a4567671e23cb8340acdc96d148c49d3",
"assets/assets/logo/brands%2520(5).png": "2670d10bc54da40d80f143a21566554e",
"assets/assets/logo/brands%2520(6).jpg": "8f3a54ffb4c265bb274c173d6a9faa2c",
"assets/assets/logo/brands%2520(6).png": "eadf1f83019fd16bbbdc9cc28cd454f7",
"assets/assets/logo/brands%2520(7).jpg": "e56357e281e72747731695192016c2ba",
"assets/assets/logo/brands%2520(7).png": "0f25039bed41bdabdd9117f0c125ac6c",
"assets/assets/logo/brands%2520(8).jpg": "b39620f96315b124118ad40800282274",
"assets/assets/logo/brands%2520(8).png": "90c087424ba583bce826e25e7767d67e",
"assets/assets/logo/brands%2520(9).jpg": "ffa4a6624dba9d276b91a8202c918cd8",
"assets/assets/logo/brands%2520(9).png": "58a23010f101ee582196f0c634c5e221",
"assets/FontManifest.json": "4c229036137d7dd4f3e072355513fe6f",
"assets/fonts/Electrolize-Regular.ttf": "1be3e0aaeb2bbd1985615a49da7f2eaf",
"assets/fonts/MaterialIcons-Regular.otf": "95db9098c58fd6db106f1116bae85a0b",
"assets/fonts/Montserrat-Regular.ttf": "ee6539921d713482b8ccd4d0d23961bb",
"assets/fonts/Rabar_021.ttf": "03d026fbc6d28522c0ff23ab50f3ba54",
"assets/NOTICES": "3319704d5bd6c09b0e2a26e6c1bb171a",
"assets/packages/cupertino_icons/assets/CupertinoIcons.ttf": "6d342eb68f170c97609e9da345464e5e",
"assets/packages/font_awesome_flutter/lib/fonts/fa-brands-400.ttf": "99f29024aee8f4672a47cc3a81b9b84a",
"assets/packages/font_awesome_flutter/lib/fonts/fa-regular-400.ttf": "48ce1bb8a42776caa951cb782d277730",
"assets/packages/font_awesome_flutter/lib/fonts/fa-solid-900.ttf": "d8e9b6203ce2657c991f0b339ccb3a6d",
"assets/packages/wakelock_web/assets/no_sleep.js": "7748a45cd593f33280669b29c2c8919a",
"assets/shaders/ink_sparkle.frag": "6333b551ea27fd9d8e1271e92def26a9",
"canvaskit/canvaskit.js": "2bc454a691c631b07a9307ac4ca47797",
"canvaskit/canvaskit.wasm": "bf50631470eb967688cca13ee181af62",
"canvaskit/profiling/canvaskit.js": "38164e5a72bdad0faa4ce740c9b8e564",
"canvaskit/profiling/canvaskit.wasm": "95a45378b69e77af5ed2bc72b2209b94",
"favicon.png": "5dcef449791fa27946b3d35ad8803796",
"flutter.js": "f85e6fb278b0fd20c349186fb46ae36d",
"icon.png": "cb78a5723cd431dedbef74cc1eab6758",
"icons/android-chrome-192x192.png": "cb78a5723cd431dedbef74cc1eab6758",
"icons/android-chrome-512x512.png": "001e3ef3ded643a0438dec72dac48620",
"icons/apple-touch-icon.png": "29423efa89219871537bfbb370c5a096",
"index.html": "42dd62e49d8eaf011380b1c1f7fa265a",
"/": "42dd62e49d8eaf011380b1c1f7fa265a",
"main.dart.js": "9f1447d925e0e8d98cbc6b74bf339fd9",
"manifest.json": "7b8895b962277efd392ffb5a94a6f11d",
"version.json": "a7e0b5aef7930ebb0acebf36e8cdce26"
};

// The application shell files that are downloaded before a service worker can
// start.
const CORE = [
  "main.dart.js",
"index.html",
"assets/AssetManifest.json",
"assets/FontManifest.json"];
// During install, the TEMP cache is populated with the application shell files.
self.addEventListener("install", (event) => {
  self.skipWaiting();
  return event.waitUntil(
    caches.open(TEMP).then((cache) => {
      return cache.addAll(
        CORE.map((value) => new Request(value, {'cache': 'reload'})));
    })
  );
});

// During activate, the cache is populated with the temp files downloaded in
// install. If this service worker is upgrading from one with a saved
// MANIFEST, then use this to retain unchanged resource files.
self.addEventListener("activate", function(event) {
  return event.waitUntil(async function() {
    try {
      var contentCache = await caches.open(CACHE_NAME);
      var tempCache = await caches.open(TEMP);
      var manifestCache = await caches.open(MANIFEST);
      var manifest = await manifestCache.match('manifest');
      // When there is no prior manifest, clear the entire cache.
      if (!manifest) {
        await caches.delete(CACHE_NAME);
        contentCache = await caches.open(CACHE_NAME);
        for (var request of await tempCache.keys()) {
          var response = await tempCache.match(request);
          await contentCache.put(request, response);
        }
        await caches.delete(TEMP);
        // Save the manifest to make future upgrades efficient.
        await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES)));
        return;
      }
      var oldManifest = await manifest.json();
      var origin = self.location.origin;
      for (var request of await contentCache.keys()) {
        var key = request.url.substring(origin.length + 1);
        if (key == "") {
          key = "/";
        }
        // If a resource from the old manifest is not in the new cache, or if
        // the MD5 sum has changed, delete it. Otherwise the resource is left
        // in the cache and can be reused by the new service worker.
        if (!RESOURCES[key] || RESOURCES[key] != oldManifest[key]) {
          await contentCache.delete(request);
        }
      }
      // Populate the cache with the app shell TEMP files, potentially overwriting
      // cache files preserved above.
      for (var request of await tempCache.keys()) {
        var response = await tempCache.match(request);
        await contentCache.put(request, response);
      }
      await caches.delete(TEMP);
      // Save the manifest to make future upgrades efficient.
      await manifestCache.put('manifest', new Response(JSON.stringify(RESOURCES)));
      return;
    } catch (err) {
      // On an unhandled exception the state of the cache cannot be guaranteed.
      console.error('Failed to upgrade service worker: ' + err);
      await caches.delete(CACHE_NAME);
      await caches.delete(TEMP);
      await caches.delete(MANIFEST);
    }
  }());
});

// The fetch handler redirects requests for RESOURCE files to the service
// worker cache.
self.addEventListener("fetch", (event) => {
  if (event.request.method !== 'GET') {
    return;
  }
  var origin = self.location.origin;
  var key = event.request.url.substring(origin.length + 1);
  // Redirect URLs to the index.html
  if (key.indexOf('?v=') != -1) {
    key = key.split('?v=')[0];
  }
  if (event.request.url == origin || event.request.url.startsWith(origin + '/#') || key == '') {
    key = '/';
  }
  // If the URL is not the RESOURCE list then return to signal that the
  // browser should take over.
  if (!RESOURCES[key]) {
    return;
  }
  // If the URL is the index.html, perform an online-first request.
  if (key == '/') {
    return onlineFirst(event);
  }
  event.respondWith(caches.open(CACHE_NAME)
    .then((cache) =>  {
      return cache.match(event.request).then((response) => {
        // Either respond with the cached resource, or perform a fetch and
        // lazily populate the cache only if the resource was successfully fetched.
        return response || fetch(event.request).then((response) => {
          if (response && Boolean(response.ok)) {
            cache.put(event.request, response.clone());
          }
          return response;
        });
      })
    })
  );
});

self.addEventListener('message', (event) => {
  // SkipWaiting can be used to immediately activate a waiting service worker.
  // This will also require a page refresh triggered by the main worker.
  if (event.data === 'skipWaiting') {
    self.skipWaiting();
    return;
  }
  if (event.data === 'downloadOffline') {
    downloadOffline();
    return;
  }
});

// Download offline will check the RESOURCES for all files not in the cache
// and populate them.
async function downloadOffline() {
  var resources = [];
  var contentCache = await caches.open(CACHE_NAME);
  var currentContent = {};
  for (var request of await contentCache.keys()) {
    var key = request.url.substring(origin.length + 1);
    if (key == "") {
      key = "/";
    }
    currentContent[key] = true;
  }
  for (var resourceKey of Object.keys(RESOURCES)) {
    if (!currentContent[resourceKey]) {
      resources.push(resourceKey);
    }
  }
  return contentCache.addAll(resources);
}

// Attempt to download the resource online before falling back to
// the offline cache.
function onlineFirst(event) {
  return event.respondWith(
    fetch(event.request).then((response) => {
      return caches.open(CACHE_NAME).then((cache) => {
        cache.put(event.request, response.clone());
        return response;
      });
    }).catch((error) => {
      return caches.open(CACHE_NAME).then((cache) => {
        return cache.match(event.request).then((response) => {
          if (response != null) {
            return response;
          }
          throw error;
        });
      });
    })
  );
}
