vg-coder-cli 2.0.10 → 2.0.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- (()=>{"use strict";const e={apiKey:"AIzaSyDrpNMso-DXeN7c4vwbpV0idpxnV2vtXhQ",authDomain:"vetgo-chrome.firebaseapp.com",databaseURL:"https://vetgo-chrome-default-rtdb.asia-southeast1.firebasedatabase.app",projectId:"vetgo-chrome",storageBucket:"vetgo-chrome.appspot.com",messagingSenderId:"211178224097",appId:"1:211178224097:web:f73bf5a81c2f4c32fc7aa0"};var t=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function c(e){try{a(r.next(e))}catch(e){i(e)}}function s(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(c,s)}a((r=r.apply(e,t||[])).next())})};const n="environmentName",r="firebaseConfig",o="midjourney";class i{static getEnvironmentName(){return t(this,void 0,void 0,function*(){return new Promise(e=>{chrome.storage.sync.get([n],t=>{const r=t[n]||o;e(r)})})})}static setEnvironmentName(e){return t(this,void 0,void 0,function*(){return new Promise((t,r)=>{e&&""!==e.trim()?chrome.storage.sync.set({[n]:e.trim()},()=>{chrome.runtime.lastError?r(chrome.runtime.lastError):t()}):r(new Error("Environment name cannot be empty"))})})}static getFirebaseConfig(){return t(this,void 0,void 0,function*(){return new Promise(t=>{chrome.storage.sync.get([r],n=>{const o=n[r];o&&Object.keys(o).length>0?t(o):t(e)})})})}static setFirebaseConfig(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{chrome.storage.sync.set({[r]:e},()=>{chrome.runtime.lastError?n(chrome.runtime.lastError):t()})})})}static resetToDefault(){return t(this,void 0,void 0,function*(){try{yield this.setEnvironmentName(o),yield new Promise(e=>{chrome.storage.sync.remove(r,()=>e())})}catch(e){throw e}})}}var c=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function c(e){try{a(r.next(e))}catch(e){i(e)}}function s(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(c,s)}a((r=r.apply(e,t||[])).next())})};const s=document.getElementById("configForm"),a=document.getElementById("environmentName"),u=document.getElementById("firebaseConfig"),m=document.getElementById("resetBtn"),h=document.getElementById("message"),d=document.getElementById("currentEnv");function f(e,t){h.textContent=e,h.className=`message ${t}`,setTimeout(()=>{h.className="message"},3e3)}function g(){return c(this,void 0,void 0,function*(){try{const t=yield i.getEnvironmentName();d.textContent=t,a.value=t;const n=yield i.getFirebaseConfig();JSON.stringify(n)===JSON.stringify(e)?(u.value="",u.placeholder=`Đang sử dụng mặc định:\n${JSON.stringify(e,null,2)}`):u.value=JSON.stringify(n,null,2)}catch(e){console.error("Error loading config:",e),d.textContent="Lỗi khi tải cấu hình",f("Không thể tải cấu hình hiện tại","error")}})}s.addEventListener("submit",function(e){return c(this,void 0,void 0,function*(){e.preventDefault();const t=a.value.trim(),n=u.value.trim();if(t)try{if(yield i.setEnvironmentName(t),d.textContent=t,n)try{const e=JSON.parse(n);if(!e.apiKey||!e.databaseURL)throw new Error("Config thiếu apiKey hoặc databaseURL");yield i.setFirebaseConfig(e)}catch(e){return void f("❌ JSON Firebase Config không hợp lệ: "+e.message,"error")}else yield new Promise(e=>{chrome.storage.sync.remove("firebaseConfig",()=>e())});f("✅ Lưu cấu hình thành công!","success"),g()}catch(e){console.error("Error saving settings:",e),f("❌ Lỗi khi lưu cấu hình: "+e.message,"error")}else f("Vui lòng nhập tên môi trường","error")})}),m.addEventListener("click",function(){return c(this,void 0,void 0,function*(){if(confirm("Bạn có chắc muốn đặt lại tất cả về mặc định?"))try{yield i.resetToDefault(),yield g(),f("✅ Đã đặt lại về cấu hình mặc định!","success")}catch(e){console.error("Error resetting environment:",e),f("❌ Lỗi khi đặt lại cấu hình","error")}})}),g()})();
1
+ (()=>{"use strict";const e={apiKey:"AIzaSyDrpNMso-DXeN7c4vwbpV0idpxnV2vtXhQ",authDomain:"vetgo-chrome.firebaseapp.com",databaseURL:"https://vetgo-chrome-default-rtdb.asia-southeast1.firebasedatabase.app",projectId:"vetgo-chrome",storageBucket:"vetgo-chrome.appspot.com",messagingSenderId:"211178224097",appId:"1:211178224097:web:f73bf5a81c2f4c32fc7aa0"};var t=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function c(e){try{a(r.next(e))}catch(e){i(e)}}function s(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(c,s)}a((r=r.apply(e,t||[])).next())})};const n="environmentName",r="firebaseConfig",o="VGCODER";class i{static getEnvironmentName(){return t(this,void 0,void 0,function*(){return new Promise(e=>{chrome.storage.sync.get([n],t=>{const r=t[n]||o;e(r)})})})}static setEnvironmentName(e){return t(this,void 0,void 0,function*(){return new Promise((t,r)=>{e&&""!==e.trim()?chrome.storage.sync.set({[n]:e.trim()},()=>{chrome.runtime.lastError?r(chrome.runtime.lastError):t()}):r(new Error("Environment name cannot be empty"))})})}static getFirebaseConfig(){return t(this,void 0,void 0,function*(){return new Promise(t=>{chrome.storage.sync.get([r],n=>{const o=n[r];o&&Object.keys(o).length>0?t(o):t(e)})})})}static setFirebaseConfig(e){return t(this,void 0,void 0,function*(){return new Promise((t,n)=>{chrome.storage.sync.set({[r]:e},()=>{chrome.runtime.lastError?n(chrome.runtime.lastError):t()})})})}static resetToDefault(){return t(this,void 0,void 0,function*(){try{yield this.setEnvironmentName(o),yield new Promise(e=>{chrome.storage.sync.remove(r,()=>e())})}catch(e){throw e}})}}var c=function(e,t,n,r){return new(n||(n=Promise))(function(o,i){function c(e){try{a(r.next(e))}catch(e){i(e)}}function s(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(c,s)}a((r=r.apply(e,t||[])).next())})};const s=document.getElementById("configForm"),a=document.getElementById("environmentName"),u=document.getElementById("firebaseConfig"),m=document.getElementById("resetBtn"),h=document.getElementById("message"),f=document.getElementById("currentEnv");function d(e,t){h.textContent=e,h.className=`message ${t}`,setTimeout(()=>{h.className="message"},3e3)}function g(){return c(this,void 0,void 0,function*(){try{const t=yield i.getEnvironmentName();f.textContent=t,a.value=t;const n=yield i.getFirebaseConfig();JSON.stringify(n)===JSON.stringify(e)?(u.value="",u.placeholder=`Đang sử dụng mặc định:\n${JSON.stringify(e,null,2)}`):u.value=JSON.stringify(n,null,2)}catch(e){console.error("Error loading config:",e),f.textContent="Lỗi khi tải cấu hình",d("Không thể tải cấu hình hiện tại","error")}})}s.addEventListener("submit",function(e){return c(this,void 0,void 0,function*(){e.preventDefault();const t=a.value.trim(),n=u.value.trim();if(t)try{if(yield i.setEnvironmentName(t),f.textContent=t,n)try{const e=JSON.parse(n);if(!e.apiKey||!e.databaseURL)throw new Error("Config thiếu apiKey hoặc databaseURL");yield i.setFirebaseConfig(e)}catch(e){return void d("❌ JSON Firebase Config không hợp lệ: "+e.message,"error")}else yield new Promise(e=>{chrome.storage.sync.remove("firebaseConfig",()=>e())});d("✅ Lưu cấu hình thành công!","success"),g()}catch(e){console.error("Error saving settings:",e),d("❌ Lỗi khi lưu cấu hình: "+e.message,"error")}else d("Vui lòng nhập tên môi trường","error")})}),m.addEventListener("click",function(){return c(this,void 0,void 0,function*(){if(confirm("Bạn có chắc muốn đặt lại tất cả về mặc định?"))try{yield i.resetToDefault(),yield g(),d("✅ Đã đặt lại về cấu hình mặc định!","success")}catch(e){console.error("Error resetting environment:",e),d("❌ Lỗi khi đặt lại cấu hình","error")}})}),g()})();
index 80fea8e..edbc690 100644
Binary file
package/vg-coder.zip CHANGED
Binary file