{"version":3,"sources":["connectivity.status.js"],"names":["clearTimeoutHandle","toggleContainer","isOnline","connectionContainer","$","statusContainer","imageContainer","clearTimeout","undefined","fadeIn","is_Online","text","imgUrl","attr","css","color","setTimeout","fadeOut","hide","document","addEventListener","navigator","onLine","window"],"mappings":"AAAA,IAAIA,mBAaJ,SAASC,gBAAgBC,GACrB,MAAMC,EAAsBC,EAAE,kCAAmCC,EAAkBD,EAAE,aAAcE,EAAiBF,EAAE,cAEtH,GADAG,aAAaP,yBACWQ,WAAbN,EAAwB,CAC/BC,EAAoBM,OAAO,QAC3B,MAAMC,GAAyB,IAAbR,EACZS,EAAOD,EAAY,+BAAiC,2BACpDE,EAASF,EAAY,YAAc,mBACzCJ,EAAeO,KAAK,MAAOD,GAC3BP,EAAgBM,KAAKA,GAAMG,IAAI,CAAEC,MAAOL,EAAY,OAAS,QAC7DV,mBAAqBgB,WAAW,KAC5BZ,EAAED,GAAqBc,QAAQ,SAChC,MAxBXb,EAAE,kCAAkCc,OACpCC,SAASC,iBAAiB,mBAAoB,KACrCC,UAAUC,QACXrB,iBAAgB,KAGxBsB,OAAOH,iBAAiB,SAAU,KAC9BnB,iBAAgB,KAEpBsB,OAAOH,iBAAiB,UAAW,KAC/BnB,iBAAgB","file":"../connectivity.status.js","sourcesContent":["let clearTimeoutHandle;\n$('.__connection-state__container').hide();\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n if (!navigator.onLine) {\n toggleContainer(false);\n }\n});\nwindow.addEventListener(\"online\", () => {\n toggleContainer(true);\n});\nwindow.addEventListener(\"offline\", () => {\n toggleContainer(false);\n});\nfunction toggleContainer(isOnline) {\n const connectionContainer = $('.__connection-state__container'), statusContainer = $('.__status'), imageContainer = $('.icon-logo');\n clearTimeout(clearTimeoutHandle);\n if (typeof isOnline !== undefined) {\n connectionContainer.fadeIn(\"slow\");\n const is_Online = isOnline === true;\n const text = is_Online ? \"Connection has been restored\" : \"Internet connection lost\";\n const imgUrl = is_Online ? '/wifi.png' : '/no-internet.png';\n imageContainer.attr('src', imgUrl);\n statusContainer.text(text).css({ color: is_Online ? '#000' : 'red' });\n clearTimeoutHandle = setTimeout(() => {\n $(connectionContainer).fadeOut(\"slow\");\n }, 5000);\n }\n}\n"]}