Repository navigation
Expand file tree
/
Copy pathperspective-WL7AKPVV.js
More file actions
3 lines (3 loc) · 50.1 KB
/
Copy pathperspective-WL7AKPVV.js
File metadata and controls
3 lines (3 loc) · 50.1 KB
1
2
3
import"/chunk-YJSVEN5S.js";var Ue=Object.defineProperty,We=(t,e)=>{for(var n in e)Ue(t,n,{get:e[n],enumerable:!0})};function Me(t,e){let n;async function _(l,s){if(s.data.cmd==="init")try{n=new t.VirtualServer(e),s.data.id!==void 0?l.postMessage({id:s.data.id}):l.postMessage(null)}catch(u){throw console.error("Error initializing worker:",u),u}else try{let u=new Uint8Array(s.data),g=(await n.handleRequest(u)).slice().buffer;l.postMessage(g,{transfer:[g]})}catch(u){throw console.error("Error handling request in worker:",u),u}}let i=new MessageChannel;return i.port1.onmessage=l=>{_(i.port1,l)},i.port2}var we={};We(we,{Client:()=>P,GenericSQLVirtualServerModel:()=>H,ProxySession:()=>V,Table:()=>$,View:()=>W,VirtualDataSlice:()=>L,VirtualServer:()=>G,default:()=>ke,init:()=>he,initSync:()=>Ze});var P=class de{static __wrap(e){e=e>>>0;let n=Object.create(de.prototype);return n.__wbg_ptr=e,K.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,K.unregister(this),e}free(){let e=this.__destroy_into_raw();r.__wbg_client_free(e,0)}__getClassname(){try{let i=r.__wbindgen_add_to_stack_pointer(-16);r.client___getClassname(i,this.__wbg_ptr);var e=c().getInt32(i+0,!0),n=c().getInt32(i+4,!0),_=h(e,n);return e!==0&&r.__wbindgen_export4(e,n,1),_}finally{r.__wbindgen_add_to_stack_pointer(16)}}__unsafe_open_view(e){let n=p(e,r.__wbindgen_export,r.__wbindgen_export2),_=f,i=r.client___unsafe_open_view(this.__wbg_ptr,n,_);return W.__wrap(i)}get_hosted_table_names(){let e=r.client_get_hosted_table_names(this.__wbg_ptr);return b(e)}handle_error(e,n){let _=p(e,r.__wbindgen_export,r.__wbindgen_export2),i=f,l=r.client_handle_error(this.__wbg_ptr,_,i,d(n)?0:a(n));return b(l)}handle_response(e){let n=r.client_handle_response(this.__wbg_ptr,a(e));return b(n)}join(e,n,_,i){let l=p(_,r.__wbindgen_export,r.__wbindgen_export2),s=f,u=r.client_join(this.__wbg_ptr,a(e),a(n),l,s,d(i)?0:a(i));return b(u)}constructor(e,n){try{let s=r.__wbindgen_add_to_stack_pointer(-16);r.client_new(s,a(e),d(n)?0:a(n));var _=c().getInt32(s+0,!0),i=c().getInt32(s+4,!0),l=c().getInt32(s+8,!0);if(l)throw b(i);return this.__wbg_ptr=_>>>0,K.register(this,this.__wbg_ptr,this),this}finally{r.__wbindgen_add_to_stack_pointer(16)}}new_proxy_session(e){try{let n=r.client_new_proxy_session(this.__wbg_ptr,ve(e));return V.__wrap(n)}finally{k[N++]=void 0}}on_error(e){let n=r.client_on_error(this.__wbg_ptr,a(e));return b(n)}on_hosted_tables_update(e){let n=r.client_on_hosted_tables_update(this.__wbg_ptr,a(e));return b(n)}open_table(e){let n=p(e,r.__wbindgen_export,r.__wbindgen_export2),_=f,i=r.client_open_table(this.__wbg_ptr,n,_);return b(i)}remove_hosted_tables_update(e){let n=r.client_remove_hosted_tables_update(this.__wbg_ptr,e);return b(n)}system_info(){let e=r.client_system_info(this.__wbg_ptr);return b(e)}table(e,n){let _=r.client_table(this.__wbg_ptr,a(e),d(n)?0:a(n));return b(_)}terminate(){try{let i=r.__wbindgen_add_to_stack_pointer(-16);r.client_terminate(i,this.__wbg_ptr);var e=c().getInt32(i+0,!0),n=c().getInt32(i+4,!0),_=c().getInt32(i+8,!0);if(_)throw b(n);return b(e)}finally{r.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(P.prototype[Symbol.dispose]=P.prototype.free);var H=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,_e.unregister(this),t}free(){let t=this.__destroy_into_raw();r.__wbg_genericsqlvirtualservermodel_free(t,0)}expressionDescribe(t,e){try{let u=r.__wbindgen_add_to_stack_pointer(-16),g=p(t,r.__wbindgen_export,r.__wbindgen_export2),w=f,y=p(e,r.__wbindgen_export,r.__wbindgen_export2),v=f;r.genericsqlvirtualservermodel_expressionDescribe(u,this.__wbg_ptr,g,w,y,v);var n=c().getInt32(u+0,!0),_=c().getInt32(u+4,!0),i=c().getInt32(u+8,!0),l=c().getInt32(u+12,!0);if(l)throw b(i);var s=h(n,_);return n!==0&&r.__wbindgen_export4(n,_,1),s}finally{r.__wbindgen_add_to_stack_pointer(16)}}expressionsDescribe(t,e){try{let u=r.__wbindgen_add_to_stack_pointer(-16),g=p(t,r.__wbindgen_export,r.__wbindgen_export2),w=f;r.genericsqlvirtualservermodel_expressionsDescribe(u,this.__wbg_ptr,g,w,a(e));var n=c().getInt32(u+0,!0),_=c().getInt32(u+4,!0),i=c().getInt32(u+8,!0),l=c().getInt32(u+12,!0);if(l)throw b(i);var s=h(n,_);return n!==0&&r.__wbindgen_export4(n,_,1),s}finally{r.__wbindgen_add_to_stack_pointer(16)}}getHostedTables(){try{let l=r.__wbindgen_add_to_stack_pointer(-16);r.genericsqlvirtualservermodel_getHostedTables(l,this.__wbg_ptr);var t=c().getInt32(l+0,!0),e=c().getInt32(l+4,!0),n=c().getInt32(l+8,!0),_=c().getInt32(l+12,!0);if(_)throw b(n);var i=h(t,e);return t!==0&&r.__wbindgen_export4(t,e,1),i}finally{r.__wbindgen_add_to_stack_pointer(16)}}constructor(t){try{let i=r.__wbindgen_add_to_stack_pointer(-16);r.genericsqlvirtualservermodel_new(i,d(t)?0:a(t));var e=c().getInt32(i+0,!0),n=c().getInt32(i+4,!0),_=c().getInt32(i+8,!0);if(_)throw b(n);return this.__wbg_ptr=e>>>0,_e.register(this,this.__wbg_ptr,this),this}finally{r.__wbindgen_add_to_stack_pointer(16)}}tableDescribe(t,e,n){try{let g=r.__wbindgen_add_to_stack_pointer(-16),w=p(t,r.__wbindgen_export,r.__wbindgen_export2),y=f;r.genericsqlvirtualservermodel_tableDescribe(g,this.__wbg_ptr,w,y,a(e),a(n));var _=c().getInt32(g+0,!0),i=c().getInt32(g+4,!0),l=c().getInt32(g+8,!0),s=c().getInt32(g+12,!0);if(s)throw b(l);var u=h(_,i);return _!==0&&r.__wbindgen_export4(_,i,1),u}finally{r.__wbindgen_add_to_stack_pointer(16)}}tableMakeView(t,e,n,_){try{let w=r.__wbindgen_add_to_stack_pointer(-16),y=p(t,r.__wbindgen_export,r.__wbindgen_export2),v=f,I=p(e,r.__wbindgen_export,r.__wbindgen_export2),x=f;r.genericsqlvirtualservermodel_tableMakeView(w,this.__wbg_ptr,y,v,I,x,a(n),a(_));var i=c().getInt32(w+0,!0),l=c().getInt32(w+4,!0),s=c().getInt32(w+8,!0),u=c().getInt32(w+12,!0);if(u)throw b(s);var g=h(i,l);return i!==0&&r.__wbindgen_export4(i,l,1),g}finally{r.__wbindgen_add_to_stack_pointer(16)}}tableSchema(t){try{let s=r.__wbindgen_add_to_stack_pointer(-16),u=p(t,r.__wbindgen_export,r.__wbindgen_export2),g=f;r.genericsqlvirtualservermodel_tableSchema(s,this.__wbg_ptr,u,g);var e=c().getInt32(s+0,!0),n=c().getInt32(s+4,!0),_=c().getInt32(s+8,!0),i=c().getInt32(s+12,!0);if(i)throw b(_);var l=h(e,n);return e!==0&&r.__wbindgen_export4(e,n,1),l}finally{r.__wbindgen_add_to_stack_pointer(16)}}tableSize(t){try{let s=r.__wbindgen_add_to_stack_pointer(-16),u=p(t,r.__wbindgen_export,r.__wbindgen_export2),g=f;r.genericsqlvirtualservermodel_tableSize(s,this.__wbg_ptr,u,g);var e=c().getInt32(s+0,!0),n=c().getInt32(s+4,!0),_=c().getInt32(s+8,!0),i=c().getInt32(s+12,!0);if(i)throw b(_);var l=h(e,n);return e!==0&&r.__wbindgen_export4(e,n,1),l}finally{r.__wbindgen_add_to_stack_pointer(16)}}viewColumnSize(t){try{let s=r.__wbindgen_add_to_stack_pointer(-16),u=p(t,r.__wbindgen_export,r.__wbindgen_export2),g=f;r.genericsqlvirtualservermodel_viewColumnSize(s,this.__wbg_ptr,u,g);var e=c().getInt32(s+0,!0),n=c().getInt32(s+4,!0),_=c().getInt32(s+8,!0),i=c().getInt32(s+12,!0);if(i)throw b(_);var l=h(e,n);return e!==0&&r.__wbindgen_export4(e,n,1),l}finally{r.__wbindgen_add_to_stack_pointer(16)}}viewDelete(t){try{let s=r.__wbindgen_add_to_stack_pointer(-16),u=p(t,r.__wbindgen_export,r.__wbindgen_export2),g=f;r.genericsqlvirtualservermodel_viewDelete(s,this.__wbg_ptr,u,g);var e=c().getInt32(s+0,!0),n=c().getInt32(s+4,!0),_=c().getInt32(s+8,!0),i=c().getInt32(s+12,!0);if(i)throw b(_);var l=h(e,n);return e!==0&&r.__wbindgen_export4(e,n,1),l}finally{r.__wbindgen_add_to_stack_pointer(16)}}viewGetData(t,e,n,_){try{let w=r.__wbindgen_add_to_stack_pointer(-16),y=p(t,r.__wbindgen_export,r.__wbindgen_export2),v=f;r.genericsqlvirtualservermodel_viewGetData(w,this.__wbg_ptr,y,v,a(e),a(n),a(_));var i=c().getInt32(w+0,!0),l=c().getInt32(w+4,!0),s=c().getInt32(w+8,!0),u=c().getInt32(w+12,!0);if(u)throw b(s);var g=h(i,l);return i!==0&&r.__wbindgen_export4(i,l,1),g}finally{r.__wbindgen_add_to_stack_pointer(16)}}viewGetMinMax(t,e,n){try{let g=r.__wbindgen_add_to_stack_pointer(-16),w=p(t,r.__wbindgen_export,r.__wbindgen_export2),y=f,v=p(e,r.__wbindgen_export,r.__wbindgen_export2),I=f;r.genericsqlvirtualservermodel_viewGetMinMax(g,this.__wbg_ptr,w,y,v,I,a(n));var _=c().getInt32(g+0,!0),i=c().getInt32(g+4,!0),l=c().getInt32(g+8,!0),s=c().getInt32(g+12,!0);if(s)throw b(l);var u=h(_,i);return _!==0&&r.__wbindgen_export4(_,i,1),u}finally{r.__wbindgen_add_to_stack_pointer(16)}}viewMakeTable(t,e,n,_,i){try{let y=r.__wbindgen_add_to_stack_pointer(-16),v=p(t,r.__wbindgen_export,r.__wbindgen_export2),I=f,x=p(e,r.__wbindgen_export,r.__wbindgen_export2),Ee=f;r.genericsqlvirtualservermodel_viewMakeTable(y,this.__wbg_ptr,v,I,x,Ee,a(n),a(_),a(i));var l=c().getInt32(y+0,!0),s=c().getInt32(y+4,!0),u=c().getInt32(y+8,!0),g=c().getInt32(y+12,!0);if(g)throw b(u);var w=h(l,s);return l!==0&&r.__wbindgen_export4(l,s,1),w}finally{r.__wbindgen_add_to_stack_pointer(16)}}viewSchema(t){try{let s=r.__wbindgen_add_to_stack_pointer(-16),u=p(t,r.__wbindgen_export,r.__wbindgen_export2),g=f;r.genericsqlvirtualservermodel_viewSchema(s,this.__wbg_ptr,u,g);var e=c().getInt32(s+0,!0),n=c().getInt32(s+4,!0),_=c().getInt32(s+8,!0),i=c().getInt32(s+12,!0);if(i)throw b(_);var l=h(e,n);return e!==0&&r.__wbindgen_export4(e,n,1),l}finally{r.__wbindgen_add_to_stack_pointer(16)}}viewSize(t){try{let s=r.__wbindgen_add_to_stack_pointer(-16),u=p(t,r.__wbindgen_export,r.__wbindgen_export2),g=f;r.genericsqlvirtualservermodel_viewSize(s,this.__wbg_ptr,u,g);var e=c().getInt32(s+0,!0),n=c().getInt32(s+4,!0),_=c().getInt32(s+8,!0),i=c().getInt32(s+12,!0);if(i)throw b(_);var l=h(e,n);return e!==0&&r.__wbindgen_export4(e,n,1),l}finally{r.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(H.prototype[Symbol.dispose]=H.prototype.free);var V=class fe{static __wrap(e){e=e>>>0;let n=Object.create(fe.prototype);return n.__wbg_ptr=e,X.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,X.unregister(this),e}free(){let e=this.__destroy_into_raw();r.__wbg_proxysession_free(e,0)}close(){let e=this.__destroy_into_raw(),n=r.proxysession_close(e);return b(n)}handle_request(e){let n=r.proxysession_handle_request(this.__wbg_ptr,a(e));return b(n)}constructor(e,n){try{Ce(e,P);let _=r.proxysession_new(e.__wbg_ptr,ve(n));return this.__wbg_ptr=_>>>0,X.register(this,this.__wbg_ptr,this),this}finally{k[N++]=void 0}}};Symbol.dispose&&(V.prototype[Symbol.dispose]=V.prototype.free);var $=class pe{static __wrap(e){e=e>>>0;let n=Object.create(pe.prototype);return n.__wbg_ptr=e,ie.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,ie.unregister(this),e}free(){let e=this.__destroy_into_raw();r.__wbg_table_free(e,0)}__getClassname(){try{let i=r.__wbindgen_add_to_stack_pointer(-16);r.table___getClassname(i,this.__wbg_ptr);var e=c().getInt32(i+0,!0),n=c().getInt32(i+4,!0),_=h(e,n);return e!==0&&r.__wbindgen_export4(e,n,1),_}finally{r.__wbindgen_add_to_stack_pointer(16)}}clear(){let e=r.table_clear(this.__wbg_ptr);return b(e)}columns(){let e=r.table_columns(this.__wbg_ptr);return b(e)}delete(e){let n=this.__destroy_into_raw(),_=r.table_delete(n,d(e)?0:a(e));return b(_)}describe(e){let n=r.table_describe(this.__wbg_ptr,d(e)?0:a(e));return b(n)}get_client(){let e=r.table_get_client(this.__wbg_ptr);return b(e)}get_index(){let e=r.table_get_index(this.__wbg_ptr);return b(e)}get_limit(){let e=r.table_get_limit(this.__wbg_ptr);return b(e)}get_name(){let e=r.table_get_name(this.__wbg_ptr);return b(e)}make_port(){let e=r.table_make_port(this.__wbg_ptr);return b(e)}on_delete(e){let n=r.table_on_delete(this.__wbg_ptr,a(e));return b(n)}remove(e,n){let _=r.table_remove(this.__wbg_ptr,a(e),d(n)?0:a(n));return b(_)}remove_delete(e){let n=r.table_remove_delete(this.__wbg_ptr,e);return b(n)}replace(e,n){let _=r.table_replace(this.__wbg_ptr,a(e),d(n)?0:a(n));return b(_)}schema(){let e=r.table_schema(this.__wbg_ptr);return b(e)}size(){let e=r.table_size(this.__wbg_ptr);return b(e)}update(e,n){let _=r.table_update(this.__wbg_ptr,a(e),d(n)?0:a(n));return b(_)}validate_expressions(e){let n=r.table_validate_expressions(this.__wbg_ptr,a(e));return b(n)}view(e){let n=r.table_view(this.__wbg_ptr,d(e)?0:a(e));return b(n)}};Symbol.dispose&&($.prototype[Symbol.dispose]=$.prototype.free);var W=class F{static __wrap(e){e=e>>>0;let n=Object.create(F.prototype);return n.__wbg_ptr=e,oe.register(n,n.__wbg_ptr,n),n}static __unwrap(e){return e instanceof F?e.__destroy_into_raw():0}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,oe.unregister(this),e}free(){let e=this.__destroy_into_raw();r.__wbg_view_free(e,0)}__get_model(){let e=r.view___get_model(this.__wbg_ptr);return F.__wrap(e)}__unsafe_get_name(){try{let i=r.__wbindgen_add_to_stack_pointer(-16);r.view___unsafe_get_name(i,this.__wbg_ptr);var e=c().getInt32(i+0,!0),n=c().getInt32(i+4,!0),_=h(e,n);return e!==0&&r.__wbindgen_export4(e,n,1),_}finally{r.__wbindgen_add_to_stack_pointer(16)}}collapse(e){let n=r.view_collapse(this.__wbg_ptr,e);return b(n)}column_paths(e){let n=r.view_column_paths(this.__wbg_ptr,d(e)?0:a(e));return b(n)}delete(){let e=this.__destroy_into_raw(),n=r.view_delete(e);return b(n)}dimensions(){let e=r.view_dimensions(this.__wbg_ptr);return b(e)}expand(e){let n=r.view_expand(this.__wbg_ptr,e);return b(n)}expression_schema(){let e=r.view_expression_schema(this.__wbg_ptr);return b(e)}get_config(){let e=r.view_get_config(this.__wbg_ptr);return b(e)}get_min_max(e){let n=p(e,r.__wbindgen_export,r.__wbindgen_export2),_=f,i=r.view_get_min_max(this.__wbg_ptr,n,_);return b(i)}num_columns(){let e=r.view_num_columns(this.__wbg_ptr);return b(e)}num_rows(){let e=r.view_num_rows(this.__wbg_ptr);return b(e)}on_delete(e){let n=r.view_on_delete(this.__wbg_ptr,a(e));return b(n)}on_remove(e){let n=r.view_on_remove(this.__wbg_ptr,a(e));return b(n)}on_update(e,n){let _=r.view_on_update(this.__wbg_ptr,a(e),d(n)?0:a(n));return b(_)}remove_delete(e){let n=r.view_remove_delete(this.__wbg_ptr,e);return b(n)}remove_remove(e){let n=r.view_remove_remove(this.__wbg_ptr,e);return b(n)}remove_update(e){let n=r.view_remove_update(this.__wbg_ptr,e);return b(n)}schema(){let e=r.view_schema(this.__wbg_ptr);return b(e)}set_depth(e){let n=r.view_set_depth(this.__wbg_ptr,e);return b(n)}to_arrow(e){let n=r.view_to_arrow(this.__wbg_ptr,d(e)?0:a(e));return b(n)}to_columns(e){let n=r.view_to_columns(this.__wbg_ptr,d(e)?0:a(e));return b(n)}to_columns_string(e){let n=r.view_to_columns_string(this.__wbg_ptr,d(e)?0:a(e));return b(n)}to_csv(e){let n=r.view_to_csv(this.__wbg_ptr,d(e)?0:a(e));return b(n)}to_json(e){let n=r.view_to_json(this.__wbg_ptr,d(e)?0:a(e));return b(n)}to_json_string(e){let n=r.view_to_json_string(this.__wbg_ptr,d(e)?0:a(e));return b(n)}to_ndjson(e){let n=r.view_to_ndjson(this.__wbg_ptr,d(e)?0:a(e));return b(n)}with_typed_arrays(e,n){let _=r.view_with_typed_arrays(this.__wbg_ptr,d(e)?0:a(e),a(n));return b(_)}};Symbol.dispose&&(W.prototype[Symbol.dispose]=W.prototype.free);var L=class ye{static __wrap(e){e=e>>>0;let n=Object.create(ye.prototype);return n.__wbg_ptr=e,Y.register(n,n.__wbg_ptr,n),n}__destroy_into_raw(){let e=this.__wbg_ptr;return this.__wbg_ptr=0,Y.unregister(this),e}free(){let e=this.__destroy_into_raw();r.__wbg_virtualdataslice_free(e,0)}fromArrowIpc(e){try{let i=r.__wbindgen_add_to_stack_pointer(-16);r.virtualdataslice_fromArrowIpc(i,this.__wbg_ptr,a(e));var n=c().getInt32(i+0,!0),_=c().getInt32(i+4,!0);if(_)throw b(n)}finally{r.__wbindgen_add_to_stack_pointer(16)}}constructor(e){let n=r.virtualdataslice_new(a(e));return this.__wbg_ptr=n>>>0,Y.register(this,this.__wbg_ptr,this),this}setBooleanCol(e,n,_,i){try{let u=r.__wbindgen_add_to_stack_pointer(-16),g=p(e,r.__wbindgen_export,r.__wbindgen_export2),w=f;r.virtualdataslice_setBooleanCol(u,this.__wbg_ptr,g,w,n,a(_),d(i)?4294967297:i>>>0);var l=c().getInt32(u+0,!0),s=c().getInt32(u+4,!0);if(s)throw b(l)}finally{r.__wbindgen_add_to_stack_pointer(16)}}setCol(e,n,_,i,l){try{let g=r.__wbindgen_add_to_stack_pointer(-16),w=p(e,r.__wbindgen_export,r.__wbindgen_export2),y=f,v=p(n,r.__wbindgen_export,r.__wbindgen_export2),I=f;r.virtualdataslice_setCol(g,this.__wbg_ptr,w,y,v,I,_,a(i),d(l)?4294967297:l>>>0);var s=c().getInt32(g+0,!0),u=c().getInt32(g+4,!0);if(u)throw b(s)}finally{r.__wbindgen_add_to_stack_pointer(16)}}setDatetimeCol(e,n,_,i){try{let u=r.__wbindgen_add_to_stack_pointer(-16),g=p(e,r.__wbindgen_export,r.__wbindgen_export2),w=f;r.virtualdataslice_setDatetimeCol(u,this.__wbg_ptr,g,w,n,a(_),d(i)?4294967297:i>>>0);var l=c().getInt32(u+0,!0),s=c().getInt32(u+4,!0);if(s)throw b(l)}finally{r.__wbindgen_add_to_stack_pointer(16)}}setFloatCol(e,n,_,i){try{let u=r.__wbindgen_add_to_stack_pointer(-16),g=p(e,r.__wbindgen_export,r.__wbindgen_export2),w=f;r.virtualdataslice_setFloatCol(u,this.__wbg_ptr,g,w,n,a(_),d(i)?4294967297:i>>>0);var l=c().getInt32(u+0,!0),s=c().getInt32(u+4,!0);if(s)throw b(l)}finally{r.__wbindgen_add_to_stack_pointer(16)}}setIntegerCol(e,n,_,i){try{let u=r.__wbindgen_add_to_stack_pointer(-16),g=p(e,r.__wbindgen_export,r.__wbindgen_export2),w=f;r.virtualdataslice_setIntegerCol(u,this.__wbg_ptr,g,w,n,a(_),d(i)?4294967297:i>>>0);var l=c().getInt32(u+0,!0),s=c().getInt32(u+4,!0);if(s)throw b(l)}finally{r.__wbindgen_add_to_stack_pointer(16)}}setStringCol(e,n,_,i){try{let u=r.__wbindgen_add_to_stack_pointer(-16),g=p(e,r.__wbindgen_export,r.__wbindgen_export2),w=f;r.virtualdataslice_setStringCol(u,this.__wbg_ptr,g,w,n,a(_),d(i)?4294967297:i>>>0);var l=c().getInt32(u+0,!0),s=c().getInt32(u+4,!0);if(s)throw b(l)}finally{r.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(L.prototype[Symbol.dispose]=L.prototype.free);var G=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,ae.unregister(this),t}free(){let t=this.__destroy_into_raw();r.__wbg_virtualserver_free(t,0)}handleRequest(t){let e=Qe(t,r.__wbindgen_export),n=f,_=r.virtualserver_handleRequest(this.__wbg_ptr,e,n);return b(_)}constructor(t){try{let i=r.__wbindgen_add_to_stack_pointer(-16);r.virtualserver_new(i,a(t));var e=c().getInt32(i+0,!0),n=c().getInt32(i+4,!0),_=c().getInt32(i+8,!0);if(_)throw b(n);return this.__wbg_ptr=e>>>0,ae.register(this,this.__wbg_ptr,this),this}finally{r.__wbindgen_add_to_stack_pointer(16)}}};Symbol.dispose&&(G.prototype[Symbol.dispose]=G.prototype.free);function he(){r.init()}function me(){return{__proto__:null,"./perspective-js.wasm_bg.js":{__proto__:null,__wbg_Error_8c4e43fe74559d73:function(t,e){var n=h(t,e);let _=Error(n);return a(_)},__wbg_Number_04624de7d0e8332d:function(t){return Number(o(t))},__wbg_String_8f0eb39a4a4c2f66:function(t,e){let n=String(o(e)),_=p(n,r.__wbindgen_export,r.__wbindgen_export2),i=f;c().setInt32(t+4,i,!0),c().setInt32(t+0,_,!0)},__wbg___wbindgen_bigint_get_as_i64_8fcf4ce7f1ca72a2:function(t,e){let n=o(e),_=typeof n=="bigint"?n:void 0;c().setBigInt64(t+8,d(_)?BigInt(0):_,!0),c().setInt32(t+0,!d(_),!0)},__wbg___wbindgen_boolean_get_bbbb1c18aa2f5e25:function(t){let e=o(t),n=typeof e=="boolean"?e:void 0;return d(n)?16777215:n?1:0},__wbg___wbindgen_debug_string_0bc8482c6e3508ae:function(t,e){let n=ne(o(e)),_=p(n,r.__wbindgen_export,r.__wbindgen_export2),i=f;c().setInt32(t+4,i,!0),c().setInt32(t+0,_,!0)},__wbg___wbindgen_in_47fa6863be6f2f25:function(t,e){return o(t)in o(e)},__wbg___wbindgen_is_bigint_31b12575b56f32fc:function(t){return typeof o(t)=="bigint"},__wbg___wbindgen_is_function_0095a73b8b156f76:function(t){return typeof o(t)=="function"},__wbg___wbindgen_is_null_ac34f5003991759a:function(t){return o(t)===null},__wbg___wbindgen_is_object_5ae8e5880f2c1fbd:function(t){let e=o(t);return typeof e=="object"&&e!==null},__wbg___wbindgen_is_string_cd444516edc5b180:function(t){return typeof o(t)=="string"},__wbg___wbindgen_is_undefined_9e4d92534c42d778:function(t){return o(t)===void 0},__wbg___wbindgen_jsval_eq_11888390b0186270:function(t,e){return o(t)===o(e)},__wbg___wbindgen_jsval_loose_eq_9dd77d8cd6671811:function(t,e){return o(t)==o(e)},__wbg___wbindgen_number_get_8ff4255516ccad3e:function(t,e){let n=o(e),_=typeof n=="number"?n:void 0;c().setFloat64(t+8,d(_)?0:_,!0),c().setInt32(t+0,!d(_),!0)},__wbg___wbindgen_string_get_72fb696202c56729:function(t,e){let n=o(e),_=typeof n=="string"?n:void 0;var i=d(_)?0:p(_,r.__wbindgen_export,r.__wbindgen_export2),l=f;c().setInt32(t+4,l,!0),c().setInt32(t+0,i,!0)},__wbg___wbindgen_throw_be289d5034ed271b:function(t,e){var n=h(t,e);throw new Error(n)},__wbg__wbg_cb_unref_d9b87ff7982e3b21:function(t){o(t)._wbg_cb_unref()},__wbg_apply_ada2ee1a60ac7b3c:function(){return m(function(t,e,n){let _=o(t).apply(o(e),o(n));return a(_)},arguments)},__wbg_at_dfc235641cc0e40c:function(t,e){let n=o(t).at(e);return a(n)},__wbg_buffer_26d0910f3a5bc899:function(t){let e=o(t).buffer;return a(e)},__wbg_call_389efe28435a9388:function(){return m(function(t,e){let n=o(t).call(o(e));return a(n)},arguments)},__wbg_call_41bedb84c3e5c0c9:function(){return m(function(t,e,n,_,i,l){let s=o(t).call(o(e),o(n),o(_),o(i),o(l));return a(s)},arguments)},__wbg_call_4708e0c13bdc8e95:function(){return m(function(t,e,n){let _=o(t).call(o(e),o(n));return a(_)},arguments)},__wbg_call_812d25f1510c13c8:function(){return m(function(t,e,n,_){let i=o(t).call(o(e),o(n),o(_));return a(i)},arguments)},__wbg_client_new:function(t){let e=P.__wrap(t);return a(e)},__wbg_debug_46a93995fc6f8820:function(t,e,n,_){console.debug(o(t),o(e),o(n),o(_))},__wbg_debug_a4099fa12db6cd61:function(t){console.debug(o(t))},__wbg_done_57b39ecd9addfe81:function(t){return o(t).done},__wbg_entries_58c7934c745daac7:function(t){let e=Object.entries(o(t));return a(e)},__wbg_error_794d0ffc9d00d5c3:function(t,e,n,_){console.error(o(t),o(e),o(n),o(_))},__wbg_error_9a7fe3f932034cde:function(t){console.error(o(t))},__wbg_error_f852e41c69b0bd84:function(t,e){console.error(o(t),o(e))},__wbg_from_bddd64e7d5ff6941:function(t){let e=Array.from(o(t));return a(e)},__wbg_getEntriesByName_02488cff0bc7581c:function(t,e,n,_,i){var l=h(e,n),s=h(_,i);let u=o(t).getEntriesByName(l,s);return a(u)},__wbg_getRandomValues_1c61fac11405ffdc:function(){return m(function(t,e){globalThis.crypto.getRandomValues(M(t,e))},arguments)},__wbg_getTime_1e3cd1391c5c3995:function(t){return o(t).getTime()},__wbg_get_76e04509d1922a04:function(t,e,n){var _=h(e,n);let i=o(t)[_];return d(i)?0:a(i)},__wbg_get_9b94d73e6221f75c:function(t,e){let n=o(t)[e>>>0];return a(n)},__wbg_get_b3ed3ad4be2bc8ac:function(){return m(function(t,e){let n=Reflect.get(o(t),o(e));return a(n)},arguments)},__wbg_get_with_ref_key_1dc361bd10053bfe:function(t,e){let n=o(t)[o(e)];return a(n)},__wbg_has_d4e53238966c12b6:function(){return m(function(t,e){return Reflect.has(o(t),o(e))},arguments)},__wbg_info_148d043840582012:function(t){console.info(o(t))},__wbg_info_9e602cf10c5c690b:function(t,e,n,_){console.info(o(t),o(e),o(n),o(_))},__wbg_instanceof_ArrayBuffer_c367199e2fa2aa04:function(t){let e;try{e=o(t)instanceof ArrayBuffer}catch{e=!1}return e},__wbg_instanceof_Array_d9eac779cd191cbc:function(t){let e;try{e=o(t)instanceof Array}catch{e=!1}return e},__wbg_instanceof_Date_1b9f15b87f10aa4c:function(t){let e;try{e=o(t)instanceof Date}catch{e=!1}return e},__wbg_instanceof_Error_8573fe0b0b480f46:function(t){let e;try{e=o(t)instanceof Error}catch{e=!1}return e},__wbg_instanceof_Map_53af74335dec57f4:function(t){let e;try{e=o(t)instanceof Map}catch{e=!1}return e},__wbg_instanceof_Object_1c6af87502b733ed:function(t){let e;try{e=o(t)instanceof Object}catch{e=!1}return e},__wbg_instanceof_Promise_0094681e3519d6ec:function(t){let e;try{e=o(t)instanceof Promise}catch{e=!1}return e},__wbg_instanceof_Uint8Array_9b9075935c74707c:function(t){let e;try{e=o(t)instanceof Uint8Array}catch{e=!1}return e},__wbg_instanceof_Window_ed49b2db8df90359:function(t){let e;try{e=o(t)instanceof Window}catch{e=!1}return e},__wbg_isArray_d314bb98fcf08331:function(t){return Array.isArray(o(t))},__wbg_isSafeInteger_bfbc7332a9768d2a:function(t){return Number.isSafeInteger(o(t))},__wbg_iterator_6ff6560ca1568e55:function(){return a(Symbol.iterator)},__wbg_keys_b50a709a76add04e:function(t){let e=Object.keys(o(t));return a(e)},__wbg_length_32ed9a279acd054c:function(t){return o(t).length},__wbg_length_35a7bace40f36eac:function(t){return o(t).length},__wbg_mark_3b530a64b09ba08a:function(){return m(function(t,e,n){var _=h(e,n);o(t).mark(_)},arguments)},__wbg_measure_288b48c082eae0fe:function(){return m(function(t,e,n,_,i){var l=h(e,n),s=h(_,i);o(t).measure(l,s)},arguments)},__wbg_message_9ddc4b9a62a7c379:function(t){let e=o(t).message;return a(e)},__wbg_new_361308b2356cecd0:function(){let t=new Object;return a(t)},__wbg_new_3eb36ae241fe6f44:function(){let t=new Array;return a(t)},__wbg_new_72b49615380db768:function(t,e){var n=h(t,e);let _=new Error(n);return a(_)},__wbg_new_b5d9e2fb389fef91:function(t,e){try{var n={a:t,b:e},_=(l,s)=>{let u=n.a;n.a=0;try{return Be(u,n.b,l,s)}finally{n.a=u}};let i=new Promise(_);return a(i)}finally{n.a=n.b=0}},__wbg_new_dca287b076112a51:function(){return a(new Map)},__wbg_new_dd2b680c8bf6ae29:function(t){let e=new Uint8Array(o(t));return a(e)},__wbg_new_from_slice_a3d2629dc1826784:function(t,e){let n=new Uint8Array(M(t,e));return a(n)},__wbg_new_no_args_1c7c842f08d00ebb:function(t,e){var n=h(t,e);let _=new Function(n);return a(_)},__wbg_new_with_length_1763c527b2923202:function(t){let e=new Array(t>>>0);return a(e)},__wbg_next_3482f54c49e8af19:function(){return m(function(t){let e=o(t).next();return a(e)},arguments)},__wbg_next_418f80d8f5303233:function(t){let e=o(t).next;return a(e)},__wbg_now_ebffdf7e580f210d:function(t){return o(t).now()},__wbg_parse_708461a1feddfb38:function(){return m(function(t,e){var n=h(t,e);let _=JSON.parse(n);return a(_)},arguments)},__wbg_performance_06f12ba62483475d:function(t){let e=o(t).performance;return d(e)?0:a(e)},__wbg_prototypesetcall_bdcdcc5842e4d77d:function(t,e,n){Uint8Array.prototype.set.call(M(t,e),o(n))},__wbg_push_8ffdcb2063340ba5:function(t,e){return o(t).push(o(e))},__wbg_queueMicrotask_0aa0a927f78f5d98:function(t){let e=o(t).queueMicrotask;return a(e)},__wbg_queueMicrotask_5bb536982f78a56f:function(t){queueMicrotask(o(t))},__wbg_reject_a2176de7f1212be5:function(t){let e=Promise.reject(o(t));return a(e)},__wbg_resolve_002c4b7d9d8f6b64:function(t){let e=Promise.resolve(o(t));return a(e)},__wbg_run_56500aec144102b2:function(){return m(function(t,e){let n=o(t).run(o(e));return a(n)},arguments)},__wbg_set_1eb0999cf5d27fc8:function(t,e,n){let _=o(t).set(o(e),o(n));return a(_)},__wbg_set_3f1d0b984ed272ed:function(t,e,n){o(t)[b(e)]=b(n)},__wbg_set_6cb8631f80447a67:function(){return m(function(t,e,n){return Reflect.set(o(t),o(e),o(n))},arguments)},__wbg_set_f43e577aea94465b:function(t,e,n){o(t)[e>>>0]=b(n)},__wbg_startTime_248495bfbcb427d3:function(t){return o(t).startTime},__wbg_static_accessor_GLOBAL_12837167ad935116:function(){let t=typeof window>"u"?null:window;return d(t)?0:a(t)},__wbg_static_accessor_GLOBAL_THIS_e628e89ab3b1c95f:function(){let t=typeof globalThis>"u"?null:globalThis;return d(t)?0:a(t)},__wbg_static_accessor_SELF_a621d3dfbb60d0ce:function(){let t=typeof self>"u"?null:self;return d(t)?0:a(t)},__wbg_static_accessor_WINDOW_f8727f0cf888e0bd:function(){let t=typeof window>"u"?null:window;return d(t)?0:a(t)},__wbg_stringify_8d1cc6ff383e8bae:function(){return m(function(t){let e=JSON.stringify(o(t));return a(e)},arguments)},__wbg_table_new:function(t){let e=$.__wrap(t);return a(e)},__wbg_then_0d9fe2c7b1857d32:function(t,e,n){let _=o(t).then(o(e),o(n));return a(_)},__wbg_then_b9e7b3b5f1a9e1b5:function(t,e){let n=o(t).then(o(e));return a(n)},__wbg_toString_964ff7fe6eca8362:function(t){let e=o(t).toString();return a(e)},__wbg_trace_9007714a6fbee374:function(t){console.trace(o(t))},__wbg_trace_bd16b570941b54fb:function(t,e,n,_){console.trace(o(t),o(e),o(n),o(_))},__wbg_value_0546255b415e96c1:function(t){let e=o(t).value;return a(e)},__wbg_values_5da93bc719d272cf:function(t){let e=Object.values(o(t));return a(e)},__wbg_view_new:function(t){let e=W.__wrap(t);return a(e)},__wbg_view_unwrap:function(t){return W.__unwrap(o(t))},__wbg_virtualdataslice_new:function(t){let e=L.__wrap(t);return a(e)},__wbg_warn_a40b971467b219c7:function(t,e,n,_){console.warn(o(t),o(e),o(n),o(_))},__wbg_warn_f7ae1b2e66ccb930:function(t){console.warn(o(t))},__wbindgen_cast_0000000000000001:function(t,e){let n=se(t,e,r.__wasm_bindgen_func_elem_1436,qe);return a(n)},__wbindgen_cast_0000000000000002:function(t,e){let n=se(t,e,r.__wasm_bindgen_func_elem_1436,je);return a(n)},__wbindgen_cast_0000000000000003:function(t,e){let n=Ge(t,e,r.__wasm_bindgen_func_elem_4636,Oe);return a(n)},__wbindgen_cast_0000000000000004:function(t){return a(t)},__wbindgen_cast_0000000000000005:function(t){return a(t)},__wbindgen_cast_0000000000000006:function(t,e){var n=h(t,e);return a(n)},__wbindgen_cast_0000000000000007:function(t,e){let n=Ne(t,e);return a(n)},__wbindgen_cast_0000000000000008:function(t,e){let n=Pe(t,e);return a(n)},__wbindgen_cast_0000000000000009:function(t,e){let n=Le(t,e);return a(n)},__wbindgen_cast_000000000000000a:function(t,e){let n=Fe(t,e);return a(n)},__wbindgen_cast_000000000000000b:function(t,e){let n=M(t,e);return a(n)},__wbindgen_cast_000000000000000c:function(t){let e=BigInt.asUintN(64,t);return a(e)},__wbindgen_cast_000000000000000d:function(t,e){var n=De(t,e).slice();return r.__wbindgen_export4(t,e*4,4),a(n)},__wbindgen_cast_000000000000000e:function(t,e){var n=M(t,e).slice();return r.__wbindgen_export4(t,e*1,1),a(n)},__wbindgen_object_clone_ref:function(t){let e=o(t);return a(e)},__wbindgen_object_drop_ref:function(t){b(t)}}}}function je(t,e){r.__wasm_bindgen_func_elem_2058(t,e)}function qe(t,e){let n=r.__wasm_bindgen_func_elem_2057(t,e);return b(n)}function Oe(t,e,n){r.__wasm_bindgen_func_elem_4638(t,e,a(n))}function Be(t,e,n,_){r.__wasm_bindgen_func_elem_13025(t,e,a(n),a(_))}var K=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>r.__wbg_client_free(t>>>0,1)),_e=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>r.__wbg_genericsqlvirtualservermodel_free(t>>>0,1)),X=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>r.__wbg_proxysession_free(t>>>0,1)),ie=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>r.__wbg_table_free(t>>>0,1)),oe=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>r.__wbg_view_free(t>>>0,1)),Y=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>r.__wbg_virtualdataslice_free(t>>>0,1)),ae=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>r.__wbg_virtualserver_free(t>>>0,1));function a(t){R===k.length&&k.push(k.length+1);let e=R;return R=k[e],k[e]=t,e}function Ce(t,e){if(!(t instanceof e))throw new Error(`expected instance of ${e.name}`)}function ve(t){if(N==1)throw new Error("out of js stack");return k[--N]=t,N}var Q=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(t=>t.dtor(t.a,t.b));function ne(t){let e=typeof t;if(e=="number"||e=="boolean"||t==null)return`${t}`;if(e=="string")return`"${t}"`;if(e=="symbol"){let i=t.description;return i==null?"Symbol":`Symbol(${i})`}if(e=="function"){let i=t.name;return typeof i=="string"&&i.length>0?`Function(${i})`:"Function"}if(Array.isArray(t)){let i=t.length,l="[";i>0&&(l+=ne(t[0]));for(let s=1;s<i;s++)l+=", "+ne(t[s]);return l+="]",l}let n=/\[object ([^\]]+)\]/.exec(toString.call(t)),_;if(n&&n.length>1)_=n[1];else return toString.call(t);if(_=="Object")try{return"Object("+JSON.stringify(t)+")"}catch{return"Object"}return t instanceof Error?`${t.name}: ${t.message}
${t.stack}`:_}function Re(t){t<132||(k[t]=R,R=t)}function Ne(t,e){return t=t>>>0,ze().subarray(t/4,t/4+e)}function Pe(t,e){return t=t>>>0,Te().subarray(t/8,t/8+e)}function Le(t,e){return t=t>>>0,He().subarray(t/4,t/4+e)}function De(t,e){t=t>>>0;let n=c(),_=[];for(let i=t;i<t+4*e;i+=4)_.push(b(n.getUint32(i,!0)));return _}function Fe(t,e){return t=t>>>0,$e().subarray(t/4,t/4+e)}function M(t,e){return t=t>>>0,E().subarray(t/1,t/1+e)}function h(t,e){return t===0?o(e):Ve(t,e)}var A=null;function c(){return(A===null||A.buffer.detached===!0||A.buffer.detached===void 0&&A.buffer!==r.memory.buffer)&&(A=new DataView(r.memory.buffer)),A}var j=null;function ze(){return(j===null||j.byteLength===0)&&(j=new Float32Array(r.memory.buffer)),j}var q=null;function Te(){return(q===null||q.byteLength===0)&&(q=new Float64Array(r.memory.buffer)),q}var O=null;function He(){return(O===null||O.byteLength===0)&&(O=new Int32Array(r.memory.buffer)),O}function Ve(t,e){return t=t>>>0,Ke(t,e)}var B=null;function $e(){return(B===null||B.byteLength===0)&&(B=new Uint32Array(r.memory.buffer)),B}var C=null;function E(){return(C===null||C.byteLength===0)&&(C=new Uint8Array(r.memory.buffer)),C}function o(t){return k[t]}function m(t,e){try{return t.apply(this,e)}catch(n){r.__wbindgen_export3(a(n))}}var k=new Array(128).fill(void 0);k.push(void 0,null,!0,!1);var R=k.length;function d(t){return t==null}function se(t,e,n,_){let i={a:t,b:e,cnt:1,dtor:n},l=(...s)=>{i.cnt++;try{return _(i.a,i.b,...s)}finally{l._wbg_cb_unref()}};return l._wbg_cb_unref=()=>{--i.cnt===0&&(i.dtor(i.a,i.b),i.a=0,Q.unregister(i))},Q.register(l,i,i),l}function Ge(t,e,n,_){let i={a:t,b:e,cnt:1,dtor:n},l=(...s)=>{i.cnt++;let u=i.a;i.a=0;try{return _(u,i.b,...s)}finally{i.a=u,l._wbg_cb_unref()}};return l._wbg_cb_unref=()=>{--i.cnt===0&&(i.dtor(i.a,i.b),i.a=0,Q.unregister(i))},Q.register(l,i,i),l}function Qe(t,e){let n=e(t.length*1,1)>>>0;return E().set(t,n/1),f=t.length,n}function p(t,e,n){if(n===void 0){let u=le.encode(t),g=e(u.length,1)>>>0;return E().subarray(g,g+u.length).set(u),f=u.length,g}let _=t.length,i=e(_,1)>>>0,l=E(),s=0;for(;s<_;s++){let u=t.charCodeAt(s);if(u>127)break;l[i+s]=u}if(s!==_){s!==0&&(t=t.slice(s)),i=n(i,_,_=s+t.length*3,1)>>>0;let u=E().subarray(i+s,i+_),g=le.encodeInto(t,u);s+=g.written,i=n(i,_,s,1)>>>0}return f=s,i}var N=128;function b(t){let e=o(t);return Re(t),e}var z=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});z.decode();var Je=2146435072,Z=0;function Ke(t,e){return Z+=e,Z>=Je&&(z=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),z.decode(),Z=e),z.decode(E().subarray(t,t+e))}var le=new TextEncoder,f=0,Xe,r;function Ie(t,e){return r=t.exports,Xe=e,A=null,j=null,q=null,O=null,B=null,C=null,r}async function Ye(t,e){if(typeof Response=="function"&&t instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(t,e)}catch(i){if(t.ok&&n(t.type)&&t.headers.get("Content-Type")!=="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",i);else throw i}let _=await t.arrayBuffer();return await WebAssembly.instantiate(_,e)}else{let _=await WebAssembly.instantiate(t,e);return _ instanceof WebAssembly.Instance?{instance:_,module:t}:_}function n(_){switch(_){case"basic":case"cors":case"default":return!0}return!1}}function Ze(t){if(r!==void 0)return r;t!==void 0&&(Object.getPrototypeOf(t)===Object.prototype?{module:t}=t:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));let e=me();t instanceof WebAssembly.Module||(t=new WebAssembly.Module(t));let n=new WebAssembly.Instance(t,e);return Ie(n,t)}async function ke(t){if(r!==void 0)return r;t!==void 0&&(Object.getPrototypeOf(t)===Object.prototype?{module_or_path:t}=t:console.warn("using deprecated parameters for the initialization function; pass a single object instead"));let e=me();(typeof t=="string"||typeof Request=="function"&&t instanceof Request||typeof URL=="function"&&t instanceof URL)&&(t=fetch(t));let{instance:n,module:_}=await Ye(await t,e);return Ie(n,_)}function et(){let t,e,n=new Promise((_,i)=>{t=_,e=i});return[t,n,e]}async function tt(t,e,n,_){let i,l;async function s(){if(l?.readyState===t.CONNECTING||l?.readyState===t.OPEN){console.warn(`Already connected ${l.readyState}`);return}let[w,y,v]=et();l=new t(n,_),l.onopen=w,l.binaryType="arraybuffer",l.onerror=I=>{let x=I.message||"Generic Websocket Error";i.handle_error(x,s),v(x)},l.onclose=I=>{let x=`WebSocket closed ${I.code}`;i.handle_error(x,s),v(x)},l.onmessage=I=>{i.handle_response(I.data)},await y}async function u(w){if(l.readyState===t.CLOSING||l.readyState===t.CLOSED){let y=`WebSocket transport error (${l.readyState})`;throw i.handle_error(y,s),new Error(y)}else if(l.readyState===t.CONNECTING){let y=`WebSocket message dropped (${l.readyState})`;throw new Error(y)}else{let y=w.slice().buffer;l.send(y)}}async function g(){console.debug("Closing WebSocket"),l.close()}return i=new e(u,g),await s(),i}function nt(){let t,e,n=new Promise((_,i)=>{t=_,e=i});return[t,n,e]}async function rt(t,e){let[n,_]=nt();t.addEventListener("message",function i(l){t.removeEventListener("message",i),n(null)}),t.onmessage=function(i){t.onmessage=function(){},n(null)},t.onmessageerror=console.error,t.postMessage({cmd:"init",args:[e]},{transfer:e===void 0||e instanceof WebAssembly.Module?[]:[e]}),await _}async function _t(t,e,n){let[_,i]=await Promise.all([e,n]),{Client:l}=await t,s,u;if(typeof SharedWorker<"u"&&i instanceof SharedWorker){let w=i.port;s=w,u=()=>w.close()}else if(typeof Worker<"u"&&i instanceof Worker)s=i,u=()=>i.terminate();else if(i instanceof MessagePort)s=i,u=()=>i.close();else throw new Error("Unsupported worker type");let g=new l(async w=>{let y=w.slice().buffer;s.postMessage(y,{transfer:[y]})},async()=>{console.debug("Closing WebWorker"),u()});return await rt(s,_),s.onmessage=w=>{g.handle_response(w.data)},g}async function it(t,e){let{Client:n}=await t;return await tt(WebSocket,n,e)}async function ot(t){let e;typeof t?.then=="function"&&(t=await t),t instanceof Response?e=await WebAssembly.instantiateStreaming(t):typeof t=="string"?e=await WebAssembly.instantiateStreaming(fetch(t)):t instanceof ArrayBuffer?e=await WebAssembly.instantiate(t):t instanceof Uint8Array?e=await WebAssembly.instantiate(t.buffer):e=t;let n=e.instance.exports,[_]=WebAssembly.Module.customSections(e.module,"psp-runtime"),[i]=WebAssembly.Module.customSections(e.module,"psp-len"),l=new DataView(i).getUint32(0,!0),s=n.resize(_.byteLength);new Uint8Array(n.memory.buffer).set(new Uint8Array(_),s);let u=n.compile(_.byteLength,l);return new Uint8Array(n.memory.buffer).slice(u,l+u)}if(typeof WebAssembly>"u")throw new Error("WebAssembly not supported.");async function xe(t){t instanceof Function&&(t=await t());try{return await ot(t)}catch{return console.warn("Stage 0 wasm loading failed, skipping"),new Uint8Array(t)}}var at=new Uint8Array([0,97,115,109,1,0,0,0,5,3,1,4,1]),ee;function Ae(){return ee===void 0&&(ee=WebAssembly.validate(at)),ee}var Se='var j=Object.defineProperty;var F=(s,t,r)=>t in s?j(s,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):s[t]=r;var g=(s,t,r)=>F(s,typeof t!="symbol"?t+"":t,r);var x=class{constructor(){g(this,"tail",Promise.resolve())}run(t){let r=this.tail.then(t,t);return this.tail=r.then(()=>{},()=>{}),r}};async function L(s,t,r){let a=s.psp_residency_safepoint;a&&await t.run(()=>a(r))}var M=class{constructor(t){g(this,"poll_handle");g(this,"server");this.server=t}set_poll_handle(){return this.poll_handle=new Promise((t,r)=>setTimeout(()=>this.server.poll().then(t).catch(r).finally(()=>{this.poll_handle=void 0}))),this.poll_handle}async on_poll_request(){this.poll_handle?await this.poll_handle.then(()=>{if(!this.poll_handle)return this.set_poll_handle()}):await this.set_poll_handle()}},k=class{constructor(t,r){g(this,"clients");g(this,"server");g(this,"module");g(this,"on_poll_request");g(this,"lock");this.clients=new Map,this.module=t,this.on_poll_request=r?.on_poll_request,this.lock=new x,this.server=t._psp_new_server(r?.on_poll_request?1:0)}make_session(t){let r=this.module._psp_new_session(this.server);return this.clients.set(r,t),new H(this.module,this.server,r,this.clients,this.lock,this.on_poll_request&&(()=>this.on_poll_request(this)))}async poll(){let t=await this.lock.run(()=>this.module._psp_poll(this.server));await N(this.module,t,async r=>{await this.clients.get(r.client_id)(r.data)}),await L(this.module,this.lock,this.server)}delete(){this.module._psp_delete_server(this.server)}},H=class{constructor(t,r,a,u,_,f){this.mod=t;this.server=r;this.client_id=a;this.client_map=u;this.lock=_;this.on_poll_request=f}async handle_request(t){let r=await V(this.mod,t,async a=>{let u=this.mod._psp_is_memory64()?BigInt(t.byteLength):t.byteLength;return this.lock.run(()=>this.mod._psp_handle_request(this.server,this.client_id,a,u))});await N(this.mod,r,async a=>{await this.client_map.get(a.client_id)(a.data)}),this.on_poll_request?await this.on_poll_request():await this.poll(),await L(this.mod,this.lock,this.server)}async poll(){let t=await this.lock.run(()=>this.mod._psp_poll(this.server));await N(this.mod,t,async r=>{r.client_id===0?await this.client_map.get(this.client_id)(r.data):await this.client_map.get(r.client_id)(r.data)})}close(){this.mod._psp_close_session(this.server,this.client_id)}};async function V(s,t,r){let a=s._psp_is_memory64(),u=s._psp_alloc(a?BigInt(t.byteLength):t.byteLength),_=a?Number(u):Number(u)>>>0;s.HEAPU8.set(t,_);let f=await r(u);return s._psp_free(u),f}async function N(s,t,r){let a=s._psp_is_memory64(),u=a?Number(t):Number(t)>>>0,_=new DataView(s.HEAPU8.buffer,u,a?12:8),f=_.getUint32(0,!0),w=Number(a?_.getBigInt64(4,!0):_.getUint32(4,!0)),m=new DataView(s.HEAPU8.buffer,w,f*(a?16:12)),y=d=>s._psp_free(a?BigInt(d):d),h=[];for(let d=0;d<f;d++)h.push(a?[Number(m.getBigInt64(d*16,!0)),m.getInt32(d*16+8,!0),m.getInt32(d*16+12,!0)]:[m.getUint32(d*12,!0),m.getUint32(d*12+4,!0),m.getInt32(d*12+8,!0)]);try{for(let[d,A,U]of h){let E=new Uint8Array(s.HEAPU8.buffer,d,A);await r({client_id:U,data:E})}}finally{for(let[d]of h)y(d);y(w),y(u)}}var z=console.log.bind(console),D=console.error.bind(console),O=new TextDecoder("utf8"),$=[null,[],[]];function G(s,t=0,r=NaN){for(var a=t+r,u=t;s[u]&&!(u>=a);)++u;return O.decode(s instanceof Uint8Array?s.subarray(t,u):new Uint8Array(s.slice(t,u)))}function q(s,t){var r=$[s];t===0||t===10?((s===1?z:D)(G(r,0)),r.length=0):r.push(t)}async function T(s){let t,r=!1,a,u=()=>new Uint8Array(a.buffer),_=e=>r?Number(e):e>>>0;function f(e){let o=_(e),i=u(),n=o;for(;i[n];)++n;return O.decode(i.subarray(o,n))}let w={heap:u,toAddr:_,readCString:f},m=Object.entries(s.env??{}).filter(([,e])=>typeof e=="string").map(([e,o])=>new TextEncoder().encode(`${e}=${o}\\0`));function y(){async function e(i,n){let c=i.split("/").filter(p=>p.length>0),l=await navigator.storage.getDirectory();for(let p=0;p<c.length-1;p++)l=await l.getDirectoryHandle(c[p],{create:n});return await l.getFileHandle(c[c.length-1],{create:n})}let o=new Map;return{async ensureOpen(i){if(o.has(i))return;let c=await(await e(i,!0)).createSyncAccessHandle();o.set(i,c)},store(i,n,c){try{let l=o.get(f(i));if(!l)return-1;if(l.truncate(c),c>0){let p=_(n);l.write(u().subarray(p,p+c),{at:0})}return l.flush(),c}catch(l){return D("psp_opfs_store failed",l),-1}},load(i,n,c){try{if(c<=0)return 0;let l=o.get(f(i));if(!l)return 0;let p=_(n);return l.read(u().subarray(p,p+c),{at:0})}catch{return 0}},remove(i){try{let n=f(i),c=o.get(n);if(c){try{c.close()}catch{}o.delete(n)}(async()=>{try{let l=n.split("/").filter(b=>b.length>0),p=await navigator.storage.getDirectory();for(let b=0;b<l.length-1;b++)p=await p.getDirectoryHandle(l[b],{create:!1});await p.removeEntry(l[l.length-1])}catch{}})()}catch{}}}}let h=s.make_disk_bridge?s.make_disk_bridge(w):y(),d={psp_opfs_store:h.store,psp_opfs_load:h.load,psp_opfs_remove:h.remove},A={HaveOffsetConverter(){console.error("HaveOffsetConverter")},__syscall_ftruncate64(...e){console.error("__syscall_frtuncate64",e)},__syscall_getdents64(...e){console.error("__syscall_frtuncate64",e)},__syscall_unlinkat(...e){console.error("__syscall_frtuncate64",e)},__throw_exception_with_stack_trace(e){let o=new WebAssembly.Exception(t.__cpp_exception,[e],{traceStack:!0});throw o.message="Unexpected internal error",o},clock_time_get(e,o,i){if(r){if(i=i,i=Number(i),!(e==0||e==1||e==2||e==3))return 28;var n;e===0?n=Date.now():n=performance.now();let l=Math.round(n*1e3*1e3),p=new BigInt64Array(a.buffer);return p[i/8]=BigInt(l),0}else{if(i=i,i>>>=0,!(e==0||e==1||e==2||e==3))return 28;var n;e===0?n=Date.now():n=performance.now();var c=Math.round(n*1e6);let p=new BigInt64Array(a.buffer);return p[i>>>3]=BigInt(c),0}},emscripten_asm_const_int(...e){return 0},emscripten_notify_memory_growth(e){r?e=Number(e):(e=e,e>>>=0),e!=0&&console.error("abort")},environ_get(e,o){let i=new DataView(a.buffer),n=_(e),c=_(o);for(let l of m)r?(i.setBigUint64(n,BigInt(c),!0),n+=8):(i.setUint32(n,c,!0),n+=4),u().set(l,c),c+=l.length;return 0},environ_sizes_get(e,o){let i=new DataView(a.buffer),n=m.reduce((c,l)=>c+l.length,0);return r?(i.setBigUint64(_(e),BigInt(m.length),!0),i.setBigUint64(_(o),BigInt(n),!0)):(i.setUint32(_(e),m.length,!0),i.setUint32(_(o),n,!0)),0},fd_close(...e){return console.error("fd_close",e),0},fd_read(...e){return console.error("fd_read",e),0},fd_seek(...e){return console.error("fs_seek",e),0},fd_write(e,o,i,n){let c=new Uint8Array(a.buffer);if(r){o=Number(o),i=Number(i),n=Number(n);let l=0,p=new BigUint64Array(a.buffer);for(let b=0;b<i;b++){let S=Number(p[o/8]),P=Number(p[(o+8)/8]);o+=16;for(let v=0;v<P;v++)q(e,c[S+v]);l+=P}return p[n/8]=BigInt(l),0}else{o=o,i=i,n=n,o>>>=0,i>>>=0,n>>>=0;let l=0,p=new Uint32Array(a.buffer);for(let b=0;b<i;b++){let S=p[o>>>2>>>0],P=p[o+4>>>2>>>0];o+=8;for(let v=0;v<P;v++)q(e,c[S+v>>>0]);l+=P}return p[n>>>2>>>0]=l,0}},proc_exit(e){return console.error("proc_exit",e),0},...d},U=await s.instantiateWasm({env:A,wasi_snapshot_preview1:A},e=>{t=e.exports,r=!!t.psp_is_memory64(),a=e.exports.memory,t._initialize()}),E={};for(let[e,o]of Object.entries(U))E[`_${e}`]=o;return{...U,...E,psp_residency_safepoint:async e=>{let o=t;if(!o.psp_residency_prepare)return;let i=Number(o.psp_residency_prepare(e));for(let n=0;n<i;n++){let c=r?BigInt(n):n,l=f(o.psp_residency_victim_fname(e,c));l&&await h.ensureOpen(l)}o.psp_residency_commit(e)},get HEAPU8(){return new Uint8Array(a.buffer)}}}async function R(s,t){let r=await T({locateFile(a){return a},make_disk_bridge:t?.make_disk_bridge,env:t?.env,instantiateWasm:async(a,u)=>{a.env={...a.env,psp_stack_trace(){let f=Error().stack||"",m=new TextEncoder().encode(f),y=r._psp_alloc(r._psp_is_memory64()?BigInt(m.byteLength+1):m.byteLength+1);return r.HEAPU8.set(m,Number(y)),r.HEAPU8[Number(y)+m.byteLength]=0,y},psp_heap_size(){return r._psp_is_memory64()?BigInt(r.HEAPU8.buffer.byteLength):r.HEAPU8.buffer.byteLength}};let _=await WebAssembly.instantiate(s,a);return u(_.instance),_.instance.exports}});return r}var B,W,I;async function C(s){if(s.data.cmd==="init"){let t=s.data.id;if(!B){let r=await R(s.data.args[0]);B=new k(r,{on_poll_request:()=>W.on_poll_request()}),W=new M(B)}I=B.make_session(async r=>{let a=r.slice().buffer;this.postMessage(a,{transfer:[a]})}),this.postMessage({id:t})}else if(I)await I?.handle_request(new Uint8Array(s.data));else throw new Error("No session")}function K(s){let t=s.ports[0];t.addEventListener("message",C.bind(t)),t.start()}self.addEventListener("connect",K);self.addEventListener("message",C.bind(self));\n',D=null;async function st(){if(D)return D;let t=new Blob([Se],{type:"application/javascript"});return D=URL.createObjectURL(t),D}async function ce(){return Se}function ue(t){console.warn("Running perspective in single-threaded mode");let e=new MessageChannel;return Function("const self = arguments[0];"+t)(e.port2),e.port2.start(),e.port1}async function lt(t){let e=t||{type:"module"};try{if(typeof window<"u"&&window.location&&window.location.protocol&&window.location.protocol.startsWith("file"))return console.warn("file:// protocol does not reliably support Web Workers"),ue(await ce());let n=await st();return new Worker(n,e)}catch(n){return console.error("Error instantiating worker; falling back to single-threaded mode",n),ue(await ce())}}var J,T;async function ct(t){return Me(await re(),t)}function ut(t){return t instanceof Uint8Array||t instanceof ArrayBuffer||typeof Response<"u"&&t instanceof Response||t instanceof Promise||t instanceof WebAssembly.Module||typeof t=="function"}async function te(t,e){let n=typeof t=="function"?await t():await t;if(n instanceof Uint8Array&&(n=n.buffer),typeof Response<"u"&&n instanceof Response){if(!n.ok)throw new Error(`Failed to fetch perspective server wasm (HTTP ${n.status} "${n.url}")`);if(e)return await n.arrayBuffer()}return e?n:(await xe(n)).buffer}async function bt(t){if(t.sole!==void 0)return await te(t.sole,t.disable_stage_0);if(t.wasm64!==void 0&&(t.wasm32===void 0||Ae()))try{return await te(t.wasm64,t.disable_stage_0)}catch(e){if(t.wasm32===void 0)throw e;console.warn("Memory64 perspective server wasm failed to load, falling back to wasm32",e)}return await te(t.wasm32,t.disable_stage_0)}function gt(t,e=!1){let n=typeof e=="boolean"?e:!!e.disable_stage_0;if(T=void 0,ut(t)){J={sole:t,disable_stage_0:n};return}let _=t;if(_.wasm32!==void 0||_.wasm64!==void 0)J={wasm32:_.wasm32,wasm64:_.wasm64,disable_stage_0:n};else throw new Error("init_server requires a wasm source or a {wasm32, wasm64} registration")}var U,S;async function wt(t){return t instanceof WebAssembly.Module?t:typeof Response<"u"&&t instanceof Response?WebAssembly.compileStreaming(t):WebAssembly.compile(t)}async function be(t,e=!1){let n=e?t:await xe(t),_=await wt(n);return S=Promise.resolve(_),await ke({module_or_path:_}),await he(),we}function dt(t,e=!1){t instanceof Uint8Array?U=be(t.buffer,e):t instanceof ArrayBuffer||t instanceof Response||t instanceof Promise?U=be(t,e):t instanceof Object&&(U=Promise.resolve(t))}function re(){let t=customElements.get("perspective-viewer");if(t)U=Promise.resolve(t.__wasm_module__),S===void 0&&t.__wasm_client_module__&&(S=Promise.resolve(t.__wasm_client_module__));else if(U===void 0)throw new Error("Missing perspective-client.wasm");return U}async function ft(){if(S!==void 0)return S;let t=customElements.get("perspective-viewer");if(t?.__wasm_client_module__)return S=Promise.resolve(t.__wasm_client_module__),S;throw new Error("perspective-js client wasm has not been compiled yet \u2014 call `init_client(...)` or `perspective.worker()` before `getCompiledClientWasm()`.")}function pt(){if(J===void 0)throw new Error("Missing perspective-server.wasm");return T===void 0&&(T=bt(J)),T.then(t=>t instanceof WebAssembly.Module?t:t.slice(0))}var ge;async function yt(){return ge===void 0?await lt({type:"module",name:"perspective-server"}):ge()}async function ht(t){return await it(re(),t)}async function mt(t){return typeof t>"u"&&(t=yt()),await _t(re(),pt(),t)}var vt={websocket:ht,worker:mt,init_client:dt,init_server:gt,host_supports_memory64:Ae,createMessageHandler:ct,getCompiledClientWasm:ft,GenericSQLVirtualServerModel:H,VirtualDataSlice:L,VirtualServer:G};export{H as GenericSQLVirtualServerModel,L as VirtualDataSlice,G as VirtualServer,ct as createMessageHandler,vt as default,ft as getCompiledClientWasm,Ae as host_supports_memory64,dt as init_client,gt as init_server,ht as websocket,mt as worker};
//# sourceMappingURL=/perspective-WL7AKPVV.js.map