@nvwa-app/sdk-uniapp 6.0.11 → 6.0.12

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.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var k=Object.defineProperty;var Be=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Ge=Object.prototype.hasOwnProperty;var ze=(t,e)=>{for(var r in e)k(t,r,{get:e[r],enumerable:!0})},Je=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of qe(e))!Ge.call(t,a)&&a!==r&&k(t,a,{get:()=>e[a],enumerable:!(s=Be(e,a))||s.enumerable});return t};var We=t=>Je(k({},"__esModule",{value:!0}),t);var vt={};ze(vt,{default:()=>H,disableIframeHoverInspector:()=>ft,enableIframeHoverInspector:()=>pt,getIframeSourceLocation:()=>mt,localStorage:()=>Fe,polyfill:()=>Ie,setupIframeHoverInspector:()=>dt,setupIframeSourceLocationListener:()=>yt,uniappFetch:()=>L});module.exports=We(vt);var Ke=Object.create,N=Object.defineProperty,Ve=Object.getOwnPropertyDescriptor,Ye=Object.getOwnPropertyNames,Qe=Object.getPrototypeOf,Xe=Object.prototype.hasOwnProperty,G=(t,e)=>()=>(t&&(e=t(t=0)),e),_=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ze=(t,e)=>{for(var r in e)N(t,r,{get:e[r],enumerable:!0})},z=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Ye(e))!Xe.call(t,a)&&a!==r&&N(t,a,{get:()=>e[a],enumerable:!(s=Ve(e,a))||s.enumerable});return t},et=(t,e,r)=>(r=t!=null?Ke(Qe(t)):{},z(e||!t||!t.__esModule?N(r,"default",{value:t,enumerable:!0}):r,t)),S=t=>z(N({},"__esModule",{value:!0}),t),g=G(()=>{"use strict"}),O={};Ze(O,{__addDisposableResource:()=>ye,__assign:()=>$,__asyncDelegator:()=>le,__asyncGenerator:()=>ie,__asyncValues:()=>ce,__await:()=>P,__awaiter:()=>te,__classPrivateFieldGet:()=>pe,__classPrivateFieldIn:()=>me,__classPrivateFieldSet:()=>fe,__createBinding:()=>x,__decorate:()=>K,__disposeResources:()=>ge,__esDecorate:()=>Y,__exportStar:()=>se,__extends:()=>J,__generator:()=>re,__importDefault:()=>de,__importStar:()=>ue,__makeTemplateObject:()=>he,__metadata:()=>ee,__param:()=>V,__propKey:()=>X,__read:()=>D,__rest:()=>W,__rewriteRelativeImportExtension:()=>ve,__runInitializers:()=>Q,__setFunctionName:()=>Z,__spread:()=>ae,__spreadArray:()=>oe,__spreadArrays:()=>ne,__values:()=>C,default:()=>Ee});function J(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");j(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function W(t,e){var r={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(r[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(t);a<s.length;a++)e.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(t,s[a])&&(r[s[a]]=t[s[a]]);return r}function K(t,e,r,s){var a=arguments.length,n=a<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,r):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,r,s);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(n=(a<3?o(n):a>3?o(e,r,n):o(e,r))||n);return a>3&&n&&Object.defineProperty(e,r,n),n}function V(t,e){return function(r,s){e(r,s,t)}}function Y(t,e,r,s,a,n){function o(v){if(v!==void 0&&typeof v!="function")throw new TypeError("Function expected");return v}for(var l=s.kind,h=l==="getter"?"get":l==="setter"?"set":"value",i=!e&&t?s.static?t:t.prototype:null,c=e||(i?Object.getOwnPropertyDescriptor(i,s.name):{}),u,f=!1,d=r.length-1;d>=0;d--){var p={};for(var m in s)p[m]=m==="access"?{}:s[m];for(var m in s.access)p.access[m]=s.access[m];p.addInitializer=function(v){if(f)throw new TypeError("Cannot add initializers after decoration has completed");n.push(o(v||null))};var y=(0,r[d])(l==="accessor"?{get:c.get,set:c.set}:c[h],p);if(l==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(u=o(y.get))&&(c.get=u),(u=o(y.set))&&(c.set=u),(u=o(y.init))&&a.unshift(u)}else(u=o(y))&&(l==="field"?a.unshift(u):c[h]=u)}i&&Object.defineProperty(i,s.name,c),f=!0}function Q(t,e,r){for(var s=arguments.length>2,a=0;a<e.length;a++)r=s?e[a].call(t,r):e[a].call(t);return s?r:void 0}function X(t){return typeof t=="symbol"?t:"".concat(t)}function Z(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function ee(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function te(t,e,r,s){function a(n){return n instanceof r?n:new r(function(o){o(n)})}return new(r||(r=Promise))(function(n,o){function l(c){try{i(s.next(c))}catch(u){o(u)}}function h(c){try{i(s.throw(c))}catch(u){o(u)}}function i(c){c.done?n(c.value):a(c.value).then(l,h)}i((s=s.apply(t,e||[])).next())})}function re(t,e){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},s,a,n,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(i){return function(c){return h([i,c])}}function h(i){if(s)throw new TypeError("Generator is already executing.");for(;o&&(o=0,i[0]&&(r=0)),r;)try{if(s=1,a&&(n=i[0]&2?a.return:i[0]?a.throw||((n=a.return)&&n.call(a),0):a.next)&&!(n=n.call(a,i[1])).done)return n;switch(a=0,n&&(i=[i[0]&2,n.value]),i[0]){case 0:case 1:n=i;break;case 4:return r.label++,{value:i[1],done:!1};case 5:r.label++,a=i[1],i=[0];continue;case 7:i=r.ops.pop(),r.trys.pop();continue;default:if(n=r.trys,!(n=n.length>0&&n[n.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!n||i[1]>n[0]&&i[1]<n[3])){r.label=i[1];break}if(i[0]===6&&r.label<n[1]){r.label=n[1],n=i;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(i);break}n[2]&&r.ops.pop(),r.trys.pop();continue}i=e.call(t,r)}catch(c){i=[6,c],a=0}finally{s=n=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}function se(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&x(e,t,r)}function C(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],s=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function D(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var s=r.call(t),a,n=[],o;try{for(;(e===void 0||e-- >0)&&!(a=s.next()).done;)n.push(a.value)}catch(l){o={error:l}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return n}function ae(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(D(arguments[e]));return t}function ne(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var s=Array(t),a=0,e=0;e<r;e++)for(var n=arguments[e],o=0,l=n.length;o<l;o++,a++)s[a]=n[o];return s}function oe(t,e,r){if(r||arguments.length===2)for(var s=0,a=e.length,n;s<a;s++)(n||!(s in e))&&(n||(n=Array.prototype.slice.call(e,0,s)),n[s]=e[s]);return t.concat(n||Array.prototype.slice.call(e))}function P(t){return this instanceof P?(this.v=t,this):new P(t)}function ie(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=r.apply(t,e||[]),a,n=[];return a=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",o),a[Symbol.asyncIterator]=function(){return this},a;function o(d){return function(p){return Promise.resolve(p).then(d,u)}}function l(d,p){s[d]&&(a[d]=function(m){return new Promise(function(y,v){n.push([d,m,y,v])>1||h(d,m)})},p&&(a[d]=p(a[d])))}function h(d,p){try{i(s[d](p))}catch(m){f(n[0][3],m)}}function i(d){d.value instanceof P?Promise.resolve(d.value.v).then(c,u):f(n[0][2],d)}function c(d){h("next",d)}function u(d){h("throw",d)}function f(d,p){d(p),n.shift(),n.length&&h(n[0][0],n[0][1])}}function le(t){var e,r;return e={},s("next"),s("throw",function(a){throw a}),s("return"),e[Symbol.iterator]=function(){return this},e;function s(a,n){e[a]=t[a]?function(o){return(r=!r)?{value:P(t[a](o)),done:!1}:n?n(o):o}:n}}function ce(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof C=="function"?C(t):t[Symbol.iterator](),r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r);function s(n){r[n]=t[n]&&function(o){return new Promise(function(l,h){o=t[n](o),a(l,h,o.done,o.value)})}}function a(n,o,l,h){Promise.resolve(h).then(function(i){n({value:i,done:l})},o)}}function he(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function ue(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=A(t),s=0;s<r.length;s++)r[s]!=="default"&&x(e,t,r[s]);return we(e,t),e}function de(t){return t&&t.__esModule?t:{default:t}}function pe(t,e,r,s){if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?s:r==="a"?s.call(t):s?s.value:e.get(t)}function fe(t,e,r,s,a){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?a.call(t,r):a?a.value=r:e.set(t,r),r}function me(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function ye(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var s,a;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");s=e[Symbol.asyncDispose]}if(s===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");s=e[Symbol.dispose],r&&(a=s)}if(typeof s!="function")throw new TypeError("Object not disposable.");a&&(s=function(){try{a.call(this)}catch(n){return Promise.reject(n)}}),t.stack.push({value:e,dispose:s,async:r})}else r&&t.stack.push({async:!0});return e}function ge(t){function e(n){t.error=t.hasError?new be(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}var r,s=0;function a(){for(;r=t.stack.pop();)try{if(!r.async&&s===1)return s=0,t.stack.push(r),Promise.resolve().then(a);if(r.dispose){var n=r.dispose.call(r.value);if(r.async)return s|=2,Promise.resolve(n).then(a,function(o){return e(o),a()})}else s|=1}catch(o){e(o)}if(s===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return a()}function ve(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,s,a,n,o){return s?e?".jsx":".js":a&&(!n||!o)?r:a+n+"."+o.toLowerCase()+"js"}):t}var j,$,x,we,A,be,Ee,T=G(()=>{"use strict";g(),j=function(t,e){return j=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(r[a]=s[a])},j(t,e)},$=function(){return $=Object.assign||function(t){for(var e,r=1,s=arguments.length;r<s;r++){e=arguments[r];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},$.apply(this,arguments)},x=Object.create?(function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||("get"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}):(function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),we=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e},A=function(t){return A=Object.getOwnPropertyNames||function(e){var r=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[r.length]=s);return r},A(t)},be=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var s=new Error(r);return s.name="SuppressedError",s.error=t,s.suppressed=e,s},Ee={__extends:J,__assign:$,__rest:W,__decorate:K,__param:V,__esDecorate:Y,__runInitializers:Q,__propKey:X,__setFunctionName:Z,__metadata:ee,__awaiter:te,__generator:re,__createBinding:x,__exportStar:se,__values:C,__read:D,__spread:ae,__spreadArrays:ne,__spreadArray:oe,__await:P,__asyncGenerator:ie,__asyncDelegator:le,__asyncValues:ce,__makeTemplateObject:he,__importStar:ue,__importDefault:de,__classPrivateFieldGet:pe,__classPrivateFieldSet:fe,__classPrivateFieldIn:me,__addDisposableResource:ye,__disposeResources:ge,__rewriteRelativeImportExtension:ve}}),_e=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=class extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.code=r.code}};t.default=e}),Oe=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(O)),r=e.__importDefault(_e()),s=class{constructor(a){var n,o;this.shouldThrowOnError=!1,this.method=a.method,this.url=a.url,this.headers=new Headers(a.headers),this.schema=a.schema,this.body=a.body,this.shouldThrowOnError=(n=a.shouldThrowOnError)!==null&&n!==void 0?n:!1,this.signal=a.signal,this.isMaybeSingle=(o=a.isMaybeSingle)!==null&&o!==void 0?o:!1,a.fetch?this.fetch=a.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(a,n){return this.headers=new Headers(this.headers),this.headers.set(a,n),this}then(a,n){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");let o=this.fetch,l=o(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async h=>{var i,c,u,f;let d=null,p=null,m=null,y=h.status,v=h.statusText;if(h.ok){if(this.method!=="HEAD"){let M=await h.text();M===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&!((i=this.headers.get("Accept"))===null||i===void 0)&&i.includes("application/vnd.pgrst.plan+text")?p=M:p=JSON.parse(M))}let b=(c=this.headers.get("Prefer"))===null||c===void 0?void 0:c.match(/count=(exact|planned|estimated)/),E=(u=h.headers.get("content-range"))===null||u===void 0?void 0:u.split("/");b&&E&&E.length>1&&(m=parseInt(E[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(p)&&(p.length>1?(d={code:"PGRST116",details:`Results contain ${p.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},p=null,m=null,y=406,v="Not Acceptable"):p.length===1?p=p[0]:p=null)}else{let b=await h.text();try{d=JSON.parse(b),Array.isArray(d)&&h.status===404&&(p=[],d=null,y=200,v="OK")}catch{h.status===404&&b===""?(y=204,v="No Content"):d={message:b}}if(d&&this.isMaybeSingle&&!((f=d?.details)===null||f===void 0)&&f.includes("0 rows")&&(d=null,y=200,v="OK"),d&&this.shouldThrowOnError)throw new r.default(d)}return{error:d,data:p,count:m,status:y,statusText:v}});return this.shouldThrowOnError||(l=l.catch(h=>{var i,c,u;return{error:{message:`${(i=h?.name)!==null&&i!==void 0?i:"FetchError"}: ${h?.message}`,details:`${(c=h?.stack)!==null&&c!==void 0?c:""}`,hint:"",code:`${(u=h?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),l.then(a,n)}returns(){return this}overrideTypes(){return this}};t.default=s}),Pe=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(O)),r=e.__importDefault(Oe()),s=class extends r.default{select(a){let n=!1,o=(a??"*").split("").map(l=>/\s/.test(l)&&!n?"":(l==='"'&&(n=!n),l)).join("");return this.url.searchParams.set("select",o),this.headers.append("Prefer","return=representation"),this}order(a,{ascending:n=!0,nullsFirst:o,foreignTable:l,referencedTable:h=l}={}){let i=h?`${h}.order`:"order",c=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${c?`${c},`:""}${a}.${n?"asc":"desc"}${o===void 0?"":o?".nullsfirst":".nullslast"}`),this}limit(a,{foreignTable:n,referencedTable:o=n}={}){let l=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(l,`${a}`),this}range(a,n,{foreignTable:o,referencedTable:l=o}={}){let h=typeof l>"u"?"offset":`${l}.offset`,i=typeof l>"u"?"limit":`${l}.limit`;return this.url.searchParams.set(h,`${a}`),this.url.searchParams.set(i,`${n-a+1}`),this}abortSignal(a){return this.signal=a,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:a=!1,verbose:n=!1,settings:o=!1,buffers:l=!1,wal:h=!1,format:i="text"}={}){var c;let u=[a?"analyze":null,n?"verbose":null,o?"settings":null,l?"buffers":null,h?"wal":null].filter(Boolean).join("|"),f=(c=this.headers.get("Accept"))!==null&&c!==void 0?c:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${f}"; options=${u};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(a){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${a}`),this}};t.default=s}),F=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(O)),r=e.__importDefault(Pe()),s=new RegExp("[,()]"),a=class extends r.default{eq(n,o){return this.url.searchParams.append(n,`eq.${o}`),this}neq(n,o){return this.url.searchParams.append(n,`neq.${o}`),this}gt(n,o){return this.url.searchParams.append(n,`gt.${o}`),this}gte(n,o){return this.url.searchParams.append(n,`gte.${o}`),this}lt(n,o){return this.url.searchParams.append(n,`lt.${o}`),this}lte(n,o){return this.url.searchParams.append(n,`lte.${o}`),this}like(n,o){return this.url.searchParams.append(n,`like.${o}`),this}likeAllOf(n,o){return this.url.searchParams.append(n,`like(all).{${o.join(",")}}`),this}likeAnyOf(n,o){return this.url.searchParams.append(n,`like(any).{${o.join(",")}}`),this}ilike(n,o){return this.url.searchParams.append(n,`ilike.${o}`),this}ilikeAllOf(n,o){return this.url.searchParams.append(n,`ilike(all).{${o.join(",")}}`),this}ilikeAnyOf(n,o){return this.url.searchParams.append(n,`ilike(any).{${o.join(",")}}`),this}is(n,o){return this.url.searchParams.append(n,`is.${o}`),this}in(n,o){let l=Array.from(new Set(o)).map(h=>typeof h=="string"&&s.test(h)?`"${h}"`:`${h}`).join(",");return this.url.searchParams.append(n,`in.(${l})`),this}contains(n,o){return typeof o=="string"?this.url.searchParams.append(n,`cs.${o}`):Array.isArray(o)?this.url.searchParams.append(n,`cs.{${o.join(",")}}`):this.url.searchParams.append(n,`cs.${JSON.stringify(o)}`),this}containedBy(n,o){return typeof o=="string"?this.url.searchParams.append(n,`cd.${o}`):Array.isArray(o)?this.url.searchParams.append(n,`cd.{${o.join(",")}}`):this.url.searchParams.append(n,`cd.${JSON.stringify(o)}`),this}rangeGt(n,o){return this.url.searchParams.append(n,`sr.${o}`),this}rangeGte(n,o){return this.url.searchParams.append(n,`nxl.${o}`),this}rangeLt(n,o){return this.url.searchParams.append(n,`sl.${o}`),this}rangeLte(n,o){return this.url.searchParams.append(n,`nxr.${o}`),this}rangeAdjacent(n,o){return this.url.searchParams.append(n,`adj.${o}`),this}overlaps(n,o){return typeof o=="string"?this.url.searchParams.append(n,`ov.${o}`):this.url.searchParams.append(n,`ov.{${o.join(",")}}`),this}textSearch(n,o,{config:l,type:h}={}){let i="";h==="plain"?i="pl":h==="phrase"?i="ph":h==="websearch"&&(i="w");let c=l===void 0?"":`(${l})`;return this.url.searchParams.append(n,`${i}fts${c}.${o}`),this}match(n){return Object.entries(n).forEach(([o,l])=>{this.url.searchParams.append(o,`eq.${l}`)}),this}not(n,o,l){return this.url.searchParams.append(n,`not.${o}.${l}`),this}or(n,{foreignTable:o,referencedTable:l=o}={}){let h=l?`${l}.or`:"or";return this.url.searchParams.append(h,`(${n})`),this}filter(n,o,l){return this.url.searchParams.append(n,`${o}.${l}`),this}};t.default=a}),Se=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(O)),r=e.__importDefault(F()),s=class{constructor(a,{headers:n={},schema:o,fetch:l}){this.url=a,this.headers=new Headers(n),this.schema=o,this.fetch=l}select(a,n){let{head:o=!1,count:l}=n??{},h=o?"HEAD":"GET",i=!1,c=(a??"*").split("").map(u=>/\s/.test(u)&&!i?"":(u==='"'&&(i=!i),u)).join("");return this.url.searchParams.set("select",c),l&&this.headers.append("Prefer",`count=${l}`),new r.default({method:h,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(a,{count:n,defaultToNull:o=!0}={}){var l;let h="POST";if(n&&this.headers.append("Prefer",`count=${n}`),o||this.headers.append("Prefer","missing=default"),Array.isArray(a)){let i=a.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(i.length>0){let c=[...new Set(i)].map(u=>`"${u}"`);this.url.searchParams.set("columns",c.join(","))}}return new r.default({method:h,url:this.url,headers:this.headers,schema:this.schema,body:a,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch})}upsert(a,{onConflict:n,ignoreDuplicates:o=!1,count:l,defaultToNull:h=!0}={}){var i;let c="POST";if(this.headers.append("Prefer",`resolution=${o?"ignore":"merge"}-duplicates`),n!==void 0&&this.url.searchParams.set("on_conflict",n),l&&this.headers.append("Prefer",`count=${l}`),h||this.headers.append("Prefer","missing=default"),Array.isArray(a)){let u=a.reduce((f,d)=>f.concat(Object.keys(d)),[]);if(u.length>0){let f=[...new Set(u)].map(d=>`"${d}"`);this.url.searchParams.set("columns",f.join(","))}}return new r.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:a,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}update(a,{count:n}={}){var o;let l="PATCH";return n&&this.headers.append("Prefer",`count=${n}`),new r.default({method:l,url:this.url,headers:this.headers,schema:this.schema,body:a,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}delete({count:a}={}){var n;let o="DELETE";return a&&this.headers.append("Prefer",`count=${a}`),new r.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}};t.default=s}),tt=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(O)),r=e.__importDefault(Se()),s=e.__importDefault(F()),a=class Te{constructor(o,{headers:l={},schema:h,fetch:i}={}){this.url=o,this.headers=new Headers(l),this.schemaName=h,this.fetch=i}from(o){let l=new URL(`${this.url}/${o}`);return new r.default(l,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(o){return new Te(this.url,{headers:this.headers,schema:o,fetch:this.fetch})}rpc(o,l={},{head:h=!1,get:i=!1,count:c}={}){var u;let f,d=new URL(`${this.url}/rpc/${o}`),p;h||i?(f=h?"HEAD":"GET",Object.entries(l).filter(([y,v])=>v!==void 0).map(([y,v])=>[y,Array.isArray(v)?`{${v.join(",")}}`:`${v}`]).forEach(([y,v])=>{d.searchParams.append(y,v)})):(f="POST",p=l);let m=new Headers(this.headers);return c&&m.set("Prefer",`count=${c}`),new s.default({method:f,url:d,headers:m,schema:this.schemaName,body:p,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}};t.default=a}),rt=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0}),t.PostgrestError=t.PostgrestBuilder=t.PostgrestTransformBuilder=t.PostgrestFilterBuilder=t.PostgrestQueryBuilder=t.PostgrestClient=void 0;var e=(T(),S(O)),r=e.__importDefault(tt());t.PostgrestClient=r.default;var s=e.__importDefault(Se());t.PostgrestQueryBuilder=s.default;var a=e.__importDefault(F());t.PostgrestFilterBuilder=a.default;var n=e.__importDefault(Pe());t.PostgrestTransformBuilder=n.default;var o=e.__importDefault(Oe());t.PostgrestBuilder=o.default;var l=e.__importDefault(_e());t.PostgrestError=l.default,t.default={PostgrestClient:r.default,PostgrestQueryBuilder:s.default,PostgrestFilterBuilder:a.default,PostgrestTransformBuilder:n.default,PostgrestBuilder:o.default,PostgrestError:l.default}});g();g();var $e=class{constructor(t,e=""){this.http=t,this.baseUrl=e.replace(/\/$/,"")}async invoke(t,e){let r=this.baseUrl?`${this.baseUrl}/functions/${t}`:`/functions/${t}`;return await(await this.http.fetch(r,{method:e.method||"POST",body:e.body,headers:e.headers})).json()}};g();g();var st="nvwa_current_jwt";var bt=typeof fetch<"u"?fetch:(()=>{throw new Error("AuthClient requires fetch")})();g();g();var w=class xe{constructor(e){if(this.headerMap=new Map,e){if(e instanceof xe)e.forEach((r,s)=>this.set(s,r));else if(Array.isArray(e))for(let[r,s]of e)this.set(r,String(s));else if(typeof e=="object")for(let r of Object.keys(e))this.set(r,String(e[r]))}}append(e,r){let s=e.toLowerCase(),a=this.headerMap.get(s);this.headerMap.set(s,a?`${a}, ${r}`:r)}set(e,r){this.headerMap.set(e.toLowerCase(),String(r))}get(e){return this.headerMap.get(e.toLowerCase())??null}has(e){return this.headerMap.has(e.toLowerCase())}delete(e){this.headerMap.delete(e.toLowerCase())}forEach(e){for(let[r,s]of this.headerMap.entries())e(s,r,this)}entries(){return this.headerMap.entries()}keys(){return this.headerMap.keys()}values(){return this.headerMap.values()}[Symbol.iterator](){return this.entries()}},Le=class je{constructor(e){if(this.params=new Map,e){if(typeof e=="string")this.parseString(e);else if(e instanceof je)this.params=new Map(e.params);else if(Array.isArray(e))for(let[r,s]of e)this.append(r,s);else if(e&&typeof e=="object")for(let[r,s]of Object.entries(e))this.set(r,s)}}parseString(e){e.startsWith("?")&&(e=e.slice(1));let r=e.split("&");for(let s of r)if(s){let[a,n]=s.split("=");a&&this.append(decodeURIComponent(a),n?decodeURIComponent(n):"")}}append(e,r){let s=this.params.get(e)||[];s.push(r),this.params.set(e,s)}delete(e){this.params.delete(e)}get(e){let r=this.params.get(e);return r?r[0]:null}getAll(e){return this.params.get(e)||[]}has(e){return this.params.has(e)}set(e,r){this.params.set(e,[r])}sort(){let e=Array.from(this.params.entries()).sort(([r],[s])=>r.localeCompare(s));this.params=new Map(e)}toString(){let e=[];for(let[r,s]of this.params.entries())for(let a of s)e.push(`${encodeURIComponent(r)}=${encodeURIComponent(a)}`);return e.join("&")}forEach(e){for(let[r,s]of this.params.entries())for(let a of s)e(a,r,this)}keys(){return this.params.keys()}values(){let e=[];for(let r of this.params.values())e.push(...r);return e[Symbol.iterator]()}entries(){let e=[];for(let[r,s]of this.params.entries())for(let a of s)e.push([r,a]);return e[Symbol.iterator]()}[Symbol.iterator](){return this.entries()}get size(){return this.params.size}},at=class U{constructor(e,r){let s;if(e instanceof U)s=e.href;else if(r){let n=r instanceof U?r.href:r;s=this.resolve(n,e)}else s=e;let a=this.parseUrl(s);this.href=s,this.origin=`${a.protocol}//${a.host}`,this.protocol=a.protocol,this.username=a.username,this.password=a.password,this.host=a.host,this.hostname=a.hostname,this.port=a.port,this.pathname=a.pathname,this.search=a.search,this.searchParams=new Le(a.search),this.hash=a.hash}resolve(e,r){if(r.startsWith("http://")||r.startsWith("https://"))return r;if(r.startsWith("//"))return`${this.parseUrl(e).protocol}${r}`;if(r.startsWith("/")){let n=this.parseUrl(e);return`${n.protocol}//${n.host}${r}`}let s=this.parseUrl(e),a=s.pathname.endsWith("/")?s.pathname:s.pathname+"/";return`${s.protocol}//${s.host}${a}${r}`}parseUrl(e){let r=e.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!r)throw new TypeError("Invalid URL");let s=r[2]||"",a=r[4]||"",n=r[5]||"/",o=r[7]?`?${r[7]}`:"",l=r[9]?`#${r[9]}`:"";if(!s&&!a&&!n.startsWith("/")&&!n.includes("/")&&!n.includes("."))throw new TypeError("Invalid URL");let h=a.match(/^([^@]*)@(.+)$/),i="",c="",u=a;if(h){let m=h[1];u=h[2];let y=m.match(/^([^:]*):?(.*)$/);y&&(i=y[1]||"",c=y[2]||"")}let f=u.match(/^([^:]+):?(\d*)$/),d=f?f[1]:u,p=f&&f[2]?f[2]:"";return{protocol:s?`${s}:`:"",username:i,password:c,host:u,hostname:d,port:p,pathname:n,search:o,hash:l}}toString(){let e=this.searchParams.toString(),r=e?`?${e}`:"";return`${this.protocol}//${this.host}${this.pathname}${r}${this.hash}`}toJSON(){return this.toString()}};g();var nt=class Ae{constructor(e,r){if(typeof e=="string")this.url=e;else if(e?.url)this.url=String(e.url);else if(typeof e?.toString=="function")this.url=String(e.toString());else throw new Error("Invalid input for Request");this.method=(r?.method||"GET").toUpperCase(),this.headers=r?.headers instanceof w?r.headers:new w(r?.headers),this.body=r?.body,this.timeout=r?.timeout,this.signal=r?.signal||void 0}clone(){return new Ae(this.url,{method:this.method,headers:this.headers,body:this.body,timeout:this.timeout})}toString(){return this.url}};g();var B=class{constructor(t,e){this.bodyData=t,this.status=e?.status??200,this.statusText=e?.statusText??"",this.headers=ot(e?.headers),this.ok=this.status>=200&&this.status<300}async text(){return typeof this.bodyData=="string"?this.bodyData:this.bodyData==null?"":typeof this.bodyData=="object"?JSON.stringify(this.bodyData):String(this.bodyData)}async json(){if(typeof this.bodyData=="string")try{return JSON.parse(this.bodyData)}catch{}return this.bodyData}async arrayBuffer(){let t=await this.text();return new TextEncoder().encode(t).buffer}};function ot(t){return t?new w(t):new w}g();var Ce=class{constructor(){this._aborted=!1,this.listeners=new Set,this.onabort=null}get aborted(){return this._aborted}_trigger(){if(!this._aborted){if(this._aborted=!0,typeof this.onabort=="function")try{this.onabort()}catch{}for(let t of Array.from(this.listeners))try{t()}catch{}this.listeners.clear()}}addEventListener(t,e){if(this._aborted){try{e()}catch{}return}this.listeners.add(e)}removeEventListener(t,e){this.listeners.delete(e)}toString(){return"[object AbortSignal]"}},it=class{constructor(){this._signal=new Ce}get signal(){return this._signal}abort(){this._signal._trigger()}toString(){return"[object AbortController]"}};g();function Ie(t){t.URL=at,t.URLSearchParams=Le,t.Headers=w,t.Request=nt,t.Response=B,t.AbortController=it,t.AbortSignal=Ce}var Ne=class{constructor(t,e,r){console.log("NvwaHttpClient constructor",t,e,r),this.storage=t,this.customFetch=e,this.handleUnauthorized=r}async fetch(t,e){return await this.customFetch(t,e)}async fetchWithAuth(t,e){let r=await this.storage.get(st),s=new w(e?.headers);r&&s.set("Authorization",`Bearer ${r}`);let a=e?.method||"GET";if((a==="POST"||a==="PUT"||a==="PATCH")&&e?.body){let o=s.get("Content-Type");(!o||o.includes("text/plain"))&&s.set("Content-Type","application/json")}let n=await this.customFetch(t,{...e,headers:s});if(n.status===401)throw this.handleUnauthorized(),new Error("\u672A\u767B\u5F55");return n}};g();var lt="/storage",ct=lt+"/generateUploadUrl",Re=class{constructor(t,e){this.baseUrl=t,this.http=e}async uploadFile(t){let e=await this.http.fetch(this.baseUrl+ct,{method:"POST",body:{fileName:t.name||t.fileName,fileSize:t.size||t.fileSize,fileType:t.type||t.fileType}}),{url:r}=await e.json();if(!r)throw new Error("\u83B7\u53D6\u4E0A\u4F20URL\u5931\u8D25");let s=await this.http.fetch(r,{method:"PUT",body:t,headers:new w({"Content-Type":t.type||t.fileType||"application/octet-stream"})}),{url:a}=await s.json();return{url:a.split("?")[0]}}};g();g();g();var q=et(rt(),1),{PostgrestClient:ht,PostgrestQueryBuilder:Et,PostgrestFilterBuilder:_t,PostgrestTransformBuilder:Ot,PostgrestBuilder:Pt,PostgrestError:St}=q.default||q,ut="/entities",He=(t,e)=>new ht(t+ut,{fetch:e.fetchWithAuth.bind(e)});g();var Me=class{constructor(t,e){this.baseUrl=t,this.http=e}async execute(t,e){let r=`${this.baseUrl}/capability/${t}/execute`,s=await(await this.http.fetchWithAuth(r,{method:"POST",body:e?JSON.stringify(e):void 0,timeout:6e5})).json();if(s.status!==200)throw new Error(s.message);return s.data}};g();var ke=class{constructor(t,e){this.baseUrl=t,this.http=e}async execute(t,e){let r=`${this.baseUrl}/capability/${t}/execute`,s=await(await this.http.fetchWithAuth(r,{method:"POST",body:e!=null?JSON.stringify(e):void 0,timeout:6e5})).json();if(s.status!==200)throw new Error(s.message);return s.data}};g();var Ue=class{constructor(){this.hoverOverlay=null,this.selectedOverlay=null,this.tooltip=null,this.hoverElement=null,this.selectedElement=null,this.hoverUpdateHandler=null,this.selectedUpdateHandler=null,this.createStyles()}createStyles(){if(document.getElementById("__nvwa-inspector-overlay-style"))return;let t=document.createElement("style");t.id="__nvwa-inspector-overlay-style",t.textContent=`
1
+ "use strict";var M=Object.defineProperty;var Be=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var Ge=Object.prototype.hasOwnProperty;var ze=(t,e)=>{for(var r in e)M(t,r,{get:e[r],enumerable:!0})},We=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of qe(e))!Ge.call(t,a)&&a!==r&&M(t,a,{get:()=>e[a],enumerable:!(s=Be(e,a))||s.enumerable});return t};var Je=t=>We(M({},"__esModule",{value:!0}),t);var vt={};ze(vt,{default:()=>H,disableIframeHoverInspector:()=>ft,enableIframeHoverInspector:()=>pt,getIframeSourceLocation:()=>mt,localStorage:()=>Fe,polyfill:()=>Ae,setupIframeHoverInspector:()=>dt,setupIframeSourceLocationListener:()=>yt,uniappFetch:()=>I});module.exports=Je(vt);var Ke=Object.create,C=Object.defineProperty,Ve=Object.getOwnPropertyDescriptor,Ye=Object.getOwnPropertyNames,Qe=Object.getPrototypeOf,Xe=Object.prototype.hasOwnProperty,G=(t,e)=>()=>(t&&(e=t(t=0)),e),_=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ze=(t,e)=>{for(var r in e)C(t,r,{get:e[r],enumerable:!0})},z=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of Ye(e))!Xe.call(t,a)&&a!==r&&C(t,a,{get:()=>e[a],enumerable:!(s=Ve(e,a))||s.enumerable});return t},et=(t,e,r)=>(r=t!=null?Ke(Qe(t)):{},z(e||!t||!t.__esModule?C(r,"default",{value:t,enumerable:!0}):r,t)),S=t=>z(C({},"__esModule",{value:!0}),t),g=G(()=>{"use strict"}),P={};Ze(P,{__addDisposableResource:()=>ye,__assign:()=>$,__asyncDelegator:()=>le,__asyncGenerator:()=>ie,__asyncValues:()=>ce,__await:()=>O,__awaiter:()=>te,__classPrivateFieldGet:()=>pe,__classPrivateFieldIn:()=>me,__classPrivateFieldSet:()=>fe,__createBinding:()=>x,__decorate:()=>K,__disposeResources:()=>ge,__esDecorate:()=>Y,__exportStar:()=>se,__extends:()=>W,__generator:()=>re,__importDefault:()=>de,__importStar:()=>ue,__makeTemplateObject:()=>he,__metadata:()=>ee,__param:()=>V,__propKey:()=>X,__read:()=>D,__rest:()=>J,__rewriteRelativeImportExtension:()=>ve,__runInitializers:()=>Q,__setFunctionName:()=>Z,__spread:()=>ae,__spreadArray:()=>oe,__spreadArrays:()=>ne,__values:()=>j,default:()=>Ee});function W(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");L(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function J(t,e){var r={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(r[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,s=Object.getOwnPropertySymbols(t);a<s.length;a++)e.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(t,s[a])&&(r[s[a]]=t[s[a]]);return r}function K(t,e,r,s){var a=arguments.length,n=a<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,r):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(t,e,r,s);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(n=(a<3?o(n):a>3?o(e,r,n):o(e,r))||n);return a>3&&n&&Object.defineProperty(e,r,n),n}function V(t,e){return function(r,s){e(r,s,t)}}function Y(t,e,r,s,a,n){function o(v){if(v!==void 0&&typeof v!="function")throw new TypeError("Function expected");return v}for(var l=s.kind,h=l==="getter"?"get":l==="setter"?"set":"value",i=!e&&t?s.static?t:t.prototype:null,c=e||(i?Object.getOwnPropertyDescriptor(i,s.name):{}),u,f=!1,d=r.length-1;d>=0;d--){var p={};for(var m in s)p[m]=m==="access"?{}:s[m];for(var m in s.access)p.access[m]=s.access[m];p.addInitializer=function(v){if(f)throw new TypeError("Cannot add initializers after decoration has completed");n.push(o(v||null))};var y=(0,r[d])(l==="accessor"?{get:c.get,set:c.set}:c[h],p);if(l==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(u=o(y.get))&&(c.get=u),(u=o(y.set))&&(c.set=u),(u=o(y.init))&&a.unshift(u)}else(u=o(y))&&(l==="field"?a.unshift(u):c[h]=u)}i&&Object.defineProperty(i,s.name,c),f=!0}function Q(t,e,r){for(var s=arguments.length>2,a=0;a<e.length;a++)r=s?e[a].call(t,r):e[a].call(t);return s?r:void 0}function X(t){return typeof t=="symbol"?t:"".concat(t)}function Z(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function ee(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function te(t,e,r,s){function a(n){return n instanceof r?n:new r(function(o){o(n)})}return new(r||(r=Promise))(function(n,o){function l(c){try{i(s.next(c))}catch(u){o(u)}}function h(c){try{i(s.throw(c))}catch(u){o(u)}}function i(c){c.done?n(c.value):a(c.value).then(l,h)}i((s=s.apply(t,e||[])).next())})}function re(t,e){var r={label:0,sent:function(){if(n[0]&1)throw n[1];return n[1]},trys:[],ops:[]},s,a,n,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(i){return function(c){return h([i,c])}}function h(i){if(s)throw new TypeError("Generator is already executing.");for(;o&&(o=0,i[0]&&(r=0)),r;)try{if(s=1,a&&(n=i[0]&2?a.return:i[0]?a.throw||((n=a.return)&&n.call(a),0):a.next)&&!(n=n.call(a,i[1])).done)return n;switch(a=0,n&&(i=[i[0]&2,n.value]),i[0]){case 0:case 1:n=i;break;case 4:return r.label++,{value:i[1],done:!1};case 5:r.label++,a=i[1],i=[0];continue;case 7:i=r.ops.pop(),r.trys.pop();continue;default:if(n=r.trys,!(n=n.length>0&&n[n.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!n||i[1]>n[0]&&i[1]<n[3])){r.label=i[1];break}if(i[0]===6&&r.label<n[1]){r.label=n[1],n=i;break}if(n&&r.label<n[2]){r.label=n[2],r.ops.push(i);break}n[2]&&r.ops.pop(),r.trys.pop();continue}i=e.call(t,r)}catch(c){i=[6,c],a=0}finally{s=n=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}function se(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&x(e,t,r)}function j(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],s=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function D(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var s=r.call(t),a,n=[],o;try{for(;(e===void 0||e-- >0)&&!(a=s.next()).done;)n.push(a.value)}catch(l){o={error:l}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return n}function ae(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(D(arguments[e]));return t}function ne(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var s=Array(t),a=0,e=0;e<r;e++)for(var n=arguments[e],o=0,l=n.length;o<l;o++,a++)s[a]=n[o];return s}function oe(t,e,r){if(r||arguments.length===2)for(var s=0,a=e.length,n;s<a;s++)(n||!(s in e))&&(n||(n=Array.prototype.slice.call(e,0,s)),n[s]=e[s]);return t.concat(n||Array.prototype.slice.call(e))}function O(t){return this instanceof O?(this.v=t,this):new O(t)}function ie(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=r.apply(t,e||[]),a,n=[];return a=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",o),a[Symbol.asyncIterator]=function(){return this},a;function o(d){return function(p){return Promise.resolve(p).then(d,u)}}function l(d,p){s[d]&&(a[d]=function(m){return new Promise(function(y,v){n.push([d,m,y,v])>1||h(d,m)})},p&&(a[d]=p(a[d])))}function h(d,p){try{i(s[d](p))}catch(m){f(n[0][3],m)}}function i(d){d.value instanceof O?Promise.resolve(d.value.v).then(c,u):f(n[0][2],d)}function c(d){h("next",d)}function u(d){h("throw",d)}function f(d,p){d(p),n.shift(),n.length&&h(n[0][0],n[0][1])}}function le(t){var e,r;return e={},s("next"),s("throw",function(a){throw a}),s("return"),e[Symbol.iterator]=function(){return this},e;function s(a,n){e[a]=t[a]?function(o){return(r=!r)?{value:O(t[a](o)),done:!1}:n?n(o):o}:n}}function ce(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof j=="function"?j(t):t[Symbol.iterator](),r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r);function s(n){r[n]=t[n]&&function(o){return new Promise(function(l,h){o=t[n](o),a(l,h,o.done,o.value)})}}function a(n,o,l,h){Promise.resolve(h).then(function(i){n({value:i,done:l})},o)}}function he(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function ue(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=N(t),s=0;s<r.length;s++)r[s]!=="default"&&x(e,t,r[s]);return we(e,t),e}function de(t){return t&&t.__esModule?t:{default:t}}function pe(t,e,r,s){if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?s:r==="a"?s.call(t):s?s.value:e.get(t)}function fe(t,e,r,s,a){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!a)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?a.call(t,r):a?a.value=r:e.set(t,r),r}function me(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function ye(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var s,a;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");s=e[Symbol.asyncDispose]}if(s===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");s=e[Symbol.dispose],r&&(a=s)}if(typeof s!="function")throw new TypeError("Object not disposable.");a&&(s=function(){try{a.call(this)}catch(n){return Promise.reject(n)}}),t.stack.push({value:e,dispose:s,async:r})}else r&&t.stack.push({async:!0});return e}function ge(t){function e(n){t.error=t.hasError?new be(n,t.error,"An error was suppressed during disposal."):n,t.hasError=!0}var r,s=0;function a(){for(;r=t.stack.pop();)try{if(!r.async&&s===1)return s=0,t.stack.push(r),Promise.resolve().then(a);if(r.dispose){var n=r.dispose.call(r.value);if(r.async)return s|=2,Promise.resolve(n).then(a,function(o){return e(o),a()})}else s|=1}catch(o){e(o)}if(s===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return a()}function ve(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,s,a,n,o){return s?e?".jsx":".js":a&&(!n||!o)?r:a+n+"."+o.toLowerCase()+"js"}):t}var L,$,x,we,N,be,Ee,T=G(()=>{"use strict";g(),L=function(t,e){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var a in s)Object.prototype.hasOwnProperty.call(s,a)&&(r[a]=s[a])},L(t,e)},$=function(){return $=Object.assign||function(t){for(var e,r=1,s=arguments.length;r<s;r++){e=arguments[r];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},$.apply(this,arguments)},x=Object.create?(function(t,e,r,s){s===void 0&&(s=r);var a=Object.getOwnPropertyDescriptor(e,r);(!a||("get"in a?!e.__esModule:a.writable||a.configurable))&&(a={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,a)}):(function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),we=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e},N=function(t){return N=Object.getOwnPropertyNames||function(e){var r=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[r.length]=s);return r},N(t)},be=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var s=new Error(r);return s.name="SuppressedError",s.error=t,s.suppressed=e,s},Ee={__extends:W,__assign:$,__rest:J,__decorate:K,__param:V,__esDecorate:Y,__runInitializers:Q,__propKey:X,__setFunctionName:Z,__metadata:ee,__awaiter:te,__generator:re,__createBinding:x,__exportStar:se,__values:j,__read:D,__spread:ae,__spreadArrays:ne,__spreadArray:oe,__await:O,__asyncGenerator:ie,__asyncDelegator:le,__asyncValues:ce,__makeTemplateObject:he,__importStar:ue,__importDefault:de,__classPrivateFieldGet:pe,__classPrivateFieldSet:fe,__classPrivateFieldIn:me,__addDisposableResource:ye,__disposeResources:ge,__rewriteRelativeImportExtension:ve}}),_e=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=class extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.code=r.code}};t.default=e}),Pe=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(P)),r=e.__importDefault(_e()),s=class{constructor(a){var n,o;this.shouldThrowOnError=!1,this.method=a.method,this.url=a.url,this.headers=new Headers(a.headers),this.schema=a.schema,this.body=a.body,this.shouldThrowOnError=(n=a.shouldThrowOnError)!==null&&n!==void 0?n:!1,this.signal=a.signal,this.isMaybeSingle=(o=a.isMaybeSingle)!==null&&o!==void 0?o:!1,a.fetch?this.fetch=a.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(a,n){return this.headers=new Headers(this.headers),this.headers.set(a,n),this}then(a,n){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");let o=this.fetch,l=o(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async h=>{var i,c,u,f;let d=null,p=null,m=null,y=h.status,v=h.statusText;if(h.ok){if(this.method!=="HEAD"){let U=await h.text();U===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&!((i=this.headers.get("Accept"))===null||i===void 0)&&i.includes("application/vnd.pgrst.plan+text")?p=U:p=JSON.parse(U))}let b=(c=this.headers.get("Prefer"))===null||c===void 0?void 0:c.match(/count=(exact|planned|estimated)/),E=(u=h.headers.get("content-range"))===null||u===void 0?void 0:u.split("/");b&&E&&E.length>1&&(m=parseInt(E[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(p)&&(p.length>1?(d={code:"PGRST116",details:`Results contain ${p.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},p=null,m=null,y=406,v="Not Acceptable"):p.length===1?p=p[0]:p=null)}else{let b=await h.text();try{d=JSON.parse(b),Array.isArray(d)&&h.status===404&&(p=[],d=null,y=200,v="OK")}catch{h.status===404&&b===""?(y=204,v="No Content"):d={message:b}}if(d&&this.isMaybeSingle&&!((f=d?.details)===null||f===void 0)&&f.includes("0 rows")&&(d=null,y=200,v="OK"),d&&this.shouldThrowOnError)throw new r.default(d)}return{error:d,data:p,count:m,status:y,statusText:v}});return this.shouldThrowOnError||(l=l.catch(h=>{var i,c,u;return{error:{message:`${(i=h?.name)!==null&&i!==void 0?i:"FetchError"}: ${h?.message}`,details:`${(c=h?.stack)!==null&&c!==void 0?c:""}`,hint:"",code:`${(u=h?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),l.then(a,n)}returns(){return this}overrideTypes(){return this}};t.default=s}),Oe=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(P)),r=e.__importDefault(Pe()),s=class extends r.default{select(a){let n=!1,o=(a??"*").split("").map(l=>/\s/.test(l)&&!n?"":(l==='"'&&(n=!n),l)).join("");return this.url.searchParams.set("select",o),this.headers.append("Prefer","return=representation"),this}order(a,{ascending:n=!0,nullsFirst:o,foreignTable:l,referencedTable:h=l}={}){let i=h?`${h}.order`:"order",c=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${c?`${c},`:""}${a}.${n?"asc":"desc"}${o===void 0?"":o?".nullsfirst":".nullslast"}`),this}limit(a,{foreignTable:n,referencedTable:o=n}={}){let l=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(l,`${a}`),this}range(a,n,{foreignTable:o,referencedTable:l=o}={}){let h=typeof l>"u"?"offset":`${l}.offset`,i=typeof l>"u"?"limit":`${l}.limit`;return this.url.searchParams.set(h,`${a}`),this.url.searchParams.set(i,`${n-a+1}`),this}abortSignal(a){return this.signal=a,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:a=!1,verbose:n=!1,settings:o=!1,buffers:l=!1,wal:h=!1,format:i="text"}={}){var c;let u=[a?"analyze":null,n?"verbose":null,o?"settings":null,l?"buffers":null,h?"wal":null].filter(Boolean).join("|"),f=(c=this.headers.get("Accept"))!==null&&c!==void 0?c:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${f}"; options=${u};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(a){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${a}`),this}};t.default=s}),F=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(P)),r=e.__importDefault(Oe()),s=new RegExp("[,()]"),a=class extends r.default{eq(n,o){return this.url.searchParams.append(n,`eq.${o}`),this}neq(n,o){return this.url.searchParams.append(n,`neq.${o}`),this}gt(n,o){return this.url.searchParams.append(n,`gt.${o}`),this}gte(n,o){return this.url.searchParams.append(n,`gte.${o}`),this}lt(n,o){return this.url.searchParams.append(n,`lt.${o}`),this}lte(n,o){return this.url.searchParams.append(n,`lte.${o}`),this}like(n,o){return this.url.searchParams.append(n,`like.${o}`),this}likeAllOf(n,o){return this.url.searchParams.append(n,`like(all).{${o.join(",")}}`),this}likeAnyOf(n,o){return this.url.searchParams.append(n,`like(any).{${o.join(",")}}`),this}ilike(n,o){return this.url.searchParams.append(n,`ilike.${o}`),this}ilikeAllOf(n,o){return this.url.searchParams.append(n,`ilike(all).{${o.join(",")}}`),this}ilikeAnyOf(n,o){return this.url.searchParams.append(n,`ilike(any).{${o.join(",")}}`),this}is(n,o){return this.url.searchParams.append(n,`is.${o}`),this}in(n,o){let l=Array.from(new Set(o)).map(h=>typeof h=="string"&&s.test(h)?`"${h}"`:`${h}`).join(",");return this.url.searchParams.append(n,`in.(${l})`),this}contains(n,o){return typeof o=="string"?this.url.searchParams.append(n,`cs.${o}`):Array.isArray(o)?this.url.searchParams.append(n,`cs.{${o.join(",")}}`):this.url.searchParams.append(n,`cs.${JSON.stringify(o)}`),this}containedBy(n,o){return typeof o=="string"?this.url.searchParams.append(n,`cd.${o}`):Array.isArray(o)?this.url.searchParams.append(n,`cd.{${o.join(",")}}`):this.url.searchParams.append(n,`cd.${JSON.stringify(o)}`),this}rangeGt(n,o){return this.url.searchParams.append(n,`sr.${o}`),this}rangeGte(n,o){return this.url.searchParams.append(n,`nxl.${o}`),this}rangeLt(n,o){return this.url.searchParams.append(n,`sl.${o}`),this}rangeLte(n,o){return this.url.searchParams.append(n,`nxr.${o}`),this}rangeAdjacent(n,o){return this.url.searchParams.append(n,`adj.${o}`),this}overlaps(n,o){return typeof o=="string"?this.url.searchParams.append(n,`ov.${o}`):this.url.searchParams.append(n,`ov.{${o.join(",")}}`),this}textSearch(n,o,{config:l,type:h}={}){let i="";h==="plain"?i="pl":h==="phrase"?i="ph":h==="websearch"&&(i="w");let c=l===void 0?"":`(${l})`;return this.url.searchParams.append(n,`${i}fts${c}.${o}`),this}match(n){return Object.entries(n).forEach(([o,l])=>{this.url.searchParams.append(o,`eq.${l}`)}),this}not(n,o,l){return this.url.searchParams.append(n,`not.${o}.${l}`),this}or(n,{foreignTable:o,referencedTable:l=o}={}){let h=l?`${l}.or`:"or";return this.url.searchParams.append(h,`(${n})`),this}filter(n,o,l){return this.url.searchParams.append(n,`${o}.${l}`),this}};t.default=a}),Se=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(P)),r=e.__importDefault(F()),s=class{constructor(a,{headers:n={},schema:o,fetch:l}){this.url=a,this.headers=new Headers(n),this.schema=o,this.fetch=l}select(a,n){let{head:o=!1,count:l}=n??{},h=o?"HEAD":"GET",i=!1,c=(a??"*").split("").map(u=>/\s/.test(u)&&!i?"":(u==='"'&&(i=!i),u)).join("");return this.url.searchParams.set("select",c),l&&this.headers.append("Prefer",`count=${l}`),new r.default({method:h,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(a,{count:n,defaultToNull:o=!0}={}){var l;let h="POST";if(n&&this.headers.append("Prefer",`count=${n}`),o||this.headers.append("Prefer","missing=default"),Array.isArray(a)){let i=a.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(i.length>0){let c=[...new Set(i)].map(u=>`"${u}"`);this.url.searchParams.set("columns",c.join(","))}}return new r.default({method:h,url:this.url,headers:this.headers,schema:this.schema,body:a,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch})}upsert(a,{onConflict:n,ignoreDuplicates:o=!1,count:l,defaultToNull:h=!0}={}){var i;let c="POST";if(this.headers.append("Prefer",`resolution=${o?"ignore":"merge"}-duplicates`),n!==void 0&&this.url.searchParams.set("on_conflict",n),l&&this.headers.append("Prefer",`count=${l}`),h||this.headers.append("Prefer","missing=default"),Array.isArray(a)){let u=a.reduce((f,d)=>f.concat(Object.keys(d)),[]);if(u.length>0){let f=[...new Set(u)].map(d=>`"${d}"`);this.url.searchParams.set("columns",f.join(","))}}return new r.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:a,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}update(a,{count:n}={}){var o;let l="PATCH";return n&&this.headers.append("Prefer",`count=${n}`),new r.default({method:l,url:this.url,headers:this.headers,schema:this.schema,body:a,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}delete({count:a}={}){var n;let o="DELETE";return a&&this.headers.append("Prefer",`count=${a}`),new r.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}};t.default=s}),tt=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(P)),r=e.__importDefault(Se()),s=e.__importDefault(F()),a=class Te{constructor(o,{headers:l={},schema:h,fetch:i}={}){this.url=o,this.headers=new Headers(l),this.schemaName=h,this.fetch=i}from(o){let l=new URL(`${this.url}/${o}`);return new r.default(l,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(o){return new Te(this.url,{headers:this.headers,schema:o,fetch:this.fetch})}rpc(o,l={},{head:h=!1,get:i=!1,count:c}={}){var u;let f,d=new URL(`${this.url}/rpc/${o}`),p;h||i?(f=h?"HEAD":"GET",Object.entries(l).filter(([y,v])=>v!==void 0).map(([y,v])=>[y,Array.isArray(v)?`{${v.join(",")}}`:`${v}`]).forEach(([y,v])=>{d.searchParams.append(y,v)})):(f="POST",p=l);let m=new Headers(this.headers);return c&&m.set("Prefer",`count=${c}`),new s.default({method:f,url:d,headers:m,schema:this.schemaName,body:p,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}};t.default=a}),rt=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0}),t.PostgrestError=t.PostgrestBuilder=t.PostgrestTransformBuilder=t.PostgrestFilterBuilder=t.PostgrestQueryBuilder=t.PostgrestClient=void 0;var e=(T(),S(P)),r=e.__importDefault(tt());t.PostgrestClient=r.default;var s=e.__importDefault(Se());t.PostgrestQueryBuilder=s.default;var a=e.__importDefault(F());t.PostgrestFilterBuilder=a.default;var n=e.__importDefault(Oe());t.PostgrestTransformBuilder=n.default;var o=e.__importDefault(Pe());t.PostgrestBuilder=o.default;var l=e.__importDefault(_e());t.PostgrestError=l.default,t.default={PostgrestClient:r.default,PostgrestQueryBuilder:s.default,PostgrestFilterBuilder:a.default,PostgrestTransformBuilder:n.default,PostgrestBuilder:o.default,PostgrestError:l.default}});g();g();var $e=class{constructor(t,e=""){this.http=t,this.baseUrl=e.replace(/\/$/,"")}async invoke(t,e){let r=this.baseUrl?`${this.baseUrl}/functions/${t}`:`/functions/${t}`;return await(await this.http.fetch(r,{method:e.method||"POST",body:e.body,headers:e.headers})).json()}};g();g();var st="nvwa_current_jwt";var bt=typeof fetch<"u"?fetch:(()=>{throw new Error("AuthClient requires fetch")})();g();g();var w=class xe{constructor(e){if(this.headerMap=new Map,e){if(e instanceof xe)e.forEach((r,s)=>this.set(s,r));else if(Array.isArray(e))for(let[r,s]of e)this.set(r,String(s));else if(typeof e=="object")for(let r of Object.keys(e))this.set(r,String(e[r]))}}append(e,r){let s=e.toLowerCase(),a=this.headerMap.get(s);this.headerMap.set(s,a?`${a}, ${r}`:r)}set(e,r){this.headerMap.set(e.toLowerCase(),String(r))}get(e){return this.headerMap.get(e.toLowerCase())??null}has(e){return this.headerMap.has(e.toLowerCase())}delete(e){this.headerMap.delete(e.toLowerCase())}forEach(e){for(let[r,s]of this.headerMap.entries())e(s,r,this)}entries(){return this.headerMap.entries()}keys(){return this.headerMap.keys()}values(){return this.headerMap.values()}[Symbol.iterator](){return this.entries()}},Ie=class Le{constructor(e){if(this.params=new Map,e){if(typeof e=="string")this.parseString(e);else if(e instanceof Le)this.params=new Map(e.params);else if(Array.isArray(e))for(let[r,s]of e)this.append(r,s);else if(e&&typeof e=="object")for(let[r,s]of Object.entries(e))this.set(r,s)}}parseString(e){e.startsWith("?")&&(e=e.slice(1));let r=e.split("&");for(let s of r)if(s){let[a,n]=s.split("=");a&&this.append(decodeURIComponent(a),n?decodeURIComponent(n):"")}}append(e,r){let s=this.params.get(e)||[];s.push(r),this.params.set(e,s)}delete(e){this.params.delete(e)}get(e){let r=this.params.get(e);return r?r[0]:null}getAll(e){return this.params.get(e)||[]}has(e){return this.params.has(e)}set(e,r){this.params.set(e,[r])}sort(){let e=Array.from(this.params.entries()).sort(([r],[s])=>r.localeCompare(s));this.params=new Map(e)}toString(){let e=[];for(let[r,s]of this.params.entries())for(let a of s)e.push(`${encodeURIComponent(r)}=${encodeURIComponent(a)}`);return e.join("&")}forEach(e){for(let[r,s]of this.params.entries())for(let a of s)e(a,r,this)}keys(){return this.params.keys()}values(){let e=[];for(let r of this.params.values())e.push(...r);return e[Symbol.iterator]()}entries(){let e=[];for(let[r,s]of this.params.entries())for(let a of s)e.push([r,a]);return e[Symbol.iterator]()}[Symbol.iterator](){return this.entries()}get size(){return this.params.size}},at=class k{constructor(e,r){let s;if(e instanceof k)s=e.href;else if(r){let n=r instanceof k?r.href:r;s=this.resolve(n,e)}else s=e;let a=this.parseUrl(s);this.href=s,this.origin=`${a.protocol}//${a.host}`,this.protocol=a.protocol,this.username=a.username,this.password=a.password,this.host=a.host,this.hostname=a.hostname,this.port=a.port,this.pathname=a.pathname,this.search=a.search,this.searchParams=new Ie(a.search),this.hash=a.hash}resolve(e,r){if(r.startsWith("http://")||r.startsWith("https://"))return r;if(r.startsWith("//"))return`${this.parseUrl(e).protocol}${r}`;if(r.startsWith("/")){let n=this.parseUrl(e);return`${n.protocol}//${n.host}${r}`}let s=this.parseUrl(e),a=s.pathname.endsWith("/")?s.pathname:s.pathname+"/";return`${s.protocol}//${s.host}${a}${r}`}parseUrl(e){let r=e.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!r)throw new TypeError("Invalid URL");let s=r[2]||"",a=r[4]||"",n=r[5]||"/",o=r[7]?`?${r[7]}`:"",l=r[9]?`#${r[9]}`:"";if(!s&&!a&&!n.startsWith("/")&&!n.includes("/")&&!n.includes("."))throw new TypeError("Invalid URL");let h=a.match(/^([^@]*)@(.+)$/),i="",c="",u=a;if(h){let m=h[1];u=h[2];let y=m.match(/^([^:]*):?(.*)$/);y&&(i=y[1]||"",c=y[2]||"")}let f=u.match(/^([^:]+):?(\d*)$/),d=f?f[1]:u,p=f&&f[2]?f[2]:"";return{protocol:s?`${s}:`:"",username:i,password:c,host:u,hostname:d,port:p,pathname:n,search:o,hash:l}}toString(){let e=this.searchParams.toString(),r=e?`?${e}`:"";return`${this.protocol}//${this.host}${this.pathname}${r}${this.hash}`}toJSON(){return this.toString()}};g();var nt=class Ne{constructor(e,r){if(typeof e=="string")this.url=e;else if(e?.url)this.url=String(e.url);else if(typeof e?.toString=="function")this.url=String(e.toString());else throw new Error("Invalid input for Request");this.method=(r?.method||"GET").toUpperCase(),this.headers=r?.headers instanceof w?r.headers:new w(r?.headers),this.body=r?.body,this.timeout=r?.timeout,this.signal=r?.signal||void 0}clone(){return new Ne(this.url,{method:this.method,headers:this.headers,body:this.body,timeout:this.timeout})}toString(){return this.url}};g();var B=class{constructor(t,e){this.bodyData=t,this.status=e?.status??200,this.statusText=e?.statusText??"",this.headers=ot(e?.headers),this.ok=this.status>=200&&this.status<300}async text(){return typeof this.bodyData=="string"?this.bodyData:this.bodyData==null?"":typeof this.bodyData=="object"?JSON.stringify(this.bodyData):String(this.bodyData)}async json(){if(typeof this.bodyData=="string")try{return JSON.parse(this.bodyData)}catch{}return this.bodyData}async arrayBuffer(){let t=await this.text();return new TextEncoder().encode(t).buffer}};function ot(t){return t?new w(t):new w}g();var je=class{constructor(){this._aborted=!1,this.listeners=new Set,this.onabort=null}get aborted(){return this._aborted}_trigger(){if(!this._aborted){if(this._aborted=!0,typeof this.onabort=="function")try{this.onabort()}catch{}for(let t of Array.from(this.listeners))try{t()}catch{}this.listeners.clear()}}addEventListener(t,e){if(this._aborted){try{e()}catch{}return}this.listeners.add(e)}removeEventListener(t,e){this.listeners.delete(e)}toString(){return"[object AbortSignal]"}},it=class{constructor(){this._signal=new je}get signal(){return this._signal}abort(){this._signal._trigger()}toString(){return"[object AbortController]"}};g();function Ae(t){t.URL=at,t.URLSearchParams=Ie,t.Headers=w,t.Request=nt,t.Response=B,t.AbortController=it,t.AbortSignal=je}var Ce=class{constructor(t,e,r){console.log("NvwaHttpClient constructor",t,e,r),this.storage=t,this.customFetch=e,this.handleUnauthorized=r}async fetch(t,e){return await this.customFetch(t,e)}async fetchWithAuth(t,e){let r=await this.storage.get(st),s=new w(e?.headers);r&&s.set("Authorization",`Bearer ${r}`);let a=e?.method||"GET";if((a==="POST"||a==="PUT"||a==="PATCH")&&e?.body){let o=s.get("Content-Type");(!o||o.includes("text/plain"))&&s.set("Content-Type","application/json")}let n=await this.customFetch(t,{...e,headers:s});if(n.status===401)throw this.handleUnauthorized(),new Error("\u672A\u767B\u5F55");return n}};g();var lt="/storage",ct=lt+"/generateUploadUrl",Re=class{constructor(t,e){this.baseUrl=t,this.http=e}async uploadFile(t){let e=await this.http.fetch(this.baseUrl+ct,{method:"POST",body:{fileName:t.name||t.fileName,fileSize:t.size||t.fileSize,fileType:t.type||t.fileType}}),{url:r}=await e.json();if(!r)throw new Error("\u83B7\u53D6\u4E0A\u4F20URL\u5931\u8D25");let s=await this.http.fetch(r,{method:"PUT",body:t,headers:new w({"Content-Type":t.type||t.fileType||"application/octet-stream"})}),{url:a}=await s.json();return{url:a.split("?")[0]}}};g();g();g();var q=et(rt(),1),{PostgrestClient:ht,PostgrestQueryBuilder:Et,PostgrestFilterBuilder:_t,PostgrestTransformBuilder:Pt,PostgrestBuilder:Ot,PostgrestError:St}=q.default||q,ut="/entities",He=(t,e)=>new ht(t+ut,{fetch:e.fetchWithAuth.bind(e)});g();var Ue=class{constructor(t,e){this.baseUrl=t,this.http=e}async execute(t,e){let r=`${this.baseUrl}/capability/${t}/execute`,s=await(await this.http.fetchWithAuth(r,{method:"POST",body:e?JSON.stringify(e):void 0,timeout:6e5})).json();if(s.status!==200)throw new Error(s.message);return s.data}};g();var Me=class{constructor(t,e){this.baseUrl=t,this.http=e}async execute(t,e){let r=`${this.baseUrl}/capability/${t}/execute`,s=await(await this.http.fetchWithAuth(r,{method:"POST",body:e!=null?JSON.stringify(e):void 0,timeout:6e5})).json();if(s.status!==200)throw new Error(s.message);return s.data}};g();var ke=class{constructor(){this.hoverOverlay=null,this.selectedOverlay=null,this.tooltip=null,this.hoverElement=null,this.selectedElement=null,this.hoverUpdateHandler=null,this.selectedUpdateHandler=null,this.createStyles()}createStyles(){if(document.getElementById("__nvwa-inspector-overlay-style"))return;let t=document.createElement("style");t.id="__nvwa-inspector-overlay-style",t.textContent=`
2
2
  .__nvwa-inspector-overlay {
3
3
  position: absolute;
4
4
  pointer-events: none;
@@ -30,4 +30,4 @@
30
30
  max-width: 400px;
31
31
  word-break: break-all;
32
32
  }
33
- `,document.head.appendChild(t)}createTooltip(){return this.tooltip?this.tooltip:(this.tooltip=document.createElement("div"),this.tooltip.id="__nvwa-inspector-tooltip",document.body.appendChild(this.tooltip),this.tooltip)}createOverlay(t){let e=document.createElement("div");return e.className=`__nvwa-inspector-overlay __nvwa-inspector-overlay-${t}`,document.body.appendChild(e),e}updateOverlayPosition(t,e){if(!e.isConnected)return;let r=e.getBoundingClientRect(),s=window.scrollX||window.pageXOffset,a=window.scrollY||window.pageYOffset;r.width>0&&r.height>0?(t.style.left=`${r.left+s}px`,t.style.top=`${r.top+a}px`,t.style.width=`${r.width}px`,t.style.height=`${r.height}px`,t.style.display="block"):t.style.display="none"}removeOverlay(t){t&&t.parentNode&&t.parentNode.removeChild(t)}highlightElement(t,e){if(!t.isConnected)return;if(this.hoverElement===t&&this.hoverOverlay){this.updateOverlayPosition(this.hoverOverlay,t);let o=this.createTooltip();e?o.textContent=e:o.textContent=`<${t.tagName.toLowerCase()}> (\u65E0 source location)`,o.style.display="block";let l=t.getBoundingClientRect();o.style.left=`${l.left+window.scrollX}px`,o.style.top=`${l.top+window.scrollY-o.offsetHeight-8}px`,l.top<o.offsetHeight+8&&(o.style.top=`${l.bottom+window.scrollY+8}px`);return}this.hoverOverlay&&(this.removeOverlay(this.hoverOverlay),this.hoverOverlay=null);let r=this.createOverlay("hover");this.updateOverlayPosition(r,t),this.hoverOverlay=r,this.hoverElement=t;let s=()=>{this.hoverOverlay&&this.hoverElement&&this.hoverElement.isConnected&&this.updateOverlayPosition(this.hoverOverlay,this.hoverElement)};this.hoverUpdateHandler&&(window.removeEventListener("scroll",this.hoverUpdateHandler,!0),window.removeEventListener("resize",this.hoverUpdateHandler)),this.hoverUpdateHandler=s,window.addEventListener("scroll",s,!0),window.addEventListener("resize",s);let a=this.createTooltip();e?a.textContent=e:a.textContent=`<${t.tagName.toLowerCase()}> (\u65E0 source location)`,a.style.display="block";let n=t.getBoundingClientRect();a.style.left=`${n.left+window.scrollX}px`,a.style.top=`${n.top+window.scrollY-a.offsetHeight-8}px`,n.top<a.offsetHeight+8&&(a.style.top=`${n.bottom+window.scrollY+8}px`)}selectElement(t,e){if(!t.isConnected)return;if(this.selectedElement===t&&this.selectedOverlay){this.updateOverlayPosition(this.selectedOverlay,t);return}this.selectedOverlay&&(this.removeOverlay(this.selectedOverlay),this.selectedOverlay=null);let r=this.createOverlay("selected");this.updateOverlayPosition(r,t),this.selectedOverlay=r,this.selectedElement=t;let s=()=>{this.selectedOverlay&&this.selectedElement&&this.selectedElement.isConnected&&this.updateOverlayPosition(this.selectedOverlay,this.selectedElement)};this.selectedUpdateHandler&&(window.removeEventListener("scroll",this.selectedUpdateHandler,!0),window.removeEventListener("resize",this.selectedUpdateHandler)),this.selectedUpdateHandler=s,window.addEventListener("scroll",s,!0),window.addEventListener("resize",s)}removeHighlight(){this.hoverOverlay&&(this.removeOverlay(this.hoverOverlay),this.hoverOverlay=null),this.hoverElement&&(this.hoverElement=null),this.tooltip&&(this.tooltip.style.display="none"),this.hoverUpdateHandler&&(window.removeEventListener("scroll",this.hoverUpdateHandler,!0),window.removeEventListener("resize",this.hoverUpdateHandler),this.hoverUpdateHandler=null)}clearSelection(){this.selectedOverlay&&(this.removeOverlay(this.selectedOverlay),this.selectedOverlay=null),this.selectedElement&&(this.selectedElement=null),this.selectedUpdateHandler&&(window.removeEventListener("scroll",this.selectedUpdateHandler,!0),window.removeEventListener("resize",this.selectedUpdateHandler),this.selectedUpdateHandler=null)}cleanup(){this.removeHighlight(),this.clearSelection(),this.tooltip&&this.tooltip.parentNode&&(this.tooltip.parentNode.removeChild(this.tooltip),this.tooltip=null);let t=document.getElementById("__nvwa-inspector-overlay-style");t&&t.parentNode&&t.parentNode.removeChild(t)}};function De(t="root"){if(typeof document>"u")return null;let e=document.getElementById(t)||document.body;if(!e)return null;let r=e.querySelector("[data-source-location]");if(r){let s=r.getAttribute("data-source-location");if(s)return s}if(e.firstElementChild){let s=e.firstElementChild.getAttribute("data-source-location");if(s)return s}return null}g();var Tt=typeof fetch<"u"?fetch:(()=>{throw new Error("payment client requires fetch")})();var R=class{constructor(){this.prefix="nvwa_"}getKey(e){return`${this.prefix}${e}`}async get(e){try{let r=this.getKey(e),s=uni.getStorageSync(r);return s?s.expires&&Date.now()>s.expires?(await this.remove(e),null):s.value:null}catch(r){return console.error("UniAppStorageService get error:",r),null}}async set(e,r,s){try{let a=this.getKey(e),n={value:r,expires:s?Date.now()+s*1e3:null,timestamp:Date.now()};uni.setStorageSync(a,n)}catch(a){throw console.error("UniAppStorageService set error:",a),a}}async remove(e){try{let r=this.getKey(e);uni.removeStorageSync(r)}catch(r){throw console.error("UniAppStorageService remove error:",r),r}}async clear(){try{uni.clearStorageSync()}catch(e){throw console.error("UniAppStorageService clear error:",e),e}}};var L=(t,e)=>{let r;if(typeof t=="string")r=t;else if(t&&typeof t.toString=="function")r=t.toString();else if(t?.url)r=t.url;else throw new Error("Invalid input for uniappFetch");let s=(e?.method||"GET").toUpperCase(),a={};if(e?.headers){let l=e.headers;if(typeof l?.forEach=="function")l.forEach((h,i)=>{a[i]=h});else if(Array.isArray(l))for(let[h,i]of l)a[h]=i;else Object.assign(a,l)}let n;if(e?.body!==void 0){let l=e.body;if(typeof l=="string")n=l;else if(l&&typeof l=="object"&&typeof l.forEach=="function"){let h={};l.forEach((i,c)=>{h[c]=i}),n=h}else n=l}let o=e?.timeout||3e4;return new Promise((l,h)=>{let i=e?.signal;if(i?.aborted){let d=new Error("The operation was aborted");d.name="AbortError",h(d);return}let c=!1,u=[],f=uni.request({url:r,method:s,data:n,header:a,timeout:o,success:d=>{if(c)return;c=!0;let p=d.statusCode,m="",y=new w,v=d.header||d.headers||{};Object.keys(v).forEach(b=>{let E=v[b];y.set(b,typeof E=="string"?E:String(E))}),l(new B(d.data,{status:p,statusText:m,headers:y}))},fail:d=>{if(c)return;c=!0;let p=d?.errMsg||d?.message||"Network Error",m=new Error(p);/(abort|aborted|canceled|cancelled)/i.test(String(p))&&(m.name="AbortError"),h(m)}});if(i&&typeof i.addEventListener=="function"){let d=()=>{if(c)return;try{f?.abort?.()}catch{}let p=new Error("The operation was aborted");p.name="AbortError",c=!0,h(p)};i.addEventListener("abort",d),u.push(()=>{try{i.removeEventListener?.("abort",d)}catch{}})}})};typeof globalThis.fetch!="function"&&(globalThis.fetch=L);function dt(){if(typeof window>"u"||window===window.parent)return;let t=!1,e=new Ue;function r(i){if(!i)return!1;let c=i.toLowerCase();return c.includes("/components/")||c.includes("\\components\\")}function s(i){let c=i,u=null;for(;c;){let f=c.getAttribute("data-source-location");if(f)if(r(f)){u||(u=f),c=c.parentElement;continue}else return f;c=c.parentElement}return u}let a=null;function n(i){t&&(a!==null&&cancelAnimationFrame(a),a=requestAnimationFrame(()=>{let c=i.target;if(!c||c===document.body||c===document.documentElement){e.removeHighlight();return}if(c.tagName.toLowerCase()==="img"){let p=s(c);e.highlightElement(c,p);let m={type:"HOVER_INSPECTOR_ELEMENT_HOVER",sourceLocation:p,elementInfo:{tagName:c.tagName.toLowerCase(),className:c.className||"",id:c.id||""}};window.parent.postMessage(m,"*");return}let u=c,f=s(c);if(!f){let p=c.parentElement;for(;p&&p!==document.body&&p!==document.documentElement;){let m=s(p);if(m){u=p,f=m;break}p=p.parentElement}}e.highlightElement(u,f);let d={type:"HOVER_INSPECTOR_ELEMENT_HOVER",sourceLocation:f,elementInfo:{tagName:u.tagName.toLowerCase(),className:u.className||"",id:u.id||""}};window.parent.postMessage(d,"*")}))}function o(){if(!t)return;e.removeHighlight();let i={type:"HOVER_INSPECTOR_ELEMENT_LEAVE"};window.parent.postMessage(i,"*")}function l(i){if(!t)return;i.preventDefault(),i.stopPropagation();let c=i.target;if(!c||c===document.body||c===document.documentElement)return;let u=s(c);e.selectElement(c,u);let f={type:"HOVER_INSPECTOR_ELEMENT_SELECT",sourceLocation:u,elementInfo:{tagName:c.tagName.toLowerCase(),className:c.className||"",id:c.id||""}};window.parent.postMessage(f,"*")}function h(i){i.data?.type==="HOVER_INSPECTOR_ENABLE"?(t=!0,document.addEventListener("mousemove",n),document.addEventListener("mouseleave",o),document.addEventListener("click",l,!0)):i.data?.type==="HOVER_INSPECTOR_DISABLE"&&(t=!1,document.removeEventListener("mousemove",n),document.removeEventListener("mouseleave",o),document.removeEventListener("click",l,!0),e.removeHighlight(),e.clearSelection())}return window.addEventListener("message",h),()=>{window.removeEventListener("message",h),document.removeEventListener("mousemove",n),document.removeEventListener("mouseleave",o),document.removeEventListener("click",l,!0),e.cleanup()}}function pt(t,e){if(!t||!t.contentWindow)throw new Error("Invalid iframe element");let r={type:"HOVER_INSPECTOR_ENABLE"};t.contentWindow.postMessage(r,e)}function ft(t,e){if(!t||!t.contentWindow)return;let r={type:"HOVER_INSPECTOR_DISABLE"};t.contentWindow.postMessage(r,e)}function mt(t,e,r=5e3){return new Promise((s,a)=>{if(!t||!t.contentWindow){a(new Error("Invalid iframe element"));return}let n=`source-location-${Date.now()}-${Math.random()}`,o=setTimeout(()=>{window.removeEventListener("message",l),a(new Error("Request timeout"))},r),l=i=>{i.origin===e&&i.data?.type==="GET_SOURCE_LOCATION_RESPONSE"&&i.data?.requestId===n&&(clearTimeout(o),window.removeEventListener("message",l),i.data.error?a(new Error(i.data.error)):s(i.data.sourceLocation||null))};window.addEventListener("message",l);let h={type:"GET_SOURCE_LOCATION_REQUEST",requestId:n};try{t.contentWindow.postMessage(h,e)}catch(i){clearTimeout(o),window.removeEventListener("message",l),a(i)}})}function yt(){if(typeof window>"u"||window===window.parent)return;let t=e=>{if(e.data?.type==="GET_SOURCE_LOCATION_REQUEST")try{let s={type:"GET_SOURCE_LOCATION_RESPONSE",sourceLocation:gt(),requestId:e.data.requestId};window.parent.postMessage(s,e.origin)}catch(r){let s={type:"GET_SOURCE_LOCATION_RESPONSE",sourceLocation:null,error:r instanceof Error?r.message:"Unknown error",requestId:e.data.requestId};window.parent.postMessage(s,e.origin)}};return window.addEventListener("message",t),()=>{window.removeEventListener("message",t)}}function gt(){return De("app")}var Fe=new R,H=class{constructor(e,r){this.httpClient=new Ne(Fe,L,r),this.fileStorage=new Re(e,this.httpClient),this.entities=He(e,this.httpClient),this.functions=new $e(this.httpClient,e),this.skill=new Me(e,this.httpClient),this.capability=new ke(e,this.httpClient)}};0&&(module.exports={disableIframeHoverInspector,enableIframeHoverInspector,getIframeSourceLocation,localStorage,polyfill,setupIframeHoverInspector,setupIframeSourceLocationListener,uniappFetch});
33
+ `,document.head.appendChild(t)}createTooltip(){return this.tooltip?this.tooltip:(this.tooltip=document.createElement("div"),this.tooltip.id="__nvwa-inspector-tooltip",document.body.appendChild(this.tooltip),this.tooltip)}createOverlay(t){let e=document.createElement("div");return e.className=`__nvwa-inspector-overlay __nvwa-inspector-overlay-${t}`,document.body.appendChild(e),e}updateOverlayPosition(t,e){if(!e.isConnected)return;let r=e.getBoundingClientRect(),s=window.scrollX||window.pageXOffset,a=window.scrollY||window.pageYOffset;r.width>0&&r.height>0?(t.style.left=`${r.left+s}px`,t.style.top=`${r.top+a}px`,t.style.width=`${r.width}px`,t.style.height=`${r.height}px`,t.style.display="block"):t.style.display="none"}removeOverlay(t){t&&t.parentNode&&t.parentNode.removeChild(t)}highlightElement(t,e){if(!t.isConnected)return;if(this.hoverElement===t&&this.hoverOverlay){this.updateOverlayPosition(this.hoverOverlay,t);let o=this.createTooltip();e?o.textContent=e:o.textContent=`<${t.tagName.toLowerCase()}> (\u65E0 source location)`,o.style.display="block";let l=t.getBoundingClientRect();o.style.left=`${l.left+window.scrollX}px`,o.style.top=`${l.top+window.scrollY-o.offsetHeight-8}px`,l.top<o.offsetHeight+8&&(o.style.top=`${l.bottom+window.scrollY+8}px`);return}this.hoverOverlay&&(this.removeOverlay(this.hoverOverlay),this.hoverOverlay=null);let r=this.createOverlay("hover");this.updateOverlayPosition(r,t),this.hoverOverlay=r,this.hoverElement=t;let s=()=>{this.hoverOverlay&&this.hoverElement&&this.hoverElement.isConnected&&this.updateOverlayPosition(this.hoverOverlay,this.hoverElement)};this.hoverUpdateHandler&&(window.removeEventListener("scroll",this.hoverUpdateHandler,!0),window.removeEventListener("resize",this.hoverUpdateHandler)),this.hoverUpdateHandler=s,window.addEventListener("scroll",s,!0),window.addEventListener("resize",s);let a=this.createTooltip();e?a.textContent=e:a.textContent=`<${t.tagName.toLowerCase()}> (\u65E0 source location)`,a.style.display="block";let n=t.getBoundingClientRect();a.style.left=`${n.left+window.scrollX}px`,a.style.top=`${n.top+window.scrollY-a.offsetHeight-8}px`,n.top<a.offsetHeight+8&&(a.style.top=`${n.bottom+window.scrollY+8}px`)}selectElement(t,e){if(!t.isConnected)return;if(this.selectedElement===t&&this.selectedOverlay){this.updateOverlayPosition(this.selectedOverlay,t);return}this.selectedOverlay&&(this.removeOverlay(this.selectedOverlay),this.selectedOverlay=null);let r=this.createOverlay("selected");this.updateOverlayPosition(r,t),this.selectedOverlay=r,this.selectedElement=t;let s=()=>{this.selectedOverlay&&this.selectedElement&&this.selectedElement.isConnected&&this.updateOverlayPosition(this.selectedOverlay,this.selectedElement)};this.selectedUpdateHandler&&(window.removeEventListener("scroll",this.selectedUpdateHandler,!0),window.removeEventListener("resize",this.selectedUpdateHandler)),this.selectedUpdateHandler=s,window.addEventListener("scroll",s,!0),window.addEventListener("resize",s)}removeHighlight(){this.hoverOverlay&&(this.removeOverlay(this.hoverOverlay),this.hoverOverlay=null),this.hoverElement&&(this.hoverElement=null),this.tooltip&&(this.tooltip.style.display="none"),this.hoverUpdateHandler&&(window.removeEventListener("scroll",this.hoverUpdateHandler,!0),window.removeEventListener("resize",this.hoverUpdateHandler),this.hoverUpdateHandler=null)}clearSelection(){this.selectedOverlay&&(this.removeOverlay(this.selectedOverlay),this.selectedOverlay=null),this.selectedElement&&(this.selectedElement=null),this.selectedUpdateHandler&&(window.removeEventListener("scroll",this.selectedUpdateHandler,!0),window.removeEventListener("resize",this.selectedUpdateHandler),this.selectedUpdateHandler=null)}cleanup(){this.removeHighlight(),this.clearSelection(),this.tooltip&&this.tooltip.parentNode&&(this.tooltip.parentNode.removeChild(this.tooltip),this.tooltip=null);let t=document.getElementById("__nvwa-inspector-overlay-style");t&&t.parentNode&&t.parentNode.removeChild(t)}};function De(t="root"){if(typeof document>"u")return null;let e=document.getElementById(t)||document.body;if(!e)return null;let r=e.querySelector("[data-source-location]");if(r){let s=r.getAttribute("data-source-location");if(s)return s}if(e.firstElementChild){let s=e.firstElementChild.getAttribute("data-source-location");if(s)return s}return null}g();var Tt=typeof fetch<"u"?fetch:(()=>{throw new Error("payment client requires fetch")})();var R=class{constructor(){this.prefix="nvwa_"}getKey(e){return`${this.prefix}${e}`}async get(e){try{let r=this.getKey(e),s=uni.getStorageSync(r);return s?s.expires&&Date.now()>s.expires?(await this.remove(e),null):s.value:null}catch(r){return console.error("UniAppStorageService get error:",r),null}}async set(e,r,s){try{let a=this.getKey(e),n={value:r,expires:s?Date.now()+s*1e3:null,timestamp:Date.now()};uni.setStorageSync(a,n)}catch(a){throw console.error("UniAppStorageService set error:",a),a}}async remove(e){try{let r=this.getKey(e);uni.removeStorageSync(r)}catch(r){throw console.error("UniAppStorageService remove error:",r),r}}async clear(){try{uni.clearStorageSync()}catch(e){throw console.error("UniAppStorageService clear error:",e),e}}};var I=(t,e)=>{let r;if(typeof t=="string")r=t;else if(t&&typeof t.toString=="function")r=t.toString();else if(t?.url)r=t.url;else throw new Error("Invalid input for uniappFetch");let s=(e?.method||"GET").toUpperCase(),a={};if(e?.headers){let l=e.headers;if(typeof l?.forEach=="function")l.forEach((h,i)=>{a[i]=h});else if(Array.isArray(l))for(let[h,i]of l)a[h]=i;else Object.assign(a,l)}let n;if(e?.body!==void 0){let l=e.body;if(typeof l=="string")n=l;else if(l&&typeof l=="object"&&typeof l.forEach=="function"){let h={};l.forEach((i,c)=>{h[c]=i}),n=h}else n=l}let o=e?.timeout||3e4;return new Promise((l,h)=>{let i=e?.signal;if(i?.aborted){let d=new Error("The operation was aborted");d.name="AbortError",h(d);return}let c=!1,u=[],f=uni.request({url:r,method:s,data:n,header:a,timeout:o,success:d=>{if(c)return;c=!0;let p=d.statusCode,m="",y=new w,v=d.header||d.headers||{};Object.keys(v).forEach(b=>{let E=v[b];y.set(b,typeof E=="string"?E:String(E))}),l(new B(d.data,{status:p,statusText:m,headers:y}))},fail:d=>{if(c)return;c=!0;let p=d?.errMsg||d?.message||"Network Error",m=new Error(p);/(abort|aborted|canceled|cancelled)/i.test(String(p))&&(m.name="AbortError"),h(m)}});if(i&&typeof i.addEventListener=="function"){let d=()=>{if(c)return;try{f?.abort?.()}catch{}let p=new Error("The operation was aborted");p.name="AbortError",c=!0,h(p)};i.addEventListener("abort",d),u.push(()=>{try{i.removeEventListener?.("abort",d)}catch{}})}})};typeof globalThis.fetch!="function"&&(globalThis.fetch=I);function dt(){if(typeof window>"u"||window===window.parent)return;let t=!1,e=new ke;function r(i){if(!i)return!1;let c=i.toLowerCase();return c.includes("/components/")||c.includes("\\components\\")}function s(i){let c=i,u=null;for(;c;){let f=c.getAttribute("data-source-location");if(f)if(r(f)){u||(u=f),c=c.parentElement;continue}else return f;c=c.parentElement}return u}let a=null;function n(i){t&&(a!==null&&cancelAnimationFrame(a),a=requestAnimationFrame(()=>{let c=i.target;if(!c||c===document.body||c===document.documentElement){e.removeHighlight();return}if(c.tagName.toLowerCase()==="img"){let p=s(c);e.highlightElement(c,p);let m={type:"HOVER_INSPECTOR_ELEMENT_HOVER",sourceLocation:p,elementInfo:{tagName:c.tagName.toLowerCase(),className:c.className||"",id:c.id||""}};window.parent.postMessage(m,"*");return}let u=c,f=s(c);if(!f){let p=c.parentElement;for(;p&&p!==document.body&&p!==document.documentElement;){let m=s(p);if(m){u=p,f=m;break}p=p.parentElement}}e.highlightElement(u,f);let d={type:"HOVER_INSPECTOR_ELEMENT_HOVER",sourceLocation:f,elementInfo:{tagName:u.tagName.toLowerCase(),className:u.className||"",id:u.id||""}};window.parent.postMessage(d,"*")}))}function o(){if(!t)return;e.removeHighlight();let i={type:"HOVER_INSPECTOR_ELEMENT_LEAVE"};window.parent.postMessage(i,"*")}function l(i){if(!t)return;i.preventDefault(),i.stopPropagation();let c=i.target;if(!c||c===document.body||c===document.documentElement)return;let u=s(c);e.selectElement(c,u);let f={type:"HOVER_INSPECTOR_ELEMENT_SELECT",sourceLocation:u,elementInfo:{tagName:c.tagName.toLowerCase(),className:c.className||"",id:c.id||""}};window.parent.postMessage(f,"*")}function h(i){i.data?.type==="HOVER_INSPECTOR_ENABLE"?(t=!0,document.addEventListener("mousemove",n),document.addEventListener("mouseleave",o),document.addEventListener("click",l,!0)):i.data?.type==="HOVER_INSPECTOR_DISABLE"&&(t=!1,document.removeEventListener("mousemove",n),document.removeEventListener("mouseleave",o),document.removeEventListener("click",l,!0),e.removeHighlight(),e.clearSelection())}return window.addEventListener("message",h),()=>{window.removeEventListener("message",h),document.removeEventListener("mousemove",n),document.removeEventListener("mouseleave",o),document.removeEventListener("click",l,!0),e.cleanup()}}function pt(t,e){if(!t||!t.contentWindow)throw new Error("Invalid iframe element");let r={type:"HOVER_INSPECTOR_ENABLE"};t.contentWindow.postMessage(r,e)}function ft(t,e){if(!t||!t.contentWindow)return;let r={type:"HOVER_INSPECTOR_DISABLE"};t.contentWindow.postMessage(r,e)}function mt(t,e,r=5e3){return new Promise((s,a)=>{if(!t||!t.contentWindow){a(new Error("Invalid iframe element"));return}let n=`source-location-${Date.now()}-${Math.random()}`,o=setTimeout(()=>{window.removeEventListener("message",l),a(new Error("Request timeout"))},r),l=i=>{i.origin===e&&i.data?.type==="GET_SOURCE_LOCATION_RESPONSE"&&i.data?.requestId===n&&(clearTimeout(o),window.removeEventListener("message",l),i.data.error?a(new Error(i.data.error)):s(i.data.sourceLocation||null))};window.addEventListener("message",l);let h={type:"GET_SOURCE_LOCATION_REQUEST",requestId:n};try{t.contentWindow.postMessage(h,e)}catch(i){clearTimeout(o),window.removeEventListener("message",l),a(i)}})}function yt(){if(typeof window>"u"||window===window.parent)return;let t=e=>{if(e.data?.type==="GET_SOURCE_LOCATION_REQUEST")try{let s={type:"GET_SOURCE_LOCATION_RESPONSE",sourceLocation:gt(),requestId:e.data.requestId};window.parent.postMessage(s,e.origin)}catch(r){let s={type:"GET_SOURCE_LOCATION_RESPONSE",sourceLocation:null,error:r instanceof Error?r.message:"Unknown error",requestId:e.data.requestId};window.parent.postMessage(s,e.origin)}};return window.addEventListener("message",t),()=>{window.removeEventListener("message",t)}}function gt(){return De("app")}var Fe=new R,H=class{constructor(e,r){this.httpClient=new Ce(Fe,I,r),this.fileStorage=new Re(e,this.httpClient),this.entities=He(e,this.httpClient),this.functions=new $e(this.httpClient,e),this.skill=new Ue(e,this.httpClient),this.capability=new Me(e,this.httpClient)}};0&&(module.exports={disableIframeHoverInspector,enableIframeHoverInspector,getIframeSourceLocation,localStorage,polyfill,setupIframeHoverInspector,setupIframeSourceLocationListener,uniappFetch});
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- var De=Object.create,N=Object.defineProperty,Fe=Object.getOwnPropertyDescriptor,Be=Object.getOwnPropertyNames,qe=Object.getPrototypeOf,Ge=Object.prototype.hasOwnProperty,G=(t,e)=>()=>(t&&(e=t(t=0)),e),_=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ze=(t,e)=>{for(var r in e)N(t,r,{get:e[r],enumerable:!0})},z=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Be(e))!Ge.call(t,n)&&n!==r&&N(t,n,{get:()=>e[n],enumerable:!(s=Fe(e,n))||s.enumerable});return t},Je=(t,e,r)=>(r=t!=null?De(qe(t)):{},z(e||!t||!t.__esModule?N(r,"default",{value:t,enumerable:!0}):r,t)),S=t=>z(N({},"__esModule",{value:!0}),t),g=G(()=>{"use strict"}),O={};ze(O,{__addDisposableResource:()=>ye,__assign:()=>$,__asyncDelegator:()=>le,__asyncGenerator:()=>ie,__asyncValues:()=>ce,__await:()=>P,__awaiter:()=>te,__classPrivateFieldGet:()=>pe,__classPrivateFieldIn:()=>me,__classPrivateFieldSet:()=>fe,__createBinding:()=>x,__decorate:()=>K,__disposeResources:()=>ge,__esDecorate:()=>Y,__exportStar:()=>se,__extends:()=>J,__generator:()=>re,__importDefault:()=>de,__importStar:()=>ue,__makeTemplateObject:()=>he,__metadata:()=>ee,__param:()=>V,__propKey:()=>X,__read:()=>U,__rest:()=>W,__rewriteRelativeImportExtension:()=>ve,__runInitializers:()=>Q,__setFunctionName:()=>Z,__spread:()=>ae,__spreadArray:()=>oe,__spreadArrays:()=>ne,__values:()=>A,default:()=>Ee});function J(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");L(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function W(t,e){var r={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(r[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(r[s[n]]=t[s[n]]);return r}function K(t,e,r,s){var n=arguments.length,a=n<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,r):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,s);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a}function V(t,e){return function(r,s){e(r,s,t)}}function Y(t,e,r,s,n,a){function o(v){if(v!==void 0&&typeof v!="function")throw new TypeError("Function expected");return v}for(var l=s.kind,h=l==="getter"?"get":l==="setter"?"set":"value",i=!e&&t?s.static?t:t.prototype:null,c=e||(i?Object.getOwnPropertyDescriptor(i,s.name):{}),u,f=!1,d=r.length-1;d>=0;d--){var p={};for(var m in s)p[m]=m==="access"?{}:s[m];for(var m in s.access)p.access[m]=s.access[m];p.addInitializer=function(v){if(f)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(v||null))};var y=(0,r[d])(l==="accessor"?{get:c.get,set:c.set}:c[h],p);if(l==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(u=o(y.get))&&(c.get=u),(u=o(y.set))&&(c.set=u),(u=o(y.init))&&n.unshift(u)}else(u=o(y))&&(l==="field"?n.unshift(u):c[h]=u)}i&&Object.defineProperty(i,s.name,c),f=!0}function Q(t,e,r){for(var s=arguments.length>2,n=0;n<e.length;n++)r=s?e[n].call(t,r):e[n].call(t);return s?r:void 0}function X(t){return typeof t=="symbol"?t:"".concat(t)}function Z(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function ee(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function te(t,e,r,s){function n(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function l(c){try{i(s.next(c))}catch(u){o(u)}}function h(c){try{i(s.throw(c))}catch(u){o(u)}}function i(c){c.done?a(c.value):n(c.value).then(l,h)}i((s=s.apply(t,e||[])).next())})}function re(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},s,n,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(i){return function(c){return h([i,c])}}function h(i){if(s)throw new TypeError("Generator is already executing.");for(;o&&(o=0,i[0]&&(r=0)),r;)try{if(s=1,n&&(a=i[0]&2?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[i[0]&2,a.value]),i[0]){case 0:case 1:a=i;break;case 4:return r.label++,{value:i[1],done:!1};case 5:r.label++,n=i[1],i=[0];continue;case 7:i=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!a||i[1]>a[0]&&i[1]<a[3])){r.label=i[1];break}if(i[0]===6&&r.label<a[1]){r.label=a[1],a=i;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(i);break}a[2]&&r.ops.pop(),r.trys.pop();continue}i=e.call(t,r)}catch(c){i=[6,c],n=0}finally{s=a=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}function se(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&x(e,t,r)}function A(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],s=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function U(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var s=r.call(t),n,a=[],o;try{for(;(e===void 0||e-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(l){o={error:l}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return a}function ae(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(U(arguments[e]));return t}function ne(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var s=Array(t),n=0,e=0;e<r;e++)for(var a=arguments[e],o=0,l=a.length;o<l;o++,n++)s[n]=a[o];return s}function oe(t,e,r){if(r||arguments.length===2)for(var s=0,n=e.length,a;s<n;s++)(a||!(s in e))&&(a||(a=Array.prototype.slice.call(e,0,s)),a[s]=e[s]);return t.concat(a||Array.prototype.slice.call(e))}function P(t){return this instanceof P?(this.v=t,this):new P(t)}function ie(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=r.apply(t,e||[]),n,a=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",o),n[Symbol.asyncIterator]=function(){return this},n;function o(d){return function(p){return Promise.resolve(p).then(d,u)}}function l(d,p){s[d]&&(n[d]=function(m){return new Promise(function(y,v){a.push([d,m,y,v])>1||h(d,m)})},p&&(n[d]=p(n[d])))}function h(d,p){try{i(s[d](p))}catch(m){f(a[0][3],m)}}function i(d){d.value instanceof P?Promise.resolve(d.value.v).then(c,u):f(a[0][2],d)}function c(d){h("next",d)}function u(d){h("throw",d)}function f(d,p){d(p),a.shift(),a.length&&h(a[0][0],a[0][1])}}function le(t){var e,r;return e={},s("next"),s("throw",function(n){throw n}),s("return"),e[Symbol.iterator]=function(){return this},e;function s(n,a){e[n]=t[n]?function(o){return(r=!r)?{value:P(t[n](o)),done:!1}:a?a(o):o}:a}}function ce(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof A=="function"?A(t):t[Symbol.iterator](),r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r);function s(a){r[a]=t[a]&&function(o){return new Promise(function(l,h){o=t[a](o),n(l,h,o.done,o.value)})}}function n(a,o,l,h){Promise.resolve(h).then(function(i){a({value:i,done:l})},o)}}function he(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function ue(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=j(t),s=0;s<r.length;s++)r[s]!=="default"&&x(e,t,r[s]);return we(e,t),e}function de(t){return t&&t.__esModule?t:{default:t}}function pe(t,e,r,s){if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?s:r==="a"?s.call(t):s?s.value:e.get(t)}function fe(t,e,r,s,n){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r}function me(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function ye(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var s,n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");s=e[Symbol.asyncDispose]}if(s===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");s=e[Symbol.dispose],r&&(n=s)}if(typeof s!="function")throw new TypeError("Object not disposable.");n&&(s=function(){try{n.call(this)}catch(a){return Promise.reject(a)}}),t.stack.push({value:e,dispose:s,async:r})}else r&&t.stack.push({async:!0});return e}function ge(t){function e(a){t.error=t.hasError?new be(a,t.error,"An error was suppressed during disposal."):a,t.hasError=!0}var r,s=0;function n(){for(;r=t.stack.pop();)try{if(!r.async&&s===1)return s=0,t.stack.push(r),Promise.resolve().then(n);if(r.dispose){var a=r.dispose.call(r.value);if(r.async)return s|=2,Promise.resolve(a).then(n,function(o){return e(o),n()})}else s|=1}catch(o){e(o)}if(s===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return n()}function ve(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,s,n,a,o){return s?e?".jsx":".js":n&&(!a||!o)?r:n+a+"."+o.toLowerCase()+"js"}):t}var L,$,x,we,j,be,Ee,T=G(()=>{"use strict";g(),L=function(t,e){return L=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(r[n]=s[n])},L(t,e)},$=function(){return $=Object.assign||function(t){for(var e,r=1,s=arguments.length;r<s;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},$.apply(this,arguments)},x=Object.create?(function(t,e,r,s){s===void 0&&(s=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,n)}):(function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),we=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e},j=function(t){return j=Object.getOwnPropertyNames||function(e){var r=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[r.length]=s);return r},j(t)},be=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var s=new Error(r);return s.name="SuppressedError",s.error=t,s.suppressed=e,s},Ee={__extends:J,__assign:$,__rest:W,__decorate:K,__param:V,__esDecorate:Y,__runInitializers:Q,__propKey:X,__setFunctionName:Z,__metadata:ee,__awaiter:te,__generator:re,__createBinding:x,__exportStar:se,__values:A,__read:U,__spread:ae,__spreadArrays:ne,__spreadArray:oe,__await:P,__asyncGenerator:ie,__asyncDelegator:le,__asyncValues:ce,__makeTemplateObject:he,__importStar:ue,__importDefault:de,__classPrivateFieldGet:pe,__classPrivateFieldSet:fe,__classPrivateFieldIn:me,__addDisposableResource:ye,__disposeResources:ge,__rewriteRelativeImportExtension:ve}}),_e=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=class extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.code=r.code}};t.default=e}),Oe=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(O)),r=e.__importDefault(_e()),s=class{constructor(n){var a,o;this.shouldThrowOnError=!1,this.method=n.method,this.url=n.url,this.headers=new Headers(n.headers),this.schema=n.schema,this.body=n.body,this.shouldThrowOnError=(a=n.shouldThrowOnError)!==null&&a!==void 0?a:!1,this.signal=n.signal,this.isMaybeSingle=(o=n.isMaybeSingle)!==null&&o!==void 0?o:!1,n.fetch?this.fetch=n.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(n,a){return this.headers=new Headers(this.headers),this.headers.set(n,a),this}then(n,a){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");let o=this.fetch,l=o(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async h=>{var i,c,u,f;let d=null,p=null,m=null,y=h.status,v=h.statusText;if(h.ok){if(this.method!=="HEAD"){let M=await h.text();M===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&!((i=this.headers.get("Accept"))===null||i===void 0)&&i.includes("application/vnd.pgrst.plan+text")?p=M:p=JSON.parse(M))}let b=(c=this.headers.get("Prefer"))===null||c===void 0?void 0:c.match(/count=(exact|planned|estimated)/),E=(u=h.headers.get("content-range"))===null||u===void 0?void 0:u.split("/");b&&E&&E.length>1&&(m=parseInt(E[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(p)&&(p.length>1?(d={code:"PGRST116",details:`Results contain ${p.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},p=null,m=null,y=406,v="Not Acceptable"):p.length===1?p=p[0]:p=null)}else{let b=await h.text();try{d=JSON.parse(b),Array.isArray(d)&&h.status===404&&(p=[],d=null,y=200,v="OK")}catch{h.status===404&&b===""?(y=204,v="No Content"):d={message:b}}if(d&&this.isMaybeSingle&&!((f=d?.details)===null||f===void 0)&&f.includes("0 rows")&&(d=null,y=200,v="OK"),d&&this.shouldThrowOnError)throw new r.default(d)}return{error:d,data:p,count:m,status:y,statusText:v}});return this.shouldThrowOnError||(l=l.catch(h=>{var i,c,u;return{error:{message:`${(i=h?.name)!==null&&i!==void 0?i:"FetchError"}: ${h?.message}`,details:`${(c=h?.stack)!==null&&c!==void 0?c:""}`,hint:"",code:`${(u=h?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),l.then(n,a)}returns(){return this}overrideTypes(){return this}};t.default=s}),Pe=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(O)),r=e.__importDefault(Oe()),s=class extends r.default{select(n){let a=!1,o=(n??"*").split("").map(l=>/\s/.test(l)&&!a?"":(l==='"'&&(a=!a),l)).join("");return this.url.searchParams.set("select",o),this.headers.append("Prefer","return=representation"),this}order(n,{ascending:a=!0,nullsFirst:o,foreignTable:l,referencedTable:h=l}={}){let i=h?`${h}.order`:"order",c=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${c?`${c},`:""}${n}.${a?"asc":"desc"}${o===void 0?"":o?".nullsfirst":".nullslast"}`),this}limit(n,{foreignTable:a,referencedTable:o=a}={}){let l=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(l,`${n}`),this}range(n,a,{foreignTable:o,referencedTable:l=o}={}){let h=typeof l>"u"?"offset":`${l}.offset`,i=typeof l>"u"?"limit":`${l}.limit`;return this.url.searchParams.set(h,`${n}`),this.url.searchParams.set(i,`${a-n+1}`),this}abortSignal(n){return this.signal=n,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:n=!1,verbose:a=!1,settings:o=!1,buffers:l=!1,wal:h=!1,format:i="text"}={}){var c;let u=[n?"analyze":null,a?"verbose":null,o?"settings":null,l?"buffers":null,h?"wal":null].filter(Boolean).join("|"),f=(c=this.headers.get("Accept"))!==null&&c!==void 0?c:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${f}"; options=${u};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(n){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${n}`),this}};t.default=s}),D=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(O)),r=e.__importDefault(Pe()),s=new RegExp("[,()]"),n=class extends r.default{eq(a,o){return this.url.searchParams.append(a,`eq.${o}`),this}neq(a,o){return this.url.searchParams.append(a,`neq.${o}`),this}gt(a,o){return this.url.searchParams.append(a,`gt.${o}`),this}gte(a,o){return this.url.searchParams.append(a,`gte.${o}`),this}lt(a,o){return this.url.searchParams.append(a,`lt.${o}`),this}lte(a,o){return this.url.searchParams.append(a,`lte.${o}`),this}like(a,o){return this.url.searchParams.append(a,`like.${o}`),this}likeAllOf(a,o){return this.url.searchParams.append(a,`like(all).{${o.join(",")}}`),this}likeAnyOf(a,o){return this.url.searchParams.append(a,`like(any).{${o.join(",")}}`),this}ilike(a,o){return this.url.searchParams.append(a,`ilike.${o}`),this}ilikeAllOf(a,o){return this.url.searchParams.append(a,`ilike(all).{${o.join(",")}}`),this}ilikeAnyOf(a,o){return this.url.searchParams.append(a,`ilike(any).{${o.join(",")}}`),this}is(a,o){return this.url.searchParams.append(a,`is.${o}`),this}in(a,o){let l=Array.from(new Set(o)).map(h=>typeof h=="string"&&s.test(h)?`"${h}"`:`${h}`).join(",");return this.url.searchParams.append(a,`in.(${l})`),this}contains(a,o){return typeof o=="string"?this.url.searchParams.append(a,`cs.${o}`):Array.isArray(o)?this.url.searchParams.append(a,`cs.{${o.join(",")}}`):this.url.searchParams.append(a,`cs.${JSON.stringify(o)}`),this}containedBy(a,o){return typeof o=="string"?this.url.searchParams.append(a,`cd.${o}`):Array.isArray(o)?this.url.searchParams.append(a,`cd.{${o.join(",")}}`):this.url.searchParams.append(a,`cd.${JSON.stringify(o)}`),this}rangeGt(a,o){return this.url.searchParams.append(a,`sr.${o}`),this}rangeGte(a,o){return this.url.searchParams.append(a,`nxl.${o}`),this}rangeLt(a,o){return this.url.searchParams.append(a,`sl.${o}`),this}rangeLte(a,o){return this.url.searchParams.append(a,`nxr.${o}`),this}rangeAdjacent(a,o){return this.url.searchParams.append(a,`adj.${o}`),this}overlaps(a,o){return typeof o=="string"?this.url.searchParams.append(a,`ov.${o}`):this.url.searchParams.append(a,`ov.{${o.join(",")}}`),this}textSearch(a,o,{config:l,type:h}={}){let i="";h==="plain"?i="pl":h==="phrase"?i="ph":h==="websearch"&&(i="w");let c=l===void 0?"":`(${l})`;return this.url.searchParams.append(a,`${i}fts${c}.${o}`),this}match(a){return Object.entries(a).forEach(([o,l])=>{this.url.searchParams.append(o,`eq.${l}`)}),this}not(a,o,l){return this.url.searchParams.append(a,`not.${o}.${l}`),this}or(a,{foreignTable:o,referencedTable:l=o}={}){let h=l?`${l}.or`:"or";return this.url.searchParams.append(h,`(${a})`),this}filter(a,o,l){return this.url.searchParams.append(a,`${o}.${l}`),this}};t.default=n}),Se=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(O)),r=e.__importDefault(D()),s=class{constructor(n,{headers:a={},schema:o,fetch:l}){this.url=n,this.headers=new Headers(a),this.schema=o,this.fetch=l}select(n,a){let{head:o=!1,count:l}=a??{},h=o?"HEAD":"GET",i=!1,c=(n??"*").split("").map(u=>/\s/.test(u)&&!i?"":(u==='"'&&(i=!i),u)).join("");return this.url.searchParams.set("select",c),l&&this.headers.append("Prefer",`count=${l}`),new r.default({method:h,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(n,{count:a,defaultToNull:o=!0}={}){var l;let h="POST";if(a&&this.headers.append("Prefer",`count=${a}`),o||this.headers.append("Prefer","missing=default"),Array.isArray(n)){let i=n.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(i.length>0){let c=[...new Set(i)].map(u=>`"${u}"`);this.url.searchParams.set("columns",c.join(","))}}return new r.default({method:h,url:this.url,headers:this.headers,schema:this.schema,body:n,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch})}upsert(n,{onConflict:a,ignoreDuplicates:o=!1,count:l,defaultToNull:h=!0}={}){var i;let c="POST";if(this.headers.append("Prefer",`resolution=${o?"ignore":"merge"}-duplicates`),a!==void 0&&this.url.searchParams.set("on_conflict",a),l&&this.headers.append("Prefer",`count=${l}`),h||this.headers.append("Prefer","missing=default"),Array.isArray(n)){let u=n.reduce((f,d)=>f.concat(Object.keys(d)),[]);if(u.length>0){let f=[...new Set(u)].map(d=>`"${d}"`);this.url.searchParams.set("columns",f.join(","))}}return new r.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:n,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}update(n,{count:a}={}){var o;let l="PATCH";return a&&this.headers.append("Prefer",`count=${a}`),new r.default({method:l,url:this.url,headers:this.headers,schema:this.schema,body:n,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}delete({count:n}={}){var a;let o="DELETE";return n&&this.headers.append("Prefer",`count=${n}`),new r.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}};t.default=s}),We=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(O)),r=e.__importDefault(Se()),s=e.__importDefault(D()),n=class Te{constructor(o,{headers:l={},schema:h,fetch:i}={}){this.url=o,this.headers=new Headers(l),this.schemaName=h,this.fetch=i}from(o){let l=new URL(`${this.url}/${o}`);return new r.default(l,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(o){return new Te(this.url,{headers:this.headers,schema:o,fetch:this.fetch})}rpc(o,l={},{head:h=!1,get:i=!1,count:c}={}){var u;let f,d=new URL(`${this.url}/rpc/${o}`),p;h||i?(f=h?"HEAD":"GET",Object.entries(l).filter(([y,v])=>v!==void 0).map(([y,v])=>[y,Array.isArray(v)?`{${v.join(",")}}`:`${v}`]).forEach(([y,v])=>{d.searchParams.append(y,v)})):(f="POST",p=l);let m=new Headers(this.headers);return c&&m.set("Prefer",`count=${c}`),new s.default({method:f,url:d,headers:m,schema:this.schemaName,body:p,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}};t.default=n}),Ke=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0}),t.PostgrestError=t.PostgrestBuilder=t.PostgrestTransformBuilder=t.PostgrestFilterBuilder=t.PostgrestQueryBuilder=t.PostgrestClient=void 0;var e=(T(),S(O)),r=e.__importDefault(We());t.PostgrestClient=r.default;var s=e.__importDefault(Se());t.PostgrestQueryBuilder=s.default;var n=e.__importDefault(D());t.PostgrestFilterBuilder=n.default;var a=e.__importDefault(Pe());t.PostgrestTransformBuilder=a.default;var o=e.__importDefault(Oe());t.PostgrestBuilder=o.default;var l=e.__importDefault(_e());t.PostgrestError=l.default,t.default={PostgrestClient:r.default,PostgrestQueryBuilder:s.default,PostgrestFilterBuilder:n.default,PostgrestTransformBuilder:a.default,PostgrestBuilder:o.default,PostgrestError:l.default}});g();g();var $e=class{constructor(t,e=""){this.http=t,this.baseUrl=e.replace(/\/$/,"")}async invoke(t,e){let r=this.baseUrl?`${this.baseUrl}/functions/${t}`:`/functions/${t}`;return await(await this.http.fetch(r,{method:e.method||"POST",body:e.body,headers:e.headers})).json()}};g();g();var Ve="nvwa_current_jwt";var it=typeof fetch<"u"?fetch:(()=>{throw new Error("AuthClient requires fetch")})();g();g();var w=class xe{constructor(e){if(this.headerMap=new Map,e){if(e instanceof xe)e.forEach((r,s)=>this.set(s,r));else if(Array.isArray(e))for(let[r,s]of e)this.set(r,String(s));else if(typeof e=="object")for(let r of Object.keys(e))this.set(r,String(e[r]))}}append(e,r){let s=e.toLowerCase(),n=this.headerMap.get(s);this.headerMap.set(s,n?`${n}, ${r}`:r)}set(e,r){this.headerMap.set(e.toLowerCase(),String(r))}get(e){return this.headerMap.get(e.toLowerCase())??null}has(e){return this.headerMap.has(e.toLowerCase())}delete(e){this.headerMap.delete(e.toLowerCase())}forEach(e){for(let[r,s]of this.headerMap.entries())e(s,r,this)}entries(){return this.headerMap.entries()}keys(){return this.headerMap.keys()}values(){return this.headerMap.values()}[Symbol.iterator](){return this.entries()}},Le=class je{constructor(e){if(this.params=new Map,e){if(typeof e=="string")this.parseString(e);else if(e instanceof je)this.params=new Map(e.params);else if(Array.isArray(e))for(let[r,s]of e)this.append(r,s);else if(e&&typeof e=="object")for(let[r,s]of Object.entries(e))this.set(r,s)}}parseString(e){e.startsWith("?")&&(e=e.slice(1));let r=e.split("&");for(let s of r)if(s){let[n,a]=s.split("=");n&&this.append(decodeURIComponent(n),a?decodeURIComponent(a):"")}}append(e,r){let s=this.params.get(e)||[];s.push(r),this.params.set(e,s)}delete(e){this.params.delete(e)}get(e){let r=this.params.get(e);return r?r[0]:null}getAll(e){return this.params.get(e)||[]}has(e){return this.params.has(e)}set(e,r){this.params.set(e,[r])}sort(){let e=Array.from(this.params.entries()).sort(([r],[s])=>r.localeCompare(s));this.params=new Map(e)}toString(){let e=[];for(let[r,s]of this.params.entries())for(let n of s)e.push(`${encodeURIComponent(r)}=${encodeURIComponent(n)}`);return e.join("&")}forEach(e){for(let[r,s]of this.params.entries())for(let n of s)e(n,r,this)}keys(){return this.params.keys()}values(){let e=[];for(let r of this.params.values())e.push(...r);return e[Symbol.iterator]()}entries(){let e=[];for(let[r,s]of this.params.entries())for(let n of s)e.push([r,n]);return e[Symbol.iterator]()}[Symbol.iterator](){return this.entries()}get size(){return this.params.size}},Ye=class k{constructor(e,r){let s;if(e instanceof k)s=e.href;else if(r){let a=r instanceof k?r.href:r;s=this.resolve(a,e)}else s=e;let n=this.parseUrl(s);this.href=s,this.origin=`${n.protocol}//${n.host}`,this.protocol=n.protocol,this.username=n.username,this.password=n.password,this.host=n.host,this.hostname=n.hostname,this.port=n.port,this.pathname=n.pathname,this.search=n.search,this.searchParams=new Le(n.search),this.hash=n.hash}resolve(e,r){if(r.startsWith("http://")||r.startsWith("https://"))return r;if(r.startsWith("//"))return`${this.parseUrl(e).protocol}${r}`;if(r.startsWith("/")){let a=this.parseUrl(e);return`${a.protocol}//${a.host}${r}`}let s=this.parseUrl(e),n=s.pathname.endsWith("/")?s.pathname:s.pathname+"/";return`${s.protocol}//${s.host}${n}${r}`}parseUrl(e){let r=e.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!r)throw new TypeError("Invalid URL");let s=r[2]||"",n=r[4]||"",a=r[5]||"/",o=r[7]?`?${r[7]}`:"",l=r[9]?`#${r[9]}`:"";if(!s&&!n&&!a.startsWith("/")&&!a.includes("/")&&!a.includes("."))throw new TypeError("Invalid URL");let h=n.match(/^([^@]*)@(.+)$/),i="",c="",u=n;if(h){let m=h[1];u=h[2];let y=m.match(/^([^:]*):?(.*)$/);y&&(i=y[1]||"",c=y[2]||"")}let f=u.match(/^([^:]+):?(\d*)$/),d=f?f[1]:u,p=f&&f[2]?f[2]:"";return{protocol:s?`${s}:`:"",username:i,password:c,host:u,hostname:d,port:p,pathname:a,search:o,hash:l}}toString(){let e=this.searchParams.toString(),r=e?`?${e}`:"";return`${this.protocol}//${this.host}${this.pathname}${r}${this.hash}`}toJSON(){return this.toString()}};g();var Qe=class Ae{constructor(e,r){if(typeof e=="string")this.url=e;else if(e?.url)this.url=String(e.url);else if(typeof e?.toString=="function")this.url=String(e.toString());else throw new Error("Invalid input for Request");this.method=(r?.method||"GET").toUpperCase(),this.headers=r?.headers instanceof w?r.headers:new w(r?.headers),this.body=r?.body,this.timeout=r?.timeout,this.signal=r?.signal||void 0}clone(){return new Ae(this.url,{method:this.method,headers:this.headers,body:this.body,timeout:this.timeout})}toString(){return this.url}};g();var F=class{constructor(t,e){this.bodyData=t,this.status=e?.status??200,this.statusText=e?.statusText??"",this.headers=Xe(e?.headers),this.ok=this.status>=200&&this.status<300}async text(){return typeof this.bodyData=="string"?this.bodyData:this.bodyData==null?"":typeof this.bodyData=="object"?JSON.stringify(this.bodyData):String(this.bodyData)}async json(){if(typeof this.bodyData=="string")try{return JSON.parse(this.bodyData)}catch{}return this.bodyData}async arrayBuffer(){let t=await this.text();return new TextEncoder().encode(t).buffer}};function Xe(t){return t?new w(t):new w}g();var Ce=class{constructor(){this._aborted=!1,this.listeners=new Set,this.onabort=null}get aborted(){return this._aborted}_trigger(){if(!this._aborted){if(this._aborted=!0,typeof this.onabort=="function")try{this.onabort()}catch{}for(let t of Array.from(this.listeners))try{t()}catch{}this.listeners.clear()}}addEventListener(t,e){if(this._aborted){try{e()}catch{}return}this.listeners.add(e)}removeEventListener(t,e){this.listeners.delete(e)}toString(){return"[object AbortSignal]"}},Ze=class{constructor(){this._signal=new Ce}get signal(){return this._signal}abort(){this._signal._trigger()}toString(){return"[object AbortController]"}};g();function et(t){t.URL=Ye,t.URLSearchParams=Le,t.Headers=w,t.Request=Qe,t.Response=F,t.AbortController=Ze,t.AbortSignal=Ce}var Ie=class{constructor(t,e,r){console.log("NvwaHttpClient constructor",t,e,r),this.storage=t,this.customFetch=e,this.handleUnauthorized=r}async fetch(t,e){return await this.customFetch(t,e)}async fetchWithAuth(t,e){let r=await this.storage.get(Ve),s=new w(e?.headers);r&&s.set("Authorization",`Bearer ${r}`);let n=e?.method||"GET";if((n==="POST"||n==="PUT"||n==="PATCH")&&e?.body){let o=s.get("Content-Type");(!o||o.includes("text/plain"))&&s.set("Content-Type","application/json")}let a=await this.customFetch(t,{...e,headers:s});if(a.status===401)throw this.handleUnauthorized(),new Error("\u672A\u767B\u5F55");return a}};g();var tt="/storage",rt=tt+"/generateUploadUrl",Ne=class{constructor(t,e){this.baseUrl=t,this.http=e}async uploadFile(t){let e=await this.http.fetch(this.baseUrl+rt,{method:"POST",body:{fileName:t.name||t.fileName,fileSize:t.size||t.fileSize,fileType:t.type||t.fileType}}),{url:r}=await e.json();if(!r)throw new Error("\u83B7\u53D6\u4E0A\u4F20URL\u5931\u8D25");let s=await this.http.fetch(r,{method:"PUT",body:t,headers:new w({"Content-Type":t.type||t.fileType||"application/octet-stream"})}),{url:n}=await s.json();return{url:n.split("?")[0]}}};g();g();g();var q=Je(Ke(),1),{PostgrestClient:st,PostgrestQueryBuilder:lt,PostgrestFilterBuilder:ct,PostgrestTransformBuilder:ht,PostgrestBuilder:ut,PostgrestError:dt}=q.default||q,at="/entities",Re=(t,e)=>new st(t+at,{fetch:e.fetchWithAuth.bind(e)});g();var He=class{constructor(t,e){this.baseUrl=t,this.http=e}async execute(t,e){let r=`${this.baseUrl}/capability/${t}/execute`,s=await(await this.http.fetchWithAuth(r,{method:"POST",body:e?JSON.stringify(e):void 0,timeout:6e5})).json();if(s.status!==200)throw new Error(s.message);return s.data}};g();var Me=class{constructor(t,e){this.baseUrl=t,this.http=e}async execute(t,e){let r=`${this.baseUrl}/capability/${t}/execute`,s=await(await this.http.fetchWithAuth(r,{method:"POST",body:e!=null?JSON.stringify(e):void 0,timeout:6e5})).json();if(s.status!==200)throw new Error(s.message);return s.data}};g();var ke=class{constructor(){this.hoverOverlay=null,this.selectedOverlay=null,this.tooltip=null,this.hoverElement=null,this.selectedElement=null,this.hoverUpdateHandler=null,this.selectedUpdateHandler=null,this.createStyles()}createStyles(){if(document.getElementById("__nvwa-inspector-overlay-style"))return;let t=document.createElement("style");t.id="__nvwa-inspector-overlay-style",t.textContent=`
1
+ var De=Object.create,C=Object.defineProperty,Fe=Object.getOwnPropertyDescriptor,Be=Object.getOwnPropertyNames,qe=Object.getPrototypeOf,Ge=Object.prototype.hasOwnProperty,G=(t,e)=>()=>(t&&(e=t(t=0)),e),_=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ze=(t,e)=>{for(var r in e)C(t,r,{get:e[r],enumerable:!0})},z=(t,e,r,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Be(e))!Ge.call(t,n)&&n!==r&&C(t,n,{get:()=>e[n],enumerable:!(s=Fe(e,n))||s.enumerable});return t},We=(t,e,r)=>(r=t!=null?De(qe(t)):{},z(e||!t||!t.__esModule?C(r,"default",{value:t,enumerable:!0}):r,t)),S=t=>z(C({},"__esModule",{value:!0}),t),g=G(()=>{"use strict"}),P={};ze(P,{__addDisposableResource:()=>ye,__assign:()=>$,__asyncDelegator:()=>le,__asyncGenerator:()=>ie,__asyncValues:()=>ce,__await:()=>O,__awaiter:()=>te,__classPrivateFieldGet:()=>pe,__classPrivateFieldIn:()=>me,__classPrivateFieldSet:()=>fe,__createBinding:()=>x,__decorate:()=>K,__disposeResources:()=>ge,__esDecorate:()=>Y,__exportStar:()=>se,__extends:()=>W,__generator:()=>re,__importDefault:()=>de,__importStar:()=>ue,__makeTemplateObject:()=>he,__metadata:()=>ee,__param:()=>V,__propKey:()=>X,__read:()=>k,__rest:()=>J,__rewriteRelativeImportExtension:()=>ve,__runInitializers:()=>Q,__setFunctionName:()=>Z,__spread:()=>ae,__spreadArray:()=>oe,__spreadArrays:()=>ne,__values:()=>N,default:()=>Ee});function W(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");I(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function J(t,e){var r={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(r[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,s=Object.getOwnPropertySymbols(t);n<s.length;n++)e.indexOf(s[n])<0&&Object.prototype.propertyIsEnumerable.call(t,s[n])&&(r[s[n]]=t[s[n]]);return r}function K(t,e,r,s){var n=arguments.length,a=n<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,r):s,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(t,e,r,s);else for(var l=t.length-1;l>=0;l--)(o=t[l])&&(a=(n<3?o(a):n>3?o(e,r,a):o(e,r))||a);return n>3&&a&&Object.defineProperty(e,r,a),a}function V(t,e){return function(r,s){e(r,s,t)}}function Y(t,e,r,s,n,a){function o(v){if(v!==void 0&&typeof v!="function")throw new TypeError("Function expected");return v}for(var l=s.kind,h=l==="getter"?"get":l==="setter"?"set":"value",i=!e&&t?s.static?t:t.prototype:null,c=e||(i?Object.getOwnPropertyDescriptor(i,s.name):{}),u,f=!1,d=r.length-1;d>=0;d--){var p={};for(var m in s)p[m]=m==="access"?{}:s[m];for(var m in s.access)p.access[m]=s.access[m];p.addInitializer=function(v){if(f)throw new TypeError("Cannot add initializers after decoration has completed");a.push(o(v||null))};var y=(0,r[d])(l==="accessor"?{get:c.get,set:c.set}:c[h],p);if(l==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(u=o(y.get))&&(c.get=u),(u=o(y.set))&&(c.set=u),(u=o(y.init))&&n.unshift(u)}else(u=o(y))&&(l==="field"?n.unshift(u):c[h]=u)}i&&Object.defineProperty(i,s.name,c),f=!0}function Q(t,e,r){for(var s=arguments.length>2,n=0;n<e.length;n++)r=s?e[n].call(t,r):e[n].call(t);return s?r:void 0}function X(t){return typeof t=="symbol"?t:"".concat(t)}function Z(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function ee(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function te(t,e,r,s){function n(a){return a instanceof r?a:new r(function(o){o(a)})}return new(r||(r=Promise))(function(a,o){function l(c){try{i(s.next(c))}catch(u){o(u)}}function h(c){try{i(s.throw(c))}catch(u){o(u)}}function i(c){c.done?a(c.value):n(c.value).then(l,h)}i((s=s.apply(t,e||[])).next())})}function re(t,e){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},s,n,a,o=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return o.next=l(0),o.throw=l(1),o.return=l(2),typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function l(i){return function(c){return h([i,c])}}function h(i){if(s)throw new TypeError("Generator is already executing.");for(;o&&(o=0,i[0]&&(r=0)),r;)try{if(s=1,n&&(a=i[0]&2?n.return:i[0]?n.throw||((a=n.return)&&a.call(n),0):n.next)&&!(a=a.call(n,i[1])).done)return a;switch(n=0,a&&(i=[i[0]&2,a.value]),i[0]){case 0:case 1:a=i;break;case 4:return r.label++,{value:i[1],done:!1};case 5:r.label++,n=i[1],i=[0];continue;case 7:i=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(i[0]===6||i[0]===2)){r=0;continue}if(i[0]===3&&(!a||i[1]>a[0]&&i[1]<a[3])){r.label=i[1];break}if(i[0]===6&&r.label<a[1]){r.label=a[1],a=i;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(i);break}a[2]&&r.ops.pop(),r.trys.pop();continue}i=e.call(t,r)}catch(c){i=[6,c],n=0}finally{s=a=0}if(i[0]&5)throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}function se(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&x(e,t,r)}function N(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],s=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&s>=t.length&&(t=void 0),{value:t&&t[s++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function k(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var s=r.call(t),n,a=[],o;try{for(;(e===void 0||e-- >0)&&!(n=s.next()).done;)a.push(n.value)}catch(l){o={error:l}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(o)throw o.error}}return a}function ae(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(k(arguments[e]));return t}function ne(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var s=Array(t),n=0,e=0;e<r;e++)for(var a=arguments[e],o=0,l=a.length;o<l;o++,n++)s[n]=a[o];return s}function oe(t,e,r){if(r||arguments.length===2)for(var s=0,n=e.length,a;s<n;s++)(a||!(s in e))&&(a||(a=Array.prototype.slice.call(e,0,s)),a[s]=e[s]);return t.concat(a||Array.prototype.slice.call(e))}function O(t){return this instanceof O?(this.v=t,this):new O(t)}function ie(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var s=r.apply(t,e||[]),n,a=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",o),n[Symbol.asyncIterator]=function(){return this},n;function o(d){return function(p){return Promise.resolve(p).then(d,u)}}function l(d,p){s[d]&&(n[d]=function(m){return new Promise(function(y,v){a.push([d,m,y,v])>1||h(d,m)})},p&&(n[d]=p(n[d])))}function h(d,p){try{i(s[d](p))}catch(m){f(a[0][3],m)}}function i(d){d.value instanceof O?Promise.resolve(d.value.v).then(c,u):f(a[0][2],d)}function c(d){h("next",d)}function u(d){h("throw",d)}function f(d,p){d(p),a.shift(),a.length&&h(a[0][0],a[0][1])}}function le(t){var e,r;return e={},s("next"),s("throw",function(n){throw n}),s("return"),e[Symbol.iterator]=function(){return this},e;function s(n,a){e[n]=t[n]?function(o){return(r=!r)?{value:O(t[n](o)),done:!1}:a?a(o):o}:a}}function ce(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof N=="function"?N(t):t[Symbol.iterator](),r={},s("next"),s("throw"),s("return"),r[Symbol.asyncIterator]=function(){return this},r);function s(a){r[a]=t[a]&&function(o){return new Promise(function(l,h){o=t[a](o),n(l,h,o.done,o.value)})}}function n(a,o,l,h){Promise.resolve(h).then(function(i){a({value:i,done:l})},o)}}function he(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function ue(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=L(t),s=0;s<r.length;s++)r[s]!=="default"&&x(e,t,r[s]);return we(e,t),e}function de(t){return t&&t.__esModule?t:{default:t}}function pe(t,e,r,s){if(r==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?s:r==="a"?s.call(t):s?s.value:e.get(t)}function fe(t,e,r,s,n){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r}function me(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function ye(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var s,n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");s=e[Symbol.asyncDispose]}if(s===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");s=e[Symbol.dispose],r&&(n=s)}if(typeof s!="function")throw new TypeError("Object not disposable.");n&&(s=function(){try{n.call(this)}catch(a){return Promise.reject(a)}}),t.stack.push({value:e,dispose:s,async:r})}else r&&t.stack.push({async:!0});return e}function ge(t){function e(a){t.error=t.hasError?new be(a,t.error,"An error was suppressed during disposal."):a,t.hasError=!0}var r,s=0;function n(){for(;r=t.stack.pop();)try{if(!r.async&&s===1)return s=0,t.stack.push(r),Promise.resolve().then(n);if(r.dispose){var a=r.dispose.call(r.value);if(r.async)return s|=2,Promise.resolve(a).then(n,function(o){return e(o),n()})}else s|=1}catch(o){e(o)}if(s===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return n()}function ve(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,s,n,a,o){return s?e?".jsx":".js":n&&(!a||!o)?r:n+a+"."+o.toLowerCase()+"js"}):t}var I,$,x,we,L,be,Ee,T=G(()=>{"use strict";g(),I=function(t,e){return I=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(r[n]=s[n])},I(t,e)},$=function(){return $=Object.assign||function(t){for(var e,r=1,s=arguments.length;r<s;r++){e=arguments[r];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])}return t},$.apply(this,arguments)},x=Object.create?(function(t,e,r,s){s===void 0&&(s=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,n)}):(function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]}),we=Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e},L=function(t){return L=Object.getOwnPropertyNames||function(e){var r=[];for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[r.length]=s);return r},L(t)},be=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var s=new Error(r);return s.name="SuppressedError",s.error=t,s.suppressed=e,s},Ee={__extends:W,__assign:$,__rest:J,__decorate:K,__param:V,__esDecorate:Y,__runInitializers:Q,__propKey:X,__setFunctionName:Z,__metadata:ee,__awaiter:te,__generator:re,__createBinding:x,__exportStar:se,__values:N,__read:k,__spread:ae,__spreadArrays:ne,__spreadArray:oe,__await:O,__asyncGenerator:ie,__asyncDelegator:le,__asyncValues:ce,__makeTemplateObject:he,__importStar:ue,__importDefault:de,__classPrivateFieldGet:pe,__classPrivateFieldSet:fe,__classPrivateFieldIn:me,__addDisposableResource:ye,__disposeResources:ge,__rewriteRelativeImportExtension:ve}}),_e=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=class extends Error{constructor(r){super(r.message),this.name="PostgrestError",this.details=r.details,this.hint=r.hint,this.code=r.code}};t.default=e}),Pe=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(P)),r=e.__importDefault(_e()),s=class{constructor(n){var a,o;this.shouldThrowOnError=!1,this.method=n.method,this.url=n.url,this.headers=new Headers(n.headers),this.schema=n.schema,this.body=n.body,this.shouldThrowOnError=(a=n.shouldThrowOnError)!==null&&a!==void 0?a:!1,this.signal=n.signal,this.isMaybeSingle=(o=n.isMaybeSingle)!==null&&o!==void 0?o:!1,n.fetch?this.fetch=n.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(n,a){return this.headers=new Headers(this.headers),this.headers.set(n,a),this}then(n,a){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");let o=this.fetch,l=o(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async h=>{var i,c,u,f;let d=null,p=null,m=null,y=h.status,v=h.statusText;if(h.ok){if(this.method!=="HEAD"){let U=await h.text();U===""||(this.headers.get("Accept")==="text/csv"||this.headers.get("Accept")&&!((i=this.headers.get("Accept"))===null||i===void 0)&&i.includes("application/vnd.pgrst.plan+text")?p=U:p=JSON.parse(U))}let b=(c=this.headers.get("Prefer"))===null||c===void 0?void 0:c.match(/count=(exact|planned|estimated)/),E=(u=h.headers.get("content-range"))===null||u===void 0?void 0:u.split("/");b&&E&&E.length>1&&(m=parseInt(E[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(p)&&(p.length>1?(d={code:"PGRST116",details:`Results contain ${p.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},p=null,m=null,y=406,v="Not Acceptable"):p.length===1?p=p[0]:p=null)}else{let b=await h.text();try{d=JSON.parse(b),Array.isArray(d)&&h.status===404&&(p=[],d=null,y=200,v="OK")}catch{h.status===404&&b===""?(y=204,v="No Content"):d={message:b}}if(d&&this.isMaybeSingle&&!((f=d?.details)===null||f===void 0)&&f.includes("0 rows")&&(d=null,y=200,v="OK"),d&&this.shouldThrowOnError)throw new r.default(d)}return{error:d,data:p,count:m,status:y,statusText:v}});return this.shouldThrowOnError||(l=l.catch(h=>{var i,c,u;return{error:{message:`${(i=h?.name)!==null&&i!==void 0?i:"FetchError"}: ${h?.message}`,details:`${(c=h?.stack)!==null&&c!==void 0?c:""}`,hint:"",code:`${(u=h?.code)!==null&&u!==void 0?u:""}`},data:null,count:null,status:0,statusText:""}})),l.then(n,a)}returns(){return this}overrideTypes(){return this}};t.default=s}),Oe=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(P)),r=e.__importDefault(Pe()),s=class extends r.default{select(n){let a=!1,o=(n??"*").split("").map(l=>/\s/.test(l)&&!a?"":(l==='"'&&(a=!a),l)).join("");return this.url.searchParams.set("select",o),this.headers.append("Prefer","return=representation"),this}order(n,{ascending:a=!0,nullsFirst:o,foreignTable:l,referencedTable:h=l}={}){let i=h?`${h}.order`:"order",c=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${c?`${c},`:""}${n}.${a?"asc":"desc"}${o===void 0?"":o?".nullsfirst":".nullslast"}`),this}limit(n,{foreignTable:a,referencedTable:o=a}={}){let l=typeof o>"u"?"limit":`${o}.limit`;return this.url.searchParams.set(l,`${n}`),this}range(n,a,{foreignTable:o,referencedTable:l=o}={}){let h=typeof l>"u"?"offset":`${l}.offset`,i=typeof l>"u"?"limit":`${l}.limit`;return this.url.searchParams.set(h,`${n}`),this.url.searchParams.set(i,`${a-n+1}`),this}abortSignal(n){return this.signal=n,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:n=!1,verbose:a=!1,settings:o=!1,buffers:l=!1,wal:h=!1,format:i="text"}={}){var c;let u=[n?"analyze":null,a?"verbose":null,o?"settings":null,l?"buffers":null,h?"wal":null].filter(Boolean).join("|"),f=(c=this.headers.get("Accept"))!==null&&c!==void 0?c:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${f}"; options=${u};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(n){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${n}`),this}};t.default=s}),D=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(P)),r=e.__importDefault(Oe()),s=new RegExp("[,()]"),n=class extends r.default{eq(a,o){return this.url.searchParams.append(a,`eq.${o}`),this}neq(a,o){return this.url.searchParams.append(a,`neq.${o}`),this}gt(a,o){return this.url.searchParams.append(a,`gt.${o}`),this}gte(a,o){return this.url.searchParams.append(a,`gte.${o}`),this}lt(a,o){return this.url.searchParams.append(a,`lt.${o}`),this}lte(a,o){return this.url.searchParams.append(a,`lte.${o}`),this}like(a,o){return this.url.searchParams.append(a,`like.${o}`),this}likeAllOf(a,o){return this.url.searchParams.append(a,`like(all).{${o.join(",")}}`),this}likeAnyOf(a,o){return this.url.searchParams.append(a,`like(any).{${o.join(",")}}`),this}ilike(a,o){return this.url.searchParams.append(a,`ilike.${o}`),this}ilikeAllOf(a,o){return this.url.searchParams.append(a,`ilike(all).{${o.join(",")}}`),this}ilikeAnyOf(a,o){return this.url.searchParams.append(a,`ilike(any).{${o.join(",")}}`),this}is(a,o){return this.url.searchParams.append(a,`is.${o}`),this}in(a,o){let l=Array.from(new Set(o)).map(h=>typeof h=="string"&&s.test(h)?`"${h}"`:`${h}`).join(",");return this.url.searchParams.append(a,`in.(${l})`),this}contains(a,o){return typeof o=="string"?this.url.searchParams.append(a,`cs.${o}`):Array.isArray(o)?this.url.searchParams.append(a,`cs.{${o.join(",")}}`):this.url.searchParams.append(a,`cs.${JSON.stringify(o)}`),this}containedBy(a,o){return typeof o=="string"?this.url.searchParams.append(a,`cd.${o}`):Array.isArray(o)?this.url.searchParams.append(a,`cd.{${o.join(",")}}`):this.url.searchParams.append(a,`cd.${JSON.stringify(o)}`),this}rangeGt(a,o){return this.url.searchParams.append(a,`sr.${o}`),this}rangeGte(a,o){return this.url.searchParams.append(a,`nxl.${o}`),this}rangeLt(a,o){return this.url.searchParams.append(a,`sl.${o}`),this}rangeLte(a,o){return this.url.searchParams.append(a,`nxr.${o}`),this}rangeAdjacent(a,o){return this.url.searchParams.append(a,`adj.${o}`),this}overlaps(a,o){return typeof o=="string"?this.url.searchParams.append(a,`ov.${o}`):this.url.searchParams.append(a,`ov.{${o.join(",")}}`),this}textSearch(a,o,{config:l,type:h}={}){let i="";h==="plain"?i="pl":h==="phrase"?i="ph":h==="websearch"&&(i="w");let c=l===void 0?"":`(${l})`;return this.url.searchParams.append(a,`${i}fts${c}.${o}`),this}match(a){return Object.entries(a).forEach(([o,l])=>{this.url.searchParams.append(o,`eq.${l}`)}),this}not(a,o,l){return this.url.searchParams.append(a,`not.${o}.${l}`),this}or(a,{foreignTable:o,referencedTable:l=o}={}){let h=l?`${l}.or`:"or";return this.url.searchParams.append(h,`(${a})`),this}filter(a,o,l){return this.url.searchParams.append(a,`${o}.${l}`),this}};t.default=n}),Se=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(P)),r=e.__importDefault(D()),s=class{constructor(n,{headers:a={},schema:o,fetch:l}){this.url=n,this.headers=new Headers(a),this.schema=o,this.fetch=l}select(n,a){let{head:o=!1,count:l}=a??{},h=o?"HEAD":"GET",i=!1,c=(n??"*").split("").map(u=>/\s/.test(u)&&!i?"":(u==='"'&&(i=!i),u)).join("");return this.url.searchParams.set("select",c),l&&this.headers.append("Prefer",`count=${l}`),new r.default({method:h,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch})}insert(n,{count:a,defaultToNull:o=!0}={}){var l;let h="POST";if(a&&this.headers.append("Prefer",`count=${a}`),o||this.headers.append("Prefer","missing=default"),Array.isArray(n)){let i=n.reduce((c,u)=>c.concat(Object.keys(u)),[]);if(i.length>0){let c=[...new Set(i)].map(u=>`"${u}"`);this.url.searchParams.set("columns",c.join(","))}}return new r.default({method:h,url:this.url,headers:this.headers,schema:this.schema,body:n,fetch:(l=this.fetch)!==null&&l!==void 0?l:fetch})}upsert(n,{onConflict:a,ignoreDuplicates:o=!1,count:l,defaultToNull:h=!0}={}){var i;let c="POST";if(this.headers.append("Prefer",`resolution=${o?"ignore":"merge"}-duplicates`),a!==void 0&&this.url.searchParams.set("on_conflict",a),l&&this.headers.append("Prefer",`count=${l}`),h||this.headers.append("Prefer","missing=default"),Array.isArray(n)){let u=n.reduce((f,d)=>f.concat(Object.keys(d)),[]);if(u.length>0){let f=[...new Set(u)].map(d=>`"${d}"`);this.url.searchParams.set("columns",f.join(","))}}return new r.default({method:c,url:this.url,headers:this.headers,schema:this.schema,body:n,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch})}update(n,{count:a}={}){var o;let l="PATCH";return a&&this.headers.append("Prefer",`count=${a}`),new r.default({method:l,url:this.url,headers:this.headers,schema:this.schema,body:n,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}delete({count:n}={}){var a;let o="DELETE";return n&&this.headers.append("Prefer",`count=${n}`),new r.default({method:o,url:this.url,headers:this.headers,schema:this.schema,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}};t.default=s}),Je=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0});var e=(T(),S(P)),r=e.__importDefault(Se()),s=e.__importDefault(D()),n=class Te{constructor(o,{headers:l={},schema:h,fetch:i}={}){this.url=o,this.headers=new Headers(l),this.schemaName=h,this.fetch=i}from(o){let l=new URL(`${this.url}/${o}`);return new r.default(l,{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(o){return new Te(this.url,{headers:this.headers,schema:o,fetch:this.fetch})}rpc(o,l={},{head:h=!1,get:i=!1,count:c}={}){var u;let f,d=new URL(`${this.url}/rpc/${o}`),p;h||i?(f=h?"HEAD":"GET",Object.entries(l).filter(([y,v])=>v!==void 0).map(([y,v])=>[y,Array.isArray(v)?`{${v.join(",")}}`:`${v}`]).forEach(([y,v])=>{d.searchParams.append(y,v)})):(f="POST",p=l);let m=new Headers(this.headers);return c&&m.set("Prefer",`count=${c}`),new s.default({method:f,url:d,headers:m,schema:this.schemaName,body:p,fetch:(u=this.fetch)!==null&&u!==void 0?u:fetch})}};t.default=n}),Ke=_(t=>{"use strict";g(),Object.defineProperty(t,"__esModule",{value:!0}),t.PostgrestError=t.PostgrestBuilder=t.PostgrestTransformBuilder=t.PostgrestFilterBuilder=t.PostgrestQueryBuilder=t.PostgrestClient=void 0;var e=(T(),S(P)),r=e.__importDefault(Je());t.PostgrestClient=r.default;var s=e.__importDefault(Se());t.PostgrestQueryBuilder=s.default;var n=e.__importDefault(D());t.PostgrestFilterBuilder=n.default;var a=e.__importDefault(Oe());t.PostgrestTransformBuilder=a.default;var o=e.__importDefault(Pe());t.PostgrestBuilder=o.default;var l=e.__importDefault(_e());t.PostgrestError=l.default,t.default={PostgrestClient:r.default,PostgrestQueryBuilder:s.default,PostgrestFilterBuilder:n.default,PostgrestTransformBuilder:a.default,PostgrestBuilder:o.default,PostgrestError:l.default}});g();g();var $e=class{constructor(t,e=""){this.http=t,this.baseUrl=e.replace(/\/$/,"")}async invoke(t,e){let r=this.baseUrl?`${this.baseUrl}/functions/${t}`:`/functions/${t}`;return await(await this.http.fetch(r,{method:e.method||"POST",body:e.body,headers:e.headers})).json()}};g();g();var Ve="nvwa_current_jwt";var it=typeof fetch<"u"?fetch:(()=>{throw new Error("AuthClient requires fetch")})();g();g();var w=class xe{constructor(e){if(this.headerMap=new Map,e){if(e instanceof xe)e.forEach((r,s)=>this.set(s,r));else if(Array.isArray(e))for(let[r,s]of e)this.set(r,String(s));else if(typeof e=="object")for(let r of Object.keys(e))this.set(r,String(e[r]))}}append(e,r){let s=e.toLowerCase(),n=this.headerMap.get(s);this.headerMap.set(s,n?`${n}, ${r}`:r)}set(e,r){this.headerMap.set(e.toLowerCase(),String(r))}get(e){return this.headerMap.get(e.toLowerCase())??null}has(e){return this.headerMap.has(e.toLowerCase())}delete(e){this.headerMap.delete(e.toLowerCase())}forEach(e){for(let[r,s]of this.headerMap.entries())e(s,r,this)}entries(){return this.headerMap.entries()}keys(){return this.headerMap.keys()}values(){return this.headerMap.values()}[Symbol.iterator](){return this.entries()}},Ie=class Le{constructor(e){if(this.params=new Map,e){if(typeof e=="string")this.parseString(e);else if(e instanceof Le)this.params=new Map(e.params);else if(Array.isArray(e))for(let[r,s]of e)this.append(r,s);else if(e&&typeof e=="object")for(let[r,s]of Object.entries(e))this.set(r,s)}}parseString(e){e.startsWith("?")&&(e=e.slice(1));let r=e.split("&");for(let s of r)if(s){let[n,a]=s.split("=");n&&this.append(decodeURIComponent(n),a?decodeURIComponent(a):"")}}append(e,r){let s=this.params.get(e)||[];s.push(r),this.params.set(e,s)}delete(e){this.params.delete(e)}get(e){let r=this.params.get(e);return r?r[0]:null}getAll(e){return this.params.get(e)||[]}has(e){return this.params.has(e)}set(e,r){this.params.set(e,[r])}sort(){let e=Array.from(this.params.entries()).sort(([r],[s])=>r.localeCompare(s));this.params=new Map(e)}toString(){let e=[];for(let[r,s]of this.params.entries())for(let n of s)e.push(`${encodeURIComponent(r)}=${encodeURIComponent(n)}`);return e.join("&")}forEach(e){for(let[r,s]of this.params.entries())for(let n of s)e(n,r,this)}keys(){return this.params.keys()}values(){let e=[];for(let r of this.params.values())e.push(...r);return e[Symbol.iterator]()}entries(){let e=[];for(let[r,s]of this.params.entries())for(let n of s)e.push([r,n]);return e[Symbol.iterator]()}[Symbol.iterator](){return this.entries()}get size(){return this.params.size}},Ye=class M{constructor(e,r){let s;if(e instanceof M)s=e.href;else if(r){let a=r instanceof M?r.href:r;s=this.resolve(a,e)}else s=e;let n=this.parseUrl(s);this.href=s,this.origin=`${n.protocol}//${n.host}`,this.protocol=n.protocol,this.username=n.username,this.password=n.password,this.host=n.host,this.hostname=n.hostname,this.port=n.port,this.pathname=n.pathname,this.search=n.search,this.searchParams=new Ie(n.search),this.hash=n.hash}resolve(e,r){if(r.startsWith("http://")||r.startsWith("https://"))return r;if(r.startsWith("//"))return`${this.parseUrl(e).protocol}${r}`;if(r.startsWith("/")){let a=this.parseUrl(e);return`${a.protocol}//${a.host}${r}`}let s=this.parseUrl(e),n=s.pathname.endsWith("/")?s.pathname:s.pathname+"/";return`${s.protocol}//${s.host}${n}${r}`}parseUrl(e){let r=e.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!r)throw new TypeError("Invalid URL");let s=r[2]||"",n=r[4]||"",a=r[5]||"/",o=r[7]?`?${r[7]}`:"",l=r[9]?`#${r[9]}`:"";if(!s&&!n&&!a.startsWith("/")&&!a.includes("/")&&!a.includes("."))throw new TypeError("Invalid URL");let h=n.match(/^([^@]*)@(.+)$/),i="",c="",u=n;if(h){let m=h[1];u=h[2];let y=m.match(/^([^:]*):?(.*)$/);y&&(i=y[1]||"",c=y[2]||"")}let f=u.match(/^([^:]+):?(\d*)$/),d=f?f[1]:u,p=f&&f[2]?f[2]:"";return{protocol:s?`${s}:`:"",username:i,password:c,host:u,hostname:d,port:p,pathname:a,search:o,hash:l}}toString(){let e=this.searchParams.toString(),r=e?`?${e}`:"";return`${this.protocol}//${this.host}${this.pathname}${r}${this.hash}`}toJSON(){return this.toString()}};g();var Qe=class Ne{constructor(e,r){if(typeof e=="string")this.url=e;else if(e?.url)this.url=String(e.url);else if(typeof e?.toString=="function")this.url=String(e.toString());else throw new Error("Invalid input for Request");this.method=(r?.method||"GET").toUpperCase(),this.headers=r?.headers instanceof w?r.headers:new w(r?.headers),this.body=r?.body,this.timeout=r?.timeout,this.signal=r?.signal||void 0}clone(){return new Ne(this.url,{method:this.method,headers:this.headers,body:this.body,timeout:this.timeout})}toString(){return this.url}};g();var F=class{constructor(t,e){this.bodyData=t,this.status=e?.status??200,this.statusText=e?.statusText??"",this.headers=Xe(e?.headers),this.ok=this.status>=200&&this.status<300}async text(){return typeof this.bodyData=="string"?this.bodyData:this.bodyData==null?"":typeof this.bodyData=="object"?JSON.stringify(this.bodyData):String(this.bodyData)}async json(){if(typeof this.bodyData=="string")try{return JSON.parse(this.bodyData)}catch{}return this.bodyData}async arrayBuffer(){let t=await this.text();return new TextEncoder().encode(t).buffer}};function Xe(t){return t?new w(t):new w}g();var je=class{constructor(){this._aborted=!1,this.listeners=new Set,this.onabort=null}get aborted(){return this._aborted}_trigger(){if(!this._aborted){if(this._aborted=!0,typeof this.onabort=="function")try{this.onabort()}catch{}for(let t of Array.from(this.listeners))try{t()}catch{}this.listeners.clear()}}addEventListener(t,e){if(this._aborted){try{e()}catch{}return}this.listeners.add(e)}removeEventListener(t,e){this.listeners.delete(e)}toString(){return"[object AbortSignal]"}},Ze=class{constructor(){this._signal=new je}get signal(){return this._signal}abort(){this._signal._trigger()}toString(){return"[object AbortController]"}};g();function et(t){t.URL=Ye,t.URLSearchParams=Ie,t.Headers=w,t.Request=Qe,t.Response=F,t.AbortController=Ze,t.AbortSignal=je}var Ae=class{constructor(t,e,r){console.log("NvwaHttpClient constructor",t,e,r),this.storage=t,this.customFetch=e,this.handleUnauthorized=r}async fetch(t,e){return await this.customFetch(t,e)}async fetchWithAuth(t,e){let r=await this.storage.get(Ve),s=new w(e?.headers);r&&s.set("Authorization",`Bearer ${r}`);let n=e?.method||"GET";if((n==="POST"||n==="PUT"||n==="PATCH")&&e?.body){let o=s.get("Content-Type");(!o||o.includes("text/plain"))&&s.set("Content-Type","application/json")}let a=await this.customFetch(t,{...e,headers:s});if(a.status===401)throw this.handleUnauthorized(),new Error("\u672A\u767B\u5F55");return a}};g();var tt="/storage",rt=tt+"/generateUploadUrl",Ce=class{constructor(t,e){this.baseUrl=t,this.http=e}async uploadFile(t){let e=await this.http.fetch(this.baseUrl+rt,{method:"POST",body:{fileName:t.name||t.fileName,fileSize:t.size||t.fileSize,fileType:t.type||t.fileType}}),{url:r}=await e.json();if(!r)throw new Error("\u83B7\u53D6\u4E0A\u4F20URL\u5931\u8D25");let s=await this.http.fetch(r,{method:"PUT",body:t,headers:new w({"Content-Type":t.type||t.fileType||"application/octet-stream"})}),{url:n}=await s.json();return{url:n.split("?")[0]}}};g();g();g();var q=We(Ke(),1),{PostgrestClient:st,PostgrestQueryBuilder:lt,PostgrestFilterBuilder:ct,PostgrestTransformBuilder:ht,PostgrestBuilder:ut,PostgrestError:dt}=q.default||q,at="/entities",Re=(t,e)=>new st(t+at,{fetch:e.fetchWithAuth.bind(e)});g();var He=class{constructor(t,e){this.baseUrl=t,this.http=e}async execute(t,e){let r=`${this.baseUrl}/capability/${t}/execute`,s=await(await this.http.fetchWithAuth(r,{method:"POST",body:e?JSON.stringify(e):void 0,timeout:6e5})).json();if(s.status!==200)throw new Error(s.message);return s.data}};g();var Ue=class{constructor(t,e){this.baseUrl=t,this.http=e}async execute(t,e){let r=`${this.baseUrl}/capability/${t}/execute`,s=await(await this.http.fetchWithAuth(r,{method:"POST",body:e!=null?JSON.stringify(e):void 0,timeout:6e5})).json();if(s.status!==200)throw new Error(s.message);return s.data}};g();var Me=class{constructor(){this.hoverOverlay=null,this.selectedOverlay=null,this.tooltip=null,this.hoverElement=null,this.selectedElement=null,this.hoverUpdateHandler=null,this.selectedUpdateHandler=null,this.createStyles()}createStyles(){if(document.getElementById("__nvwa-inspector-overlay-style"))return;let t=document.createElement("style");t.id="__nvwa-inspector-overlay-style",t.textContent=`
2
2
  .__nvwa-inspector-overlay {
3
3
  position: absolute;
4
4
  pointer-events: none;
@@ -30,4 +30,4 @@ var De=Object.create,N=Object.defineProperty,Fe=Object.getOwnPropertyDescriptor,
30
30
  max-width: 400px;
31
31
  word-break: break-all;
32
32
  }
33
- `,document.head.appendChild(t)}createTooltip(){return this.tooltip?this.tooltip:(this.tooltip=document.createElement("div"),this.tooltip.id="__nvwa-inspector-tooltip",document.body.appendChild(this.tooltip),this.tooltip)}createOverlay(t){let e=document.createElement("div");return e.className=`__nvwa-inspector-overlay __nvwa-inspector-overlay-${t}`,document.body.appendChild(e),e}updateOverlayPosition(t,e){if(!e.isConnected)return;let r=e.getBoundingClientRect(),s=window.scrollX||window.pageXOffset,n=window.scrollY||window.pageYOffset;r.width>0&&r.height>0?(t.style.left=`${r.left+s}px`,t.style.top=`${r.top+n}px`,t.style.width=`${r.width}px`,t.style.height=`${r.height}px`,t.style.display="block"):t.style.display="none"}removeOverlay(t){t&&t.parentNode&&t.parentNode.removeChild(t)}highlightElement(t,e){if(!t.isConnected)return;if(this.hoverElement===t&&this.hoverOverlay){this.updateOverlayPosition(this.hoverOverlay,t);let o=this.createTooltip();e?o.textContent=e:o.textContent=`<${t.tagName.toLowerCase()}> (\u65E0 source location)`,o.style.display="block";let l=t.getBoundingClientRect();o.style.left=`${l.left+window.scrollX}px`,o.style.top=`${l.top+window.scrollY-o.offsetHeight-8}px`,l.top<o.offsetHeight+8&&(o.style.top=`${l.bottom+window.scrollY+8}px`);return}this.hoverOverlay&&(this.removeOverlay(this.hoverOverlay),this.hoverOverlay=null);let r=this.createOverlay("hover");this.updateOverlayPosition(r,t),this.hoverOverlay=r,this.hoverElement=t;let s=()=>{this.hoverOverlay&&this.hoverElement&&this.hoverElement.isConnected&&this.updateOverlayPosition(this.hoverOverlay,this.hoverElement)};this.hoverUpdateHandler&&(window.removeEventListener("scroll",this.hoverUpdateHandler,!0),window.removeEventListener("resize",this.hoverUpdateHandler)),this.hoverUpdateHandler=s,window.addEventListener("scroll",s,!0),window.addEventListener("resize",s);let n=this.createTooltip();e?n.textContent=e:n.textContent=`<${t.tagName.toLowerCase()}> (\u65E0 source location)`,n.style.display="block";let a=t.getBoundingClientRect();n.style.left=`${a.left+window.scrollX}px`,n.style.top=`${a.top+window.scrollY-n.offsetHeight-8}px`,a.top<n.offsetHeight+8&&(n.style.top=`${a.bottom+window.scrollY+8}px`)}selectElement(t,e){if(!t.isConnected)return;if(this.selectedElement===t&&this.selectedOverlay){this.updateOverlayPosition(this.selectedOverlay,t);return}this.selectedOverlay&&(this.removeOverlay(this.selectedOverlay),this.selectedOverlay=null);let r=this.createOverlay("selected");this.updateOverlayPosition(r,t),this.selectedOverlay=r,this.selectedElement=t;let s=()=>{this.selectedOverlay&&this.selectedElement&&this.selectedElement.isConnected&&this.updateOverlayPosition(this.selectedOverlay,this.selectedElement)};this.selectedUpdateHandler&&(window.removeEventListener("scroll",this.selectedUpdateHandler,!0),window.removeEventListener("resize",this.selectedUpdateHandler)),this.selectedUpdateHandler=s,window.addEventListener("scroll",s,!0),window.addEventListener("resize",s)}removeHighlight(){this.hoverOverlay&&(this.removeOverlay(this.hoverOverlay),this.hoverOverlay=null),this.hoverElement&&(this.hoverElement=null),this.tooltip&&(this.tooltip.style.display="none"),this.hoverUpdateHandler&&(window.removeEventListener("scroll",this.hoverUpdateHandler,!0),window.removeEventListener("resize",this.hoverUpdateHandler),this.hoverUpdateHandler=null)}clearSelection(){this.selectedOverlay&&(this.removeOverlay(this.selectedOverlay),this.selectedOverlay=null),this.selectedElement&&(this.selectedElement=null),this.selectedUpdateHandler&&(window.removeEventListener("scroll",this.selectedUpdateHandler,!0),window.removeEventListener("resize",this.selectedUpdateHandler),this.selectedUpdateHandler=null)}cleanup(){this.removeHighlight(),this.clearSelection(),this.tooltip&&this.tooltip.parentNode&&(this.tooltip.parentNode.removeChild(this.tooltip),this.tooltip=null);let t=document.getElementById("__nvwa-inspector-overlay-style");t&&t.parentNode&&t.parentNode.removeChild(t)}};function Ue(t="root"){if(typeof document>"u")return null;let e=document.getElementById(t)||document.body;if(!e)return null;let r=e.querySelector("[data-source-location]");if(r){let s=r.getAttribute("data-source-location");if(s)return s}if(e.firstElementChild){let s=e.firstElementChild.getAttribute("data-source-location");if(s)return s}return null}g();var pt=typeof fetch<"u"?fetch:(()=>{throw new Error("payment client requires fetch")})();var R=class{constructor(){this.prefix="nvwa_"}getKey(e){return`${this.prefix}${e}`}async get(e){try{let r=this.getKey(e),s=uni.getStorageSync(r);return s?s.expires&&Date.now()>s.expires?(await this.remove(e),null):s.value:null}catch(r){return console.error("UniAppStorageService get error:",r),null}}async set(e,r,s){try{let n=this.getKey(e),a={value:r,expires:s?Date.now()+s*1e3:null,timestamp:Date.now()};uni.setStorageSync(n,a)}catch(n){throw console.error("UniAppStorageService set error:",n),n}}async remove(e){try{let r=this.getKey(e);uni.removeStorageSync(r)}catch(r){throw console.error("UniAppStorageService remove error:",r),r}}async clear(){try{uni.clearStorageSync()}catch(e){throw console.error("UniAppStorageService clear error:",e),e}}};var H=(t,e)=>{let r;if(typeof t=="string")r=t;else if(t&&typeof t.toString=="function")r=t.toString();else if(t?.url)r=t.url;else throw new Error("Invalid input for uniappFetch");let s=(e?.method||"GET").toUpperCase(),n={};if(e?.headers){let l=e.headers;if(typeof l?.forEach=="function")l.forEach((h,i)=>{n[i]=h});else if(Array.isArray(l))for(let[h,i]of l)n[h]=i;else Object.assign(n,l)}let a;if(e?.body!==void 0){let l=e.body;if(typeof l=="string")a=l;else if(l&&typeof l=="object"&&typeof l.forEach=="function"){let h={};l.forEach((i,c)=>{h[c]=i}),a=h}else a=l}let o=e?.timeout||3e4;return new Promise((l,h)=>{let i=e?.signal;if(i?.aborted){let d=new Error("The operation was aborted");d.name="AbortError",h(d);return}let c=!1,u=[],f=uni.request({url:r,method:s,data:a,header:n,timeout:o,success:d=>{if(c)return;c=!0;let p=d.statusCode,m="",y=new w,v=d.header||d.headers||{};Object.keys(v).forEach(b=>{let E=v[b];y.set(b,typeof E=="string"?E:String(E))}),l(new F(d.data,{status:p,statusText:m,headers:y}))},fail:d=>{if(c)return;c=!0;let p=d?.errMsg||d?.message||"Network Error",m=new Error(p);/(abort|aborted|canceled|cancelled)/i.test(String(p))&&(m.name="AbortError"),h(m)}});if(i&&typeof i.addEventListener=="function"){let d=()=>{if(c)return;try{f?.abort?.()}catch{}let p=new Error("The operation was aborted");p.name="AbortError",c=!0,h(p)};i.addEventListener("abort",d),u.push(()=>{try{i.removeEventListener?.("abort",d)}catch{}})}})};typeof globalThis.fetch!="function"&&(globalThis.fetch=H);function Ft(){if(typeof window>"u"||window===window.parent)return;let t=!1,e=new ke;function r(i){if(!i)return!1;let c=i.toLowerCase();return c.includes("/components/")||c.includes("\\components\\")}function s(i){let c=i,u=null;for(;c;){let f=c.getAttribute("data-source-location");if(f)if(r(f)){u||(u=f),c=c.parentElement;continue}else return f;c=c.parentElement}return u}let n=null;function a(i){t&&(n!==null&&cancelAnimationFrame(n),n=requestAnimationFrame(()=>{let c=i.target;if(!c||c===document.body||c===document.documentElement){e.removeHighlight();return}if(c.tagName.toLowerCase()==="img"){let p=s(c);e.highlightElement(c,p);let m={type:"HOVER_INSPECTOR_ELEMENT_HOVER",sourceLocation:p,elementInfo:{tagName:c.tagName.toLowerCase(),className:c.className||"",id:c.id||""}};window.parent.postMessage(m,"*");return}let u=c,f=s(c);if(!f){let p=c.parentElement;for(;p&&p!==document.body&&p!==document.documentElement;){let m=s(p);if(m){u=p,f=m;break}p=p.parentElement}}e.highlightElement(u,f);let d={type:"HOVER_INSPECTOR_ELEMENT_HOVER",sourceLocation:f,elementInfo:{tagName:u.tagName.toLowerCase(),className:u.className||"",id:u.id||""}};window.parent.postMessage(d,"*")}))}function o(){if(!t)return;e.removeHighlight();let i={type:"HOVER_INSPECTOR_ELEMENT_LEAVE"};window.parent.postMessage(i,"*")}function l(i){if(!t)return;i.preventDefault(),i.stopPropagation();let c=i.target;if(!c||c===document.body||c===document.documentElement)return;let u=s(c);e.selectElement(c,u);let f={type:"HOVER_INSPECTOR_ELEMENT_SELECT",sourceLocation:u,elementInfo:{tagName:c.tagName.toLowerCase(),className:c.className||"",id:c.id||""}};window.parent.postMessage(f,"*")}function h(i){i.data?.type==="HOVER_INSPECTOR_ENABLE"?(t=!0,document.addEventListener("mousemove",a),document.addEventListener("mouseleave",o),document.addEventListener("click",l,!0)):i.data?.type==="HOVER_INSPECTOR_DISABLE"&&(t=!1,document.removeEventListener("mousemove",a),document.removeEventListener("mouseleave",o),document.removeEventListener("click",l,!0),e.removeHighlight(),e.clearSelection())}return window.addEventListener("message",h),()=>{window.removeEventListener("message",h),document.removeEventListener("mousemove",a),document.removeEventListener("mouseleave",o),document.removeEventListener("click",l,!0),e.cleanup()}}function Bt(t,e){if(!t||!t.contentWindow)throw new Error("Invalid iframe element");let r={type:"HOVER_INSPECTOR_ENABLE"};t.contentWindow.postMessage(r,e)}function qt(t,e){if(!t||!t.contentWindow)return;let r={type:"HOVER_INSPECTOR_DISABLE"};t.contentWindow.postMessage(r,e)}function Gt(t,e,r=5e3){return new Promise((s,n)=>{if(!t||!t.contentWindow){n(new Error("Invalid iframe element"));return}let a=`source-location-${Date.now()}-${Math.random()}`,o=setTimeout(()=>{window.removeEventListener("message",l),n(new Error("Request timeout"))},r),l=i=>{i.origin===e&&i.data?.type==="GET_SOURCE_LOCATION_RESPONSE"&&i.data?.requestId===a&&(clearTimeout(o),window.removeEventListener("message",l),i.data.error?n(new Error(i.data.error)):s(i.data.sourceLocation||null))};window.addEventListener("message",l);let h={type:"GET_SOURCE_LOCATION_REQUEST",requestId:a};try{t.contentWindow.postMessage(h,e)}catch(i){clearTimeout(o),window.removeEventListener("message",l),n(i)}})}function zt(){if(typeof window>"u"||window===window.parent)return;let t=e=>{if(e.data?.type==="GET_SOURCE_LOCATION_REQUEST")try{let s={type:"GET_SOURCE_LOCATION_RESPONSE",sourceLocation:nt(),requestId:e.data.requestId};window.parent.postMessage(s,e.origin)}catch(r){let s={type:"GET_SOURCE_LOCATION_RESPONSE",sourceLocation:null,error:r instanceof Error?r.message:"Unknown error",requestId:e.data.requestId};window.parent.postMessage(s,e.origin)}};return window.addEventListener("message",t),()=>{window.removeEventListener("message",t)}}function nt(){return Ue("app")}var ot=new R,B=class{constructor(e,r){this.httpClient=new Ie(ot,H,r),this.fileStorage=new Ne(e,this.httpClient),this.entities=Re(e,this.httpClient),this.functions=new $e(this.httpClient,e),this.skill=new He(e,this.httpClient),this.capability=new Me(e,this.httpClient)}};export{B as default,qt as disableIframeHoverInspector,Bt as enableIframeHoverInspector,Gt as getIframeSourceLocation,ot as localStorage,et as polyfill,Ft as setupIframeHoverInspector,zt as setupIframeSourceLocationListener,H as uniappFetch};
33
+ `,document.head.appendChild(t)}createTooltip(){return this.tooltip?this.tooltip:(this.tooltip=document.createElement("div"),this.tooltip.id="__nvwa-inspector-tooltip",document.body.appendChild(this.tooltip),this.tooltip)}createOverlay(t){let e=document.createElement("div");return e.className=`__nvwa-inspector-overlay __nvwa-inspector-overlay-${t}`,document.body.appendChild(e),e}updateOverlayPosition(t,e){if(!e.isConnected)return;let r=e.getBoundingClientRect(),s=window.scrollX||window.pageXOffset,n=window.scrollY||window.pageYOffset;r.width>0&&r.height>0?(t.style.left=`${r.left+s}px`,t.style.top=`${r.top+n}px`,t.style.width=`${r.width}px`,t.style.height=`${r.height}px`,t.style.display="block"):t.style.display="none"}removeOverlay(t){t&&t.parentNode&&t.parentNode.removeChild(t)}highlightElement(t,e){if(!t.isConnected)return;if(this.hoverElement===t&&this.hoverOverlay){this.updateOverlayPosition(this.hoverOverlay,t);let o=this.createTooltip();e?o.textContent=e:o.textContent=`<${t.tagName.toLowerCase()}> (\u65E0 source location)`,o.style.display="block";let l=t.getBoundingClientRect();o.style.left=`${l.left+window.scrollX}px`,o.style.top=`${l.top+window.scrollY-o.offsetHeight-8}px`,l.top<o.offsetHeight+8&&(o.style.top=`${l.bottom+window.scrollY+8}px`);return}this.hoverOverlay&&(this.removeOverlay(this.hoverOverlay),this.hoverOverlay=null);let r=this.createOverlay("hover");this.updateOverlayPosition(r,t),this.hoverOverlay=r,this.hoverElement=t;let s=()=>{this.hoverOverlay&&this.hoverElement&&this.hoverElement.isConnected&&this.updateOverlayPosition(this.hoverOverlay,this.hoverElement)};this.hoverUpdateHandler&&(window.removeEventListener("scroll",this.hoverUpdateHandler,!0),window.removeEventListener("resize",this.hoverUpdateHandler)),this.hoverUpdateHandler=s,window.addEventListener("scroll",s,!0),window.addEventListener("resize",s);let n=this.createTooltip();e?n.textContent=e:n.textContent=`<${t.tagName.toLowerCase()}> (\u65E0 source location)`,n.style.display="block";let a=t.getBoundingClientRect();n.style.left=`${a.left+window.scrollX}px`,n.style.top=`${a.top+window.scrollY-n.offsetHeight-8}px`,a.top<n.offsetHeight+8&&(n.style.top=`${a.bottom+window.scrollY+8}px`)}selectElement(t,e){if(!t.isConnected)return;if(this.selectedElement===t&&this.selectedOverlay){this.updateOverlayPosition(this.selectedOverlay,t);return}this.selectedOverlay&&(this.removeOverlay(this.selectedOverlay),this.selectedOverlay=null);let r=this.createOverlay("selected");this.updateOverlayPosition(r,t),this.selectedOverlay=r,this.selectedElement=t;let s=()=>{this.selectedOverlay&&this.selectedElement&&this.selectedElement.isConnected&&this.updateOverlayPosition(this.selectedOverlay,this.selectedElement)};this.selectedUpdateHandler&&(window.removeEventListener("scroll",this.selectedUpdateHandler,!0),window.removeEventListener("resize",this.selectedUpdateHandler)),this.selectedUpdateHandler=s,window.addEventListener("scroll",s,!0),window.addEventListener("resize",s)}removeHighlight(){this.hoverOverlay&&(this.removeOverlay(this.hoverOverlay),this.hoverOverlay=null),this.hoverElement&&(this.hoverElement=null),this.tooltip&&(this.tooltip.style.display="none"),this.hoverUpdateHandler&&(window.removeEventListener("scroll",this.hoverUpdateHandler,!0),window.removeEventListener("resize",this.hoverUpdateHandler),this.hoverUpdateHandler=null)}clearSelection(){this.selectedOverlay&&(this.removeOverlay(this.selectedOverlay),this.selectedOverlay=null),this.selectedElement&&(this.selectedElement=null),this.selectedUpdateHandler&&(window.removeEventListener("scroll",this.selectedUpdateHandler,!0),window.removeEventListener("resize",this.selectedUpdateHandler),this.selectedUpdateHandler=null)}cleanup(){this.removeHighlight(),this.clearSelection(),this.tooltip&&this.tooltip.parentNode&&(this.tooltip.parentNode.removeChild(this.tooltip),this.tooltip=null);let t=document.getElementById("__nvwa-inspector-overlay-style");t&&t.parentNode&&t.parentNode.removeChild(t)}};function ke(t="root"){if(typeof document>"u")return null;let e=document.getElementById(t)||document.body;if(!e)return null;let r=e.querySelector("[data-source-location]");if(r){let s=r.getAttribute("data-source-location");if(s)return s}if(e.firstElementChild){let s=e.firstElementChild.getAttribute("data-source-location");if(s)return s}return null}g();var pt=typeof fetch<"u"?fetch:(()=>{throw new Error("payment client requires fetch")})();var R=class{constructor(){this.prefix="nvwa_"}getKey(e){return`${this.prefix}${e}`}async get(e){try{let r=this.getKey(e),s=uni.getStorageSync(r);return s?s.expires&&Date.now()>s.expires?(await this.remove(e),null):s.value:null}catch(r){return console.error("UniAppStorageService get error:",r),null}}async set(e,r,s){try{let n=this.getKey(e),a={value:r,expires:s?Date.now()+s*1e3:null,timestamp:Date.now()};uni.setStorageSync(n,a)}catch(n){throw console.error("UniAppStorageService set error:",n),n}}async remove(e){try{let r=this.getKey(e);uni.removeStorageSync(r)}catch(r){throw console.error("UniAppStorageService remove error:",r),r}}async clear(){try{uni.clearStorageSync()}catch(e){throw console.error("UniAppStorageService clear error:",e),e}}};var H=(t,e)=>{let r;if(typeof t=="string")r=t;else if(t&&typeof t.toString=="function")r=t.toString();else if(t?.url)r=t.url;else throw new Error("Invalid input for uniappFetch");let s=(e?.method||"GET").toUpperCase(),n={};if(e?.headers){let l=e.headers;if(typeof l?.forEach=="function")l.forEach((h,i)=>{n[i]=h});else if(Array.isArray(l))for(let[h,i]of l)n[h]=i;else Object.assign(n,l)}let a;if(e?.body!==void 0){let l=e.body;if(typeof l=="string")a=l;else if(l&&typeof l=="object"&&typeof l.forEach=="function"){let h={};l.forEach((i,c)=>{h[c]=i}),a=h}else a=l}let o=e?.timeout||3e4;return new Promise((l,h)=>{let i=e?.signal;if(i?.aborted){let d=new Error("The operation was aborted");d.name="AbortError",h(d);return}let c=!1,u=[],f=uni.request({url:r,method:s,data:a,header:n,timeout:o,success:d=>{if(c)return;c=!0;let p=d.statusCode,m="",y=new w,v=d.header||d.headers||{};Object.keys(v).forEach(b=>{let E=v[b];y.set(b,typeof E=="string"?E:String(E))}),l(new F(d.data,{status:p,statusText:m,headers:y}))},fail:d=>{if(c)return;c=!0;let p=d?.errMsg||d?.message||"Network Error",m=new Error(p);/(abort|aborted|canceled|cancelled)/i.test(String(p))&&(m.name="AbortError"),h(m)}});if(i&&typeof i.addEventListener=="function"){let d=()=>{if(c)return;try{f?.abort?.()}catch{}let p=new Error("The operation was aborted");p.name="AbortError",c=!0,h(p)};i.addEventListener("abort",d),u.push(()=>{try{i.removeEventListener?.("abort",d)}catch{}})}})};typeof globalThis.fetch!="function"&&(globalThis.fetch=H);function Ft(){if(typeof window>"u"||window===window.parent)return;let t=!1,e=new Me;function r(i){if(!i)return!1;let c=i.toLowerCase();return c.includes("/components/")||c.includes("\\components\\")}function s(i){let c=i,u=null;for(;c;){let f=c.getAttribute("data-source-location");if(f)if(r(f)){u||(u=f),c=c.parentElement;continue}else return f;c=c.parentElement}return u}let n=null;function a(i){t&&(n!==null&&cancelAnimationFrame(n),n=requestAnimationFrame(()=>{let c=i.target;if(!c||c===document.body||c===document.documentElement){e.removeHighlight();return}if(c.tagName.toLowerCase()==="img"){let p=s(c);e.highlightElement(c,p);let m={type:"HOVER_INSPECTOR_ELEMENT_HOVER",sourceLocation:p,elementInfo:{tagName:c.tagName.toLowerCase(),className:c.className||"",id:c.id||""}};window.parent.postMessage(m,"*");return}let u=c,f=s(c);if(!f){let p=c.parentElement;for(;p&&p!==document.body&&p!==document.documentElement;){let m=s(p);if(m){u=p,f=m;break}p=p.parentElement}}e.highlightElement(u,f);let d={type:"HOVER_INSPECTOR_ELEMENT_HOVER",sourceLocation:f,elementInfo:{tagName:u.tagName.toLowerCase(),className:u.className||"",id:u.id||""}};window.parent.postMessage(d,"*")}))}function o(){if(!t)return;e.removeHighlight();let i={type:"HOVER_INSPECTOR_ELEMENT_LEAVE"};window.parent.postMessage(i,"*")}function l(i){if(!t)return;i.preventDefault(),i.stopPropagation();let c=i.target;if(!c||c===document.body||c===document.documentElement)return;let u=s(c);e.selectElement(c,u);let f={type:"HOVER_INSPECTOR_ELEMENT_SELECT",sourceLocation:u,elementInfo:{tagName:c.tagName.toLowerCase(),className:c.className||"",id:c.id||""}};window.parent.postMessage(f,"*")}function h(i){i.data?.type==="HOVER_INSPECTOR_ENABLE"?(t=!0,document.addEventListener("mousemove",a),document.addEventListener("mouseleave",o),document.addEventListener("click",l,!0)):i.data?.type==="HOVER_INSPECTOR_DISABLE"&&(t=!1,document.removeEventListener("mousemove",a),document.removeEventListener("mouseleave",o),document.removeEventListener("click",l,!0),e.removeHighlight(),e.clearSelection())}return window.addEventListener("message",h),()=>{window.removeEventListener("message",h),document.removeEventListener("mousemove",a),document.removeEventListener("mouseleave",o),document.removeEventListener("click",l,!0),e.cleanup()}}function Bt(t,e){if(!t||!t.contentWindow)throw new Error("Invalid iframe element");let r={type:"HOVER_INSPECTOR_ENABLE"};t.contentWindow.postMessage(r,e)}function qt(t,e){if(!t||!t.contentWindow)return;let r={type:"HOVER_INSPECTOR_DISABLE"};t.contentWindow.postMessage(r,e)}function Gt(t,e,r=5e3){return new Promise((s,n)=>{if(!t||!t.contentWindow){n(new Error("Invalid iframe element"));return}let a=`source-location-${Date.now()}-${Math.random()}`,o=setTimeout(()=>{window.removeEventListener("message",l),n(new Error("Request timeout"))},r),l=i=>{i.origin===e&&i.data?.type==="GET_SOURCE_LOCATION_RESPONSE"&&i.data?.requestId===a&&(clearTimeout(o),window.removeEventListener("message",l),i.data.error?n(new Error(i.data.error)):s(i.data.sourceLocation||null))};window.addEventListener("message",l);let h={type:"GET_SOURCE_LOCATION_REQUEST",requestId:a};try{t.contentWindow.postMessage(h,e)}catch(i){clearTimeout(o),window.removeEventListener("message",l),n(i)}})}function zt(){if(typeof window>"u"||window===window.parent)return;let t=e=>{if(e.data?.type==="GET_SOURCE_LOCATION_REQUEST")try{let s={type:"GET_SOURCE_LOCATION_RESPONSE",sourceLocation:nt(),requestId:e.data.requestId};window.parent.postMessage(s,e.origin)}catch(r){let s={type:"GET_SOURCE_LOCATION_RESPONSE",sourceLocation:null,error:r instanceof Error?r.message:"Unknown error",requestId:e.data.requestId};window.parent.postMessage(s,e.origin)}};return window.addEventListener("message",t),()=>{window.removeEventListener("message",t)}}function nt(){return ke("app")}var ot=new R,B=class{constructor(e,r){this.httpClient=new Ae(ot,H,r),this.fileStorage=new Ce(e,this.httpClient),this.entities=Re(e,this.httpClient),this.functions=new $e(this.httpClient,e),this.skill=new He(e,this.httpClient),this.capability=new Ue(e,this.httpClient)}};export{B as default,qt as disableIframeHoverInspector,Bt as enableIframeHoverInspector,Gt as getIframeSourceLocation,ot as localStorage,et as polyfill,Ft as setupIframeHoverInspector,zt as setupIframeSourceLocationListener,H as uniappFetch};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nvwa-app/sdk-uniapp",
3
- "version": "6.0.11",
3
+ "version": "6.0.12",
4
4
  "description": "NVWA跨端通用工具类UniApp端实现",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",