diff --git a/build/_locales/de/messages.json b/build/_locales/de/messages.json index a7bc11a..dad83e2 100644 --- a/build/_locales/de/messages.json +++ b/build/_locales/de/messages.json @@ -1,6 +1,6 @@ { "extName": { - "message": "Screenity - Bildschirmaufnahme & Beschriftungswerkzeug", + "message": "Screenity - Bildschirmaufnahme & Beschriftung", "description": "Erweiterungsname" }, "extDesc": { diff --git a/build/_locales/fr/messages.json b/build/_locales/fr/messages.json index a44f3b4..d7a3408 100644 --- a/build/_locales/fr/messages.json +++ b/build/_locales/fr/messages.json @@ -1,6 +1,6 @@ { "extName": { - "message": "Screenity - Enregistreur d'écran et outil d'annotation", + "message": "Screenity - Capture & Annotation d'écran", "description": "Nom de l'extension" }, "extDesc": { diff --git a/build/_locales/hi/messages.json b/build/_locales/hi/messages.json index 7b86cea..f2f18d5 100644 --- a/build/_locales/hi/messages.json +++ b/build/_locales/hi/messages.json @@ -1,6 +1,6 @@ { "extName": { - "message": "स्क्रीनिटी – स्क्रीन रिकॉर्डिंग और व्याख्या का उपकरण", + "message": "स्क्रीनिटी - स्क्रीन रिकॉर्डिंग & नोट्स", "description": "एक्सटेंशन का नाम" }, "extDesc": { diff --git a/build/_locales/pl/messages.json b/build/_locales/pl/messages.json index f2d4b69..75257e1 100644 --- a/build/_locales/pl/messages.json +++ b/build/_locales/pl/messages.json @@ -1,6 +1,6 @@ { "extName": { - "message": "Screenity - Rejestrator ekranu & Narzędzie do adnotacji", + "message": "Screenity - Nagrywarka & Edytor adnotacji", "description": "Nazwa rozszerzenia" }, "extDesc": { diff --git a/build/_locales/ru/messages.json b/build/_locales/ru/messages.json index 71b4479..3262ebb 100644 --- a/build/_locales/ru/messages.json +++ b/build/_locales/ru/messages.json @@ -1,6 +1,6 @@ { "extName": { - "message": "Screenity - Инструмент для записи экрана и аннотаций", + "message": "Screenity - Запись экрана & Аннотации", "description": "Название расширения" }, "extDesc": { diff --git a/build/_locales/ta/messages.json b/build/_locales/ta/messages.json index 5f4f4f0..464418b 100644 --- a/build/_locales/ta/messages.json +++ b/build/_locales/ta/messages.json @@ -1,6 +1,6 @@ { "extName": { - "message": "ஸ்க்ரீனிட்டி - திரை ரெக்கார்டர் & சிறுகுறிப்பு கருவி", + "message": "ஸ்க்ரீனிட்டி - திரைப்பதிவு & குறிப்புகள்", "description": "நீட்சிதம் பெயர்" }, "extDesc": { diff --git a/build/_locales/tr/messages.json b/build/_locales/tr/messages.json index f5fa117..1ef9cda 100644 --- a/build/_locales/tr/messages.json +++ b/build/_locales/tr/messages.json @@ -1,6 +1,6 @@ { "extName": { - "message": "Screenity - Ekran Kaydedici & Not Ekleme Aracı", + "message": "Screenity - Ekran Kayıt & Not Aracı", "description": "Uzantı adı" }, "extDesc": { diff --git a/build/_locales/uk/messages.json b/build/_locales/uk/messages.json index 73dcf09..14d8b14 100644 --- a/build/_locales/uk/messages.json +++ b/build/_locales/uk/messages.json @@ -1,6 +1,6 @@ { "extName": { - "message": "Screenity - Запис екрану та інструмент для анотацій", + "message": "Screenity - Запис екрану & Анотації", "description": "Extension name" }, "extDesc": { diff --git a/build/background.bundle.js b/build/background.bundle.js index bc27ed0..636e31a 100644 --- a/build/background.bundle.js +++ b/build/background.bundle.js @@ -5,4 +5,4 @@ https://localforage.github.io/localForage (c) 2013-2017 Mozilla, Apache License 2.0 */ -e.exports=function e(t,r,n){function o(i,c){if(!r[i]){if(!t[i]){if(a)return a(i,!0);var u=new Error("Cannot find module '"+i+"'");throw u.code="MODULE_NOT_FOUND",u}var s=r[i]={exports:{}};t[i][0].call(s.exports,(function(e){var r=t[i][1][e];return o(r||e)}),s,s.exports,e,t,r,n)}return r[i].exports}for(var a=void 0,i=0;i=43)}})).catch((function(){return!1}))}function k(e){return"boolean"==typeof m?s.resolve(m):x(e).then((function(e){return m=e}))}function E(e){var t=v[e.name],r={};r.promise=new s((function(e,t){r.resolve=e,r.reject=t})),t.deferredOperations.push(r),t.dbReady?t.dbReady=t.dbReady.then((function(){return r.promise})):t.dbReady=r.promise}function _(e){var t=v[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function I(e,t){var r=v[e.name].deferredOperations.pop();if(r)return r.reject(t),r.promise}function T(e,t){return new s((function(r,n){if(v[e.name]=v[e.name]||P(),e.db){if(!t)return r(e.db);E(e),e.db.close()}var o=[e.name];t&&o.push(e.version);var a=i.open.apply(i,o);t&&(a.onupgradeneeded=function(t){var r=a.result;try{r.createObjectStore(e.storeName),t.oldVersion<=1&&r.createObjectStore(d)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),a.onerror=function(e){e.preventDefault(),n(a.error)},a.onsuccess=function(){var t=a.result;t.onversionchange=function(e){e.target.close()},r(t),_(e)}}))}function S(e){return T(e,!1)}function L(e){return T(e,!0)}function j(e,t){if(!e.db)return!0;var r=!e.db.objectStoreNames.contains(e.storeName),n=e.versione.db.version;if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),o||r){if(r){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function O(e){return new s((function(t,r){var n=new FileReader;n.onerror=r,n.onloadend=function(r){var n=btoa(r.target.result||"");t({__local_forage_encoded_blob:!0,data:n,type:e.type})},n.readAsBinaryString(e)}))}function A(e){return u([w(atob(e.data))],{type:e.type})}function N(e){return e&&e.__local_forage_encoded_blob}function D(e){var t=this,r=t._initReady().then((function(){var e=v[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return l(r,e,e),r}function R(e){E(e);for(var t=v[e.name],r=t.forages,n=0;n0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return s.resolve().then((function(){if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),L(e)})).then((function(){return R(e).then((function(){C(e,t,r,n-1)}))})).catch(r);r(o)}}function P(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function F(e){var t=this,r={db:null};if(e)for(var n in e)r[n]=e[n];var o=v[r.name];o||(o=P(),v[r.name]=o),o.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=D);var a=[];function i(){return s.resolve()}for(var c=0;c>4,f[u++]=(15&n)<<4|o>>2,f[u++]=(3&o)<<6|63&a;return s}function de(e){var t,r=new Uint8Array(e),n="";for(t=0;t>2],n+=X[(3&r[t])<<4|r[t+1]>>4],n+=X[(15&r[t+1])<<2|r[t+2]>>6],n+=X[63&r[t+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function me(e,t){var r="";if(e&&(r=he.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===he.call(e.buffer))){var n,o=Z;e instanceof ArrayBuffer?(n=e,o+=ee):(n=e.buffer,"[object Int8Array]"===r?o+=re:"[object Uint8Array]"===r?o+=ne:"[object Uint8ClampedArray]"===r?o+=oe:"[object Int16Array]"===r?o+=ae:"[object Uint16Array]"===r?o+=ce:"[object Int32Array]"===r?o+=ie:"[object Uint32Array]"===r?o+=ue:"[object Float32Array]"===r?o+=se:"[object Float64Array]"===r?o+=fe:t(new Error("Failed to get type for BinaryArray"))),t(o+de(n))}else if("[object Blob]"===r){var a=new FileReader;a.onload=function(){var r=J+e.type+"~"+de(this.result);t(Z+te+r)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}}function ve(e){if(e.substring(0,$)!==Z)return JSON.parse(e);var t,r=e.substring(le),n=e.substring($,le);if(n===te&&Q.test(r)){var o=r.match(Q);t=o[1],r=r.substring(o[0].length)}var a=pe(r);switch(n){case ee:return a;case te:return u([a],{type:t});case re:return new Int8Array(a);case ne:return new Uint8Array(a);case oe:return new Uint8ClampedArray(a);case ae:return new Int16Array(a);case ce:return new Uint16Array(a);case ie:return new Int32Array(a);case ue:return new Uint32Array(a);case se:return new Float32Array(a);case fe:return new Float64Array(a);default:throw new Error("Unkown type: "+n)}}var ge={serialize:me,deserialize:ve,stringToBuffer:pe,bufferToString:de};function ye(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function be(e){var t=this,r={db:null};if(e)for(var n in e)r[n]="string"!=typeof e[n]?e[n].toString():e[n];var o=new s((function(e,n){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(e){return n(e)}r.db.transaction((function(o){ye(o,r,(function(){t._dbInfo=r,e()}),(function(e,t){n(t)}))}),n)}));return r.serializer=ge,o}function we(e,t,r,n,o,a){e.executeSql(r,n,o,(function(e,i){i.code===i.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,c){c.rows.length?a(e,i):ye(e,t,(function(){e.executeSql(r,n,o,a)}),a)}),a):a(e,i)}),a)}function xe(e,t){var r=this;e=h(e);var n=new s((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){we(r,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=o.serializer.deserialize(n)),t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return f(n,t),n}function ke(e,t){var r=this,n=new s((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){we(r,o,"SELECT * FROM "+o.storeName,[],(function(r,n){for(var a=n.rows,i=a.length,c=0;c0)return void a(Ee.apply(o,[e,c,r,n-1]));i(t)}}))}))})).catch(i)}));return f(a,r),a}function _e(e,t,r){return Ee.apply(this,[e,t,r,1])}function Ie(e,t){var r=this;e=h(e);var n=new s((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){we(r,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){n(t)}))}))})).catch(n)}));return f(n,t),n}function Te(e){var t=this,r=new s((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){we(t,n,"DELETE FROM "+n.storeName,[],(function(){e()}),(function(e,t){r(t)}))}))})).catch(r)}));return f(r,e),r}function Se(e){var t=this,r=new s((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){we(t,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],(function(t,r){var n=r.rows.item(0).c;e(n)}),(function(e,t){r(t)}))}))})).catch(r)}));return f(r,e),r}function Le(e,t){var r=this,n=new s((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){we(r,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,r){var n=r.rows.length?r.rows.item(0).key:null;t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return f(n,t),n}function je(e){var t=this,r=new s((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){we(t,n,"SELECT key FROM "+n.storeName,[],(function(t,r){for(var n=[],o=0;o '__WebKitDatabaseInfoTable__'",[],(function(r,n){for(var o=[],a=0;a0}function Fe(e){var t=this,r={};if(e)for(var n in e)r[n]=e[n];return r.keyPrefix=Re(e,t._defaultConfig),Pe()?(t._dbInfo=r,r.serializer=ge,s.resolve()):s.reject()}function Ue(e){var t=this,r=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(e)&&localStorage.removeItem(n)}}));return f(r,e),r}function Me(e,t){var r=this;e=h(e);var n=r.ready().then((function(){var t=r._dbInfo,n=localStorage.getItem(t.keyPrefix+e);return n&&(n=t.serializer.deserialize(n)),n}));return f(n,t),n}function Be(e,t){var r=this,n=r.ready().then((function(){for(var t=r._dbInfo,n=t.keyPrefix,o=n.length,a=localStorage.length,i=1,c=0;c=0;t--){var r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}})):s.reject("Invalid arguments"),f(n,t),n}var Ke={_driver:"localStorageWrapper",_initStorage:Fe,_support:De(),iterate:Be,getItem:Me,setItem:Ye,removeItem:We,clear:Ue,length:ze,key:qe,keys:Ge,dropInstance:Ve},He=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},Xe=function(e,t){for(var r=e.length,n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return n};var r,n={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(r){l=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,a=Object.create(o.prototype),c=new N(n||[]);return i(a,"_invoke",{value:L(e,r,c)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var d="suspendedStart",m="suspendedYield",v="executing",g="completed",y={};function b(){}function w(){}function x(){}var k={};l(k,u,(function(){return this}));var E=Object.getPrototypeOf,_=E&&E(E(D([])));_&&_!==o&&a.call(_,u)&&(k=_);var I=x.prototype=b.prototype=Object.create(k);function T(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function S(t,r){function n(o,i,c,u){var s=p(t[o],t,i);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==e(l)&&a.call(l,"__await")?r.resolve(l.__await).then((function(e){n("next",e,c,u)}),(function(e){n("throw",e,c,u)})):r.resolve(l).then((function(e){f.value=e,c(f)}),(function(e){return n("throw",e,c,u)}))}u(s.arg)}var o;i(this,"_invoke",{value:function(e,t){function a(){return new r((function(r,o){n(e,t,r,o)}))}return o=o?o.then(a,a):a()}})}function L(e,t,n){var o=d;return function(a,i){if(o===v)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:r,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=p(e,t,n);if("normal"===s.type){if(o=n.done?g:m,s.arg===y)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=g,n.method="throw",n.arg=s.arg)}}}function j(e,t){var n=t.method,o=e.iterator[n];if(o===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=r,j(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=p(o,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,y;var i=a.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,y):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,y)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function e(){for(;++o=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),s=a.call(i,"finallyLoc");if(u&&s){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:D(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),y}},n}function n(e,t,r,n,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}const o=function(){var e,r=(e=t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,chrome.identity.getAuthToken({interactive:!0});case 3:if(r=e.sent){e.next=6;break}throw new Error("User cancelled sign-in or failed to get token");case 6:return e.next=8,new Promise((function(e){return chrome.storage.local.set({token:r.token},(function(){return e()}))}));case 8:return e.next=10,chrome.identity.getProfileUserInfo();case 10:return e.sent,e.abrupt("return",r.token);case 14:return e.prev=14,e.t0=e.catch(0),console.error("Error signing in:",e.t0.message),e.abrupt("return",null);case 19:case"end":return e.stop()}}),e,null,[[0,14]])})),function(){var t=this,r=arguments;return new Promise((function(o,a){var i=e.apply(t,r);function c(e){n(i,o,a,c,u,"next",e)}function u(e){n(i,o,a,c,u,"throw",e)}c(void 0)}))});return function(){return r.apply(this,arguments)}}();function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var a=t&&t.prototype instanceof b?t:b,i=Object.create(a.prototype),c=new N(n||[]);return o(i,"_invoke",{value:L(e,r,c)}),i}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var d="suspendedStart",m="suspendedYield",v="executing",g="completed",y={};function b(){}function w(){}function x(){}var k={};l(k,u,(function(){return this}));var E=Object.getPrototypeOf,_=E&&E(E(D([])));_&&_!==r&&n.call(_,u)&&(k=_);var I=x.prototype=b.prototype=Object.create(k);function T(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(o,i,c,u){var s=p(e[o],e,i);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==a(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,c,u)}),(function(e){r("throw",e,c,u)})):t.resolve(l).then((function(e){f.value=e,c(f)}),(function(e){return r("throw",e,c,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function L(t,r,n){var o=d;return function(a,i){if(o===v)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=p(t,r,n);if("normal"===s.type){if(o=n.done?g:m,s.arg===y)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=g,n.method="throw",n.arg=s.arg)}}}function j(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,j(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=p(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function D(t){if(t||""===t){var r=t[u];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:D(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function c(e,t,r,n,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}function u(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){c(a,n,o,i,u,"next",e)}function u(e){c(a,n,o,i,u,"throw",e)}i(void 0)}))}}const s=function(){var e=u(i().mark((function e(t,r,n){var a,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=function(){return c=u(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){chrome.storage.local.get(["token"],function(){var r=u(i().mark((function r(n){var a,c,u,s;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!chrome.runtime.lastError){r.next=4;break}t(new Error(chrome.runtime.lastError)),r.next=24;break;case 4:if((a=n.token)&&null!==a){r.next=13;break}return r.next=8,o();case 8:(c=r.sent)&&null!==c||t(new Error("Sign-in failed")),e(c),r.next=24;break;case 13:r.prev=13,u=JSON.parse(atob(a.split(".")[1])),r.next=21;break;case 17:return r.prev=17,r.t0=r.catch(13),chrome.identity.getAuthToken({interactive:!0},(function(r){chrome.runtime.lastError?t(new Error(chrome.runtime.lastError)):e(r)})),r.abrupt("return");case 21:s=1e3*u.exp,Date.now()>=s?chrome.identity.getAuthToken({interactive:!0},(function(r){chrome.runtime.lastError?t(new Error(chrome.runtime.lastError)):e(r)})):e(a);case 24:case"end":return r.stop()}}),r,null,[[13,17]])})));return function(e){return r.apply(this,arguments)}}())})));case 1:case"end":return e.stop()}}),e)}))),c.apply(this,arguments)},a=function(){return c.apply(this,arguments)},e.abrupt("return",new Promise(function(){var e=u(i().mark((function e(o,c){var u,s,f,l,h,p,d,m;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,a();case 3:if((u=e.sent)&&null!==u){e.next=6;break}throw new Error("Sign-in failed");case 6:return s=new Headers({Authorization:"Bearer ".concat(u),"Content-Type":t.type}),e.next=9,fetch("https://www.googleapis.com/upload/drive/v3/files?uploadType=media",{method:"POST",headers:s,body:t});case 9:if((f=e.sent).ok){e.next=12;break}throw new Error("Error uploading to Google Drive: ".concat(f.status));case 12:return e.next=14,f.json();case 14:if(l=e.sent,h=l.id){e.next=18;break}throw new Error("File ID is undefined");case 18:return p={name:r},e.next=21,fetch("https://www.googleapis.com/drive/v3/files/".concat(h),{method:"PATCH",headers:new Headers({Authorization:"Bearer ".concat(u),"Content-Type":"application/json; charset=UTF-8"}),body:JSON.stringify(p)});case 21:if((d=e.sent).ok){e.next=28;break}return e.next=25,d.json();case 25:throw m=e.sent,console.error("Error updating file metadata:",d.status,m.error.message),new Error("Error updating file metadata: ".concat(d.status));case 28:n({status:"ok",url:h}),chrome.tabs.create({url:"https://drive.google.com/file/d/".concat(h,"/view")}),o("https://drive.google.com/file/d/".concat(h,"/view")),e.next=38;break;case 33:e.prev=33,e.t0=e.catch(0),console.error("Error uploading to Google Drive:",e.t0.message),n({status:"ew",url:null}),c(e.t0);case 38:case"end":return e.stop()}}),e,null,[[0,33]])})));return function(t,r){return e.apply(this,arguments)}}()));case 3:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}();function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,s=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:D(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function d(e,t,r,n,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}function m(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){d(a,n,o,i,c,"next",e)}function c(e){d(a,n,o,i,c,"throw",e)}i(void 0)}))}}var v=function(){var e=m(p().mark((function e(t,r){var n,o,a,i=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.length>2&&void 0!==i[2]&&i[2],o=i.length>3&&void 0!==i[3]&&i[3],null!==t&&null!==r){e.next=4;break}return e.abrupt("return");case 4:return e.prev=4,e.next=7,new Promise((function(e){chrome.tabs.get(t,(function(t){e(t)}))}));case 7:if(!((a=e.sent)&&a.url&&a.url.startsWith("chrome://")||a.url.startsWith("chromewebstore.google.com")||a.url.startsWith("chrome.google.com/webstore")||""===a.url||"about:blank"===a.url)){e.next=12;break}return e.abrupt("return");case 12:if(a&&a.url){e.next=14;break}return e.abrupt("return");case 14:a&&a.id?n&&"function"==typeof n?chrome.tabs.sendMessage(a.id,r,n):chrome.tabs.sendMessage(a.id,r):o&&"function"==typeof o&&o(),e.next=19;break;case 17:e.prev=17,e.t0=e.catch(4);case 19:case"end":return e.stop()}}),e,null,[[4,17]])})));return function(t,r){return e.apply(this,arguments)}}(),g=function(){var e=m(p().mark((function e(t){var r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,new Promise((function(e){chrome.tabs.get(t,(function(t){e(t)}))}));case 5:(r=e.sent)&&r.id&&chrome.windows.update(r.windowId,{focused:!0}).then((function(){chrome.tabs.update(r.id,{active:!0})})),e.next=11;break;case 9:e.prev=9,e.t0=e.catch(2);case 11:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t){return e.apply(this,arguments)}}(),y=function(){var e=m(p().mark((function e(t){var r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,new Promise((function(e){chrome.tabs.get(t,(function(t){e(t)}))}));case 5:(r=e.sent)&&r.id&&chrome.tabs.remove(r.id),e.next=11;break;case 9:e.prev=9,e.t0=e.catch(2);case 11:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t){return e.apply(this,arguments)}}(),b=function(){var e=m(p().mark((function e(){var t,r,n,o;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={active:!0,lastFocusedWindow:!0},e.next=3,chrome.tabs.query(t);case 3:return r=e.sent,n=l(r,1),o=n[0],e.abrupt("return",o);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),w=function(){var e=m(p().mark((function e(t){var r,n,o,a=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=a.length>1&&void 0!==a[1]&&a[1],n=a.length>2&&void 0!==a[2]&&a[2],t){e.next=4;break}return e.abrupt("return");case 4:r&&((o=chrome.i18n.getMessage("@@ui_locale")).includes("en")||(t="http://translate.google.com/translate?js=n&sl=auto&tl="+o+"&u="+t)),chrome.tabs.create({url:t,active:n});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),x=r(9483),k=r.n(x);function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}function _(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=T(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw a}}}}function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,s=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||T(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e,t){if(e){if("string"==typeof e)return S(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(e,t):void 0}}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:D(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function j(e,t,r,n,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}function O(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){j(a,n,o,i,c,"next",e)}function c(e){j(a,n,o,i,c,"throw",e)}i(void 0)}))}}k().config({driver:k().INDEXEDDB,name:"screenity",version:1});var A=k().createInstance({name:"chunks"}),N=k().createInstance({name:"localDirectory"}),D=function(){var e=O(L().mark((function e(){var t,r,n,o;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,chrome.storage.local.get(["recordingTab"]);case 2:return t=e.sent,r=t.recordingTab,e.next=6,chrome.storage.local.get(["offscreen"]);case 6:n=e.sent,o=n.offscreen,(null!=r||o)&&(chrome.storage.local.set({recording:!0}),P());case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),R=function(){var e=O(L().mark((function e(){var t,r,n;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="editor.html",navigator.userAgent.includes("Chrome/")&&parseInt(navigator.userAgent.match(/Chrome\/([0-9]+)/)[1])<=109&&(t="editorfallback.html"),e.next=4,chrome.storage.local.get(["activeTab"]);case 4:r=e.sent,n=r.activeTab,chrome.tabs.get(n,(function(e){e&&chrome.windows.update(e.windowId,{focused:!0},(function(){chrome.tabs.update(n,{active:!0,selected:!0,highlighted:!0}),chrome.tabs.create({url:t,index:1,pinned:!0,active:!1},function(){var e=O(L().mark((function e(t){var r;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(n),chrome.storage.local.set({sandboxTab:t.id}),v(n,{type:"ready-to-record"}),e.next=5,chrome.storage.local.get(["countdown"]);case 5:r=e.sent,r.countdown?setTimeout((function(){D()}),3500):setTimeout((function(){D()}),500);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}))}));case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),C=function(){var e=O(L().mark((function e(){var t,r;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,chrome.storage.local.get(["activeTab"]);case 2:t=e.sent,r=t.activeTab,g(r).then(O(L().mark((function e(){var t;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(r,{type:"ready-to-record"}),e.next=3,chrome.storage.local.get(["countdown"]);case 3:t=e.sent,t.countdown?setTimeout((function(){D()}),3e3):P();case 6:case"end":return e.stop()}}),e)}))));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),P=function(){var e=O(L().mark((function e(){var t,r,n,o,a,i,c;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return chrome.storage.local.set({recordingStartTime:Date.now(),restarting:!1,recording:!0}),e.next=3,chrome.storage.local.get(["customRegion"]);case 3:return t=e.sent,r=t.customRegion,J(r?{type:"start-recording-tab",region:!0}:{type:"start-recording-tab"}),chrome.action.setIcon({path:"assets/recording-logo.png"}),e.next=9,chrome.storage.local.get(["alarm"]);case 9:return n=e.sent,o=n.alarm,e.next=13,chrome.storage.local.get(["alarmTime"]);case 13:a=e.sent,i=a.alarmTime,o&&(c=parseFloat(i),chrome.alarms.create("recording-alarm",{delayInMinutes:c/60}));case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();chrome.commands.onCommand.addListener(function(){var e=O(L().mark((function e(t){var r,n,o;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("start-recording"!==t){e.next=7;break}return e.next=3,b();case 3:r=e.sent,!1===navigator.onLine&&!r.url.includes("/playground.html")&&!r.url.includes("/setup.html")||r.url.startsWith("chrome://")||r.url.startsWith("chrome-extension://")&&!r.url.includes("/playground.html")&&!r.url.includes("/setup.html")||r.url.includes("stackoverflow.com/")||r.url.includes("chrome.google.com/webstore")||r.url.includes("chromewebstore.google.com")?chrome.tabs.create({url:"playground.html",active:!0}).then((function(e){chrome.storage.local.set({activeTab:e.id}),chrome.tabs.onUpdated.addListener((function e(t,r,n){t===n.id&&"complete"===r.status&&(setTimeout((function(){v(n.id,{type:"start-stream"})}),500),chrome.tabs.onUpdated.removeListener(e))}))})):v(r.id,{type:"start-stream"}),e.next=19;break;case 7:if("cancel-recording"!==t){e.next=14;break}return e.next=10,b();case 10:n=e.sent,v(n.id,{type:"cancel-recording"}),e.next=19;break;case 14:if("pause-recording"!=t){e.next=19;break}return e.next=17,b();case 17:o=e.sent,v(o.id,{type:"pause-recording"});case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());var F=function(){var e=O(L().mark((function e(t){var r,n,o,a,i,c;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("recording-alarm"!==t.name){e.next=22;break}return e.next=3,chrome.storage.local.get(["recording"]);case 3:if(r=e.sent,!r.recording){e.next=21;break}return W(),e.next=9,chrome.storage.local.get(["recordingTab"]);case 9:return n=e.sent,o=n.recordingTab,v(o,{type:"stop-recording-tab"}),e.next=14,chrome.storage.local.get(["activeTab"]);case 14:return a=e.sent,i=a.activeTab,v(i,{type:"stop-recording-tab"}),e.next=19,b();case 19:c=e.sent,v(c.id,{type:"stop-recording-tab"});case 21:chrome.alarms.clear("recording-alarm");case 22:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),U=function(e){F(e)},M=function(){chrome.alarms.onAlarm.hasListener(U)||chrome.alarms.onAlarm.addListener(U)};chrome.permissions&&chrome.permissions.contains({permissions:["alarms"]},(function(e){e&&M()}));var B=function(){var e=O(L().mark((function e(t){var r,n,o,a,i,c,u,s,f,l,h,p,d,m,g,y,b,w,x,k;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,chrome.storage.local.get(["recordingStartTime"]);case 2:return r=e.sent,n=r.recordingStartTime,e.next=6,chrome.tabs.get(t.tabId);case 6:return o=e.sent,e.next=9,chrome.storage.local.get(["recording"]);case 9:return a=e.sent,i=a.recording,e.next=13,chrome.storage.local.get(["restarting"]);case 13:if(c=e.sent,u=c.restarting,!i){e.next=32;break}return e.next=18,chrome.storage.local.get(["tabRecordedID"]);case 18:return s=e.sent,(f=s.tabRecordedID)&&f!=t.tabId?v(t.tabId,{type:"hide-popup-recording"}):o.url.includes("backup.html")&&o.url.includes("chrome-extension://")||chrome.storage.local.set({activeTab:t.tabId}),e.next=23,chrome.storage.local.get(["region"]);case 23:return l=e.sent,h=l.region,e.next=27,chrome.storage.local.get(["customRegion"]);case 27:p=e.sent,d=p.customRegion,h||d||v(t.tabId,{type:"recording-check"}),e.next=33;break;case 32:i||u||v(t.tabId,{type:"recording-ended"});case 33:if(!n){e.next=51;break}return e.next=36,chrome.storage.local.get(["alarm"]);case 36:if(m=e.sent,!m.alarm){e.next=49;break}return e.next=41,chrome.storage.local.get(["alarmTime"]);case 41:g=e.sent,y=g.alarmTime,b=parseFloat(y),w=Math.floor((Date.now()-n)/1e3),x=b-w,v(t.tabId,{type:"time",time:x}),e.next=51;break;case 49:k=Math.floor((Date.now()-n)/1e3),v(t.tabId,{type:"time",time:k});case 51:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function q(e){return new Promise((function(t,r){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=function(e){r(e)},n.readAsDataURL(e)}))}chrome.windows.onFocusChanged.addListener(function(){var e=O(L().mark((function e(t){var r,n,o;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==chrome.windows.WINDOW_ID_NONE){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,chrome.tabs.query({active:!0,windowId:t});case 4:r=e.sent,n=I(r,1),(o=n[0])&&B({tabId:o.id});case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),chrome.tabs.onActivated.addListener(function(){var e=O(L().mark((function e(t){return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:B(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),chrome.tabs.onUpdated.addListener(function(){var e=O(L().mark((function e(t,r,n){var o,a,i,c,u,s,f,l,h,p,d,m,g,y,b,w;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("complete"!==r.status){e.next=44;break}return e.next=3,chrome.storage.local.get(["recording"]);case 3:return o=e.sent,a=o.recording,e.next=7,chrome.storage.local.get(["restarting"]);case 7:return i=e.sent,c=i.restarting,e.next=11,chrome.storage.local.get(["tabRecordedID"]);case 11:return u=e.sent,s=u.tabRecordedID,a||c?a&&s&&s==t&&v(t,{type:"recording-check",force:!0}):v(t,{type:"recording-ended"}),e.next=16,chrome.storage.local.get(["recordingStartTime"]);case 16:return f=e.sent,l=f.recordingStartTime,e.next=20,chrome.tabs.get(t);case 20:if(h=e.sent,!l){e.next=39;break}return e.next=24,chrome.storage.local.get(["alarm"]);case 24:if(p=e.sent,!p.alarm){e.next=37;break}return e.next=29,chrome.storage.local.get(["alarmTime"]);case 29:d=e.sent,m=d.alarmTime,g=parseFloat(m),y=Math.floor((Date.now()-l)/1e3),v(t,{type:"time",time:g-y}),e.next=39;break;case 37:b=Math.floor((Date.now()-l)/1e3),v(t,{type:"time",time:b});case 39:return e.next=41,chrome.commands.getAll();case 41:w=e.sent,v(t,{type:"commands",commands:w}),h.url.includes(chrome.runtime.getURL("playground.html"))&&"complete"===r.status&&v(h.id,{type:"toggle-popup"});case 44:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}());var G=function(){var e=O(L().mark((function e(t){var r,n,o,a,i,c,u,s,f=arguments;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=f.length>1&&void 0!==f[1]&&f[1],t.sort((function(e,t){return e.timestamp-t.timestamp})),e.next=4,chrome.storage.local.get(["sandboxTab"]);case 4:if(n=e.sent,o=n.sandboxTab,0!==t.length){e.next=9;break}return v(o,{type:"make-video-tab",override:r}),e.abrupt("return");case 9:a=0,10,i=t.length,c=0,5,u=1e3,v(o,{type:"chunk-count",count:i}),s=function(){var e=O(L().mark((function e(){var n,f,l,h,p,d,m,g,y,b=arguments;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=b.length>0&&void 0!==b[0]?b[0]:0,f=c,l=Math.min(c+10,i),h=[],p=f;case 5:if(!(p0?v(o,{type:"new-chunk-tab",chunks:h},(function(e){e?(c+=10)0&&void 0!==n[0]&&n[0],e.prev=1,r=[],e.next=5,A.iterate((function(e,t){r.push(e)}));case 5:G(r,t),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),chrome.runtime.reload();case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}(),W=function(){var e=O(L().mark((function e(){var t,r,n,o,a,i,c;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return chrome.storage.local.set({restarting:!1}),e.next=3,chrome.storage.local.get(["recordingStartTime"]);case 3:return t=e.sent,r=t.recordingStartTime,n=Date.now()-r,o=42e4,0===r&&(n=0),chrome.storage.local.set({recording:!1,recordingDuration:n,tabRecordedID:null}),chrome.storage.local.set({recordingStartTime:0}),e.next=12,chrome.storage.local.get(["sandboxTab"]);case 12:return a=e.sent,i=a.sandboxTab,n>o?chrome.tabs.create({url:"editorfallback.html",active:!0},(function(e){chrome.tabs.onUpdated.addListener((function t(r,n,o){r===e.id&&"complete"===n.status&&(chrome.tabs.onUpdated.removeListener(t),y(i),chrome.storage.local.set({sandboxTab:e.id}),z())}))})):(chrome.tabs.get(i,(function(e){chrome.windows.update(e.windowId,{focused:!0}).then((function(){chrome.tabs.update(i,{active:!0,pinned:!1}),chrome.tabs.move(i,{index:-1})}))})),z()),chrome.action.setIcon({path:"assets/icon-34.png"}),e.next=18,chrome.storage.local.get(["wasRegion"]);case 18:c=e.sent,c.wasRegion&&chrome.storage.local.set({wasRegion:!1,region:!0}),chrome.alarms.clear("recording-alarm"),ee();case 23:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Y=function(){var e=O(L().mark((function e(){var t,r,n;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="editor.html",e.next=3,chrome.storage.local.get(["sandboxTab"]);case 3:r=e.sent,n=r.sandboxTab,chrome.tabs.create({url:t,active:!0},(function(e){chrome.tabs.onUpdated.addListener((function t(r,o,a){r===e.id&&"complete"===o.status&&(chrome.tabs.onUpdated.removeListener(t),y(n),chrome.storage.local.set({sandboxTab:e.id}),z(!0))}))}));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();chrome.runtime.onStartup.addListener((function(){console.log("Starting...")})),chrome.action.onClicked.addListener(function(){var e=O(L().mark((function e(t){var r,n,o,a,i;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,chrome.storage.local.get(["recording"]);case 2:if(r=e.sent,!r.recording){e.next=14;break}return W(),J({type:"stop-recording-tab"}),e.next=9,chrome.storage.local.get(["activeTab"]);case 9:n=e.sent,o=n.activeTab,chrome.tabs.get(o,(function(e){e?v(o,{type:"stop-recording-tab"}):(v(t.id,{type:"stop-recording-tab"}),chrome.storage.local.set({activeTab:t.id}))})),e.next=15;break;case 14:!1===navigator.onLine&&!t.url.includes("/playground.html")&&!t.url.includes("/setup.html")||t.url.startsWith("chrome://")||t.url.startsWith("chrome-extension://")&&!t.url.includes("/playground.html")&&!t.url.includes("/setup.html")||t.url.includes("stackoverflow.com/")||t.url.includes("chrome.google.com/webstore")||t.url.includes("chromewebstore.google.com")?chrome.tabs.create({url:"playground.html",active:!0}).then((function(e){chrome.storage.local.set({activeTab:e.id})})):(v(t.id,{type:"toggle-popup"}),chrome.storage.local.set({activeTab:t.id}));case 15:return e.next=17,chrome.storage.local.get(["firstTime"]);case 17:if(a=e.sent,!a.firstTime||!t.url.includes(chrome.runtime.getURL("setup.html"))){e.next=25;break}return chrome.storage.local.set({firstTime:!1}),e.next=23,b();case 23:i=e.sent,v(i.id,{type:"setup-complete"});case 25:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());var V=function(){var e=O(L().mark((function e(){var t;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b();case 2:t=e.sent,v(t.id,{type:"ready-to-record"});case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),K=function(){var e=O(L().mark((function e(){var t,r,n,o,a,i,c;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,chrome.storage.local.get(["micActive","defaultAudioInput","defaultAudioOutput","defaultVideoInput","systemAudio","recordingType"]);case 2:return t=e.sent,r=t.micActive,n=t.defaultAudioInput,o=t.defaultAudioOutput,a=t.defaultVideoInput,i=t.systemAudio,c=t.recordingType,e.abrupt("return",{micActive:r,defaultAudioInput:n,defaultAudioOutput:o,defaultVideoInput:a,systemAudio:i,recordingType:c});case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),H=function(){var e=O(L().mark((function e(){var t,r,n,o;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return chrome.storage.local.set({restarting:!0}),e.next=3,chrome.storage.local.get(["region"]);case 3:if(t=e.sent,t.region){e.next=11;break}return e.next=8,chrome.storage.local.get(["sandboxTab"]);case 8:r=e.sent,n=r.sandboxTab,y(n);case 11:return e.next=13,chrome.storage.local.get(["wasRegion"]);case 13:o=e.sent,o.wasRegion&&chrome.storage.local.set({wasRegion:!1,region:!0}),chrome.action.setIcon({path:"assets/icon-34.png"});case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=function(){var e=O(L().mark((function e(){var t,r,n;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return chrome.storage.local.set({restarting:!0}),t="editor.html",navigator.userAgent.includes("Chrome/")&&parseInt(navigator.userAgent.match(/Chrome\/([0-9]+)/)[1])<=109&&(t="editorfallback.html"),e.next=5,chrome.storage.local.get(["sandboxTab"]);case 5:r=e.sent,n=r.sandboxTab,y(n),chrome.tabs.create({url:t,index:1,pinned:!0,active:!1},(function(e){chrome.storage.local.set({sandboxTab:e.id}),chrome.tabs.onUpdated.addListener((function e(t,r,n){t===n.id&&"complete"===r.status&&(chrome.tabs.onUpdated.removeListener(e),C())}))}));case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=function(){var e=O(L().mark((function e(t){return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:chrome.storage.local.get(["recordingTab","offscreen"],(function(e){e.offscreen?chrome.runtime.sendMessage(t):v(e.recordingTab,t)}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Q=function(){var e=O(L().mark((function e(t,r){var n,o,a;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,chrome.storage.local.get(["backupTab"]);case 2:n=e.sent,o=n.backupTab,a=chrome.runtime.getURL("backup.html"),o?chrome.tabs.get(o,(function(e){e?v(e.id,{type:"init-backup",request:t,tabId:r}):chrome.tabs.create({url:a,active:!0,pinned:!0,index:0},(function(e){chrome.storage.local.set({backupTab:e.id}),chrome.tabs.onUpdated.addListener((function n(o,a,i){o===e.id&&"complete"===a.status&&(v(e.id,{type:"init-backup",request:t,tabId:r}),chrome.tabs.onUpdated.removeListener(n))}))}))})):chrome.tabs.create({url:a,active:!0,pinned:!0,index:0},(function(e){chrome.storage.local.set({backupTab:e.id}),chrome.tabs.onUpdated.addListener((function n(o,a,i){o===e.id&&"complete"===a.status&&(v(e.id,{type:"init-backup",request:t,tabId:r}),chrome.tabs.onUpdated.removeListener(n))}))}));case 6:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Z=function(){var e=O(L().mark((function e(t){var r,n,o,a,i,c,u,s,f,l,h,p,d,m=arguments;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=m.length>1&&void 0!==m[1]?m[1]:null,e.next=3,chrome.storage.local.get(["backup"]);case 3:return n=e.sent,o=n.backup,e.next=7,b();case 7:if(a=e.sent,null===r){e.next=12;break}return e.next=11,chrome.tabs.get(r);case 11:a=e.sent;case 12:return chrome.storage.local.set({activeTab:a.id,tabRecordedID:null,memoryError:!1}),a.url.includes(chrome.runtime.getURL("playground.html"))?chrome.storage.local.set({tabPreferred:!0}):chrome.storage.local.set({tabPreferred:!1}),e.prev=14,e.next=17,chrome.runtime.getContexts({});case 17:if(i=e.sent,!i.find((function(e){return"OFFSCREEN_DOCUMENT"===e.contextType}))){e.next=22;break}return e.next=22,chrome.offscreen.closeDocument();case 22:e.next=26;break;case 24:e.prev=24,e.t0=e.catch(14);case 26:if(!t.region){e.next=56;break}if(null!==r&&chrome.tabs.update(r,{active:!0}),chrome.storage.local.set({recordingTab:a.id,offscreen:!1,region:!0}),!t.customRegion){e.next=33;break}J({type:"loaded",request:t,backup:o,region:!0}),e.next=54;break;case 33:throw e.prev=33,new Error("Exit offscreen recording");case 37:if(c=e.sent,!c.find((function(e){return"OFFSCREEN_DOCUMENT"===e.contextType}))){e.next=42;break}return e.next=42,chrome.offscreen.closeDocument();case 42:return e.next=44,chrome.offscreen.createDocument({url:"recorderoffscreen.html",reasons:["USER_MEDIA","AUDIO_PLAYBACK","DISPLAY_MEDIA"],justification:"Recording from getDisplayMedia API and tabCapture API"});case 44:return e.next=46,chrome.tabCapture.getMediaStreamId({targetTabId:a.id});case 46:u=e.sent,chrome.storage.local.set({recordingTab:null,offscreen:!0,region:!1,wasRegion:!0}),J({type:"loaded",request:t,isTab:!0,tabID:u}),e.next=54;break;case 51:e.prev=51,e.t1=e.catch(33),chrome.tabs.create({url:"recorder.html",pinned:!0,index:0,active:!!a.url.includes(chrome.runtime.getURL("playground.html"))}).then((function(e){chrome.storage.local.set({recordingTab:e.id,offscreen:!1,region:!1,wasRegion:!0,tabRecordedID:a.id}),chrome.tabs.onUpdated.addListener((function r(n,i,c){n===e.id&&"complete"===i.status&&(chrome.tabs.onUpdated.removeListener(r),J({type:"loaded",request:t,tabID:a.id,backup:o,isTab:!0}))}))}));case 54:e.next=86;break;case 56:if(e.prev=56,t.offscreenRecording&&!t.camera){e.next=59;break}throw new Error("Exit offscreen recording");case 59:return null!==r&&chrome.tabs.update(r,{active:!0}),e.next=62,chrome.storage.local.get(["qualityValue"]);case 62:return s=e.sent,f=s.qualityValue,e.next=66,chrome.storage.local.get(["fpsValue"]);case 66:return l=e.sent,h=l.fpsValue,e.next=70,chrome.runtime.getContexts({});case 70:if(p=e.sent,!p.find((function(e){return"OFFSCREEN_DOCUMENT"===e.contextType}))){e.next=75;break}return e.next=75,chrome.offscreen.closeDocument();case 75:return e.next=77,chrome.offscreen.createDocument({url:"recorderoffscreen.html",reasons:["USER_MEDIA","AUDIO_PLAYBACK","DISPLAY_MEDIA"],justification:"Recording from getDisplayMedia API"});case 77:chrome.storage.local.set({recordingTab:null,offscreen:!0,region:!1,wasRegion:!1}),J({type:"loaded",request:t,isTab:!1,quality:f,fps:h,backup:o}),e.next=86;break;case 81:e.prev=81,e.t2=e.catch(56),d=!0,t.camera&&(d=!1),chrome.tabs.create({url:"recorder.html",pinned:!0,index:0,active:d}).then((function(e){chrome.storage.local.set({recordingTab:e.id,offscreen:!1,region:!1,wasRegion:!1}),chrome.tabs.onUpdated.addListener((function r(n,a,i){n===e.id&&"complete"===a.status&&(chrome.tabs.onUpdated.removeListener(r),J({type:"loaded",request:t,backup:o}))}))}));case 86:case"end":return e.stop()}}),e,null,[[14,24],[33,51],[56,81]])})));return function(t){return e.apply(this,arguments)}}(),$=function(){var e=O(L().mark((function e(){var t,r;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,chrome.storage.local.get(["sandboxTab"]);case 2:t=e.sent,r=t.sandboxTab,v(r,{type:"saved-to-drive"});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ee=function(){var e=O(L().mark((function e(){var t;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,chrome.runtime.getContexts({});case 3:if(t=e.sent,!t.find((function(e){return"OFFSCREEN_DOCUMENT"===e.contextType}))){e.next=8;break}return e.next=8,chrome.offscreen.closeDocument();case 8:e.next=12;break;case 10:e.prev=10,e.t0=e.catch(0);case 12:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),te=function(){var e=O(L().mark((function e(){var t,r,n,o,a,i,c,u,s,f,l;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=chrome.runtime.getManifest().content_scripts,r=t.map((function(e){return chrome.tabs.query({url:e.matches})})),e.next=4,Promise.all(r);case 4:for(n=e.sent,o=[],a=0;a2&&void 0!==d[2]&&d[2]){e.next=7;break}n=fe(r.base64),o=r.title+".mp4",s(n,o,t).then((function(){$()})),e.next=25;break;case 7:return a=[],e.next=10,A.iterate((function(e,t){a.push(e)}));case 10:i=[],c=0,u=0,f=a;case 13:if(!(u0&&void 0!==o[0]&&o[0],e.next=3,chrome.storage.local.get(["activeTab"]);case 3:r=e.sent,n=r.activeTab,v(n,t?{type:"pip-started"}:{type:"pip-ended"});case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Se=function(){var e=O(L().mark((function e(){var t,r;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,chrome.storage.local.get(["token"]);case 2:t=e.sent,r=t.token,fetch("https://accounts.google.com/o/oauth2/revoke?token="+r),chrome.identity.removeCachedAuthToken({token:r}),chrome.storage.local.set({token:!1});case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Le=function(){var e=O(L().mark((function e(t){var r,n;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return chrome.storage.local.set({recording:!1,restarting:!1,tabRecordedID:null,memoryError:!0}),J({type:"stop-recording-tab"}),e.next=4,chrome.storage.local.get(["activeTab"]);case 4:r=e.sent,n=r.activeTab,v(n,{type:"stop-pending"}),g(n);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),je=function(){var e=O(L().mark((function e(){return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:A.clear();case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Oe=function(){var e=O(L().mark((function e(t,r){return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==t&&0!==r){e.next=2;break}return e.abrupt("return");case 2:chrome.windows.getCurrent((function(e){chrome.windows.update(e.id,{width:t,height:r})}));case 3:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}();chrome.runtime.onMessage.addListener((function(e,t,r){if("desktop-capture"===e.type)he(e);else if("backup-created"===e.type)Z(e.request,e.tabId);else if("write-file"===e.type)pe(e);else if("handle-restart"===e.type)X();else if("handle-dismiss"===e.type)H();else if("reset-active-tab"===e.type)R();else if("reset-active-tab-restart"===e.type)C();else if("start-rec"===e.type)P();else if("video-ready"===e.type)de();else if("start-recording"===e.type)P();else if("restarted"===e.type)V();else{if("new-chunk"===e.type)return me(e),!0;if("get-streaming-data"===e.type)ve();else if("cancel-recording"===e.type)ge();else if("stop-recording-tab"===e.type)ye(e);else if("restart-recording-tab"===e.type)be();else if("dismiss-recording-tab"===e.type)we();else if("pause-recording-tab"===e.type)J({type:"pause-recording-tab"});else if("resume-recording-tab"===e.type)J({type:"resume-recording-tab"});else if("set-mic-active-tab"===e.type)xe(e);else if("recording-error"===e.type)ke(e);else if("on-get-permissions"===e.type)Ee(e);else if("recording-complete"===e.type)_e();else if("check-recording"===e.type)ne();else if("review-screenity"===e.type)w("https://chrome.google.com/webstore/detail/screenity-screen-recorder/kbbdabhdfibnancpjfhlkhafgdilcnji/reviews",!1,!0);else if("follow-twitter"===e.type)w("https://alyssax.substack.com/",!1,!0);else if("open-processing-info"===e.type)w("https://help.screenity.io/editing-and-exporting/dJRFpGq56JFKC7k8zEvsqb/why-is-there-a-5-minute-limit-for-editing/ddy4e4TpbnrFJ8VoRT37tQ",!0,!0);else if("upgrade-info"===e.type)w("https://help.screenity.io/getting-started/77KizPC8MHVGfpKpqdux9D/what-are-the-technical-requirements-for-using-screenity/6kdB6qru6naVD8ZLFvX3m9",!0,!0);else if("trim-info"===e.type)w("https://help.screenity.io/editing-and-exporting/dJRFpGq56JFKC7k8zEvsqb/how-to-cut-trim-or-mute-parts-of-your-video/svNbM7YHYY717MuSWXrKXH",!0,!0);else if("join-waitlist"===e.type)w("https://tally.so/r/npojNV",!0,!0);else if("chrome-update-info"===e.type)w("https://help.screenity.io/getting-started/77KizPC8MHVGfpKpqdux9D/what-are-the-technical-requirements-for-using-screenity/6kdB6qru6naVD8ZLFvX3m9",!0,!0);else if("set-surface"===e.type)Ie(e);else if("pip-ended"===e.type)Te(!1);else if("pip-started"===e.type)Te(!0);else if("new-sandbox-page-restart"===e.type)ae();else if("sign-out-drive"===e.type)Se();else if("open-help"===e.type)w("https://help.screenity.io/",!0,!0);else if("memory-limit-help"===e.type)w("https://help.screenity.io/troubleshooting/9Jy5RGjNrBB42hqUdREQ7W/what-does-%E2%80%9Cmemory-limit-reached%E2%80%9D-mean-when-recording/8WkwHbt3puuXunYqQnyPcb",!0,!0);else if("open-home"===e.type)w("https://screenity.io/",!1,!0);else if("report-bug"===e.type)w("https://tally.so/r/3ElpXq?version="+chrome.runtime.getManifest().version,!1,!0);else if("clear-recordings"===e.type)je();else if("force-processing"===e.type)Y();else if("focus-this-tab"===e.type)g(t.tab.id);else if("stop-recording-tab-backup"===e.type)Le(e);else if("indexed-db-download"===e.type)ce();else{if("get-platform-info"===e.type)return function(e){chrome.runtime.getPlatformInfo((function(t){e(t)}))}(r),!0;if("restore-recording"===e.type)ue();else{if("check-restore"===e.type)return se(r),!0;if("check-capture-permissions"===e.type)return function(e){chrome.permissions.contains({permissions:["desktopCapture","alarms","offscreen"]},(function(t){t?e({status:"ok"}):chrome.permissions.request({permissions:["desktopCapture","alarms","offscreen"]},(function(t){t?(M(),e({status:"ok"})):e({status:"error"})}))}))}(r),!0;if("is-pinned"===e.type)return function(e){chrome.action.getUserSettings().then((function(t){e({pinned:t.isOnToolbar})}))}(r),!0;if("save-to-drive"===e.type)return le(r,e,!1),!0;if("save-to-drive-fallback"===e.type)return le(r,e,!0),!0;if("request-download"===e.type)ie(e.base64,e.title);else if("resize-window"===e.type)Oe(e.width,e.height);else{if("available-memory"===e.type)return function(e){navigator.storage.estimate().then((function(t){e({data:t})}))}(r),!0;"extension-media-permissions"===e.type?w("chrome://settings/content/siteDetails?site=chrome-extension://"+chrome.runtime.id,!1,!0):"add-alarm-listener"===e.type&&M()}}}}}))})()})(); \ No newline at end of file +e.exports=function e(t,r,n){function o(i,c){if(!r[i]){if(!t[i]){if(a)return a(i,!0);var u=new Error("Cannot find module '"+i+"'");throw u.code="MODULE_NOT_FOUND",u}var s=r[i]={exports:{}};t[i][0].call(s.exports,(function(e){var r=t[i][1][e];return o(r||e)}),s,s.exports,e,t,r,n)}return r[i].exports}for(var a=void 0,i=0;i=43)}})).catch((function(){return!1}))}function k(e){return"boolean"==typeof m?s.resolve(m):x(e).then((function(e){return m=e}))}function E(e){var t=v[e.name],r={};r.promise=new s((function(e,t){r.resolve=e,r.reject=t})),t.deferredOperations.push(r),t.dbReady?t.dbReady=t.dbReady.then((function(){return r.promise})):t.dbReady=r.promise}function _(e){var t=v[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function I(e,t){var r=v[e.name].deferredOperations.pop();if(r)return r.reject(t),r.promise}function T(e,t){return new s((function(r,n){if(v[e.name]=v[e.name]||P(),e.db){if(!t)return r(e.db);E(e),e.db.close()}var o=[e.name];t&&o.push(e.version);var a=i.open.apply(i,o);t&&(a.onupgradeneeded=function(t){var r=a.result;try{r.createObjectStore(e.storeName),t.oldVersion<=1&&r.createObjectStore(d)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),a.onerror=function(e){e.preventDefault(),n(a.error)},a.onsuccess=function(){var t=a.result;t.onversionchange=function(e){e.target.close()},r(t),_(e)}}))}function S(e){return T(e,!1)}function L(e){return T(e,!0)}function j(e,t){if(!e.db)return!0;var r=!e.db.objectStoreNames.contains(e.storeName),n=e.versione.db.version;if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),o||r){if(r){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function O(e){return new s((function(t,r){var n=new FileReader;n.onerror=r,n.onloadend=function(r){var n=btoa(r.target.result||"");t({__local_forage_encoded_blob:!0,data:n,type:e.type})},n.readAsBinaryString(e)}))}function A(e){return u([w(atob(e.data))],{type:e.type})}function N(e){return e&&e.__local_forage_encoded_blob}function D(e){var t=this,r=t._initReady().then((function(){var e=v[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return l(r,e,e),r}function R(e){E(e);for(var t=v[e.name],r=t.forages,n=0;n0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return s.resolve().then((function(){if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),L(e)})).then((function(){return R(e).then((function(){C(e,t,r,n-1)}))})).catch(r);r(o)}}function P(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function F(e){var t=this,r={db:null};if(e)for(var n in e)r[n]=e[n];var o=v[r.name];o||(o=P(),v[r.name]=o),o.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=D);var a=[];function i(){return s.resolve()}for(var c=0;c>4,f[u++]=(15&n)<<4|o>>2,f[u++]=(3&o)<<6|63&a;return s}function de(e){var t,r=new Uint8Array(e),n="";for(t=0;t>2],n+=X[(3&r[t])<<4|r[t+1]>>4],n+=X[(15&r[t+1])<<2|r[t+2]>>6],n+=X[63&r[t+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function me(e,t){var r="";if(e&&(r=he.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===he.call(e.buffer))){var n,o=Z;e instanceof ArrayBuffer?(n=e,o+=ee):(n=e.buffer,"[object Int8Array]"===r?o+=re:"[object Uint8Array]"===r?o+=ne:"[object Uint8ClampedArray]"===r?o+=oe:"[object Int16Array]"===r?o+=ae:"[object Uint16Array]"===r?o+=ce:"[object Int32Array]"===r?o+=ie:"[object Uint32Array]"===r?o+=ue:"[object Float32Array]"===r?o+=se:"[object Float64Array]"===r?o+=fe:t(new Error("Failed to get type for BinaryArray"))),t(o+de(n))}else if("[object Blob]"===r){var a=new FileReader;a.onload=function(){var r=J+e.type+"~"+de(this.result);t(Z+te+r)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}}function ve(e){if(e.substring(0,$)!==Z)return JSON.parse(e);var t,r=e.substring(le),n=e.substring($,le);if(n===te&&Q.test(r)){var o=r.match(Q);t=o[1],r=r.substring(o[0].length)}var a=pe(r);switch(n){case ee:return a;case te:return u([a],{type:t});case re:return new Int8Array(a);case ne:return new Uint8Array(a);case oe:return new Uint8ClampedArray(a);case ae:return new Int16Array(a);case ce:return new Uint16Array(a);case ie:return new Int32Array(a);case ue:return new Uint32Array(a);case se:return new Float32Array(a);case fe:return new Float64Array(a);default:throw new Error("Unkown type: "+n)}}var ge={serialize:me,deserialize:ve,stringToBuffer:pe,bufferToString:de};function ye(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function be(e){var t=this,r={db:null};if(e)for(var n in e)r[n]="string"!=typeof e[n]?e[n].toString():e[n];var o=new s((function(e,n){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(e){return n(e)}r.db.transaction((function(o){ye(o,r,(function(){t._dbInfo=r,e()}),(function(e,t){n(t)}))}),n)}));return r.serializer=ge,o}function we(e,t,r,n,o,a){e.executeSql(r,n,o,(function(e,i){i.code===i.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,c){c.rows.length?a(e,i):ye(e,t,(function(){e.executeSql(r,n,o,a)}),a)}),a):a(e,i)}),a)}function xe(e,t){var r=this;e=h(e);var n=new s((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){we(r,o,"SELECT * FROM "+o.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=o.serializer.deserialize(n)),t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return f(n,t),n}function ke(e,t){var r=this,n=new s((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){we(r,o,"SELECT * FROM "+o.storeName,[],(function(r,n){for(var a=n.rows,i=a.length,c=0;c0)return void a(Ee.apply(o,[e,c,r,n-1]));i(t)}}))}))})).catch(i)}));return f(a,r),a}function _e(e,t,r){return Ee.apply(this,[e,t,r,1])}function Ie(e,t){var r=this;e=h(e);var n=new s((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){we(r,o,"DELETE FROM "+o.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){n(t)}))}))})).catch(n)}));return f(n,t),n}function Te(e){var t=this,r=new s((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){we(t,n,"DELETE FROM "+n.storeName,[],(function(){e()}),(function(e,t){r(t)}))}))})).catch(r)}));return f(r,e),r}function Se(e){var t=this,r=new s((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){we(t,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],(function(t,r){var n=r.rows.item(0).c;e(n)}),(function(e,t){r(t)}))}))})).catch(r)}));return f(r,e),r}function Le(e,t){var r=this,n=new s((function(t,n){r.ready().then((function(){var o=r._dbInfo;o.db.transaction((function(r){we(r,o,"SELECT key FROM "+o.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,r){var n=r.rows.length?r.rows.item(0).key:null;t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return f(n,t),n}function je(e){var t=this,r=new s((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){we(t,n,"SELECT key FROM "+n.storeName,[],(function(t,r){for(var n=[],o=0;o '__WebKitDatabaseInfoTable__'",[],(function(r,n){for(var o=[],a=0;a0}function Fe(e){var t=this,r={};if(e)for(var n in e)r[n]=e[n];return r.keyPrefix=Re(e,t._defaultConfig),Pe()?(t._dbInfo=r,r.serializer=ge,s.resolve()):s.reject()}function Ue(e){var t=this,r=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(e)&&localStorage.removeItem(n)}}));return f(r,e),r}function Me(e,t){var r=this;e=h(e);var n=r.ready().then((function(){var t=r._dbInfo,n=localStorage.getItem(t.keyPrefix+e);return n&&(n=t.serializer.deserialize(n)),n}));return f(n,t),n}function Be(e,t){var r=this,n=r.ready().then((function(){for(var t=r._dbInfo,n=t.keyPrefix,o=n.length,a=localStorage.length,i=1,c=0;c=0;t--){var r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}})):s.reject("Invalid arguments"),f(n,t),n}var Ke={_driver:"localStorageWrapper",_initStorage:Fe,_support:De(),iterate:Be,getItem:Me,setItem:Ye,removeItem:We,clear:Ue,length:ze,key:qe,keys:Ge,dropInstance:Ve},He=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},Xe=function(e,t){for(var r=e.length,n=0;n{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */t=function(){return n};var r,n={},o=Object.prototype,a=o.hasOwnProperty,i=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(r){l=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var o=t&&t.prototype instanceof b?t:b,a=Object.create(o.prototype),c=new N(n||[]);return i(a,"_invoke",{value:L(e,r,c)}),a}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}n.wrap=h;var d="suspendedStart",m="suspendedYield",v="executing",g="completed",y={};function b(){}function w(){}function x(){}var k={};l(k,u,(function(){return this}));var E=Object.getPrototypeOf,_=E&&E(E(D([])));_&&_!==o&&a.call(_,u)&&(k=_);var I=x.prototype=b.prototype=Object.create(k);function T(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function S(t,r){function n(o,i,c,u){var s=p(t[o],t,i);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==e(l)&&a.call(l,"__await")?r.resolve(l.__await).then((function(e){n("next",e,c,u)}),(function(e){n("throw",e,c,u)})):r.resolve(l).then((function(e){f.value=e,c(f)}),(function(e){return n("throw",e,c,u)}))}u(s.arg)}var o;i(this,"_invoke",{value:function(e,t){function a(){return new r((function(r,o){n(e,t,r,o)}))}return o=o?o.then(a,a):a()}})}function L(e,t,n){var o=d;return function(a,i){if(o===v)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:r,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=p(e,t,n);if("normal"===s.type){if(o=n.done?g:m,s.arg===y)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=g,n.method="throw",n.arg=s.arg)}}}function j(e,t){var n=t.method,o=e.iterator[n];if(o===r)return t.delegate=null,"throw"===n&&e.iterator.return&&(t.method="return",t.arg=r,j(e,t),"throw"===t.method)||"return"!==n&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=p(o,e.iterator,t.arg);if("throw"===a.type)return t.method="throw",t.arg=a.arg,t.delegate=null,y;var i=a.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=r),t.delegate=null,y):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,y)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function D(t){if(t||""===t){var n=t[u];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function e(){for(;++o=0;--o){var i=this.tryEntries[o],c=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var u=a.call(i,"catchLoc"),s=a.call(i,"finallyLoc");if(u&&s){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&a.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:D(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=r),y}},n}function n(e,t,r,n,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}const o=function(){var e,r=(e=t().mark((function e(){var r;return t().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,chrome.identity.getAuthToken({interactive:!0});case 3:if(r=e.sent){e.next=6;break}throw new Error("User cancelled sign-in or failed to get token");case 6:return e.next=8,new Promise((function(e){return chrome.storage.local.set({token:r.token},(function(){return e()}))}));case 8:return e.next=10,chrome.identity.getProfileUserInfo();case 10:return e.sent,e.abrupt("return",r.token);case 14:return e.prev=14,e.t0=e.catch(0),console.error("Error signing in:",e.t0.message),e.abrupt("return",null);case 19:case"end":return e.stop()}}),e,null,[[0,14]])})),function(){var t=this,r=arguments;return new Promise((function(o,a){var i=e.apply(t,r);function c(e){n(i,o,a,c,u,"next",e)}function u(e){n(i,o,a,c,u,"throw",e)}c(void 0)}))});return function(){return r.apply(this,arguments)}}();function a(e){return a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},a(e)}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return t};var e,t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(e,t,r){e[t]=r.value},c="function"==typeof Symbol?Symbol:{},u=c.iterator||"@@iterator",s=c.asyncIterator||"@@asyncIterator",f=c.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(e){l=function(e,t,r){return e[t]=r}}function h(e,t,r,n){var a=t&&t.prototype instanceof b?t:b,i=Object.create(a.prototype),c=new N(n||[]);return o(i,"_invoke",{value:L(e,r,c)}),i}function p(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var d="suspendedStart",m="suspendedYield",v="executing",g="completed",y={};function b(){}function w(){}function x(){}var k={};l(k,u,(function(){return this}));var E=Object.getPrototypeOf,_=E&&E(E(D([])));_&&_!==r&&n.call(_,u)&&(k=_);var I=x.prototype=b.prototype=Object.create(k);function T(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function r(o,i,c,u){var s=p(e[o],e,i);if("throw"!==s.type){var f=s.arg,l=f.value;return l&&"object"==a(l)&&n.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,c,u)}),(function(e){r("throw",e,c,u)})):t.resolve(l).then((function(e){f.value=e,c(f)}),(function(e){return r("throw",e,c,u)}))}u(s.arg)}var i;o(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,o){r(e,n,t,o)}))}return i=i?i.then(o,o):o()}})}function L(t,r,n){var o=d;return function(a,i){if(o===v)throw new Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(n.method=a,n.arg=i;;){var c=n.delegate;if(c){var u=j(c,n);if(u){if(u===y)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===d)throw o=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var s=p(t,r,n);if("normal"===s.type){if(o=n.done?g:m,s.arg===y)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(o=g,n.method="throw",n.arg=s.arg)}}}function j(t,r){var n=r.method,o=t.iterator[n];if(o===e)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=e,j(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),y;var a=p(o,t.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,y;var i=a.arg;return i?i.done?(r[t.resultName]=i.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=e),r.delegate=null,y):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function A(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function N(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(O,this),this.reset(!0)}function D(t){if(t||""===t){var r=t[u];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function r(){for(;++o=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:D(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function c(e,t,r,n,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}function u(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){c(a,n,o,i,u,"next",e)}function u(e){c(a,n,o,i,u,"throw",e)}i(void 0)}))}}const s=function(){var e=u(i().mark((function e(t,r,n){var a,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=function(){return c=u(i().mark((function e(){return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){chrome.storage.local.get(["token"],function(){var r=u(i().mark((function r(n){var a,c,u,s;return i().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!chrome.runtime.lastError){r.next=4;break}t(new Error(chrome.runtime.lastError)),r.next=24;break;case 4:if((a=n.token)&&null!==a){r.next=13;break}return r.next=8,o();case 8:(c=r.sent)&&null!==c||t(new Error("Sign-in failed")),e(c),r.next=24;break;case 13:r.prev=13,u=JSON.parse(atob(a.split(".")[1])),r.next=21;break;case 17:return r.prev=17,r.t0=r.catch(13),chrome.identity.getAuthToken({interactive:!0},(function(r){chrome.runtime.lastError?t(new Error(chrome.runtime.lastError)):e(r)})),r.abrupt("return");case 21:s=1e3*u.exp,Date.now()>=s?chrome.identity.getAuthToken({interactive:!0},(function(r){chrome.runtime.lastError?t(new Error(chrome.runtime.lastError)):e(r)})):e(a);case 24:case"end":return r.stop()}}),r,null,[[13,17]])})));return function(e){return r.apply(this,arguments)}}())})));case 1:case"end":return e.stop()}}),e)}))),c.apply(this,arguments)},a=function(){return c.apply(this,arguments)},e.abrupt("return",new Promise(function(){var e=u(i().mark((function e(o,c){var u,s,f,l,h,p,d,m;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,a();case 3:if((u=e.sent)&&null!==u){e.next=6;break}throw new Error("Sign-in failed");case 6:return s=new Headers({Authorization:"Bearer ".concat(u),"Content-Type":t.type}),e.next=9,fetch("https://www.googleapis.com/upload/drive/v3/files?uploadType=media",{method:"POST",headers:s,body:t});case 9:if((f=e.sent).ok){e.next=12;break}throw new Error("Error uploading to Google Drive: ".concat(f.status));case 12:return e.next=14,f.json();case 14:if(l=e.sent,h=l.id){e.next=18;break}throw new Error("File ID is undefined");case 18:return p={name:r},e.next=21,fetch("https://www.googleapis.com/drive/v3/files/".concat(h),{method:"PATCH",headers:new Headers({Authorization:"Bearer ".concat(u),"Content-Type":"application/json; charset=UTF-8"}),body:JSON.stringify(p)});case 21:if((d=e.sent).ok){e.next=28;break}return e.next=25,d.json();case 25:throw m=e.sent,console.error("Error updating file metadata:",d.status,m.error.message),new Error("Error updating file metadata: ".concat(d.status));case 28:n({status:"ok",url:h}),chrome.tabs.create({url:"https://drive.google.com/file/d/".concat(h,"/view")}),o("https://drive.google.com/file/d/".concat(h,"/view")),e.next=38;break;case 33:e.prev=33,e.t0=e.catch(0),console.error("Error uploading to Google Drive:",e.t0.message),n({status:"ew",url:null}),c(e.t0);case 38:case"end":return e.stop()}}),e,null,[[0,33]])})));return function(t,r){return e.apply(this,arguments)}}()));case 3:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}();function f(e){return f="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(e)}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,s=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return h(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return h(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:D(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),y}},t}function d(e,t,r,n,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}function m(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){d(a,n,o,i,c,"next",e)}function c(e){d(a,n,o,i,c,"throw",e)}i(void 0)}))}}var v=function(){var e=m(p().mark((function e(t,r){var n,o,a,i=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=i.length>2&&void 0!==i[2]&&i[2],o=i.length>3&&void 0!==i[3]&&i[3],null!==t&&null!==r){e.next=4;break}return e.abrupt("return");case 4:return e.prev=4,e.next=7,new Promise((function(e){chrome.tabs.get(t,(function(t){e(t)}))}));case 7:if(!((a=e.sent)&&a.url&&a.url.startsWith("chrome://")||a.url.startsWith("chromewebstore.google.com")||a.url.startsWith("chrome.google.com/webstore")||""===a.url||"about:blank"===a.url)){e.next=12;break}return e.abrupt("return");case 12:if(a&&a.url){e.next=14;break}return e.abrupt("return");case 14:a&&a.id?n&&"function"==typeof n?chrome.tabs.sendMessage(a.id,r,n):chrome.tabs.sendMessage(a.id,r):o&&"function"==typeof o&&o(),e.next=19;break;case 17:e.prev=17,e.t0=e.catch(4);case 19:case"end":return e.stop()}}),e,null,[[4,17]])})));return function(t,r){return e.apply(this,arguments)}}(),g=function(){var e=m(p().mark((function e(t){var r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,new Promise((function(e){chrome.tabs.get(t,(function(t){e(t)}))}));case 5:(r=e.sent)&&r.id&&chrome.windows.update(r.windowId,{focused:!0}).then((function(){chrome.tabs.update(r.id,{active:!0})})),e.next=11;break;case 9:e.prev=9,e.t0=e.catch(2);case 11:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t){return e.apply(this,arguments)}}(),y=function(){var e=m(p().mark((function e(t){var r;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==t){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,new Promise((function(e){chrome.tabs.get(t,(function(t){e(t)}))}));case 5:(r=e.sent)&&r.id&&chrome.tabs.remove(r.id),e.next=11;break;case 9:e.prev=9,e.t0=e.catch(2);case 11:case"end":return e.stop()}}),e,null,[[2,9]])})));return function(t){return e.apply(this,arguments)}}(),b=function(){var e=m(p().mark((function e(){var t,r,n,o;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={active:!0,lastFocusedWindow:!0},e.next=3,chrome.tabs.query(t);case 3:return r=e.sent,n=l(r,1),o=n[0],e.abrupt("return",o);case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),w=function(){var e=m(p().mark((function e(t){var r,n,o,a=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=a.length>1&&void 0!==a[1]&&a[1],n=a.length>2&&void 0!==a[2]&&a[2],t){e.next=4;break}return e.abrupt("return");case 4:r&&((o=chrome.i18n.getMessage("@@ui_locale")).includes("en")||(t="http://translate.google.com/translate?js=n&sl=auto&tl="+o+"&u="+t)),chrome.tabs.create({url:t,active:n});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),x=r(9483),k=r.n(x);function E(e){return E="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},E(e)}function _(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=T(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw a}}}}function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,c=[],u=!0,s=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(c.push(n.value),c.length!==t);u=!0);}catch(e){s=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(s)throw o}}return c}}(e,t)||T(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e,t){if(e){if("string"==typeof e)return S(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(e,t):void 0}}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var u=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(u&&s){if(this.prev=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),A(r),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;A(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,n){return this.delegate={iterator:D(t),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=e),v}},t}function j(e,t,r,n,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}function O(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){j(a,n,o,i,c,"next",e)}function c(e){j(a,n,o,i,c,"throw",e)}i(void 0)}))}}k().config({driver:k().INDEXEDDB,name:"screenity",version:1});var A=k().createInstance({name:"chunks"}),N=k().createInstance({name:"localDirectory"}),D=function(){var e=O(L().mark((function e(){var t,r,n,o;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,chrome.storage.local.get(["recordingTab"]);case 2:return t=e.sent,r=t.recordingTab,e.next=6,chrome.storage.local.get(["offscreen"]);case 6:n=e.sent,o=n.offscreen,(null!=r||o)&&(chrome.storage.local.set({recording:!0}),P());case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),R=function(){var e=O(L().mark((function e(){var t,r,n;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="editor.html",navigator.userAgent.includes("Chrome/")&&parseInt(navigator.userAgent.match(/Chrome\/([0-9]+)/)[1])<=109&&(t="editorfallback.html"),e.next=4,chrome.storage.local.get(["activeTab"]);case 4:r=e.sent,n=r.activeTab,chrome.tabs.get(n,(function(e){e&&chrome.windows.update(e.windowId,{focused:!0},(function(){chrome.tabs.update(n,{active:!0,selected:!0,highlighted:!0}),chrome.tabs.create({url:t,index:1,pinned:!0,active:!1},function(){var e=O(L().mark((function e(t){var r;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return g(n),chrome.storage.local.set({sandboxTab:t.id}),v(n,{type:"ready-to-record"}),e.next=5,chrome.storage.local.get(["countdown"]);case 5:r=e.sent,r.countdown?setTimeout((function(){D()}),3500):setTimeout((function(){D()}),500);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}))}));case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),C=function(){var e=O(L().mark((function e(){var t,r;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,chrome.storage.local.get(["activeTab"]);case 2:t=e.sent,r=t.activeTab,g(r).then(O(L().mark((function e(){var t;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return v(r,{type:"ready-to-record"}),e.next=3,chrome.storage.local.get(["countdown"]);case 3:t=e.sent,t.countdown?setTimeout((function(){D()}),3e3):P();case 6:case"end":return e.stop()}}),e)}))));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),P=function(){var e=O(L().mark((function e(){var t,r,n,o,a,i,c;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return chrome.storage.local.set({recordingStartTime:Date.now(),restarting:!1,recording:!0}),e.next=3,chrome.storage.local.get(["customRegion"]);case 3:return t=e.sent,r=t.customRegion,J(r?{type:"start-recording-tab",region:!0}:{type:"start-recording-tab"}),chrome.action.setIcon({path:"assets/recording-logo.png"}),e.next=9,chrome.storage.local.get(["alarm"]);case 9:return n=e.sent,o=n.alarm,e.next=13,chrome.storage.local.get(["alarmTime"]);case 13:a=e.sent,i=a.alarmTime,o&&(c=parseFloat(i),chrome.alarms.create("recording-alarm",{delayInMinutes:c/60}));case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();chrome.commands.onCommand.addListener(function(){var e=O(L().mark((function e(t){var r,n,o;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("start-recording"!==t){e.next=7;break}return e.next=3,b();case 3:r=e.sent,!1===navigator.onLine&&!r.url.includes("/playground.html")&&!r.url.includes("/setup.html")||r.url.startsWith("chrome://")||r.url.startsWith("chrome-extension://")&&!r.url.includes("/playground.html")&&!r.url.includes("/setup.html")||r.url.includes("stackoverflow.com/")||r.url.includes("chrome.google.com/webstore")||r.url.includes("chromewebstore.google.com")?chrome.tabs.create({url:"playground.html",active:!0}).then((function(e){chrome.storage.local.set({activeTab:e.id}),chrome.tabs.onUpdated.addListener((function e(t,r,n){t===n.id&&"complete"===r.status&&(setTimeout((function(){v(n.id,{type:"start-stream"})}),500),chrome.tabs.onUpdated.removeListener(e))}))})):v(r.id,{type:"start-stream"}),e.next=19;break;case 7:if("cancel-recording"!==t){e.next=14;break}return e.next=10,b();case 10:n=e.sent,v(n.id,{type:"cancel-recording"}),e.next=19;break;case 14:if("pause-recording"!=t){e.next=19;break}return e.next=17,b();case 17:o=e.sent,v(o.id,{type:"pause-recording"});case 19:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());var F=function(){var e=O(L().mark((function e(t){var r,n,o,a,i,c;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("recording-alarm"!==t.name){e.next=22;break}return e.next=3,chrome.storage.local.get(["recording"]);case 3:if(r=e.sent,!r.recording){e.next=21;break}return W(),e.next=9,chrome.storage.local.get(["recordingTab"]);case 9:return n=e.sent,o=n.recordingTab,v(o,{type:"stop-recording-tab"}),e.next=14,chrome.storage.local.get(["activeTab"]);case 14:return a=e.sent,i=a.activeTab,v(i,{type:"stop-recording-tab"}),e.next=19,b();case 19:c=e.sent,v(c.id,{type:"stop-recording-tab"});case 21:chrome.alarms.clear("recording-alarm");case 22:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),U=function(e){F(e)},M=function(){chrome.alarms.onAlarm.hasListener(U)||chrome.alarms.onAlarm.addListener(U)};chrome.permissions&&chrome.permissions.contains({permissions:["alarms"]},(function(e){e&&M()}));var B=function(){var e=O(L().mark((function e(t){var r,n,o,a,i,c,u,s,f,l,h,p,d,m,g,y,b,w,x,k;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,chrome.storage.local.get(["recordingStartTime"]);case 2:return r=e.sent,n=r.recordingStartTime,e.next=6,chrome.tabs.get(t.tabId);case 6:return o=e.sent,e.next=9,chrome.storage.local.get(["recording"]);case 9:return a=e.sent,i=a.recording,e.next=13,chrome.storage.local.get(["restarting"]);case 13:if(c=e.sent,u=c.restarting,!i){e.next=32;break}return e.next=18,chrome.storage.local.get(["tabRecordedID"]);case 18:return s=e.sent,(f=s.tabRecordedID)&&f!=t.tabId?v(t.tabId,{type:"hide-popup-recording"}):o.url.includes("backup.html")&&o.url.includes("chrome-extension://")||chrome.storage.local.set({activeTab:t.tabId}),e.next=23,chrome.storage.local.get(["region"]);case 23:return l=e.sent,h=l.region,e.next=27,chrome.storage.local.get(["customRegion"]);case 27:p=e.sent,d=p.customRegion,h||d||v(t.tabId,{type:"recording-check"}),e.next=33;break;case 32:i||u||v(t.tabId,{type:"recording-ended"});case 33:if(!n){e.next=51;break}return e.next=36,chrome.storage.local.get(["alarm"]);case 36:if(m=e.sent,!m.alarm){e.next=49;break}return e.next=41,chrome.storage.local.get(["alarmTime"]);case 41:g=e.sent,y=g.alarmTime,b=parseFloat(y),w=Math.floor((Date.now()-n)/1e3),x=b-w,v(t.tabId,{type:"time",time:x}),e.next=51;break;case 49:k=Math.floor((Date.now()-n)/1e3),v(t.tabId,{type:"time",time:k});case 51:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}();function q(e){return new Promise((function(t,r){var n=new FileReader;n.onload=function(){t(n.result)},n.onerror=function(e){r(e)},n.readAsDataURL(e)}))}chrome.windows.onFocusChanged.addListener(function(){var e=O(L().mark((function e(t){var r,n,o;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t!==chrome.windows.WINDOW_ID_NONE){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,chrome.tabs.query({active:!0,windowId:t});case 4:r=e.sent,n=I(r,1),(o=n[0])&&B({tabId:o.id});case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),chrome.tabs.onActivated.addListener(function(){var e=O(L().mark((function e(t){return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:B(t);case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),chrome.tabs.onUpdated.addListener(function(){var e=O(L().mark((function e(t,r,n){var o,a,i,c,u,s,f,l,h,p,d,m,g,y,b,w;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("complete"!==r.status){e.next=44;break}return e.next=3,chrome.storage.local.get(["recording"]);case 3:return o=e.sent,a=o.recording,e.next=7,chrome.storage.local.get(["restarting"]);case 7:return i=e.sent,c=i.restarting,e.next=11,chrome.storage.local.get(["tabRecordedID"]);case 11:return u=e.sent,s=u.tabRecordedID,a||c?a&&s&&s==t&&v(t,{type:"recording-check",force:!0}):v(t,{type:"recording-ended"}),e.next=16,chrome.storage.local.get(["recordingStartTime"]);case 16:return f=e.sent,l=f.recordingStartTime,e.next=20,chrome.tabs.get(t);case 20:if(h=e.sent,!l){e.next=39;break}return e.next=24,chrome.storage.local.get(["alarm"]);case 24:if(p=e.sent,!p.alarm){e.next=37;break}return e.next=29,chrome.storage.local.get(["alarmTime"]);case 29:d=e.sent,m=d.alarmTime,g=parseFloat(m),y=Math.floor((Date.now()-l)/1e3),v(t,{type:"time",time:g-y}),e.next=39;break;case 37:b=Math.floor((Date.now()-l)/1e3),v(t,{type:"time",time:b});case 39:return e.next=41,chrome.commands.getAll();case 41:w=e.sent,v(t,{type:"commands",commands:w}),h.url.includes(chrome.runtime.getURL("playground.html"))&&"complete"===r.status&&v(h.id,{type:"toggle-popup"});case 44:case"end":return e.stop()}}),e)})));return function(t,r,n){return e.apply(this,arguments)}}());var G=function(){var e=O(L().mark((function e(t){var r,n,o,a,i,c,u,s,f=arguments;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=f.length>1&&void 0!==f[1]&&f[1],t.sort((function(e,t){return e.timestamp-t.timestamp})),e.next=4,chrome.storage.local.get(["sandboxTab"]);case 4:if(n=e.sent,o=n.sandboxTab,0!==t.length){e.next=9;break}return v(o,{type:"make-video-tab",override:r}),e.abrupt("return");case 9:a=0,10,i=t.length,c=0,5,u=1e3,v(o,{type:"chunk-count",count:i,override:r}),s=function(){var e=O(L().mark((function e(){var n,f,l,h,p,d,m,g,y,b=arguments;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=b.length>0&&void 0!==b[0]?b[0]:0,f=c,l=Math.min(c+10,i),h=[],p=f;case 5:if(!(p0?v(o,{type:"new-chunk-tab",chunks:h},(function(e){e?(c+=10)0&&void 0!==n[0]&&n[0],e.prev=1,r=[],e.next=5,A.iterate((function(e,t){r.push(e)}));case 5:G(r,t),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),chrome.runtime.reload();case 11:case"end":return e.stop()}}),e,null,[[1,8]])})));return function(){return e.apply(this,arguments)}}(),W=function(){var e=O(L().mark((function e(){var t,r,n,o,a,i,c;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return chrome.storage.local.set({restarting:!1}),e.next=3,chrome.storage.local.get(["recordingStartTime"]);case 3:return t=e.sent,r=t.recordingStartTime,n=Date.now()-r,o=42e4,0===r&&(n=0),chrome.storage.local.set({recording:!1,recordingDuration:n,tabRecordedID:null}),chrome.storage.local.set({recordingStartTime:0}),e.next=12,chrome.storage.local.get(["sandboxTab"]);case 12:return a=e.sent,i=a.sandboxTab,n>o?chrome.tabs.create({url:"editorfallback.html",active:!0},(function(e){chrome.tabs.onUpdated.addListener((function t(r,n,o){r===e.id&&"complete"===n.status&&(chrome.tabs.onUpdated.removeListener(t),y(i),chrome.storage.local.set({sandboxTab:e.id}),z())}))})):(chrome.tabs.get(i,(function(e){chrome.windows.update(e.windowId,{focused:!0}).then((function(){chrome.tabs.update(i,{active:!0,pinned:!1}),chrome.tabs.move(i,{index:-1})}))})),z()),chrome.action.setIcon({path:"assets/icon-34.png"}),e.next=18,chrome.storage.local.get(["wasRegion"]);case 18:c=e.sent,c.wasRegion&&chrome.storage.local.set({wasRegion:!1,region:!0}),chrome.alarms.clear("recording-alarm"),ee();case 23:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Y=function(){var e=O(L().mark((function e(){var t,r,n;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="editor.html",e.next=3,chrome.storage.local.get(["sandboxTab"]);case 3:r=e.sent,n=r.sandboxTab,chrome.tabs.create({url:t,active:!0},(function(e){chrome.tabs.onUpdated.addListener((function t(r,o,a){r===e.id&&"complete"===o.status&&(chrome.tabs.onUpdated.removeListener(t),y(n),chrome.storage.local.set({sandboxTab:e.id}),z(!0))}))}));case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();chrome.runtime.onStartup.addListener((function(){console.log("Starting...")})),chrome.action.onClicked.addListener(function(){var e=O(L().mark((function e(t){var r,n,o,a,i;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,chrome.storage.local.get(["recording"]);case 2:if(r=e.sent,!r.recording){e.next=14;break}return W(),J({type:"stop-recording-tab"}),e.next=9,chrome.storage.local.get(["activeTab"]);case 9:n=e.sent,o=n.activeTab,chrome.tabs.get(o,(function(e){e?v(o,{type:"stop-recording-tab"}):(v(t.id,{type:"stop-recording-tab"}),chrome.storage.local.set({activeTab:t.id}))})),e.next=15;break;case 14:!1===navigator.onLine&&!t.url.includes("/playground.html")&&!t.url.includes("/setup.html")||t.url.startsWith("chrome://")||t.url.startsWith("chrome-extension://")&&!t.url.includes("/playground.html")&&!t.url.includes("/setup.html")||t.url.includes("stackoverflow.com/")||t.url.includes("chrome.google.com/webstore")||t.url.includes("chromewebstore.google.com")?chrome.tabs.create({url:"playground.html",active:!0}).then((function(e){chrome.storage.local.set({activeTab:e.id})})):(v(t.id,{type:"toggle-popup"}),chrome.storage.local.set({activeTab:t.id}));case 15:return e.next=17,chrome.storage.local.get(["firstTime"]);case 17:if(a=e.sent,!a.firstTime||!t.url.includes(chrome.runtime.getURL("setup.html"))){e.next=25;break}return chrome.storage.local.set({firstTime:!1}),e.next=23,b();case 23:i=e.sent,v(i.id,{type:"setup-complete"});case 25:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());var V=function(){var e=O(L().mark((function e(){var t;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,b();case 2:t=e.sent,v(t.id,{type:"ready-to-record"});case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),K=function(){var e=O(L().mark((function e(){var t,r,n,o,a,i,c;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,chrome.storage.local.get(["micActive","defaultAudioInput","defaultAudioOutput","defaultVideoInput","systemAudio","recordingType"]);case 2:return t=e.sent,r=t.micActive,n=t.defaultAudioInput,o=t.defaultAudioOutput,a=t.defaultVideoInput,i=t.systemAudio,c=t.recordingType,e.abrupt("return",{micActive:r,defaultAudioInput:n,defaultAudioOutput:o,defaultVideoInput:a,systemAudio:i,recordingType:c});case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),H=function(){var e=O(L().mark((function e(){var t,r,n,o;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return chrome.storage.local.set({restarting:!0}),e.next=3,chrome.storage.local.get(["region"]);case 3:if(t=e.sent,t.region){e.next=11;break}return e.next=8,chrome.storage.local.get(["sandboxTab"]);case 8:r=e.sent,n=r.sandboxTab,y(n);case 11:return e.next=13,chrome.storage.local.get(["wasRegion"]);case 13:o=e.sent,o.wasRegion&&chrome.storage.local.set({wasRegion:!1,region:!0}),chrome.action.setIcon({path:"assets/icon-34.png"});case 17:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),X=function(){var e=O(L().mark((function e(){var t,r,n;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return chrome.storage.local.set({restarting:!0}),t="editor.html",navigator.userAgent.includes("Chrome/")&&parseInt(navigator.userAgent.match(/Chrome\/([0-9]+)/)[1])<=109&&(t="editorfallback.html"),e.next=5,chrome.storage.local.get(["sandboxTab"]);case 5:r=e.sent,n=r.sandboxTab,y(n),chrome.tabs.create({url:t,index:1,pinned:!0,active:!1},(function(e){chrome.storage.local.set({sandboxTab:e.id}),chrome.tabs.onUpdated.addListener((function e(t,r,n){t===n.id&&"complete"===r.status&&(chrome.tabs.onUpdated.removeListener(e),C())}))}));case 9:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),J=function(){var e=O(L().mark((function e(t){return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:chrome.storage.local.get(["recordingTab","offscreen"],(function(e){e.offscreen?chrome.runtime.sendMessage(t):v(e.recordingTab,t)}));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),Q=function(){var e=O(L().mark((function e(t,r){var n,o,a;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,chrome.storage.local.get(["backupTab"]);case 2:n=e.sent,o=n.backupTab,a=chrome.runtime.getURL("backup.html"),o?chrome.tabs.get(o,(function(e){e?v(e.id,{type:"init-backup",request:t,tabId:r}):chrome.tabs.create({url:a,active:!0,pinned:!0,index:0},(function(e){chrome.storage.local.set({backupTab:e.id}),chrome.tabs.onUpdated.addListener((function n(o,a,i){o===e.id&&"complete"===a.status&&(v(e.id,{type:"init-backup",request:t,tabId:r}),chrome.tabs.onUpdated.removeListener(n))}))}))})):chrome.tabs.create({url:a,active:!0,pinned:!0,index:0},(function(e){chrome.storage.local.set({backupTab:e.id}),chrome.tabs.onUpdated.addListener((function n(o,a,i){o===e.id&&"complete"===a.status&&(v(e.id,{type:"init-backup",request:t,tabId:r}),chrome.tabs.onUpdated.removeListener(n))}))}));case 6:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),Z=function(){var e=O(L().mark((function e(t){var r,n,o,a,i,c,u,s,f,l,h,p,d,m=arguments;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=m.length>1&&void 0!==m[1]?m[1]:null,e.next=3,chrome.storage.local.get(["backup"]);case 3:return n=e.sent,o=n.backup,e.next=7,b();case 7:if(a=e.sent,null===r){e.next=12;break}return e.next=11,chrome.tabs.get(r);case 11:a=e.sent;case 12:return chrome.storage.local.set({activeTab:a.id,tabRecordedID:null,memoryError:!1}),a.url.includes(chrome.runtime.getURL("playground.html"))?chrome.storage.local.set({tabPreferred:!0}):chrome.storage.local.set({tabPreferred:!1}),e.prev=14,e.next=17,chrome.runtime.getContexts({});case 17:if(i=e.sent,!i.find((function(e){return"OFFSCREEN_DOCUMENT"===e.contextType}))){e.next=22;break}return e.next=22,chrome.offscreen.closeDocument();case 22:e.next=26;break;case 24:e.prev=24,e.t0=e.catch(14);case 26:if(!t.region){e.next=56;break}if(null!==r&&chrome.tabs.update(r,{active:!0}),chrome.storage.local.set({recordingTab:a.id,offscreen:!1,region:!0}),!t.customRegion){e.next=33;break}J({type:"loaded",request:t,backup:o,region:!0}),e.next=54;break;case 33:throw e.prev=33,new Error("Exit offscreen recording");case 37:if(c=e.sent,!c.find((function(e){return"OFFSCREEN_DOCUMENT"===e.contextType}))){e.next=42;break}return e.next=42,chrome.offscreen.closeDocument();case 42:return e.next=44,chrome.offscreen.createDocument({url:"recorderoffscreen.html",reasons:["USER_MEDIA","AUDIO_PLAYBACK","DISPLAY_MEDIA"],justification:"Recording from getDisplayMedia API and tabCapture API"});case 44:return e.next=46,chrome.tabCapture.getMediaStreamId({targetTabId:a.id});case 46:u=e.sent,chrome.storage.local.set({recordingTab:null,offscreen:!0,region:!1,wasRegion:!0}),J({type:"loaded",request:t,isTab:!0,tabID:u}),e.next=54;break;case 51:e.prev=51,e.t1=e.catch(33),chrome.tabs.create({url:"recorder.html",pinned:!0,index:0,active:!!a.url.includes(chrome.runtime.getURL("playground.html"))}).then((function(e){chrome.storage.local.set({recordingTab:e.id,offscreen:!1,region:!1,wasRegion:!0,tabRecordedID:a.id}),chrome.tabs.onUpdated.addListener((function r(n,i,c){n===e.id&&"complete"===i.status&&(chrome.tabs.onUpdated.removeListener(r),J({type:"loaded",request:t,tabID:a.id,backup:o,isTab:!0}))}))}));case 54:e.next=86;break;case 56:if(e.prev=56,t.offscreenRecording&&!t.camera){e.next=59;break}throw new Error("Exit offscreen recording");case 59:return null!==r&&chrome.tabs.update(r,{active:!0}),e.next=62,chrome.storage.local.get(["qualityValue"]);case 62:return s=e.sent,f=s.qualityValue,e.next=66,chrome.storage.local.get(["fpsValue"]);case 66:return l=e.sent,h=l.fpsValue,e.next=70,chrome.runtime.getContexts({});case 70:if(p=e.sent,!p.find((function(e){return"OFFSCREEN_DOCUMENT"===e.contextType}))){e.next=75;break}return e.next=75,chrome.offscreen.closeDocument();case 75:return e.next=77,chrome.offscreen.createDocument({url:"recorderoffscreen.html",reasons:["USER_MEDIA","AUDIO_PLAYBACK","DISPLAY_MEDIA"],justification:"Recording from getDisplayMedia API"});case 77:chrome.storage.local.set({recordingTab:null,offscreen:!0,region:!1,wasRegion:!1}),J({type:"loaded",request:t,isTab:!1,quality:f,fps:h,backup:o}),e.next=86;break;case 81:e.prev=81,e.t2=e.catch(56),d=!0,t.camera&&(d=!1),chrome.tabs.create({url:"recorder.html",pinned:!0,index:0,active:d}).then((function(e){chrome.storage.local.set({recordingTab:e.id,offscreen:!1,region:!1,wasRegion:!1}),chrome.tabs.onUpdated.addListener((function r(n,a,i){n===e.id&&"complete"===a.status&&(chrome.tabs.onUpdated.removeListener(r),J({type:"loaded",request:t,backup:o}))}))}));case 86:case"end":return e.stop()}}),e,null,[[14,24],[33,51],[56,81]])})));return function(t){return e.apply(this,arguments)}}(),$=function(){var e=O(L().mark((function e(){var t,r;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,chrome.storage.local.get(["sandboxTab"]);case 2:t=e.sent,r=t.sandboxTab,v(r,{type:"saved-to-drive"});case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ee=function(){var e=O(L().mark((function e(){var t;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,chrome.runtime.getContexts({});case 3:if(t=e.sent,!t.find((function(e){return"OFFSCREEN_DOCUMENT"===e.contextType}))){e.next=8;break}return e.next=8,chrome.offscreen.closeDocument();case 8:e.next=12;break;case 10:e.prev=10,e.t0=e.catch(0);case 12:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(){return e.apply(this,arguments)}}(),te=function(){var e=O(L().mark((function e(){var t,r,n,o,a,i,c,u,s,f,l;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=chrome.runtime.getManifest().content_scripts,r=t.map((function(e){return chrome.tabs.query({url:e.matches})})),e.next=4,Promise.all(r);case 4:for(n=e.sent,o=[],a=0;a2&&void 0!==d[2]&&d[2]){e.next=7;break}n=fe(r.base64),o=r.title+".mp4",s(n,o,t).then((function(){$()})),e.next=25;break;case 7:return a=[],e.next=10,A.iterate((function(e,t){a.push(e)}));case 10:i=[],c=0,u=0,f=a;case 13:if(!(u0&&void 0!==o[0]&&o[0],e.next=3,chrome.storage.local.get(["activeTab"]);case 3:r=e.sent,n=r.activeTab,v(n,t?{type:"pip-started"}:{type:"pip-ended"});case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Se=function(){var e=O(L().mark((function e(){var t,r;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,chrome.storage.local.get(["token"]);case 2:t=e.sent,r=t.token,fetch("https://accounts.google.com/o/oauth2/revoke?token="+r),chrome.identity.removeCachedAuthToken({token:r}),chrome.storage.local.set({token:!1});case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Le=function(){var e=O(L().mark((function e(t){var r,n;return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return chrome.storage.local.set({recording:!1,restarting:!1,tabRecordedID:null,memoryError:!0}),J({type:"stop-recording-tab"}),e.next=4,chrome.storage.local.get(["activeTab"]);case 4:r=e.sent,n=r.activeTab,v(n,{type:"stop-pending"}),g(n);case 8:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),je=function(){var e=O(L().mark((function e(){return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:A.clear();case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Oe=function(){var e=O(L().mark((function e(t,r){return L().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==t&&0!==r){e.next=2;break}return e.abrupt("return");case 2:chrome.windows.getCurrent((function(e){chrome.windows.update(e.id,{width:t,height:r})}));case 3:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}();chrome.runtime.onMessage.addListener((function(e,t,r){if("desktop-capture"===e.type)he(e);else if("backup-created"===e.type)Z(e.request,e.tabId);else if("write-file"===e.type)pe(e);else if("handle-restart"===e.type)X();else if("handle-dismiss"===e.type)H();else if("reset-active-tab"===e.type)R();else if("reset-active-tab-restart"===e.type)C();else if("start-rec"===e.type)P();else if("video-ready"===e.type)de();else if("start-recording"===e.type)P();else if("restarted"===e.type)V();else{if("new-chunk"===e.type)return me(e),!0;if("get-streaming-data"===e.type)ve();else if("cancel-recording"===e.type)ge();else if("stop-recording-tab"===e.type)ye(e);else if("restart-recording-tab"===e.type)be();else if("dismiss-recording-tab"===e.type)we();else if("pause-recording-tab"===e.type)J({type:"pause-recording-tab"});else if("resume-recording-tab"===e.type)J({type:"resume-recording-tab"});else if("set-mic-active-tab"===e.type)xe(e);else if("recording-error"===e.type)ke(e);else if("on-get-permissions"===e.type)Ee(e);else if("recording-complete"===e.type)_e();else if("check-recording"===e.type)ne();else if("review-screenity"===e.type)w("https://chrome.google.com/webstore/detail/screenity-screen-recorder/kbbdabhdfibnancpjfhlkhafgdilcnji/reviews",!1,!0);else if("follow-twitter"===e.type)w("https://alyssax.substack.com/",!1,!0);else if("open-processing-info"===e.type)w("https://help.screenity.io/editing-and-exporting/dJRFpGq56JFKC7k8zEvsqb/why-is-there-a-5-minute-limit-for-editing/ddy4e4TpbnrFJ8VoRT37tQ",!0,!0);else if("upgrade-info"===e.type)w("https://help.screenity.io/getting-started/77KizPC8MHVGfpKpqdux9D/what-are-the-technical-requirements-for-using-screenity/6kdB6qru6naVD8ZLFvX3m9",!0,!0);else if("trim-info"===e.type)w("https://help.screenity.io/editing-and-exporting/dJRFpGq56JFKC7k8zEvsqb/how-to-cut-trim-or-mute-parts-of-your-video/svNbM7YHYY717MuSWXrKXH",!0,!0);else if("join-waitlist"===e.type)w("https://tally.so/r/npojNV",!0,!0);else if("chrome-update-info"===e.type)w("https://help.screenity.io/getting-started/77KizPC8MHVGfpKpqdux9D/what-are-the-technical-requirements-for-using-screenity/6kdB6qru6naVD8ZLFvX3m9",!0,!0);else if("set-surface"===e.type)Ie(e);else if("pip-ended"===e.type)Te(!1);else if("pip-started"===e.type)Te(!0);else if("new-sandbox-page-restart"===e.type)ae();else if("sign-out-drive"===e.type)Se();else if("open-help"===e.type)w("https://help.screenity.io/",!0,!0);else if("memory-limit-help"===e.type)w("https://help.screenity.io/troubleshooting/9Jy5RGjNrBB42hqUdREQ7W/what-does-%E2%80%9Cmemory-limit-reached%E2%80%9D-mean-when-recording/8WkwHbt3puuXunYqQnyPcb",!0,!0);else if("open-home"===e.type)w("https://screenity.io/",!1,!0);else if("report-bug"===e.type)w("https://tally.so/r/3ElpXq?version="+chrome.runtime.getManifest().version,!1,!0);else if("clear-recordings"===e.type)je();else if("force-processing"===e.type)Y();else if("focus-this-tab"===e.type)g(t.tab.id);else if("stop-recording-tab-backup"===e.type)Le(e);else if("indexed-db-download"===e.type)ce();else{if("get-platform-info"===e.type)return function(e){chrome.runtime.getPlatformInfo((function(t){e(t)}))}(r),!0;if("restore-recording"===e.type)ue();else{if("check-restore"===e.type)return se(r),!0;if("check-capture-permissions"===e.type)return function(e){chrome.permissions.contains({permissions:["desktopCapture","alarms","offscreen"]},(function(t){t?e({status:"ok"}):chrome.permissions.request({permissions:["desktopCapture","alarms","offscreen"]},(function(t){t?(M(),e({status:"ok"})):e({status:"error"})}))}))}(r),!0;if("is-pinned"===e.type)return function(e){chrome.action.getUserSettings().then((function(t){e({pinned:t.isOnToolbar})}))}(r),!0;if("save-to-drive"===e.type)return le(r,e,!1),!0;if("save-to-drive-fallback"===e.type)return le(r,e,!0),!0;if("request-download"===e.type)ie(e.base64,e.title);else if("resize-window"===e.type)Oe(e.width,e.height);else{if("available-memory"===e.type)return function(e){navigator.storage.estimate().then((function(t){e({data:t})}))}(r),!0;"extension-media-permissions"===e.type?w("chrome://settings/content/siteDetails?site=chrome-extension://"+chrome.runtime.id,!1,!0):"add-alarm-listener"===e.type&&M()}}}}}))})()})(); \ No newline at end of file diff --git a/build/manifest.json b/build/manifest.json index 78537bf..0f26768 100644 --- a/build/manifest.json +++ b/build/manifest.json @@ -1 +1 @@ -{"description":"__MSG_extDesc__","version":"3.1.5","manifest_version":3,"name":"__MSG_extName__","default_locale":"en","background":{"service_worker":"background.bundle.js"},"action":{"default_icon":"assets/img/icon-34.png"},"icons":{"128":"assets/img/icon-128.png"},"host_permissions":[""],"content_scripts":[{"matches":[""],"js":["contentScript.bundle.js"],"css":["assets/fonts/fonts.css"]}],"web_accessible_resources":[{"resources":["content.styles.css","blank.mp4","playground.html","editor.html","assets/*","setup.html","worker.js","vendor/*","recorder.html","recorderoffscreen.html","sandbox.html","wrapper.html","camera.html","permissions.html","region.html","waveform.html","playground.html","editorfallback.html","download.html","*"],"matches":[""]}],"oauth2":{"client_id":"560517327251-m7n1k3kddknu7s9s4ejvrs1bj91gutd7.apps.googleusercontent.com","scopes":["https://www.googleapis.com/auth/drive.file"]},"cross_origin_embedder_policy":{"value":"require-corp"},"cross_origin_opener_policy":{"value":"same-origin"},"content_security_policy":{"sandbox":"sandbox allow-scripts allow-modals allow-popups; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; object-src 'self';worker-src 'self' blob: ;","extension_pages":"script-src 'self' 'wasm-unsafe-eval'; object-src 'self'; media-src 'self' data: blob: *;"},"sandbox":{"pages":["editor.html"]},"commands":{"start-recording":{"suggested_key":{"default":"Alt+Shift+G"},"description":"Start recording"},"cancel-recording":{"suggested_key":{"default":"Alt+Shift+X"},"description":"Cancel recording"},"pause-recording":{"suggested_key":{"default":"Alt+Shift+M"},"description":"Pause/Resume recording"}},"permissions":["identity","activeTab","storage","unlimitedStorage","downloads","tabs","tabCapture","scripting"],"optional_permissions":["offscreen","desktopCapture","alarms"]} \ No newline at end of file +{"description":"__MSG_extDesc__","version":"3.1.6","manifest_version":3,"name":"__MSG_extName__","default_locale":"en","background":{"service_worker":"background.bundle.js"},"action":{"default_icon":"assets/img/icon-34.png"},"icons":{"128":"assets/img/icon-128.png"},"host_permissions":[""],"content_scripts":[{"matches":[""],"js":["contentScript.bundle.js"],"css":["assets/fonts/fonts.css"]}],"web_accessible_resources":[{"resources":["content.styles.css","blank.mp4","playground.html","editor.html","assets/*","setup.html","worker.js","vendor/*","recorder.html","recorderoffscreen.html","sandbox.html","wrapper.html","camera.html","permissions.html","region.html","waveform.html","playground.html","editorfallback.html","download.html","*"],"matches":[""]}],"oauth2":{"client_id":"560517327251-m7n1k3kddknu7s9s4ejvrs1bj91gutd7.apps.googleusercontent.com","scopes":["https://www.googleapis.com/auth/drive.file"]},"cross_origin_embedder_policy":{"value":"require-corp"},"cross_origin_opener_policy":{"value":"same-origin"},"content_security_policy":{"sandbox":"sandbox allow-scripts allow-modals allow-popups; script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:; object-src 'self';worker-src 'self' blob: ;","extension_pages":"script-src 'self' 'wasm-unsafe-eval'; object-src 'self'; media-src 'self' data: blob: *;"},"sandbox":{"pages":["editor.html"]},"commands":{"start-recording":{"suggested_key":{"default":"Alt+Shift+G"},"description":"Start recording"},"cancel-recording":{"suggested_key":{"default":"Alt+Shift+X"},"description":"Cancel recording"},"pause-recording":{"suggested_key":{"default":"Alt+Shift+M"},"description":"Pause/Resume recording"}},"permissions":["identity","activeTab","storage","unlimitedStorage","downloads","tabs","tabCapture","scripting"],"optional_permissions":["offscreen","desktopCapture","alarms"]} \ No newline at end of file diff --git a/build/permissions.bundle.js b/build/permissions.bundle.js index 1e69921..9720645 100644 --- a/build/permissions.bundle.js +++ b/build/permissions.bundle.js @@ -6,7 +6,7 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n